summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
diff options
context:
space:
mode:
authorKristof Umann <dkszelethus@gmail.com>2018-11-02 15:48:10 +0000
committerKristof Umann <dkszelethus@gmail.com>2018-11-02 15:48:10 +0000
commitc83b0dda493e0e029b6d0b8a71659643d396b448 (patch)
tree6016474178bb7565e91688ec7cac44660cb56f79 /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
parent3444cb9993af16a4914c47a311f9eb8543abf513 (diff)
downloadbcm5719-llvm-c83b0dda493e0e029b6d0b8a71659643d396b448.tar.gz
bcm5719-llvm-c83b0dda493e0e029b6d0b8a71659643d396b448.zip
[analyzer][NFC] Fix some incorrect uses of -analyzer-config options
I'm in the process of refactoring AnalyzerOptions. The main motivation behind here is to emit warnings if an invalid -analyzer-config option is given from the command line, and be able to list them all. In this patch, I found some flags that should've been used as checker options, or have absolutely no mention of in AnalyzerOptions, or are nonexistent. - NonLocalizedStringChecker now uses its "AggressiveReport" flag as a checker option - lib/StaticAnalyzer/Frontend/ModelInjector.cpp now accesses the "model-path" option through a getter in AnalyzerOptions - -analyzer-config path-diagnostics-alternate=false is not a thing, I removed it, - lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp and lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h are weird, they actually only contain an option getter. I deleted them, and fixed RetainCountChecker to get it's "leak-diagnostics-reference-allocation" option as a checker option, - "region-store-small-struct-limit" has a proper getter now. Differential Revision: https://reviews.llvm.org/D53276 llvm-svn: 345985
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index cde2f4c2591..55ace6b4122 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -503,8 +503,21 @@ bool AnalyzerOptions::naiveCTUEnabled() {
return NaiveCTU.getValue();
}
+unsigned AnalyzerOptions::getRegionStoreSmallStructLimit() {
+ if (!RegionStoreSmallStructLimit.hasValue())
+ RegionStoreSmallStructLimit =
+ getOptionAsInteger("region-store-small-struct-limit", 2);
+ return RegionStoreSmallStructLimit.getValue();
+}
+
StringRef AnalyzerOptions::getCTUIndexName() {
if (!CTUIndexName.hasValue())
CTUIndexName = getOptionAsString("ctu-index-name", "externalFnMap.txt");
return CTUIndexName.getValue();
}
+
+StringRef AnalyzerOptions::getModelPath() {
+ if (!ModelPath.hasValue())
+ ModelPath = getOptionAsString("model-path", "");
+ return ModelPath.getValue();
+}
OpenPOWER on IntegriCloud