[PATCH] D83089: DomTree: Extract (mostly) read-only logic into type-erased base classes
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 6 13:06:27 PDT 2020
nhaehnle added inline comments.
================
Comment at: llvm/include/llvm/Support/GenericDomTree.h:81-82
- iterator begin() { return Children.begin(); }
- iterator end() { return Children.end(); }
+ iterator generic_begin() { return Children.begin(); }
+ iterator generic_end() { return Children.end(); }
const_iterator begin() const { return Children.begin(); }
----------------
arsenm wrote:
> Iterating over "generic" seems like a strange naming choice? The generic_children range is a bit better, but this should probably match
Okay, so the reason why I originally did this was that NewGVN wants to change the order of children (for what seems like dubious reasons, but I didn't want to touch *that* too), and providing non-const iteration from DomTreeNodeBase<T> is problematic. A cleaner way is to have NewGVN explicitly refer to the base class begin/end methods.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83089/new/
https://reviews.llvm.org/D83089
More information about the llvm-commits
mailing list