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
}
}
+void DwarfCompileUnit::emitHeader(const MCSymbol *ASectionSym) const {
+ // Emit the compile units header.
+ Asm->OutStreamer.EmitLabel(LabelBegin);
+
+ DwarfUnit::emitHeader(ASectionSym);
+}
+
+
} // end llvm namespace
return sizeof(uint32_t) + // Length field
getHeaderSize() + UnitDie.getSize();
}
+
+ void emitHeader(const MCSymbol *ASectionSym) const override;
};
} // end llvm namespace
const MCSection *USection = TheU->getSection();
Asm->OutStreamer.SwitchSection(USection);
- // Emit the compile units header.
- Asm->OutStreamer.EmitLabel(TheU->getLabelBegin());
-
- // Emit size of content not including length itself
- Asm->OutStreamer.AddComment("Length of Unit");
- Asm->EmitInt32(TheU->getHeaderSize() + Die.getSize());
-
TheU->emitHeader(ASectionSym);
DD.emitDIE(Die);
}
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");