aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenHan Gu <Wenhan.gu@mediatek.com>2014-08-06 18:46:14 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-03-24 11:55:55 -0700
commitca3ddbe0af6cb5bd1b19668f73570ff8aebace4c (patch)
tree1e9ab6d7a7f3a5ba5912840eb4a8f94f79c7fee5
parent94f23d95cd04e944abe801aad4615a587cd0008a (diff)
downloadllvm-ca3ddbe0af6cb5bd1b19668f73570ff8aebace4c.tar.gz
[ndk] Fix inappropriate debug info assertion.
This assertion is valid on single bitcode codegen. However, if we uses llvm-link many bitcodes, then llc. It may bump this assertion failure but everything should be fine.
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 455258e81e6..1f8ccd01bcd 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -775,8 +775,11 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
DIType Ty(TyNode);
assert(Ty.isType());
- assert(Ty == resolve(Ty.getRef()) &&
- "type was not uniqued, possible ODR violation.");
+ // Consider there is one metadata to point to a class in each bitcode, after linking,
+ // the big bitcodes has several metadata to the class (but they are not fully same on fields,
+ // so they cannot be merged). However, the contents are actually the same, i.e., the class.
+ // We unique the type. This is a noop if the type has no unique identifier.
+ Ty = DIType(resolve(Ty.getRef()));
// DW_TAG_restrict_type is not supported in DWARF2
if (Ty.getTag() == dwarf::DW_TAG_restrict_type && DD->getDwarfVersion() <= 2)