summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Warn about -analyzer-configs being meant for development purposes ↵Kristof Umann2019-08-151-5/+16
| | | | | | | | | | | | only This is more of a temporary fix, long term, we should convert AnalyzerOptions.def into the universally beloved (*coughs*) TableGen format, where they can more easily be separated into developer-only, alpha, and user-facing configs. Differential Revision: https://reviews.llvm.org/D66261 llvm-svn: 368980
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [analyzer] Add a new frontend flag to display all checker optionsKristof Umann2019-05-231-35/+16
| | | | | | | | | Add the new frontend flag -analyzer-checker-option-help to display all checker/package options. Differential Revision: https://reviews.llvm.org/D57858 llvm-svn: 361552
* [analyzer][NFC] Use capital variable names, move methods out-of-line, rename ↵Kristof Umann2019-04-181-2/+4
| | | | | | | | | | | | some in CheckerRegistry There are barely any lines I haven't changed in these files, so I think I could might as well leave it in an LLVM coding style conforming state. I also renamed 2 functions and moved addDependency out of line to ease on followup patches. Differential Revision: https://reviews.llvm.org/D59457 llvm-svn: 358676
* [analyzer] Fix an bug where statically linked, but not registered checkers ↵Kristof Umann2019-01-261-4/+2
| | | | | | | | | | | | | | weren't recognized My last patch, D56989, moved the validation of whether a checker exists into its constructor, but we do support statically linked (and non-plugin) checkers that were do not have an entry in Checkers.td. However, the handling of this happens after the creation of the CheckerRegistry object. This patch fixes this bug by moving even this functionality into CheckerRegistry's constructor. llvm-svn: 352284
* [analyzer][NFC] Supply CheckerRegistry with AnalyzerOptionsKristof Umann2019-01-261-6/+7
| | | | | | | | | Since pretty much all methods of CheckerRegistry has AnalyzerOptions as an argument, it makes sense to just simply require it in it's constructor. Differential Revision: https://reviews.llvm.org/D56988 llvm-svn: 352279
* [analyzer] Supply all checkers with a shouldRegister functionKristof Umann2019-01-261-5/+7
| | | | | | | | | | | | | | | | | | Introduce the boolean ento::shouldRegister##CHECKERNAME(const LangOptions &LO) function very similarly to ento::register##CHECKERNAME. This will force every checker to implement this function, but maybe it isn't that bad: I saw a lot of ObjC or C++ specific checkers that should probably not register themselves based on some LangOptions (mine too), but they do anyways. A big benefit of this is that all registry functions now register their checker, once it is called, registration is guaranteed. This patch is a part of a greater effort to reinvent checker registration, more info here: D54438#1315953 Differential Revision: https://reviews.llvm.org/D55424 llvm-svn: 352277
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [analyzer][NFC] Merge ClangCheckerRegistry to CheckerRegistryKristof Umann2018-12-151-86/+7
| | | | | | | | | | | Now that CheckerRegistry lies in Frontend, we can finally eliminate ClangCheckerRegistry. Fortunately, this also provides us with a DiagnosticsEngine, so I went ahead and removed some parameters from it's methods. Differential Revision: https://reviews.llvm.org/D54437 llvm-svn: 349280
* [analyzer][NFC] Move CheckerRegistry from the Core directory to FrontendKristof Umann2018-12-151-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ClangCheckerRegistry is a very non-obvious, poorly documented, weird concept. It derives from CheckerRegistry, and is placed in lib/StaticAnalyzer/Frontend, whereas it's base is located in lib/StaticAnalyzer/Core. It was, from what I can imagine, used to circumvent the problem that the registry functions of the checkers are located in the clangStaticAnalyzerCheckers library, but that library depends on clangStaticAnalyzerCore. However, clangStaticAnalyzerFrontend depends on both of those libraries. One can make the observation however, that CheckerRegistry has no place in Core, it isn't used there at all! The only place where it is used is Frontend, which is where it ultimately belongs. This move implies that since include/clang/StaticAnalyzer/Checkers/ClangCheckers.h only contained a single function: class CheckerRegistry; void registerBuiltinCheckers(CheckerRegistry &registry); it had to re purposed, as CheckerRegistry is no longer available to clangStaticAnalyzerCheckers. It was renamed to BuiltinCheckerRegistration.h, which actually describes it a lot better -- it does not contain the registration functions for checkers, but only those generated by the tblgen files. Differential Revision: https://reviews.llvm.org/D54436 llvm-svn: 349275
* [analyzer] Prefer returns values to out-params in CheckerRegistry.cppKristof Umann2018-12-151-2/+3
| | | | | | | | | | | | | | | Renaming collectCheckers to getEnabledCheckers Changing the functionality to acquire all enabled checkers, rather then collect checkers for a specific CheckerOptInfo (for example, collecting all checkers for { "core", true }, which meant enabling all checkers from the core package, which was an unnecessary complication). Removing CheckerOptInfo, instead of storing whether the option was claimed via a field, we handle errors immediately, as getEnabledCheckers can now access a DiagnosticsEngine. Realize that the remaining information it stored is directly accessible through AnalyzerOptions.CheckerControlList. Fix a test with -analyzer-disable-checker -verify accidentally left in. llvm-svn: 349274
* [analyzer][NFC] Move CheckerOptInfo to CheckerRegistry.cpp, and make it localKristof Umann2018-11-181-25/+2
| | | | | | | | | CheckerOptInfo feels very much out of place in CheckerRegistration.cpp, so I moved it to CheckerRegistry.h. Differential Revision: https://reviews.llvm.org/D54397 llvm-svn: 347157
* Attempt to fix 'logical operation on address of string constant'Kristof Umann2018-11-021-2/+4
| | | | | | | Caused a lot of warnings for Windows: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/21178/steps/build/logs/warnings%20%2867%29 llvm-svn: 346033
* [analyzer] New flag to print all -analyzer-config optionsKristof Umann2018-11-021-0/+72
| | | | | | | | A new -cc1 flag is avaible for the said purpose: -analyzer-config-help Differential Revision: https://reviews.llvm.org/D53296 llvm-svn: 345989
* [analyzer] Add ASTContext to CheckerManagerGeorge Karpenkov2018-08-061-3/+3
| | | | | | | | | Some checkers require ASTContext. Having it in the constructor saves a lot of boilerplate of having to pass it around. Differential Revision: https://reviews.llvm.org/D50111 llvm-svn: 339079
* [analyzer] Allow registering custom statically-linked analyzer checkersAlexander Kornienko2018-06-271-4/+9
| | | | | | | | | | | | | | | | | | Summary: Add an extension point to allow registration of statically-linked Clang Static Analyzer checkers that are not a part of the Clang tree. This extension point employs the mechanism used when checkers are registered from dynamically loaded plugins. Reviewers: george.karpenkov, NoQ, xazax.hun, dcoughlin Reviewed By: george.karpenkov Subscribers: mgorny, mikhail.ramalho, rnkovacs, xazax.hun, szepet, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D45718 llvm-svn: 335740
* Remove use of intrusive ref count ownership acquisitionDavid Blaikie2017-01-041-1/+1
| | | | | | | | | | | The one use of CheckerManager (AnalysisConsumer, calling createCheckerManager) keeps a strong reference to the AnalysisOptions anyway, so this ownership wasn't necessary. (I'm not even sure AnalysisOptions needs ref counting at all - but that's more involved) llvm-svn: 291017
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-021-1/+1
| | | | | | | | | | Reviewers: aaron.ballman, mehdi_amini, dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26206 llvm-svn: 285799
* [analyzer] Command line option to show enabled checker list.Gabor Horvath2016-08-081-5/+20
| | | | | | | | | | | | This patch adds a command line option to list the checkers that were enabled by analyzer-checker and not disabled by -analyzer-disable-checker. It can be very useful to debug long command lines when it is not immediately apparent which checkers are turned on and which checkers are turned off. Differential Revision: https://reviews.llvm.org/D23060 llvm-svn: 278006
* Refactor: Simplify boolean conditional return statements in ↵Alexander Kornienko2015-12-281-4/+1
| | | | | | | | | | | | | | | | lib/StaticAnalyzer/Frontend Summary: Use clang-tidy to simplify boolean conditional return statements Reviewers: dcoughlin, alexfh Subscribers: alexfh, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10023 llvm-svn: 256497
* [analyzer] Apply whitespace cleanups by Honggyu Kim.Ted Kremenek2015-09-081-1/+1
| | | | llvm-svn: 246978
* [Static Analyzer] Do not fail silently, when the analyzer is invoked from ↵Gabor Horvath2015-07-151-1/+6
| | | | | | tooling lib, an analyzer plugin is loaded, but the runtime linker fails to link. llvm-svn: 242326
* [Static Analyzer] Basic per checker command line option validation.Gabor Horvath2015-07-091-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D8077 llvm-svn: 241863
* Remove std::move that was preventing return value optimization.Richard Trieu2015-01-171-1/+1
| | | | llvm-svn: 226357
* unique_ptrify clang::ento::createCheckerManagerDavid Blaikie2014-08-291-6/+5
| | | | llvm-svn: 216765
* Add an option to silence all analyzer warnings.Anna Zaks2014-08-291-1/+4
| | | | | | | | | | | | People have been incorrectly using "-analyzer-disable-checker" to silence analyzer warnings on a file, when analyzing a project. Add the "-analyzer-disable-all-checks" option, which would allow the suppression and suggest it as part of the error message for "-analyzer-disable-checker". The idea here is to compose this with "--analyze" so that users can selectively opt out specific files from static analysis. llvm-svn: 216763
* [C++11] Use 'nullptr'. StaticAnalyzer edition.Craig Topper2014-05-271-2/+2
| | | | llvm-svn: 209642
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-2/+2
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-1/+1
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* Factor CheckerManager to be able to pass AnalyzerOptions to checkersTed Kremenek2013-04-161-2/+3
| | | | | | | | during checker registration. There are no immediate clients of this, but this provides a way for checkers to query the options table at startup instead. llvm-svn: 179626
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-6/+6
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Move AnalyzerOptions.h into 'Core' StaticAnalyzer sub-library.Ted Kremenek2012-08-311-1/+1
| | | | llvm-svn: 162977
* Move AnalyzerOptions.h to include/clang/StaticAnalyzer.Ted Kremenek2012-08-301-1/+1
| | | | llvm-svn: 162928
* Promote warn_unknown_analyzer_checker to an error. Addresses ↵Ted Kremenek2012-07-251-1/+1
| | | | | | <rdar://problem/10987863>. llvm-svn: 160706
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | llvm-svn: 149798
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-5/+6
| | | | llvm-svn: 140478
* Fix typo.Jordy Rose2011-08-171-1/+1
| | | | llvm-svn: 137814
* [analyzer] Add a warning for an incompatible plugin version.Jordy Rose2011-08-171-6/+28
| | | | llvm-svn: 137813
* Silence compiler warnings by casting object pointers to function pointers ↵Benjamin Kramer2011-08-171-1/+2
| | | | | | | | via intptr_t. This is ugly but ISO C++ doesn't allow direct casts. llvm-svn: 137812
* [analyzer] Add basic support for pluggable checkers.Jordy Rose2011-08-171-11/+49
| | | | llvm-svn: 137802
* [analyzer] Overhaul of checker registration in preparation for basic plugin ↵Jordy Rose2011-08-161-17/+23
| | | | | | support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages). llvm-svn: 137758
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* [analyzer] For -analyzer-checker-help show all the info about groups, ↵Argyrios Kyrtzidis2011-03-291-3/+0
| | | | | | packages, and which packages/checkers are hidden. llvm-svn: 128511
* [analyzer] Introduce "event" mechanism in CheckerManager.Argyrios Kyrtzidis2011-02-281-0/+2
| | | | | | | | | A checker can register as receiver/listener of "events" (basically it registers a callback with a function getting called with an argument of the event type) and other checkers can register as "dispatchers" and can pass an event object to all the listeners. This allows cooperation amongst checkers but with very loose coupling. llvm-svn: 126658
* Intoduce '-analyzer-checker-help' flag which outputs a list of all available ↵Argyrios Kyrtzidis2011-02-251-0/+15
| | | | | | | | static analyzer checkers. This is pretty basic for now, eventually checkers should be grouped according to package, hidden checkers should be indicated etc. llvm-svn: 126454
* [analyzer] Add LangOptions in CheckerManager.Argyrios Kyrtzidis2011-02-231-1/+2
| | | | llvm-svn: 126306
* Fix the clang-wpa example.Argyrios Kyrtzidis2011-02-151-1/+1
| | | | llvm-svn: 125565
* [analyzer] Overhauling of the checker registration mechanism.Argyrios Kyrtzidis2011-02-141-0/+50
-Checkers will be defined in the tablegen file 'Checkers.td'. -Apart from checkers, we can define checker "packages" that will contain a collection of checkers. -Checkers can be enabled with -analyzer-checker=<name> and disabled with -analyzer-disable-checker=<name> e.g: Enable checkers from 'cocoa' and 'corefoundation' packages except the self-initialization checker: -analyzer-checker=cocoa -analyzer-checker=corefoundation -analyzer-disable-checker=cocoa.SelfInit -Introduces CheckerManager and CheckerProvider. CheckerProviders get the set of checker names to enable/disable and register them with the CheckerManager which will be the entry point for all checker-related functionality. Currently only the self-initialization checker takes advantage of the new mechanism. llvm-svn: 125503
OpenPOWER on IntegriCloud