summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-11-02 02:26:24 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-11-02 02:26:24 +0000
commitb6726a9ecef262ff854217ee972c81067a38882e (patch)
tree2414eedce8550028cb112a3d64e999708a45d81a /llvm
parentab60bb9b8185e8e3c8b398a03a993de950d891cb (diff)
downloadbcm5719-llvm-b6726a9ecef262ff854217ee972c81067a38882e.tar.gz
bcm5719-llvm-b6726a9ecef262ff854217ee972c81067a38882e.zip
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
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp5
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h7
2 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 885be61b7c9..63cf62c03f9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 5f80e0cfc23..27ed6fc1431 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/llvm/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() {
OpenPOWER on IntegriCloud