This revision was automatically updated to reflect the committed changes.
Closed by commit rL366672: [AST] Treat semantic form of InitListExpr as
implicit code in traversals (authored by ibiryukov, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed
ilya-biryukov updated this revision to Diff 211035.
ilya-biryukov marked an inline comment as done.
ilya-biryukov added a comment.
- Rewrite code as suggested in the review
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64762/new/
ilya-biryukov added inline comments.
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2332
S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
TRY_TO(TraverseSynOrSemInitListExpr(
S->isSemanticForm() ? S : S->getSemanticForm(), Queue));
gribozavr accepted this revision.
gribozavr added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2332
S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
ilya-biryukov marked an inline comment as done.
ilya-biryukov added inline comments.
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2332
S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
TRY_TO(TraverseSynOrSemInitListExpr(
S->isSemanticForm()
ilya-biryukov updated this revision to Diff 210052.
ilya-biryukov added a comment.
- Add a test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64762/new/
https://reviews.llvm.org/D64762
Files:
clang/include/clang/AST/RecursiveASTVisitor.h
ilya-biryukov added inline comments.
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2332
S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
TRY_TO(TraverseSynOrSemInitListExpr(
S->isSemanticForm() ? S : S->getSemanticForm(), Queue));
gribozavr added a comment.
Please add tests to
`llvm/tools/clang/unittests/Tooling/RecursiveASTVisitorTests/`.
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2332
S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
ilya-biryukov created this revision.
ilya-biryukov added a reviewer: gribozavr.
Herald added a subscriber: kadircet.
Herald added a project: clang.
In particular, do not traverse the semantic form shouldVisitImplicitCode()
returns false.
This simplifies the common case of traversals, avoiding