diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-11-08 17:21:38 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-11-08 17:21:38 +0000 |
commit | 0f569535676325a94981881eba6f8c7e61630992 (patch) | |
tree | 07ff3c59959ab83e3e82bdf16ee56d3fe7c52961 /lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | |
parent | d9afb4d08a0143c9b9266001175c1b03e33663b6 (diff) | |
download | external_llvm-0f569535676325a94981881eba6f8c7e61630992.zip external_llvm-0f569535676325a94981881eba6f8c7e61630992.tar.gz external_llvm-0f569535676325a94981881eba6f8c7e61630992.tar.bz2 |
Factor out offset printing code into generic AsmPrinter.
FIXME: it seems, that most of targets don't support
offsets wrt CPI/GlobalAddress', was it intentional?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 556757a..66319c3 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -344,11 +344,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, O << "@GOTOFF"; } - int Offset = MO.getOffset(); - if (Offset > 0) - O << '+' << Offset; - else if (Offset < 0) - O << Offset; + printOffset(MO.getOffset()); if (isMemOp && Subtarget->isPICStyleRIPRel() && !NotRIPRel) O << "(%rip)"; @@ -429,11 +425,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, if (GV->hasExternalWeakLinkage()) ExtWeakSymbols.insert(GV); - int Offset = MO.getOffset(); - if (Offset > 0) - O << '+' << Offset; - else if (Offset < 0) - O << Offset; + printOffset(MO.getOffset()); if (isThreadLocal) { if (TM.getRelocationModel() == Reloc::PIC_ || Subtarget->is64Bit()) |