DebugInfo: Hash DW_FORM_GNU_str_index as a string.
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 21 Oct 2013 16:37:22 +0000 (16:37 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 21 Oct 2013 16:37:22 +0000 (16:37 +0000)
Found while adding type safety to the various DWARF enumerations (form,
attribute, tag, etc) that caused Clang to warn on an incompletely
covered switch. Converting the comment to a default/unreachable
uncovered this case of an unsupported form encoding. Seems we were
skipping fission strings entirely.

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

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

index 88c515c8cfa88403488c7715386cc37118d31b20..13238f37b34c01209a7a17e907a626db8f0dd26b 100644 (file)
@@ -230,6 +230,7 @@ void DIEHash::hashAttribute(AttrEntry Attr) {
   case dwarf::DW_FORM_string:
     llvm_unreachable(
         "Add support for DW_FORM_string if we ever start emitting them again");
+  case dwarf::DW_FORM_GNU_str_index:
   case dwarf::DW_FORM_strp:
     addULEB128(dwarf::DW_FORM_string);
     addString(cast<DIEString>(Value)->getString());
@@ -242,7 +243,8 @@ void DIEHash::hashAttribute(AttrEntry Attr) {
     addULEB128(dwarf::DW_FORM_sdata);
     addSLEB128((int64_t)cast<DIEInteger>(Value)->getValue());
     break;
-  // TODO: Add support for additional forms.
+  default:
+    llvm_unreachable("Add support for additional forms");
   }
 }
 
index 969b21c4d8d6a3a99792a75d9f06d09620c518f6..e3e0c30661d0d536a64b3ff1a0f1ea80a383a695 100644 (file)
@@ -3,8 +3,8 @@
 
 ; The source is an empty file.
 
-; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x63fc20b98dd69e2d)
-; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x63fc20b98dd69e2d)
+; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x0c1e629c9e5ada4f)
+; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x0c1e629c9e5ada4f)
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3}