Index: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h =================================================================== --- include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -330,6 +330,8 @@ /// \sa shouldElideConstructors Optional ElideConstructors; + /// \sa getModelPath + Optional ModelPath; /// A helper function that retrieves option for a given full-qualified /// checker name. @@ -729,6 +731,8 @@ /// Starting with C++17 some elisions become mandatory, and in these cases /// the option will be ignored. bool shouldElideConstructors(); + + StringRef getModelPath(); }; using AnalyzerOptionsRef = IntrusiveRefCntPtr; Index: lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp +++ lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp @@ -1398,7 +1398,8 @@ NonLocalizedStringChecker *checker = mgr.registerChecker(); checker->IsAggressive = - mgr.getAnalyzerOptions().getBooleanOption("AggressiveReport", false); + mgr.getAnalyzerOptions().getBooleanOption("AggressiveReport", false, + checker); } void ento::registerEmptyLocalizationContextChecker(CheckerManager &mgr) { Index: lib/StaticAnalyzer/Core/AnalyzerOptions.cpp =================================================================== --- lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -502,3 +502,9 @@ CTUIndexName = getOptionAsString("ctu-index-name", "externalFnMap.txt"); return CTUIndexName.getValue(); } + +StringRef AnalyzerOptions::getModelPath() { + if (!ModelPath.hasValue()) + ModelPath = getOptionAsString("model-path", ""); + return ModelPath.getValue(); +} Index: lib/StaticAnalyzer/Frontend/ModelInjector.cpp =================================================================== --- lib/StaticAnalyzer/Frontend/ModelInjector.cpp +++ lib/StaticAnalyzer/Frontend/ModelInjector.cpp @@ -48,7 +48,7 @@ FileID mainFileID = SM.getMainFileID(); AnalyzerOptionsRef analyzerOpts = CI.getAnalyzerOpts(); - llvm::StringRef modelPath = analyzerOpts->Config["model-path"]; + llvm::StringRef modelPath = analyzerOpts->getModelPath(); llvm::SmallString<128> fileName; Index: test/Analysis/cstring-plist.c =================================================================== --- test/Analysis/cstring-plist.c +++ test/Analysis/cstring-plist.c @@ -1,5 +1,8 @@ // RUN: rm -f %t -// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,unix.Malloc,unix.cstring.NullArg -analyzer-disable-checker=alpha.unix.cstring.OutOfBounds -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s +// RUN: %clang_analyze_cc1 -fblocks \ +// RUN: -analyzer-checker=core,unix.Malloc,unix.cstring.NullArg \ +// RUN: -analyzer-disable-checker=alpha.unix.cstring.OutOfBounds \ +// RUN: -analyzer-output=plist -o %t %s // RUN: FileCheck -input-file %t %s typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/localization-aggressive.m =================================================================== --- test/Analysis/localization-aggressive.m +++ test/Analysis/localization-aggressive.m @@ -1,6 +1,10 @@ // RUN: %clang_cc1 -fblocks -x objective-c-header -emit-pch -o %t.pch %S/Inputs/localization-pch.h -// RUN: %clang_analyze_cc1 -fblocks -analyzer-store=region -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=optin.osx.cocoa.localizability.EmptyLocalizationContextChecker -include-pch %t.pch -verify -analyzer-config AggressiveReport=true %s +// RUN: %clang_analyze_cc1 -fblocks -analyzer-store=region \ +// RUN: -analyzer-config optin.osx.cocoa.localizability.NonLocalizedStringChecker:AggressiveReport=true \ +// RUN: -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker \ +// RUN: -analyzer-checker=optin.osx.cocoa.localizability.EmptyLocalizationContextChecker \ +// RUN: -include-pch %t.pch -verify %s // These declarations were reduced using Delta-Debugging from Foundation.h // on Mac OS X.