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
This commit is contained in:
David Blaikie 2013-10-21 16:37:22 +00:00
parent ef57b656f1
commit 63bb3e1182
2 changed files with 5 additions and 3 deletions

View 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");
}
}

View 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}