[llvm] r231744 - Move label creation close to emission. NFC.
Rafael Espindola
rafael.espindola at gmail.com
Mon Mar 9 20:11:11 PDT 2015
Author: rafael
Date: Mon Mar 9 22:11:11 2015
New Revision: 231744
URL: http://llvm.org/viewvc/llvm-project?rev=231744&view=rev
Log:
Move label creation close to emission. NFC.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=231744&r1=231743&r2=231744&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Mon Mar 9 22:11:11 2015
@@ -711,10 +711,13 @@ void DwarfCompileUnit::collectDeadVariab
}
}
-void DwarfCompileUnit::emitHeader(const MCSymbol *ASectionSym) const {
+void DwarfCompileUnit::emitHeader(const MCSymbol *ASectionSym) {
// Don't bother labeling the .dwo unit, as its offset isn't used.
- if (!Skeleton)
+ if (!Skeleton) {
+ LabelBegin =
+ Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID());
Asm->OutStreamer.EmitLabel(LabelBegin);
+ }
DwarfUnit::emitHeader(ASectionSym);
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=231744&r1=231743&r2=231744&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Mon Mar 9 22:11:11 2015
@@ -179,11 +179,6 @@ public:
void initSection(const MCSection *Section, MCSymbol *SectionSym) {
DwarfUnit::initSection(Section);
this->SectionSym = SectionSym;
-
- // Don't bother labeling the .dwo unit, as its offset isn't used.
- if (!Skeleton)
- LabelBegin =
- Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID());
}
unsigned getLength() {
@@ -191,7 +186,7 @@ public:
getHeaderSize() + UnitDie.getSize();
}
- void emitHeader(const MCSymbol *ASectionSym) const override;
+ void emitHeader(const MCSymbol *ASectionSym) override;
MCSymbol *getLabelBegin() const {
assert(Section);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=231744&r1=231743&r2=231744&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Mon Mar 9 22:11:11 2015
@@ -1604,7 +1604,7 @@ DIE *DwarfUnit::getOrCreateStaticMemberD
return &StaticMemberDIE;
}
-void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const {
+void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) {
// Emit size of content not including length itself
Asm->OutStreamer.AddComment("Length of Unit");
Asm->EmitInt32(getHeaderSize() + UnitDie.getSize());
@@ -1629,7 +1629,7 @@ void DwarfUnit::initSection(const MCSect
this->Section = Section;
}
-void DwarfTypeUnit::emitHeader(const MCSymbol *ASectionSym) const {
+void DwarfTypeUnit::emitHeader(const MCSymbol *ASectionSym) {
DwarfUnit::emitHeader(ASectionSym);
Asm->OutStreamer.AddComment("Type Signature");
Asm->OutStreamer.EmitIntValue(TypeSignature, sizeof(TypeSignature));
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=231744&r1=231743&r2=231744&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Mon Mar 9 22:11:11 2015
@@ -321,7 +321,7 @@ public:
}
/// Emit the header for this unit, not including the initial length field.
- virtual void emitHeader(const MCSymbol *ASectionSym) const;
+ virtual void emitHeader(const MCSymbol *ASectionSym);
virtual DwarfCompileUnit &getCU() = 0;
@@ -423,7 +423,7 @@ public:
void setType(const DIE *Ty) { this->Ty = Ty; }
/// Emit the header for this unit, not including the initial length field.
- void emitHeader(const MCSymbol *ASectionSym) const override;
+ void emitHeader(const MCSymbol *ASectionSym) override;
unsigned getHeaderSize() const override {
return DwarfUnit::getHeaderSize() + sizeof(uint64_t) + // Type Signature
sizeof(uint32_t); // Type DIE Offset
More information about the llvm-commits
mailing list