[PATCH] D90023: [Syntax] Add iterators over children of syntax trees.
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 26 09:03:42 PDT 2020
gribozavr2 added inline comments.
================
Comment at: clang/include/clang/Tooling/Syntax/Tree.h:182
+ /// The element, or nullptr if past-the-end.
+ NodeT *asPointer() const { return N; }
+ };
----------------
sammccall wrote:
> gribozavr2 wrote:
> > "nodePointer()" ?
> I find this a little confusing; it suggests to me there's also something *other* than the node here.
> What aspect does it help with?
>
> I can live with it, though currently would prefer `pointer()`, `getPointer()` or `asPointer()`.
> it suggests to me there's also something *other* than the node here.
Not in this case, but there often are other pointers -- LLVM types often have an "opaque pointer" representation, and that was the first thing that I thought about when I read `asPointer()`. However, it is strongly typed, so one can figure it out. Up to you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90023/new/
https://reviews.llvm.org/D90023
More information about the cfe-commits
mailing list