mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
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
This commit is contained in:
parent
dd0d4884c9
commit
63abdad81d
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user