.debug_names: Parse DW_IDX_die_offset as a reference
Before this patch we were parsing the attributes as section offsets, as
that is what apple_names is doing. However, this is not correct as DWARF
v5 specifies that this attribute should use the Reference form class.
This also updates all the testcases (except the ones that deliberately
pass a different form) to use the correct form class.
llvm-svn: 328773
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-find.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-find.s
index e65ede1..d21ba6d 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-find.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-find.s
@@ -121,7 +121,7 @@
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
@@ -163,7 +163,7 @@
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-duplicate.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-duplicate.s
index 5c5075c..03b1af9 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-duplicate.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-duplicate.s
@@ -50,13 +50,13 @@
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-forms.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-forms.s
index 9aaa4c4..910431c 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-forms.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-forms.s
@@ -65,7 +65,7 @@
.byte 17 # DW_FORM_ref1
.byte 2 # DW_IDX_type_unit
.byte 17 # DW_FORM_ref1
- .byte 2 # DW_IDX_die_offset
+ .byte 2 # DW_IDX_type_unit
.byte 5 # DW_FORM_data2
.byte 5 # DW_IDX_type_hash
.byte 6 # DW_FORM_data4
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-buckets.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-buckets.s
index 5934d6d..551e51c 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-buckets.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-buckets.s
@@ -69,7 +69,7 @@
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-unhashed-names.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-unhashed-names.s
index cd9bbcd..72ee6d7 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-unhashed-names.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-unhashed-names.s
@@ -97,7 +97,7 @@
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-wrong-hash.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-wrong-hash.s
index baffaec..b0e0181 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-wrong-hash.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-wrong-hash.s
@@ -79,7 +79,7 @@
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
- .byte 6 # DW_FORM_data4
+ .byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list