aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 231d666..0d25169 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -1232,13 +1232,17 @@ void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
OS, cast<ExternalSymbolPseudoSourceValue>(PVal)->getSymbol());
break;
default: {
- const MIRFormatter *Formatter = TII->getMIRFormatter();
// FIXME: This is not necessarily the correct MIR serialization format for
// a custom pseudo source value, but at least it allows
// MIR printing to work on a target with custom pseudo source
// values.
OS << "custom \"";
- Formatter->printCustomPseudoSourceValue(OS, MST, *PVal);
+ if (TII) {
+ const MIRFormatter *Formatter = TII->getMIRFormatter();
+ Formatter->printCustomPseudoSourceValue(OS, MST, *PVal);
+ } else {
+ PVal->printCustom(OS);
+ }
OS << '\"';
break;
}