remove the didInitial ivar, rename emitInitial to be more
descriptive, change EmitSectionOffset back to taking a
symbol instead of a string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100361 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 8958985..71bdd52 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -35,11 +35,19 @@
DwarfPrinter::DwarfPrinter(AsmPrinter *A)
: Asm(A), MAI(A->MAI), TD(Asm->TM.getTargetData()),
RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),
- SubprogramCount(0) {}
+ SubprogramCount(0) {
+}
+/// EmitSectionOffset - Emit the 4-byte offset of Label from the start of its
+/// section. This can be done with a special directive if the target supports
+/// it (e.g. cygwin) or by emitting it as an offset from a label at the start
+/// of the section.
+///
+/// SectionLabel is a temporary label emitted at the start of the section that
+/// Label lives in.
void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
- const char *SectionLabel) {
+ const MCSymbol *SectionLabel) const {
// On COFF targets, we have to emit the special .secrel32 directive.
if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
// FIXME: MCize.
@@ -54,8 +62,7 @@
return;
}
- MCSymbol *SectionSym = Asm->GetTempSymbol(SectionLabel);
- Asm->EmitLabelDifference(Label, SectionSym, 4);
+ Asm->EmitLabelDifference(Label, SectionLabel, 4);
}
/// EmitFrameMoves - Emit frame instructions to describe the layout of the