From 6189ed10c1a6a39ad516aca2bda2c05fff35a55b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 4 Apr 2010 23:25:33 +0000 Subject: now that the magic is dispelled, move EmitSectionOffset to AsmPrinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100368 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 36 --------------------------------- 1 file changed, 36 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfPrinter.cpp') diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 84d47ec449..57fd469fe4 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -20,7 +20,6 @@ #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" -#include "llvm/MC/MCSection.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Target/TargetData.h" @@ -40,41 +39,6 @@ DwarfPrinter::DwarfPrinter(AsmPrinter *A) } -/// 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 MCSymbol *SectionLabel) const { - // On COFF targets, we have to emit the special .secrel32 directive. - if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) { - // FIXME: MCize. - Asm->OutStreamer.EmitRawText(SecOffDir + Twine(Label->getName())); - return; - } - - // Get the section that we're referring to, based on SectionLabel. - const MCSection &Section = SectionLabel->getSection(); - - // If Label has already been emitted, verify that it is in the same section as - // section label for sanity. - assert((!Label->isInSection() || &Label->getSection() == &Section) && - "Section offset using wrong section base for label"); - - // If the section in question will end up with an address of 0 anyway, we can - // just emit an absolute reference to save a relocation. - if (Section.isBaseAddressKnownZero()) { - Asm->OutStreamer.EmitSymbolValue(Label, 4, 0/*AddrSpace*/); - return; - } - - // Otherwise, emit it as a label difference from the start of the section. - Asm->EmitLabelDifference(Label, SectionLabel, 4); -} - /// EmitFrameMoves - Emit frame instructions to describe the layout of the /// frame. void DwarfPrinter::EmitFrameMoves(MCSymbol *BaseLabel, -- cgit v1.2.3-18-g5258