diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-11-22 16:15:34 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-11-22 16:15:34 +0000 |
commit | 7751ad92daeea5a3502fbc266ae814baec5c03e6 (patch) | |
tree | e8fe5ac64eef58c1c5313b6c94b8037be8d04aa4 /lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | |
parent | 253174bf50c932abaa680f465e2888c0e5272267 (diff) | |
download | external_llvm-7751ad92daeea5a3502fbc266ae814baec5c03e6.zip external_llvm-7751ad92daeea5a3502fbc266ae814baec5c03e6.tar.gz external_llvm-7751ad92daeea5a3502fbc266ae814baec5c03e6.tar.bz2 |
Make a convenient helper for printing offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59872 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()) |