[PATCH] D52902: [WebAssembly] Don't modify preds/succs iterators while erasing from them

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 13:44:19 PDT 2018


dschuff accepted this revision.
dschuff added a comment.
This revision is now accepted and ready to land.

Otherwise LGTM, and I verified that it fixes the expensive checks failure.



================
Comment at: lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp:94
     MachineBasicBlock *MBB = WL.pop_back_val();
+    SmallVector<MachineBasicBlock *, 4> Preds, Succs;
     for (auto *Pred : MBB->predecessors())
----------------
dschuff wrote:
> Could you just copy the Predecessors in the constructor, the way you do with `WL`?
e.g. `Preds(MBB->pred_begin(), MBB->pred_end())`


Repository:
  rL LLVM

https://reviews.llvm.org/D52902





More information about the llvm-commits mailing list