]> granicus.if.org Git - clang/commit
[libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible...
authorYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 13 Aug 2019 12:31:29 +0000 (12:31 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 13 Aug 2019 12:31:29 +0000 (12:31 +0000)
commit931a0dac83e7165dd14c874fa09cbcc37e6d825e
tree0decea853ab0c541c4ef0f9366324b2bfee34e8d
parent072a7d11572497d1e9889f04bd62d81ed6c4960c
[libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

Summary:
This patch removes an (artificial) limitation of `applyFirst`, which requires
that all of the rules' matchers can be grouped together in a single `anyOf()`.
This change generalizes the code to group the matchers into separate `anyOf`s
based on compatibility. Correspondingly, `buildMatcher` is changed to
`buildMatchers`, to allow for returning a set of matchers rather than just one.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

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