From 63bb3e1182f79f52d15cbf658545515f6bcece7b Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 21 Oct 2013 16:37:22 +0000 Subject: [PATCH] DebugInfo: Hash DW_FORM_GNU_str_index as a string. 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. llvm-svn: 193089 --- llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp | 4 +++- llvm/test/DebugInfo/X86/fission-hash.ll | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp b/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp index 88c515c8cfa8..13238f37b34c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp @@ -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(Value)->getString()); @@ -242,7 +243,8 @@ void DIEHash::hashAttribute(AttrEntry Attr) { addULEB128(dwarf::DW_FORM_sdata); addSLEB128((int64_t)cast(Value)->getValue()); break; - // TODO: Add support for additional forms. + default: + llvm_unreachable("Add support for additional forms"); } } diff --git a/llvm/test/DebugInfo/X86/fission-hash.ll b/llvm/test/DebugInfo/X86/fission-hash.ll index 969b21c4d8d6..e3e0c30661d0 100644 --- a/llvm/test/DebugInfo/X86/fission-hash.ll +++ b/llvm/test/DebugInfo/X86/fission-hash.ll @@ -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}