diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-05-26 21:54:24 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-05-26 21:54:24 +0000 |
commit | 34568bc602d66867070fb5aac2e9fbe4fb92b2bf (patch) | |
tree | 5ceb98bb6e4499589536010d306ddb4c79890bd7 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | f3c1c065aa55bddee26487725b08576ab71619d4 (diff) | |
download | bcm5719-llvm-34568bc602d66867070fb5aac2e9fbe4fb92b2bf.tar.gz bcm5719-llvm-34568bc602d66867070fb5aac2e9fbe4fb92b2bf.zip |
[MS ABI, DebugInfo] Omit the size for model-less pointers-to-members
The representation of a pointer-to-member in the MS ABI is governed by
the layout of the relevant class or if a model has been explicitly
specified. If no model is specified, then an appropriate
"worst-case-scenario" model is implicitly chosen if, and only, if the
pointer-to-member type's representation was needed.
Debug info cannot force a pointer-to-member type to have a
representation so do not try to query the size of such a type unless we
know it is safe to do so.
llvm-svn: 238259
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index be684d46cb7..48458dbd600 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1878,11 +1878,13 @@ llvm::DIType *CGDebugInfo::CreateType(const RValueReferenceType *Ty, llvm::DIType *CGDebugInfo::CreateType(const MemberPointerType *Ty, llvm::DIFile *U) { + uint64_t Size = CGM.getCXXABI().isTypeInfoCalculable(QualType(Ty, 0)) + ? CGM.getContext().getTypeSize(Ty) + : 0; llvm::DIType *ClassType = getOrCreateType(QualType(Ty->getClass(), 0), U); if (Ty->isMemberDataPointerType()) return DBuilder.createMemberPointerType( - getOrCreateType(Ty->getPointeeType(), U), ClassType, - CGM.getContext().getTypeSize(Ty)); + getOrCreateType(Ty->getPointeeType(), U), ClassType, Size); const FunctionProtoType *FPT = Ty->getPointeeType()->getAs<FunctionProtoType>(); @@ -1890,7 +1892,7 @@ llvm::DIType *CGDebugInfo::CreateType(const MemberPointerType *Ty, getOrCreateInstanceMethodType(CGM.getContext().getPointerType(QualType( Ty->getClass(), FPT->getTypeQuals())), FPT, U), - ClassType, CGM.getContext().getTypeSize(Ty)); + ClassType, Size); } llvm::DIType *CGDebugInfo::CreateType(const AtomicType *Ty, llvm::DIFile *U) { |