Sink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place...
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfUnit.cpp
index bdcb8cc11eed3e520ff3303755904dc18a9b051f..065026677d0f042078f8319fce7bb0c4460c6e66 100644 (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");
@@ -1748,8 +1752,6 @@ void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const {
 void DwarfUnit::initSection(const MCSection *Section) {
   assert(!this->Section);
   this->Section = Section;
-  this->LabelBegin =
-      Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID());
 }
 
 void DwarfTypeUnit::emitHeader(const MCSymbol *ASectionSym) const {