aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-05-14 10:17:52 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-05-14 10:17:52 +0000
commitc3b20c260ee17a66c6306f81293c75681d8ea0aa (patch)
treefdc283d6c8468f22fb87cf0b90cf4abf46cf7170 /lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp
parent5096dc74ae0df903d54085af3a57fa66b382493c (diff)
downloadexternal_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.cpp20
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,