Don't bother creating LabelBegin for .dwo units
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfCompileUnit.h
index 5f80e0cfc23b6ed6ae01996a7152a6bda10c3082..27ed6fc1431816ca7f14e99d76a96e3690002948 100644 (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() {