]> granicus.if.org Git - clang/commit
[LibTooling] Add support to Transformer for composing rules as an ordered choice.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 17 May 2019 14:23:33 +0000 (14:23 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 17 May 2019 14:23:33 +0000 (14:23 +0000)
commit2033acf56e6a287b9fd32bd85e65c2ad21735583
tree0d9533167f40bb47748ab9f2e89737a0717dcb73
parent6da38a622be8198c59aed95c7440a645bc8b00b7
[LibTooling] Add support to Transformer for composing rules as an ordered choice.

This revision updates `RewriteRule` to support multiple subrules that are
interpreted as an ordered-choice (apply the first one that matches). With this
feature, users can write the rules that appear later in the list of subrules
knowing that previous rules' patterns *have not matched*, freeing them from
reasoning about those cases in the current pattern.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

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