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 | c3b20c260ee17a66c6306f81293c75681d8ea0aa (patch) | |
tree | fdc283d6c8468f22fb87cf0b90cf4abf46cf7170 /lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp | |
parent | 5096dc74ae0df903d54085af3a57fa66b382493c (diff) | |
download | external_llvm-c3b20c260ee17a66c6306f81293c75681d8ea0aa.zip external_llvm-c3b20c260ee17a66c6306f81293c75681d8ea0aa.tar.gz external_llvm-c3b20c260ee17a66c6306f81293c75681d8ea0aa.tar.bz2 |
[SystemZ] Add disassembler support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp')
-rw-r--r-- | lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp b/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp index d73cf49..369802b 100644 --- a/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp +++ b/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, |