[PATCH] D29705: Fix PR 24415 (at least), by making our post-dominator tree behavior sane.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 06:37:09 PST 2017


dberlin added inline comments.


================
Comment at: include/llvm/Support/GenericDomTreeConstruction.h:165
+    for (auto I = FuncGraphT::nodes_begin(&F), E = FuncGraphT::nodes_end(&F);
+         I != E; ++I) {
+      ++Total;
----------------
bryant wrote:
> Ranged-for? `for (NodeType *BB: make_range(FuncGraphT::nodes_begin(&F), FuncGraphT::nodes_end(&F))) {`.
Honestly, i would rather us just improve graph traits to provide ranges here.
I'm not sure i believe the ranged for version is more readable/easier to understand with make_range.
i'm happy to do that as a followup to add "nodes"  and "children" to graph traits.



https://reviews.llvm.org/D29705





More information about the llvm-commits mailing list