[llvm] r357628 - [dwarfdump] Remove bogus verifier error
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 3 12:57:13 PDT 2019
Author: jdevlieghere
Date: Wed Apr 3 12:57:13 2019
New Revision: 357628
URL: http://llvm.org/viewvc/llvm-project?rev=357628&view=rev
Log:
[dwarfdump] Remove bogus verifier error
The standard doesn't require a DW_TAG_variable, DW_TAG_formal_parameter
or DW_TAG_constant to A DW_AT_type attribute describing the type of the
variable. It only specifies that it *can* have one.
Modified:
llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp
llvm/trunk/test/tools/llvm-dwarfdump/X86/verify_debug_info.s
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp?rev=357628&r1=357627&r2=357628&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp Wed Apr 3 12:57:13 2019
@@ -178,21 +178,11 @@ unsigned DWARFVerifier::verifyUnitConten
if (Die.getTag() == DW_TAG_null)
continue;
- bool HasTypeAttr = false;
for (auto AttrValue : Die.attributes()) {
NumUnitErrors += verifyDebugInfoAttribute(Die, AttrValue);
NumUnitErrors += verifyDebugInfoForm(Die, AttrValue);
- HasTypeAttr |= (AttrValue.Attr == DW_AT_type);
}
- if (!HasTypeAttr && (Die.getTag() == DW_TAG_formal_parameter ||
- Die.getTag() == DW_TAG_variable ||
- Die.getTag() == DW_TAG_array_type)) {
- error() << "DIE with tag " << TagString(Die.getTag())
- << " is missing type attribute:\n";
- dump(Die) << '\n';
- NumUnitErrors++;
- }
NumUnitErrors += verifyDebugInfoCallSite(Die);
}
@@ -621,7 +611,7 @@ unsigned DWARFVerifier::verifyDebugInfoF
dump(Die) << '\n';
break;
}
- // Check that the index is within the bounds of the section.
+ // Check that the index is within the bounds of the section.
unsigned ItemSize = DieCU->getDwarfStringOffsetsByteSize();
// Use a 64-bit type to calculate the offset to guard against overflow.
uint64_t Offset =
Modified: llvm/trunk/test/tools/llvm-dwarfdump/X86/verify_debug_info.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/X86/verify_debug_info.s?rev=357628&r1=357627&r2=357628&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/X86/verify_debug_info.s (original)
+++ llvm/trunk/test/tools/llvm-dwarfdump/X86/verify_debug_info.s Wed Apr 3 12:57:13 2019
@@ -22,13 +22,6 @@
# CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true)
# CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052} "")
# CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}
-# CHECK-NEXT: error: DIE with tag DW_TAG_variable is missing type attribute:{{[[:space:]]}}
-# CHECK-NEXT: 0x00000044: DW_TAG_variable [3]
-# CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg -8)
-# CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006a] = "a")
-# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
-# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (2)
-# CHECK-NEXT: DW_AT_use_location [DW_FORM_ref4] (cu + 0x0053 => {0x00000053}){{[[:space:]]}}
# CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null.
# CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match.
# CHECK-NEXT: error: Units[2] - start offset: 0x00000068
More information about the llvm-commits
mailing list