diff options
author | Roman Tereshin <rtereshin@apple.com> | 2018-05-07 22:31:12 +0000 |
---|---|---|
committer | Roman Tereshin <rtereshin@apple.com> | 2018-05-07 22:31:12 +0000 |
commit | f487edae49368e1fb620a3597c61deef4275aa86 (patch) | |
tree | 2a31d538f7aa5de387d5567e3e7eb54d3f23a298 /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | a6cede6d8ee2ad78710e248463c346c6ec5e72ec (diff) | |
download | bcm5719-llvm-f487edae49368e1fb620a3597c61deef4275aa86.tar.gz bcm5719-llvm-f487edae49368e1fb620a3597c61deef4275aa86.zip |
[MachineVerifier][GlobalISel] NFC, Improving MO printing and refactoring visitMachineInstrBefore
This is an NFC pre-commit for the following "Checking that generic
instrs have LLTs on all vregs" commit.
This overloads MachineOperand::print to make it possible to print LLTs
with standalone machine operands.
This also overloads MachineVerifier::print(...MachineOperand...) with
an optional LLT using the newly introduced MachineOperand::print
variant; no actual calls added.
This also refactors MachineVerifier::visitMachineInstrBefore in the
parts dealing with all generic instructions (checking Selected
property, LLTs, and phys regs).
llvm-svn: 331693
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineOperand.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp index 764514e9261..2078a8bc6b0 100644 --- a/llvm/lib/CodeGen/MachineOperand.cpp +++ b/llvm/lib/CodeGen/MachineOperand.cpp @@ -704,9 +704,15 @@ static void printCFI(raw_ostream &OS, const MCCFIInstruction &CFI, void MachineOperand::print(raw_ostream &OS, const TargetRegisterInfo *TRI, const TargetIntrinsicInfo *IntrinsicInfo) const { + print(OS, LLT{}, TRI, IntrinsicInfo); +} + +void MachineOperand::print(raw_ostream &OS, LLT TypeToPrint, + const TargetRegisterInfo *TRI, + const TargetIntrinsicInfo *IntrinsicInfo) const { tryToGetTargetInfo(*this, TRI, IntrinsicInfo); ModuleSlotTracker DummyMST(nullptr); - print(OS, DummyMST, LLT{}, /*PrintDef=*/false, /*IsStandalone=*/true, + print(OS, DummyMST, TypeToPrint, /*PrintDef=*/false, /*IsStandalone=*/true, /*ShouldPrintRegisterTies=*/true, /*TiedOperandIdx=*/0, TRI, IntrinsicInfo); } |