]> granicus.if.org Git - clang/commit
[LibTooling] Relax Transformer to allow rewriting macro expansions
authorYitzhak Mandelbaum <yitzhakm@google.com>
Thu, 18 Jul 2019 17:44:54 +0000 (17:44 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Thu, 18 Jul 2019 17:44:54 +0000 (17:44 +0000)
commitf44f939e355c13ccff5bc7f67b6ea957ff6f4c41
treea1f5ed6c9828dc45404a12809ebd7cef9b6d00c8
parent0e9e18592ac449e5c58779a1b17846b885c1b90e
[LibTooling] Relax Transformer to allow rewriting macro expansions

Summary:
Currently, Transformer rejects any changes to source locations inside macro
expansions. This change relaxes that constraint to allow rewrites when the
entirety of the expansion is replaced, since that can be mapped to replacing the
entirety of the expansion range in the file source.  This change makes
Transformer consistent with the handling of edit ranges in `clang::edit::Commit`
(which is used, for example, for applying `FixItHint`s from diagnostics).

Reviewers: ilya-biryukov

Subscribers: gribozavr, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366473 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Tooling/Refactoring/Transformer.cpp
unittests/Tooling/TransformerTest.cpp