[PATCH] D23649: [ADT] Change the range-based for loop in DFS to normal loop. NFC.

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 23:15:10 PDT 2016


dberris accepted this revision.
dberris added a reviewer: dberris.
This revision is now accepted and ready to land.

================
Comment at: include/llvm/ADT/DepthFirstIterator.h:110-111
@@ -109,3 +109,4 @@
 
-      for (NodeRef Next : make_range(*Opt, GT::child_end(Node))) {
+      for (auto &It = *Opt; It != GT::child_end(Node); ++It) {
+        NodeRef Next = *It;
         // Has our next sibling been visited?
----------------
Perhaps comment before these lines to explain that you don't do a range-based for loop for the reasons you explain, so the next person reading this doesn't go "why don't we make it a range-based for loop instead?".


https://reviews.llvm.org/D23649





More information about the llvm-commits mailing list