diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-08 23:58:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-08 23:58:37 +0000 |
commit | 0d50c7620d92762eaa5c9dedd07c94f5a6a19935 (patch) | |
tree | 9b875823c81984c10175b00d3fb0dd16d682dee2 /lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | |
parent | 5196018d9cb80a1cc81b95c6365de24f33c5f6bb (diff) |
move .set generation out of DwarfPrinter into AsmPrinter and
MCize it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 52a4055d15..0f68c58b8d 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -35,7 +35,7 @@ DwarfPrinter::DwarfPrinter(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T, const char *flavor) : O(OS), Asm(A), MAI(T), TD(Asm->TM.getTargetData()), RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL), - SubprogramCount(0), Flavor(flavor), SetCounter(1) {} + SubprogramCount(0), Flavor(flavor) {} /// getDWLabel - Return the MCSymbol corresponding to the assembler temporary @@ -243,7 +243,7 @@ void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const { O << *TLOF.getSymbolForDwarfReference(Sym, Asm->MMI, Encoding);; } -void DwarfPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const { +void DwarfPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const{ const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); PrintRelDirective(Encoding); @@ -255,25 +255,8 @@ void DwarfPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const /// supports .set, we emit a .set of a temporary and then use it in the .word. void DwarfPrinter::EmitDifference(const MCSymbol *TagHi, const MCSymbol *TagLo, bool IsSmall) { - if (MAI->hasSetDirective()) { - // FIXME: switch to OutStreamer.EmitAssignment. - O << "\t.set\t"; - PrintLabelName("set", SetCounter, Flavor); - O << ","; - PrintLabelName(TagHi); - O << "-"; - PrintLabelName(TagLo); - O << "\n"; - - PrintRelDirective(IsSmall); - PrintLabelName("set", SetCounter, Flavor); - ++SetCounter; - } else { - PrintRelDirective(IsSmall); - PrintLabelName(TagHi); - O << "-"; - PrintLabelName(TagLo); - } + unsigned Size = IsSmall ? 4 : TD->getPointerSize(); + Asm->EmitLabelDifference(TagHi, TagLo, Size); } void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label, |