[libTooling] In Transformer, allow atomic changes to span multiple files.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 19 May 2020 18:26:46 +0000 (14:26 -0400)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 26 May 2020 13:17:35 +0000 (09:17 -0400)
commitff2743bf047deac7ef6cc6c3efd30ff05e55b2ad
tree507a8685fa03b18e7ebcf5bf4a09a1cf90b7ad03
parent049c16ba93fa77df7984353b1a0124ed64fc0439
[libTooling] In Transformer, allow atomic changes to span multiple files.

Summary:
Currently, all changes returned by a single application of a rule must fit in
one atomic change and therefore must apply to one file. However, there are
patterns in which a single rule will want to modify multiple files; for example,
a header and implementation to change a declaration and its definition. This
patch relaxes Transformer, libTooling's interpreter of RewriteRules, to support
multiple changes.

Reviewers: gribozavr

Subscribers: mgrang, jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80239
clang/lib/Tooling/Transformer/Transformer.cpp
clang/unittests/Tooling/TransformerTest.cpp