[PATCH] D133903: Fix crash while printing MMO target flags
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 14 17:30:11 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGef4b9c33f5dd: Fix crash while printing MMO target flags (authored by rampitec).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133903/new/
https://reviews.llvm.org/D133903
Files:
llvm/lib/CodeGen/MachineOperand.cpp
Index: llvm/lib/CodeGen/MachineOperand.cpp
===================================================================
--- llvm/lib/CodeGen/MachineOperand.cpp
+++ llvm/lib/CodeGen/MachineOperand.cpp
@@ -1114,15 +1114,24 @@
OS << "dereferenceable ";
if (isInvariant())
OS << "invariant ";
- if (getFlags() & MachineMemOperand::MOTargetFlag1)
- OS << '"' << getTargetMMOFlagName(*TII, MachineMemOperand::MOTargetFlag1)
- << "\" ";
- if (getFlags() & MachineMemOperand::MOTargetFlag2)
- OS << '"' << getTargetMMOFlagName(*TII, MachineMemOperand::MOTargetFlag2)
- << "\" ";
- if (getFlags() & MachineMemOperand::MOTargetFlag3)
- OS << '"' << getTargetMMOFlagName(*TII, MachineMemOperand::MOTargetFlag3)
- << "\" ";
+ if (TII) {
+ if (getFlags() & MachineMemOperand::MOTargetFlag1)
+ OS << '"' << getTargetMMOFlagName(*TII, MachineMemOperand::MOTargetFlag1)
+ << "\" ";
+ if (getFlags() & MachineMemOperand::MOTargetFlag2)
+ OS << '"' << getTargetMMOFlagName(*TII, MachineMemOperand::MOTargetFlag2)
+ << "\" ";
+ if (getFlags() & MachineMemOperand::MOTargetFlag3)
+ OS << '"' << getTargetMMOFlagName(*TII, MachineMemOperand::MOTargetFlag3)
+ << "\" ";
+ } else {
+ if (getFlags() & MachineMemOperand::MOTargetFlag1)
+ OS << "\"MOTargetFlag1\" ";
+ if (getFlags() & MachineMemOperand::MOTargetFlag2)
+ OS << "\"MOTargetFlag2\" ";
+ if (getFlags() & MachineMemOperand::MOTargetFlag3)
+ OS << "\"MOTargetFlag3\" ";
+ }
assert((isLoad() || isStore()) &&
"machine memory operand must be a load or store (or both)");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133903.460272.patch
Type: text/x-patch
Size: 1631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220915/3c3eead8/attachment.bin>
More information about the llvm-commits
mailing list