DebugInfo: Avoid emitting pubtype entries for type DIEs that just indirect to a type unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195698 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-11-26 00:22:37 +00:00
parent 0e6ec124d5
commit 999cf05d6a
3 changed files with 74 additions and 58 deletions

View File

@@ -34,27 +34,29 @@ static void dumpPubSection(raw_ostream &OS, StringRef Name, StringRef Data,
OS << "\n." << Name << " contents:\n";
DataExtractor pubNames(Data, LittleEndian, 0);
uint32_t offset = 0;
OS << "length = " << format("0x%08x", pubNames.getU32(&offset));
OS << " version = " << format("0x%04x", pubNames.getU16(&offset));
OS << " unit_offset = " << format("0x%08x", pubNames.getU32(&offset));
OS << " unit_size = " << format("0x%08x", pubNames.getU32(&offset)) << '\n';
if (GnuStyle)
OS << "Offset Linkage Kind Name\n";
else
OS << "Offset Name\n";
while (pubNames.isValidOffset(offset)) {
OS << "length = " << format("0x%08x", pubNames.getU32(&offset));
OS << " version = " << format("0x%04x", pubNames.getU16(&offset));
OS << " unit_offset = " << format("0x%08x", pubNames.getU32(&offset));
OS << " unit_size = " << format("0x%08x", pubNames.getU32(&offset)) << '\n';
if (GnuStyle)
OS << "Offset Linkage Kind Name\n";
else
OS << "Offset Name\n";
while (offset < Data.size()) {
uint32_t dieRef = pubNames.getU32(&offset);
if (dieRef == 0)
break;
OS << format("0x%8.8x ", dieRef);
if (GnuStyle) {
PubIndexEntryDescriptor desc(pubNames.getU8(&offset));
OS << format("%-8s", dwarf::GDBIndexEntryLinkageString(desc.Linkage))
<< ' ' << format("%-8s", dwarf::GDBIndexEntryKindString(desc.Kind))
<< ' ';
while (offset < Data.size()) {
uint32_t dieRef = pubNames.getU32(&offset);
if (dieRef == 0)
break;
OS << format("0x%8.8x ", dieRef);
if (GnuStyle) {
PubIndexEntryDescriptor desc(pubNames.getU8(&offset));
OS << format("%-8s", dwarf::GDBIndexEntryLinkageString(desc.Linkage))
<< ' ' << format("%-8s", dwarf::GDBIndexEntryKindString(desc.Kind))
<< ' ';
}
OS << '\"' << pubNames.getCStr(&offset) << "\"\n";
}
OS << '\"' << pubNames.getCStr(&offset) << "\"\n";
}
}