Sink dwarf unit length emission down into DwarfUnit::emitHeader

This allows the CU label to be emitted only for compile units, as
they're the only ones that need it (so they can be referenced from
pubnames)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221072 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-11-01 23:59:23 +00:00
parent d457d52613
commit 5e8ee21fb6
4 changed files with 14 additions and 7 deletions

View File

@ -1730,6 +1730,10 @@ DIE *DwarfUnit::getOrCreateStaticMemberDIE(DIDerivedType DT) {
}
void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const {
// Emit size of content not including length itself
Asm->OutStreamer.AddComment("Length of Unit");
Asm->EmitInt32(getHeaderSize() + UnitDie.getSize());
Asm->OutStreamer.AddComment("DWARF version number");
Asm->EmitInt16(DD->getDwarfVersion());
Asm->OutStreamer.AddComment("Offset Into Abbrev. Section");