aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-03-22 15:03:10 -0700
committerFangrui Song <maskray@google.com>2020-03-26 08:28:59 -0700
commit87de9a0786d922a1b52db6cd8b12f642d1d00d85 (patch)
treef1a319b5cd9f43ae755a02c87c04d9686423715b /llvm/lib/CodeGen/MachineOperand.cpp
parent62dea6e9be31b100962f9ad41c1b79467a53f6cd (diff)
downloadllvm-87de9a0786d922a1b52db6cd8b12f642d1d00d85.zip
llvm-87de9a0786d922a1b52db6cd8b12f642d1d00d85.tar.gz
llvm-87de9a0786d922a1b52db6cd8b12f642d1d00d85.tar.bz2
[X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form
``` // llvm-objdump -d output (before) 400000: e8 0b 00 00 00 callq 11 400005: e8 0b 00 00 00 callq 11 // llvm-objdump -d output (after) 400000: e8 0b 00 00 00 callq 0x400010 400005: e8 0b 00 00 00 callq 0x400015 // GNU objdump -d. The lack of 0x is not ideal because the result cannot be re-assembled 400000: e8 0b 00 00 00 callq 400010 400005: e8 0b 00 00 00 callq 400015 ``` In llvm-objdump, we pass the address of the next MCInst. Ideally we should just thread the address of the current address, unfortunately we cannot call X86MCCodeEmitter::encodeInstruction (X86MCCodeEmitter requires MCInstrInfo and MCContext) to get the length of the MCInst. MCInstPrinter::printInst has other callers (e.g llvm-mc -filetype=asm, llvm-mca) which set Address to 0. They leave MCInstPrinter::PrintBranchImmAsAddress as false and this change is a no-op for them. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D76580
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions