summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp2
-rw-r--r--clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp12
2 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index 893c72190e1..1ac1cc214f0 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -163,7 +163,7 @@ int AnalyzerOptions::getCheckerIntegerOption(StringRef CheckerName,
bool HasFailed = getCheckerStringOption(CheckerName, OptionName,
std::to_string(DefaultVal),
SearchInParents)
- .getAsInteger(10, Ret);
+ .getAsInteger(0, Ret);
assert(!HasFailed && "analyzer-config option should be numeric");
(void)HasFailed;
return Ret;
diff --git a/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp b/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
index 4267d8a2cdc..7eef09b8833 100644
--- a/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
+++ b/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
@@ -309,27 +309,31 @@ void CheckerRegistry::addDependency(StringRef FullName, StringRef Dependency) {
template <class T>
static void
insertOptionToCollection(StringRef FullName, T &Collection,
- const CheckerRegistry::CmdLineOption &&Option) {
+ const CheckerRegistry::CmdLineOption &Option,
+ AnalyzerOptions &AnOpts) {
auto It = binaryFind(Collection, FullName);
assert(It != Collection.end() &&
"Failed to find the checker while attempting to add a command line "
"option to it!");
- It->CmdLineOptions.emplace_back(std::move(Option));
+ AnOpts.Config.insert(
+ {(FullName + ":" + Option.OptionName).str(), Option.DefaultValStr});
+
+ It->CmdLineOptions.emplace_back(Option);
}
void CheckerRegistry::resolveCheckerAndPackageOptions() {
for (const std::pair<StringRef, CmdLineOption> &CheckerOptEntry :
CheckerOptions) {
insertOptionToCollection(CheckerOptEntry.first, Checkers,
- std::move(CheckerOptEntry.second));
+ CheckerOptEntry.second, AnOpts);
}
CheckerOptions.clear();
for (const std::pair<StringRef, CmdLineOption> &PackageOptEntry :
PackageOptions) {
insertOptionToCollection(PackageOptEntry.first, Checkers,
- std::move(PackageOptEntry.second));
+ PackageOptEntry.second, AnOpts);
}
PackageOptions.clear();
}
OpenPOWER on IntegriCloud