DIEHash: Do not use shallow type hashing for unnamed types
llvm-svn: 193361
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp b/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp
index 34d9fff..e345344 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp
@@ -242,10 +242,12 @@
// there's a decl/def difference in the containing type of a
// ptr_to_member_type, but it's what DWARF says, for some reason.
Attribute == dwarf::DW_AT_type) {
- // [FIXME] ... has a DW_AT_name attribute,
- hashShallowTypeReference(Attribute, Entry,
- getDIEStringAttr(Entry, dwarf::DW_AT_name));
- return;
+ // ... has a DW_AT_name attribute,
+ StringRef Name = getDIEStringAttr(Entry, dwarf::DW_AT_name);
+ if (!Name.empty()) {
+ hashShallowTypeReference(Attribute, Entry, Name);
+ return;
+ }
}
unsigned &DieNumber = Numbering[&Entry];