1919
2020#include " phasar/DB/ProjectIRDB.h"
2121#include " phasar/PhasarLLVM/AnalysisStrategy/AnalysisSetup.h"
22+ #include " phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
23+ #include " phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h"
2224
2325namespace psr {
2426
@@ -51,7 +53,7 @@ class WholeProgramAnalysis {
5153 Solver DataFlowSolver;
5254
5355public:
54- WholeProgramAnalysis (ProjectIRDB &IRDB,
56+ WholeProgramAnalysis (IFDSIDESolverConfig SolverConfig, ProjectIRDB &IRDB,
5557 std::set<std::string> EntryPoints = {},
5658 PointerAnalysisTy *PointerInfo = nullptr ,
5759 CallGraphAnalysisTy *CallGraph = nullptr ,
@@ -70,12 +72,17 @@ class WholeProgramAnalysis {
7072 : std::unique_ptr<CallGraphAnalysisTy>(CallGraph)),
7173 EntryPoints(EntryPoints),
7274 ProblemDesc(&IRDB, TypeHierarchy, CallGraph, PointerInfo, EntryPoints),
73- DataFlowSolver(ProblemDesc) {}
75+ DataFlowSolver(ProblemDesc) {
76+ if constexpr (has_setIFDSIDESolverConfig_v<ProblemDescription>) {
77+ ProblemDesc.setIFDSIDESolverConfig (SolverConfig);
78+ }
79+ }
7480
7581 template <typename T = ProblemDescription,
7682 typename = typename std::enable_if_t <!std::is_same_v<
7783 typename T::ConfigurationTy, HasNoConfigurationType>>>
78- WholeProgramAnalysis (ProjectIRDB &IRDB, ConfigurationTy *Config,
84+ WholeProgramAnalysis (IFDSIDESolverConfig SolverConfig, ProjectIRDB &IRDB,
85+ ConfigurationTy *Config,
7986 std::set<std::string> EntryPoints = {},
8087 PointerAnalysisTy *PointerInfo = nullptr ,
8188 CallGraphAnalysisTy *CallGraph = nullptr ,
@@ -95,12 +102,17 @@ class WholeProgramAnalysis {
95102 EntryPoints(EntryPoints), Config(Config),
96103 ProblemDesc(&IRDB, TypeHierarchy, CallGraph, PointerInfo, *Config,
97104 EntryPoints),
98- DataFlowSolver(ProblemDesc) {}
105+ DataFlowSolver(ProblemDesc) {
106+ if constexpr (has_setIFDSIDESolverConfig_v<ProblemDescription>) {
107+ ProblemDesc.setIFDSIDESolverConfig (SolverConfig);
108+ }
109+ }
99110
100111 template <typename T = ProblemDescription,
101112 typename = typename std::enable_if_t <!std::is_same_v<
102113 typename T::ConfigurationTy, HasNoConfigurationType>>>
103- WholeProgramAnalysis (ProjectIRDB &IRDB, std::string ConfigPath,
114+ WholeProgramAnalysis (IFDSIDESolverConfig SolverConfig, ProjectIRDB &IRDB,
115+ std::string ConfigPath,
104116 std::set<std::string> EntryPoints = {},
105117 PointerAnalysisTy *PointerInfo = nullptr ,
106118 CallGraphAnalysisTy *CallGraph = nullptr ,
@@ -121,7 +133,11 @@ class WholeProgramAnalysis {
121133 OwnsConfig(true ), ConfigPath(ConfigPath),
122134 ProblemDesc(&IRDB, TypeHierarchy, CallGraph, PointerInfo, *Config,
123135 EntryPoints),
124- DataFlowSolver(ProblemDesc) {}
136+ DataFlowSolver(ProblemDesc) {
137+ if constexpr (has_setIFDSIDESolverConfig_v<ProblemDescription>) {
138+ ProblemDesc.setIFDSIDESolverConfig (SolverConfig);
139+ }
140+ }
125141
126142 WholeProgramAnalysis (const WholeProgramAnalysis &) = delete;
127143 WholeProgramAnalysis (WholeProgramAnalysis &&) = delete;
0 commit comments