diff options
author | Devang Patel <dpatel@apple.com> | 2010-10-14 22:59:23 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-10-14 22:59:23 +0000 |
commit | 0f58561907985a879d90b210a2a32fac1d5518c8 (patch) | |
tree | c93f8cc43188c84781b68f612a4cf39f9c2f656e /clang | |
parent | 8b6a9c157453b220a9988d3d78653f0fe36e9e55 (diff) | |
download | bcm5719-llvm-0f58561907985a879d90b210a2a32fac1d5518c8.tar.gz bcm5719-llvm-0f58561907985a879d90b210a2a32fac1d5518c8.zip |
Use root non-virtual primary base class, not just immediate primary base class, for AT_containing_type.
This is tested by virtfunc.exp in gdb testsuite.
llvm-svn: 116535
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 404c010c770..224710af357 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1018,9 +1018,19 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, // A class's primary base or the class itself contains the vtable. const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(RD); - if (const CXXRecordDecl *PBase = RL.getPrimaryBase()) + if (const CXXRecordDecl *PBase = RL.getPrimaryBase()) { + // Seek non virtual primary base root. + while (1) { + const ASTRecordLayout &BRL = CGM.getContext().getASTRecordLayout(PBase); + const CXXRecordDecl *PBT = BRL.getPrimaryBase(); + if (PBT && !BRL.getPrimaryBaseWasVirtual()) + PBase = PBT; + else + break; + } ContainingType = getOrCreateType(QualType(PBase->getTypeForDecl(), 0), Unit); + } else if (CXXDecl->isDynamicClass()) ContainingType = FwdDecl; } |