From: David Blaikie Date: Sun, 2 Nov 2014 02:26:24 +0000 (+0000) Subject: Don't bother creating LabelBegin for .dwo units X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3ee898c624b9b2869d1e273d12d9bb8728ec236c;p=oota-llvm.git Don't bother creating LabelBegin for .dwo units This would help catch cases where we might otherwise try to reference a dwo CU label, which would be weird - because without relocations in the dwo file it's not generally meaningful to talk about the CU offsets there (or, if it is, we can do so in absolute terms without using a relocation to compute it). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221078 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 885be61b7c9..63cf62c03f9 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -687,8 +687,9 @@ void DwarfCompileUnit::collectDeadVariables(DISubprogram SP) { } void DwarfCompileUnit::emitHeader(const MCSymbol *ASectionSym) const { - // Emit the compile units header. - Asm->OutStreamer.EmitLabel(LabelBegin); + // Don't bother labeling the .dwo unit, as its offset isn't used. + if (!Skeleton) + Asm->OutStreamer.EmitLabel(LabelBegin); DwarfUnit::emitHeader(ASectionSym); } diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 5f80e0cfc23..27ed6fc1431 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -158,8 +158,11 @@ public: void initSection(const MCSection *Section, MCSymbol *SectionSym) { DwarfUnit::initSection(Section); this->SectionSym = SectionSym; - LabelBegin = - Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID()); + + // Don't bother labeling the .dwo unit, as its offset isn't used. + if (!Skeleton) + LabelBegin = + Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID()); } unsigned getLength() {