diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-09-06 18:46:00 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-09-06 18:46:00 +0000 |
commit | d8f798ea97351ff42c6793c12953f90522d5e4a5 (patch) | |
tree | cf6ea434bed0ec4a86bf10043a6320c962d7f7e0 /llvm/lib | |
parent | 277206fa282715dcd3b62800b46be574b96f7dbb (diff) | |
download | bcm5719-llvm-d8f798ea97351ff42c6793c12953f90522d5e4a5.tar.gz bcm5719-llvm-d8f798ea97351ff42c6793c12953f90522d5e4a5.zip |
Debug Info: Use identifier to reference DIType in containing type field of
a DICompositeType.
Verifier is updated accordingly.
llvm-svn: 190190
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 6db54d2fafb..f9ea545483e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1083,7 +1083,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { if (CTy.isAppleBlockExtension()) addFlag(&Buffer, dwarf::DW_AT_APPLE_block); - DICompositeType ContainingType = CTy.getContainingType(); + DICompositeType ContainingType(DD->resolve(CTy.getContainingType())); if (DIDescriptor(ContainingType).isCompositeType()) addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4, getOrCreateTypeDIE(DIType(ContainingType))); diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index d58a9dcd7a9..72205f67873 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -626,7 +626,7 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name, DerivedFrom, Elements, ConstantInt::get(Type::getInt32Ty(VMContext), 0), - VTableHolder, + DIType(VTableHolder).generateRef(), TemplateParams, UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier) }; @@ -663,7 +663,7 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context, DerivedFrom, Elements, ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang), - VTableHolder, + DIType(VTableHolder).generateRef(), NULL, UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier) }; diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 70b4257caeb..8a6f006d323 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -497,7 +497,7 @@ bool DICompositeType::Verify() const { // Make sure DerivedFrom @ field 9 and ContainingType @ field 12 are MDNodes. if (!fieldIsMDNode(DbgNode, 9)) return false; - if (!fieldIsMDNode(DbgNode, 12)) + if (!fieldIsTypeRef(DbgNode, 12)) return false; // Make sure the type identifier at field 14 is MDString, it can be null. @@ -721,7 +721,7 @@ DITypeRef DIType::generateRef() { /// \brief Set the containing type. void DICompositeType::setContainingType(DICompositeType ContainingType) { TrackingVH<MDNode> N(*this); - N->replaceOperandWith(12, ContainingType); + N->replaceOperandWith(12, ContainingType.generateRef()); DbgNode = N; } |