aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 404c010c77..224710af35 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/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;
}