summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 22:33:59 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 22:33:59 +0000
commitfa070b01753e2d547539dca4e9d55459c652dc9c (patch)
treeebd70fc418b854d3a30eb7944ef9bbd8cd0638f5 /lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
parent2e3ebedc881091fcf0c68aebb48649582689ee78 (diff)
downloadllvm-fa070b01753e2d547539dca4e9d55459c652dc9c.tar.gz
llvm-fa070b01753e2d547539dca4e9d55459c652dc9c.tar.bz2
llvm-fa070b01753e2d547539dca4e9d55459c652dc9c.tar.xz
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 895898594e..71bdd52762 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -35,11 +35,19 @@ using namespace llvm;
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 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
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