DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers

This commit does not complete the type units feature - there are issues
around fission support (skeletal type units, pubtypes/pubnames) and
hashing of some types including those containing references to types in
other type units.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197073 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-12-11 21:36:27 +00:00
parent bd71b0a161
commit 3d2670cc54
8 changed files with 93 additions and 29 deletions

View File

@ -1997,3 +1997,27 @@ void DwarfUnit::emitHeader(const MCSection *ASection,
Asm->OutStreamer.AddComment("Address Size (in bytes)");
Asm->EmitInt8(Asm->getDataLayout().getPointerSize());
}
void DwarfTypeUnit::emitHeader(const MCSection *ASection,
const MCSymbol *ASectionSym) const {
DwarfUnit::emitHeader(ASection, ASectionSym);
Asm->OutStreamer.AddComment("Type Signature");
Asm->OutStreamer.EmitIntValue(TypeSignature, sizeof(TypeSignature));
Asm->OutStreamer.AddComment("Type DIE Offset");
Asm->OutStreamer.EmitIntValue(Ty->getOffset(), sizeof(Ty->getOffset()));
}
void DwarfTypeUnit::initSection(const MCSection *Section) {
assert(!this->Section);
this->Section = Section;
// Since each type unit is contained in its own COMDAT section, the begin
// label and the section label are the same. Using the begin label emission in
// DwarfDebug to emit the section label as well is slightly subtle/sneaky, but
// the only other alternative of lazily constructing start-of-section labels
// and storing a mapping in DwarfDebug (or AsmPrinter).
this->SectionSym = this->LabelBegin =
Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID());
this->LabelEnd =
Asm->GetTempSymbol(Section->getLabelEndName(), getUniqueID());
this->LabelRange = Asm->GetTempSymbol("gnu_ranges", getUniqueID());
}