From da39dd30ad3c969be3ac843307d4630807699538 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193089 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DIEHash.cpp | 4 +++- test/DebugInfo/X86/fission-hash.ll | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DIEHash.cpp b/lib/CodeGen/AsmPrinter/DIEHash.cpp index 88c515c8cfa..13238f37b34 100644 --- a/lib/CodeGen/AsmPrinter/DIEHash.cpp +++ b/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/test/DebugInfo/X86/fission-hash.ll b/test/DebugInfo/X86/fission-hash.ll index 969b21c4d8d..e3e0c30661d 100644 --- a/test/DebugInfo/X86/fission-hash.ll +++ b/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}