[libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 24 Jul 2020 13:27:51 +0000 (13:27 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 24 Jul 2020 14:38:17 +0000 (14:38 +0000)
commitc332a984aefc6f8a6b44fd3687a5bbce3f8f035c
treecd8d5d8e4847fb7944e87a9c4dc1a4eb30c19d22
parent4ef2e594d5be2e0e6d4446c8082b15466bc7ffcb
[libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.

The new combinator, `rewriteDescendants`, applies a rewrite rule to all
descendants of a specified bound node.  That rewrite rule can refer to nodes
bound by the parent, both in the matcher and in the edits.

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D84409
clang/include/clang/Tooling/Transformer/RewriteRule.h
clang/lib/Tooling/Transformer/RewriteRule.cpp
clang/lib/Tooling/Transformer/Transformer.cpp
clang/unittests/Tooling/TransformerTest.cpp