diff options
| author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-05-14 10:17:52 +0000 |
|---|---|---|
| committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-05-14 10:17:52 +0000 |
| commit | eb9af294266ee67924030f546205ea41a3eea0c2 (patch) | |
| tree | 8e89cbaadb329b036ce03a9a2295903a0751354b /llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp | |
| parent | 1290369f7b268027f72f7cd6203c77e3253cd276 (diff) | |
| download | bcm5719-llvm-eb9af294266ee67924030f546205ea41a3eea0c2.tar.gz bcm5719-llvm-eb9af294266ee67924030f546205ea41a3eea0c2.zip | |
[SystemZ] Add disassembler support
llvm-svn: 181777
Diffstat (limited to 'llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp b/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp index d73cf498089..369802b2b81 100644 --- a/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp +++ b/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp @@ -114,10 +114,26 @@ void SystemZInstPrinter::printAccessRegOperand(const MCInst *MI, int OpNum, O << "%a" << (unsigned int)Value; } +void SystemZInstPrinter::printPCRelOperand(const MCInst *MI, int OpNum, + raw_ostream &O) { + const MCOperand &MO = MI->getOperand(OpNum); + if (MO.isImm()) { + O << "0x"; + O.write_hex(MO.getImm()); + } else + O << *MO.getExpr(); +} + void SystemZInstPrinter::printCallOperand(const MCInst *MI, int OpNum, raw_ostream &O) { - printOperand(MI, OpNum, O); - O << "@PLT"; + const MCOperand &MO = MI->getOperand(OpNum); + if (MO.isImm()) { + O << "0x"; + O.write_hex(MO.getImm()); + } else { + O << *MO.getExpr(); + O << "@PLT"; + } } void SystemZInstPrinter::printOperand(const MCInst *MI, int OpNum, |

