[PATCH] D65879: [clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers` functionality.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 7 08:09:21 PDT 2019


ymandel created this revision.
ymandel added a reviewer: gribozavr.
Herald added a subscriber: xazax.hun.
Herald added a project: clang.

`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`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65879

Files:
  clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp


Index: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
+++ clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
@@ -62,7 +62,8 @@
 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(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65879.213889.patch
Type: text/x-patch
Size: 637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190807/5921a773/attachment.bin>


More information about the cfe-commits mailing list