}
/// Recursively append the DIE type name when applicable.
- void appendUnqualifiedName(const DWARFDie &D,
- bool SkipFirstParamIfArtificial = false) {
- if (!D.isValid() || D.isNULL())
- return;
-
+ void appendUnqualifiedName(const DWARFDie &D) {
// FIXME: We should have pretty printers per language. Currently we print
// everything as if it was C++ and fall back to the TAG type name.
DWARFDie Inner = appendUnqualifiedNameBefore(D);
- appendUnqualifiedNameAfter(D, Inner, SkipFirstParamIfArtificial);
+ appendUnqualifiedNameAfter(D, Inner);
}
void appendSubroutineNameAfter(DWARFDie D, DWARFDie Inner,
DINameKind::LinkageName))
OS << Space << "\"" << Name << '\"';
} else if (Attr == DW_AT_type) {
- OS << Space << "\"";
- DWARFTypePrinter(OS).appendQualifiedName(
- Die.getAttributeValueAsReferencedDie(FormValue));
- OS << '"';
+ DWARFDie D = Die.getAttributeValueAsReferencedDie(FormValue);
+ if (D && !D.isNULL()) {
+ OS << Space << "\"";
+ DWARFTypePrinter(OS).appendQualifiedName(D);
+ OS << '"';
+ }
} else if (Attr == DW_AT_APPLE_property_attribute) {
if (Optional<uint64_t> OptVal = FormValue.getAsUnsignedConstant())
dumpApplePropertyAttribute(OS, *OptVal);
# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (1)
# 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_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052})
# CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}
# CHECK-NEXT: error: DIE has DW_AT_type with incompatible tag DW_TAG_null{{[[:space:]]}}
# CHECK-NEXT: 0x0000002b: DW_TAG_subprogram [2] *
# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (1)
# 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_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052})
# CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}
# CHECK-NEXT: error: DIE has DW_AT_decl_file that references a file with index 1 and the compile unit has no line table{{[[:space:]]}}
# CHECK-NEXT: 0x00000044: DW_TAG_variable [3]