DIEHash: Do not use shallow type hashing for unnamed types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193361 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DIEHash.cpp b/lib/CodeGen/AsmPrinter/DIEHash.cpp
index 34d9fff..e345344 100644
--- a/lib/CodeGen/AsmPrinter/DIEHash.cpp
+++ b/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];