@@ -774,6 +774,7 @@ class StdLibraryFunctionsChecker
774774 bool DisplayLoadedSummaries = false ;
775775 bool ModelPOSIX = false ;
776776 bool ShouldAssumeControlledEnvironment = false ;
777+ std::string SummaryConfigPath;
777778
778779private:
779780 Optional<Summary> findFunctionSummary (const FunctionDecl *FD,
@@ -1452,12 +1453,10 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
14521453
14531454// User-provided summary configuration.
14541455CheckerManager *Mgr = C.getAnalysisManager ().getCheckerManager ();
1455- std::string Option{" Config" };
1456- /* StringRef ConfigFile =
1457- Mgr->getAnalyzerOptions().getCheckerStringOption(this, Option);*/
1458- StringRef ConfigFile = " /local/workspace/llvm-project/clang/test/Analysis/Inputs/fread-summary.yaml" ;
1456+ std::string Option{" SummaryConfigPath" };
1457+ Mgr->getAnalyzerOptions ().getCheckerStringOption (this , Option);
14591458llvm::Optional<SummaryConfiguration> Config =
1460- getConfiguration<SummaryConfiguration>(*Mgr, this , Option, ConfigFile );
1459+ getConfiguration<SummaryConfiguration>(*Mgr, this , Option, SummaryConfigPath );
14611460llvm::errs () << " Config :" << Config.has_value () << " \n " ;
14621461
14631462auto GetTypeFromStr = [&](StringRef TypeName) {
@@ -3178,6 +3177,8 @@ void ento::registerStdCLibraryFunctionsChecker(CheckerManager &mgr) {
31783177 Checker->ModelPOSIX = Opts.getCheckerBooleanOption (Checker, " ModelPOSIX" );
31793178 Checker->ShouldAssumeControlledEnvironment =
31803179 Opts.ShouldAssumeControlledEnvironment ;
3180+ Checker->SummaryConfigPath =
3181+ Opts.getCheckerStringOption (Checker, " SummaryConfigPath" );
31813182}
31823183
31833184bool ento::shouldRegisterStdCLibraryFunctionsChecker (
0 commit comments