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).

llvm-svn: 221078
This commit is contained in:
David Blaikie 2014-11-02 02:26:24 +00:00
parent ab60bb9b81
commit b6726a9ece
2 changed files with 8 additions and 4 deletions

View File

@ -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);
}

View File

@ -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() {