diff options
| author | David Blaikie <dblaikie@gmail.com> | 2018-12-12 19:33:08 +0000 | 
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2018-12-12 19:33:08 +0000 | 
| commit | 815cffaad868b9c7003b6288c4dce8781576343b (patch) | |
| tree | eac855d714dcb225e78674ba94ec468f3f3e9f42 | |
| parent | 92b5493a14d86bbf28abfda2616994a4e2dbdf62 (diff) | |
| download | bcm5719-llvm-815cffaad868b9c7003b6288c4dce8781576343b.tar.gz bcm5719-llvm-815cffaad868b9c7003b6288c4dce8781576343b.zip  | |
DebugInfo/DWARF: Refactor type dumping to dump types, rather than DIEs that reference types
This lays the foundation for dumping types not referenced by DW_AT_type
attributes (in the near-term, that'll be DW_AT_containing_type for a
DW_TAG_ptr_to_member_type - in the future, potentially dumping the
pretty printed name next to the DW_TAG for the type, rather than only
when the type is referenced from elsewhere)
llvm-svn: 348961
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 8 | 
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index e88ea354d9f..c607807d822 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -155,9 +155,7 @@ static void dumpTypeTagName(raw_ostream &OS, dwarf::Tag T) {  }  /// Recursively dump the DIE type name when applicable. -static void dumpTypeName(raw_ostream &OS, const DWARFDie &Die) { -  DWARFDie D = Die.getAttributeValueAsReferencedDie(DW_AT_type); - +static void dumpTypeName(raw_ostream &OS, const DWARFDie &D) {    if (!D.isValid())      return; @@ -181,7 +179,7 @@ static void dumpTypeName(raw_ostream &OS, const DWARFDie &Die) {    }    // Follow the DW_AT_type if possible. -  dumpTypeName(OS, D); +  dumpTypeName(OS, D.getAttributeValueAsReferencedDie(DW_AT_type));    switch (T) {    case DW_TAG_array_type: { @@ -295,7 +293,7 @@ static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,        OS << Space << "\"" << Name << '\"';    } else if (Attr == DW_AT_type) {      OS << Space << "\""; -    dumpTypeName(OS, Die); +    dumpTypeName(OS, Die.getAttributeValueAsReferencedDie(formValue));      OS << '"';    } else if (Attr == DW_AT_APPLE_property_attribute) {      if (Optional<uint64_t> OptVal = formValue.getAsUnsignedConstant())  | 

