[PATCH] D71453: [llvm-objdump] Print target address instead of call/j/br pc-rel immediate

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 13:49:54 PST 2020


MaskRay added a comment.

MIPS `beq $9, $6, 1332`
RISCV: `beqz x10, 512`

These are examples that a direct call/jump instruction may take more than one operands. I think we should

- Teach `MCInstPrinter::printInst` and `MCInstrPrinter::printInstruction` to take an extra parameter `Address` (D72172 <https://reviews.llvm.org/D72172> D72180 <https://reviews.llvm.org/D72180>)
- Migrate targets's `*InstrInfo.td` files to use a different `PrintMethod`, say, `printBranchOperand`, instead of the default `printOperand`. Pass `Address` to `printBranchOperand`.

    case 1:
      // PseudoFLD, PseudoFLW, PseudoFSD, PseudoFSW, PseudoSB, PseudoSD, Pseudo...
  -    printBranchOperand(MI, 1, STI, O);
  -    printBranchOperand(MI, 1, Address, STI, O);
      return;
      break;


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71453/new/

https://reviews.llvm.org/D71453





More information about the llvm-commits mailing list