[PATCH] D115187: [clangd] Expose CoawaitExpr's operand in the AST

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 00:03:04 PDT 2022


nridge added a comment.

In D115187#3192034 <https://reviews.llvm.org/D115187#3192034>, @sammccall wrote:

> A change that probably goes along with this one is having RecursiveASTVisitor traverse the syntactic form instead of the semantic one if traversal of implicit code is off.

I believe that's already the behaviour that falls out of the current implementation <https://searchfox.org/llvm/rev/1f0b8ba47ab0f1dc678099d4830d0cc0d10850b6/clang/include/clang/AST/RecursiveASTVisitor.h#2809>:

  DEF_TRAVERSE_STMT(CoawaitExpr, {
    if (!getDerived().shouldVisitImplicitCode()) {
      TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getOperand());
      ShouldVisitChildren = false;
    }
  })

If we are not visiting implicit code, we only visit the operand, otherwise we visit all subexpressions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115187



More information about the cfe-commits mailing list