diff options
author | Jim Grosbach <grosbach@apple.com> | 2014-06-11 20:26:45 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2014-06-11 20:26:45 +0000 |
commit | 7a930bf9efee4f7c2de4cfdbe6c79c693d8805b1 (patch) | |
tree | f6b785aab83c3e865a60a6509a6f884fc180b767 /llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp | |
parent | 3fdf7cfba014838471cb056f44c038815d2826ad (diff) | |
download | bcm5719-llvm-7a930bf9efee4f7c2de4cfdbe6c79c693d8805b1.tar.gz bcm5719-llvm-7a930bf9efee4f7c2de4cfdbe6c79c693d8805b1.zip |
ARM: honor hex immediate formatting for ldr/str i12 offsets.
Previously we would always print the offset as decimal, regardless of
the formatting requested. Now we use the formatImm() helper so the value
is printed as the client (LLDB in the motivating example) requested.
Before:
ldr.w r8, [sp, #180] @ always
After:
ldr.w r8, [sp, #0xb4] @ when printing hex immediates
ldr.w r8, [sp, #0180] @ when printing decimal immediates
rdar://17237103
llvm-svn: 210701
Diffstat (limited to 'llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp index e4b785def87..228fb5756ca 100644 --- a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp +++ b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp @@ -1092,13 +1092,13 @@ void ARMInstPrinter::printAddrModeImm12Operand(const MCInst *MI, unsigned OpNum, if (isSub) { O << ", " << markup("<imm:") - << "#-" << -OffImm + << "#-" << formatImm(-OffImm) << markup(">"); } else if (AlwaysPrintImm0 || OffImm > 0) { O << ", " << markup("<imm:") - << "#" << OffImm + << "#" << formatImm(OffImm) << markup(">"); } O << "]" << markup(">"); |