Make sure we don't emit an ODR hash for types with no name and make
sure the comments for each testcase are a bit easier to distinguish.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187392 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 33d18db..8735442 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1104,10 +1104,12 @@
   for (unsigned i = 0, e = TypeUnits.size(); i != e; ++i) {
     MD5 Hash;
     DIE *Die = TypeUnits[i];
-    // If we've requested ODR hashes, the current language is C++, and the type
-    // isn't located inside a C++ anonymous namespace then add the attribute now.
+    // If we've requested ODR hashes, the current language is C++, the type is
+    // named, and the type isn't located inside a C++ anonymous namespace then
+    // add the ODR signature attribute now.
     if (GenerateODRHash &&
         CUMap.begin()->second->getLanguage() == dwarf::DW_LANG_C_plus_plus &&
+        (getDIEStringAttr(Die, dwarf::DW_AT_name) != "") &&
         !isContainedInAnonNamespace(Die))
       addDIEODRSignature(Hash, CUMap.begin()->second, Die);
   }