llvm-project/clang-tools-extra/clang-tidy
Yitzhak Mandelbaum 068da2c749 [clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly.
Adds support for setting the `Rule` field. In the process, refactors the code that accesses that field and adds a constructor that doesn't require a rule argument.

This feature is needed by checks that must set the rule *after* the check class
is constructed. For example, any check that maintains state to be accessed from
the rule needs this support. Since the object's fields are not initialized when
the superclass constructor is called, they can't be (safely) captured by a rule
passed to the existing constructor.  This patch allows constructing the check
superclass fully before setting the rule.

As a driveby fix, removed the "optional" from the rule, since rules are just a
set of cases, so empty rules are evident.

Differential Revision: https://reviews.llvm.org/D91544
2020-11-18 18:25:21 +00:00
..
abseil [clang-tidy] Fix an abseil-redundant-strcat-calls crash on 0-parameter StrCat(). 2020-11-17 11:05:24 +01:00
altera Add a new altera kernel name restriction check to clang-tidy. 2020-11-09 09:26:50 -05:00
android Allow to specify macro names for android-comparison-in-temp-failure-retry 2020-10-01 10:09:26 -07:00
boost [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
bugprone [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups 2020-11-14 08:35:21 +03:00
cert [clang-tidy] Add signal-handler-check for SEI CERT rule SIG30-C 2020-11-04 16:42:30 +01:00
cppcoreguidelines [clang] Use SourceLocation as key in hash maps, NFCI 2020-10-20 16:24:09 +01:00
darwin [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
fuchsia [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
google [clang-tidy] Add links to check docs in comments 2020-10-22 13:31:21 +02:00
hicpp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
linuxkernel [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
llvm [clang-tidy] Make clang-format and include-order-check coherent 2020-11-17 14:54:10 +01:00
llvmlibc [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
misc clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC 2020-10-15 00:35:16 -04:00
modernize [NFC][clang-tidy] Use isInStdNamespace matcher instead of check defined alternatives 2020-10-18 16:02:11 +01:00
mpi [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
objc [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
openmp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
performance Always allow std::function to be copied. 2020-10-21 17:20:35 -04:00
plugin [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
portability [clang tidy] Fix SIMDIntrinsicsCheck not storing options 2020-10-18 15:56:39 +01:00
readability [clang-tidy] Remove bad assert after 3b9b90a1 2020-11-09 13:21:55 +00:00
tool [clang-tidy] Merge options inplace instead of copying 2020-11-12 18:19:12 +00:00
utils [clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly. 2020-11-18 18:25:21 +00:00
zircon [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
CMakeLists.txt Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
ClangTidy.cpp Use ANSI escape codes for --use-color on Windows 2020-10-31 10:36:42 -04:00
ClangTidy.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ClangTidyCheck.cpp [clang-tidy][NFC] Added convienence methods for getting optional options 2020-08-01 01:45:34 +01:00
ClangTidyCheck.h [clang-tidy][NFC] Added convienence methods for getting optional options 2020-08-01 01:45:34 +01:00
ClangTidyDiagnosticConsumer.cpp [clang-tidy] Merge options inplace instead of copying 2020-11-12 18:19:12 +00:00
ClangTidyDiagnosticConsumer.h Add missing #include 2020-06-29 22:08:20 -07:00
ClangTidyForceLinker.h Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
ClangTidyModule.cpp [clang-tidy][NFC] Use StringMap for ClangTidyCheckFactories::FacoryMap 2020-07-30 22:57:33 +01:00
ClangTidyModule.h [clang-tidy][NFC] Use StringMap for ClangTidyCheckFactories::FacoryMap 2020-07-30 22:57:33 +01:00
ClangTidyModuleRegistry.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyOptions.cpp [clang-tidy] Merge options inplace instead of copying 2020-11-12 18:19:12 +00:00
ClangTidyOptions.h [clang-tidy] Merge options inplace instead of copying 2020-11-12 18:19:12 +00:00
ClangTidyProfiling.cpp Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
ClangTidyProfiling.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ExpandModularHeadersPPCallbacks.cpp [clang-tidy] Silence unused variable warning in Release builds. NFCI. 2020-10-26 20:20:23 +01:00
ExpandModularHeadersPPCallbacks.h Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
GlobList.cpp [clang-tidy][NFC] Tweak GlobList to iterate backwards 2020-11-10 14:27:24 +00:00
GlobList.h [clang-tidy][NFC] Tweak GlobList to iterate backwards 2020-11-10 14:27:24 +00:00
add_new_check.py [clang-tidy] prevent generated checks from triggering assertions on anonymous functions 2020-08-12 12:43:40 +01:00
clang-tidy-config.h.cmake Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
rename_check.py [clang-tidy] NFC: Cleanup Python scripts 2020-05-18 12:21:27 +02:00