summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2017-12-08 22:53:21 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2017-12-08 22:53:21 +0000
commit440f69c95aeadb6e4c920d81db50c44c17810d97 (patch)
tree46c5c1a57cb6c39e7f540f62358f27da57e1bf2c /llvm/lib/CodeGen/MachineOperand.cpp
parent9b8caf5bd796b25a8a6e457e7b0d73da8163633d (diff)
downloadbcm5719-llvm-440f69c95aeadb6e4c920d81db50c44c17810d97.tar.gz
bcm5719-llvm-440f69c95aeadb6e4c920d81db50c44c17810d97.zip
[CodeGen] Move printing MO_Immediate operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the interfaces. Add support for operand subreg index as an immediate to debug printing and use ::print in the MIRPrinter. Differential Review: https://reviews.llvm.org/D40965 llvm-svn: 320209
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 0cbcb65a99a..8bd6a7a965b 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -345,6 +345,15 @@ static void tryToGetTargetInfo(const MachineOperand &MO,
}
}
+void MachineOperand::printSubregIdx(raw_ostream &OS, uint64_t Index,
+ const TargetRegisterInfo *TRI) {
+ OS << "%subreg.";
+ if (TRI)
+ OS << TRI->getSubRegIndexName(Index);
+ else
+ OS << Index;
+}
+
void MachineOperand::print(raw_ostream &OS, const TargetRegisterInfo *TRI,
const TargetIntrinsicInfo *IntrinsicInfo) const {
tryToGetTargetInfo(*this, TRI, IntrinsicInfo);
OpenPOWER on IntegriCloud