[PATCH] D50447: [clang-tidy] Add a whitelistClasses option in performance-for-range-copy check.

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 8 06:53:29 PDT 2018


JonasToth added a comment.

If whitelisting works, thats fine. But I agree with @lebedev.ri that a contribution/improvement to the ExprMutAnalyzer is the better option. This is especially the case, because multiple checks (and maybe even some other parts then clang-tidy) will utilize this analysis.



================
Comment at: clang-tidy/performance/ForRangeCopyCheck.cpp:39
+  auto WhitelistClassMatcher =
+      cxxRecordDecl(hasAnyName(SmallVector<StringRef, 4>(
+          WhitelistClasses.begin(), WhitelistClasses.end())));
----------------
I have seens this pattern now multiple times in various checks, we should have some utility wrapping the `hasAnyName(MyList)`. (Just in general, does not need to happen with this check)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50447





More information about the cfe-commits mailing list