[PATCH] D73028: Extract ExprTraversal class from Expr

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 12:36:53 PST 2020


steveire added a comment.

In D73028#1839383 <https://reviews.llvm.org/D73028#1839383>, @rsmith wrote:

> > An addition to the API will be concerned with ascending through the AST in different traversal modes.
>
> Ascending through the AST is not possibly by design. (For example, we share AST nodes between template instantiations, and statement nodes don't contain parent pointers.) Can you say more about what you're thinking of adding here?


The follow-up is here: https://reviews.llvm.org/D73029 .

I have the need to change the ascending traversal implemented in ASTContext.cpp with a map (populated while descending) to make it skip nodes too during parent traversal.

I didn't want to have descending traversal in Expr.cpp and ascending traversal in ASTContext.cpp as they would be likely to go out of sync, so moving this implementation here allows extending the purpose in the follow-up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73028/new/

https://reviews.llvm.org/D73028





More information about the cfe-commits mailing list