[PATCH] D54401: [analyzer] Prefer returns values to out-params in CheckerRegistry.cpp
Umann Kristóf via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 11 14:17:30 PST 2018
Szelethus created this revision.
Szelethus added reviewers: NoQ, george.karpenkov, xazax.hun, MTC.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity.
This bugged me for a long time, so it's time to put an end to it: `collectCheckers` was cryptic and hard to understand. This is done by
- 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`.
- Removing the suggestion to disable all checkers when a checker option is left unclaimed. I personally found this super annoying, and I'd be very surprised if this was a welcome suggestion to anyone.
- Fix a test with `-analyzer-disable-checker -verify` accidentally left in.
Repository:
rC Clang
https://reviews.llvm.org/D54401
Files:
include/clang/StaticAnalyzer/Core/CheckerRegistry.h
include/clang/StaticAnalyzer/Frontend/FrontendActions.h
lib/FrontendTool/ExecuteCompilerInvocation.cpp
lib/StaticAnalyzer/Core/CheckerRegistry.cpp
lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
test/Analysis/disable-all-checks.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54401.173583.patch
Type: text/x-patch
Size: 11425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181111/75270ef3/attachment-0001.bin>
More information about the cfe-commits
mailing list