[PATCH] D38331: [Dominators] Add DFS number verification
Jakub Kuderski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 2 08:42:54 PDT 2017
kuhar added inline comments.
================
Comment at: include/llvm/Support/GenericDomTreeConstruction.h:1395
+ // Make a copy and sort is such that it is possible to check if there are
+ // no gaps between DFS numbers of adjacent children.
+ auto Children = Node->getChildren();
----------------
dberlin wrote:
> My only concern here is that this mutates the tree in a verification function.
> Given its verification, i would probably push the children and dfs numbers into a new vector, and sort + check that, to avoid mutating the tree.
It doesn't mutate children here -- a copy is made instead.
If it improves readability, I can change it into an construction of a new vector with explicit type instead of auto.
https://reviews.llvm.org/D38331
More information about the llvm-commits
mailing list