[PATCH] D58041: [Backend] DBG_CALLSITE & DBG_CALLSITEPARAM instr handling

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 13 03:08:44 PST 2019


dstenb added inline comments.


================
Comment at: lib/CodeGen/StackColoring.cpp:963
   for (MachineBasicBlock &BB : *MF)
-    for (MachineInstr &I : BB) {
+    for (auto I = BB.instr_begin(), E = BB.instr_end(); I != E; I++) {
       // Skip lifetime markers. We'll remove them soon.
----------------
The iterator does seem to be invalidated here (or am I overlooking something?), so you should be able to use `BB.instrs()` here instead.


================
Comment at: lib/CodeGen/StackSlotColoring.cpp:375
   for (MachineBasicBlock &MBB : MF) {
-    for (MachineInstr &MI : MBB)
-      RewriteInstruction(MI, SlotMapping, MF);
+    for (auto I = MBB.instr_begin(), E = MBB.instr_end(); I != E; I++)
+      RewriteInstruction(*I, SlotMapping, MF);
----------------
`MBB.instrs()`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58041/new/

https://reviews.llvm.org/D58041





More information about the llvm-commits mailing list