diff options
author | Manman Ren <manman.ren@gmail.com> | 2014-07-28 23:04:20 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2014-07-28 23:04:20 +0000 |
commit | bd1628a595b27f05c130c0b5127eee32abdf0e38 (patch) | |
tree | efe29d55919599356a88a8f4b76ad2baec669cb8 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | ef7150925f0772469aba11745df9b625c9f6d05d (diff) | |
download | bcm5719-llvm-bd1628a595b27f05c130c0b5127eee32abdf0e38.tar.gz bcm5719-llvm-bd1628a595b27f05c130c0b5127eee32abdf0e38.zip |
[Debug Info] unique MDNodes in the enum types of each compile unit.
The enum types array by design contains pointers to MDNodes rather than DIRefs.
Unique them when handling the enum types in DwarfDebug.
rdar://17628609
llvm-svn: 214139
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 3ac4899f544..d58e47eaf03 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -762,8 +762,13 @@ void DwarfDebug::beginModule() { for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i) SPMap.insert(std::make_pair(SPs.getElement(i), &CU)); DIArray EnumTypes = CUNode.getEnumTypes(); - for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i) - CU.getOrCreateTypeDIE(EnumTypes.getElement(i)); + for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i) { + DIType Ty(EnumTypes.getElement(i)); + // The enum types array by design contains pointers to + // MDNodes rather than DIRefs. Unique them here. + DIType UniqueTy(resolve(Ty.getRef())); + CU.getOrCreateTypeDIE(UniqueTy); + } DIArray RetainedTypes = CUNode.getRetainedTypes(); for (unsigned i = 0, e = RetainedTypes.getNumElements(); i != e; ++i) { DIType Ty(RetainedTypes.getElement(i)); |