Add support for DW_FORM_dataN and DW_FORM_udata to the DIE hashing
authorEric Christopher <echristo@gmail.com>
Wed, 28 Aug 2013 00:10:38 +0000 (00:10 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 28 Aug 2013 00:10:38 +0000 (00:10 +0000)
algorithm. Update the split dwarf hashing testcase accordingly - this
should be the last time that the hash of an empty file changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189427 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DIEHash.cpp
lib/CodeGen/AsmPrinter/DIEHash.h
test/DebugInfo/X86/fission-hash.ll

index f0ab38c3d4ea37e970983b30c118b7e769b22324..1322743247eea959713259b7eb4594dabb425808 100644 (file)
@@ -119,6 +119,9 @@ void DIEHash::collectAttributes(DIE *Die, DIEAttrs &Attrs) {
     case dwarf::DW_AT_name:
       COLLECT_ATTR(DW_AT_name);
       break;
+    case dwarf::DW_AT_language:
+      COLLECT_ATTR(DW_AT_language);
+      break;
     default:
       break;
     }
@@ -145,6 +148,13 @@ void DIEHash::hashAttribute(AttrEntry Attr) {
   case dwarf::DW_FORM_strp:
     addString(cast<DIEString>(Value)->getString());
     break;
+  case dwarf::DW_FORM_data1:
+  case dwarf::DW_FORM_data2:
+  case dwarf::DW_FORM_data4:
+  case dwarf::DW_FORM_data8:
+  case dwarf::DW_FORM_udata:
+    addULEB128(cast<DIEInteger>(Value)->getValue());
+    break;
   }
 }
 
@@ -159,6 +169,7 @@ void DIEHash::hashAttributes(const DIEAttrs &Attrs) {
 
   // FIXME: Add the rest.
   ADD_ATTR(Attrs.DW_AT_name);
+  ADD_ATTR(Attrs.DW_AT_language);
 }
 
 // Add all of the attributes for \param Die to the hash.
index f53529c54f1e1b671108b4e517ba34fb472d87ee..d83f78f68b48f1959697ec5a7a7f72fd3f54a65d 100644 (file)
@@ -29,6 +29,7 @@ class DIEHash {
   // Collection of all attributes used in hashing a particular DIE.
   struct DIEAttrs {
     AttrEntry DW_AT_name;
+    AttrEntry DW_AT_language;
   };
 
 public:
index f0fe0d4cd5b88efbc8890fe68b21440ac5726f76..c4ba9ca75c945f68b16e81012dfaf14e040e970b 100644 (file)
@@ -3,8 +3,8 @@
 
 ; The source is an empty file.
 
-; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xa188c11a9264c05d)
-; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xa188c11a9264c05d)
+; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xc357bdf055b6393d)
+; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xc357bdf055b6393d)
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3}