[clang-tools-extra] r368700 - [clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers` functionality.

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 07:48:14 PDT 2019


Author: ymandel
Date: Tue Aug 13 07:48:13 2019
New Revision: 368700

URL: http://llvm.org/viewvc/llvm-project?rev=368700&view=rev
Log:
[clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers` functionality.

Summary:
`buildMatchers` is the new, more general way to extract the matcher from a rule.
This change migrates the code to use it instead of `buildMatcher`.

Reviewers: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

Modified:
    clang-tools-extra/trunk/clang-tidy/utils/TransformerClangTidyCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/utils/TransformerClangTidyCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/TransformerClangTidyCheck.cpp?rev=368700&r1=368699&r2=368700&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/TransformerClangTidyCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/TransformerClangTidyCheck.cpp Tue Aug 13 07:48:13 2019
@@ -62,7 +62,8 @@ void TransformerClangTidyCheck::register
 void TransformerClangTidyCheck::registerMatchers(
     ast_matchers::MatchFinder *Finder) {
   if (Rule)
-    Finder->addDynamicMatcher(tooling::detail::buildMatcher(*Rule), this);
+    for (auto &Matcher : tooling::detail::buildMatchers(*Rule))
+      Finder->addDynamicMatcher(Matcher, this);
 }
 
 void TransformerClangTidyCheck::check(




More information about the cfe-commits mailing list