[PATCH] D53333: [SystemZ] Make sure that SystemZAddressingMode::dump() does not crash.

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 07:00:06 PDT 2018


thegameg added inline comments.


================
Comment at: lib/CodeGen/MachineOperand.cpp:464
   }
-  MachineOperand::printIRSlotNumber(OS, MST.getLocalSlot(&V));
+  if (MST.getCurrentFunction())
+    MachineOperand::printIRSlotNumber(OS, MST.getLocalSlot(&V));
----------------
Can we make this:

```
int Slot = MST.getCurrentFunction() ? MST.getLocalSlot(&V) : -1;
MachineOperand::printIRSlotNumber(OS, Slot);
```

?

That way, `printIRSlotNumber` will print `<badref>` instead of `?`.


https://reviews.llvm.org/D53333





More information about the llvm-commits mailing list