summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.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/MachineInstr.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/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index fb0b82c348c..96722b26ee8 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1405,8 +1405,11 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
} else {
LLT TypeToPrint = MRI ? getTypeToPrint(i, PrintedTypes, *MRI) : LLT{};
unsigned TiedOperandIdx = getTiedOperandIdx(i);
- MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true, ShouldPrintRegisterTies,
- TiedOperandIdx, TRI, IntrinsicInfo);
+ if (MO.isImm() && isOperandSubregIdx(i))
+ MachineOperand::printSubregIdx(OS, MO.getImm(), TRI);
+ else
+ MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true,
+ ShouldPrintRegisterTies, TiedOperandIdx, TRI, IntrinsicInfo);
}
}
OpenPOWER on IntegriCloud