summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e8144d)
raw | patch | inline | side by side (parent: 5e8144d)
author | Adrian Prantl <aprantl@apple.com> | |
Tue, 18 Mar 2014 02:35:03 +0000 (02:35 +0000) | ||
committer | Adrian Prantl <aprantl@apple.com> | |
Tue, 18 Mar 2014 02:35:03 +0000 (02:35 +0000) |
This is a follow-up to r203983 based on feedback from dblaikie and mren (Thanks!)
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204107 91177308-0d34-0410-b5e6-96231b3b80d8
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204107 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | patch | blob | history | |
lib/CodeGen/AsmPrinter/DwarfUnit.cpp | patch | blob | history |
index ecd10460a59b785b5347ff5a82105d2540039de8..87f1878e86503e3e916582db4989f313f3fd8ddb 100644 (file)
for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i)
CU->getOrCreateTypeDIE(EnumTypes.getElement(i));
DIArray RetainedTypes = CUNode.getRetainedTypes();
- for (unsigned i = 0, e = RetainedTypes.getNumElements(); i != e; ++i)
- CU->getOrCreateTypeDIE(RetainedTypes.getElement(i));
+ for (unsigned i = 0, e = RetainedTypes.getNumElements(); i != e; ++i) {
+ DIType Ty(RetainedTypes.getElement(i));
+ // The retained types array by design contains pointers to
+ // MDNodes rather than DIRefs. Unique them here.
+ DIType UniqueTy(resolve(Ty.getRef()));
+ CU->getOrCreateTypeDIE(UniqueTy);
+ }
// Emit imported_modules last so that the relevant context is already
// available.
for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
index a7b43d80328417bc1b4d2b59ab720879689e7c4b..be21d633e54ba287cedaee0577d298a3bd24bfa7 100644 (file)
DIType Ty(TyNode);
assert(Ty.isType());
+ assert(*&Ty == resolve(Ty.getRef()) &&
+ "type was not uniqued, possible ODR violation.");
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(Context);
assert(ContextDIE);
- // Unique the type. This is a noop if the type has no unique identifier.
- Ty = DIType(resolve(Ty.getRef()));
-
DIE *TyDIE = getDIE(Ty);
if (TyDIE)
return TyDIE;