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

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 25 17:08:45 PDT 2018


jonpa accepted this revision.
jonpa marked an inline comment as done.
jonpa added a comment.
This revision is now accepted and ready to land.

Thanks for review. SystemZ changes committed as r345347.



================
Comment at: lib/CodeGen/MachineOperand.cpp:464
   }
-  MachineOperand::printIRSlotNumber(OS, MST.getLocalSlot(&V));
+  if (MST.getCurrentFunction())
+    MachineOperand::printIRSlotNumber(OS, MST.getLocalSlot(&V));
----------------
thegameg wrote:
> Can we make this:
> 
> ```
> int Slot = MST.getCurrentFunction() ? MST.getLocalSlot(&V) : -1;
> MachineOperand::printIRSlotNumber(OS, Slot);
> ```
> 
> ?
> 
> That way, `printIRSlotNumber` will print `<badref>` instead of `?`.
Yes, I checked that we get this output. Committed this separately as r345342


https://reviews.llvm.org/D53333





More information about the llvm-commits mailing list