[PATCH] D103181: [SimplifyCFG] Use make_early_inc_range() while deleting instructions

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 11:38:10 PDT 2021


lebedev.ri accepted this revision.
lebedev.ri added a comment.

LG, thank you, and sorry for the trouble!



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4503
     Instruction *InsertPt = DestEHPad;
-    for (PHINode &PN : BB->phis()) {
-      // The iterator must be incremented here because the instructions are
-      // being moved to another block.
+    for (PHINode &PN : llvm::make_early_inc_range(BB->phis())) {
       if (PN.use_empty() || !PN.isUsedOutsideOfBlock(BB))
----------------
Is `llvm::` really needed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103181



More information about the llvm-commits mailing list