[AST] Traverse attributes inside DEF_TRAVERSE_DECL macro
authorIlya Biryukov <ibiryukov@google.com>
Tue, 6 Aug 2019 15:46:12 +0000 (15:46 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Tue, 6 Aug 2019 15:46:12 +0000 (15:46 +0000)
commit4b03364d72a5f4e372e631178bd32e0d4f531241
treee5f656baafa9435bc61c35613e662bb2cef0caed
parent8442252c490896fa62050266c11431fe1bbc398b
[AST] Traverse attributes inside DEF_TRAVERSE_DECL macro

Summary:
Instead of traversing inside the TraverseDecl() function.
Previously the attributes were traversed after Travese(Some)Decl
returns.

Logically attributes are properties of particular Decls and should be
traversed alongside other "child" nodes.

None of the tests relied on this behavior, hopefully this is an indication
that the change is relatively safe.

This change started with a discussion on cfe-dev, for details see:
https://lists.llvm.org/pipermail/cfe-dev/2019-July/062899.html

Reviewers: rsmith, gribozavr

Reviewed By: gribozavr

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 368052
clang/include/clang/AST/RecursiveASTVisitor.h
clang/unittests/AST/CMakeLists.txt
clang/unittests/AST/RecursiveASTVisitorTest.cpp [new file with mode: 0644]