[AST] Treat semantic form of InitListExpr as implicit code in traversals
authorIlya Biryukov <ibiryukov@google.com>
Mon, 22 Jul 2019 09:58:53 +0000 (09:58 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Mon, 22 Jul 2019 09:58:53 +0000 (09:58 +0000)
commit0a42fe70a566f22599e04a6f1344ca2dc5565e17
treebb6fc3d1778028a9040dcbb6b699dc9abc675de0
parent3a52e50d737905ff7da2747f27d61ca331ad6081
[AST] Treat semantic form of InitListExpr as implicit code in traversals

Summary:
In particular, do not traverse the semantic form if shouldVisitImplicitCode()
returns false.

This simplifies the common case of traversals, avoiding the need to
worry about some expressions being traversed twice.

No tests break after the change, the change would allow to simplify at
least one of the usages, i.e. r366070 which had to handle this in
clangd.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64762

llvm-svn: 366672
clang/include/clang/AST/RecursiveASTVisitor.h
clang/unittests/Tooling/RecursiveASTVisitorTests/InitListExprPreOrder.cpp