[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis
Umann Kristóf via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 25 05:29:52 PDT 2018
Szelethus created this revision.
Szelethus added reviewers: xazax.hun, NoQ, george.karpenkov, MTC, rnkovacs.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, mgrang, szepet, whisperity.
Szelethus added a dependency: D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered.
This patch contains very little logic but touches a lot of lines.
Now that we're confident that //all// non-checker configs are gathered, I went ahead and did some actual changes to how `AnalyzerOptions` works.
This patch is a proposal to evaluate all config options (and possibly emit warning about them) at the beginning of the analysis, rather then whenever a getter function is called for it. This is done by changing the generated `Optional<TYPE>` fields' accessibility to public, evaluating all options as soon as the `ConfigTable` is assembled, and removing generated getters, as are they are no longer necessary. Now, every single public function (except `parseConfigs`) is const, as should `AnalyzerOptions` be after options are parsed (coming soon™ in a followup patch).
One important thing to notice is that the `ConfigTable` is no longer modified once received, so I needed to update `debug.ConfigDumper` accordingly.
The removal of those getters implied however that every single use of those getters had to be changed (`Opts.shouldDoThat()` -> `Opts.ShouldDoThat.getValue()`), and I got to simplify the def file. I clang-formatted it, and since I don't expect the format to change for a good long while, I think it should be clang-formatted in the future whenever.
Also coming soon™, the actual implementation of warnings.
Repository:
rC Clang
https://reviews.llvm.org/D53692
Files:
include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
lib/Frontend/CompilerInvocation.cpp
lib/StaticAnalyzer/Checkers/DebugCheckers.cpp
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Core/AnalysisManager.cpp
lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
lib/StaticAnalyzer/Core/CallEvent.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp
lib/StaticAnalyzer/Core/SValBuilder.cpp
lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
lib/StaticAnalyzer/Frontend/ModelInjector.cpp
test/Analysis/analyzer-config.c
test/Analysis/analyzer-config.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53692.171066.patch
Type: text/x-patch
Size: 72322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181025/4a87c70c/attachment-0001.bin>
More information about the cfe-commits
mailing list