@@ -130,17 +130,18 @@ void AnalysisController::executeVariational() {}
130130
131131void AnalysisController::executeWholeProgram () {
132132 size_t ConfigIdx = 0 ;
133- for (auto _DataFlowAnalysis : DataFlowAnalyses) {
133+ for (const auto &DFA : DataFlowAnalyses) {
134134 std::string AnalysisConfigPath =
135135 (ConfigIdx < AnalysisConfigs.size ()) ? AnalysisConfigs[ConfigIdx] : " " ;
136- if (std::holds_alternative<DataFlowAnalysisType>(_DataFlowAnalysis)) {
137- auto getTaintConfig = [&]() {
138- if (!AnalysisConfigPath.empty ()) {
139- return TaintConfig (IRDB, parseTaintConfig (AnalysisConfigPath));
140- }
141- return TaintConfig (IRDB);
142- };
143- auto DataFlowAnalysis = std::get<DataFlowAnalysisType>(_DataFlowAnalysis);
136+ if (std::holds_alternative<DataFlowAnalysisType>(DFA)) {
137+ auto getTaintConfig // NOLINT
138+ = [&]() {
139+ if (!AnalysisConfigPath.empty ()) {
140+ return TaintConfig (IRDB, parseTaintConfig (AnalysisConfigPath));
141+ }
142+ return TaintConfig (IRDB);
143+ };
144+ auto DataFlowAnalysis = std::get<DataFlowAnalysisType>(DFA);
144145 switch (DataFlowAnalysis) {
145146 case DataFlowAnalysisType::IFDSUninitializedVariables: {
146147 WholeProgramAnalysis<IFDSSolver_P<IFDSUninitializedVariables>,
@@ -295,34 +296,30 @@ void AnalysisController::executeWholeProgram() {
295296 default :
296297 break ;
297298 }
298- } else if (std::holds_alternative<IFDSPluginConstructor>(
299- _DataFlowAnalysis)) {
300- auto Problem = std::get<IFDSPluginConstructor>(_DataFlowAnalysis)(
301- &IRDB, &TH, &ICF, &PT, EntryPoints);
299+ } else if (std::holds_alternative<IFDSPluginConstructor>(DFA)) {
300+ auto Problem = std::get<IFDSPluginConstructor>(DFA)(&IRDB, &TH, &ICF, &PT,
301+ EntryPoints);
302302 IFDSSolver_P<std::remove_reference<decltype (*Problem)>::type> Solver (
303303 *Problem);
304304 Solver.solve ();
305305 emitRequestedDataFlowResults (Solver);
306- } else if (std::holds_alternative<IDEPluginConstructor>(
307- _DataFlowAnalysis)) {
308- auto Problem = std::get<IDEPluginConstructor>(_DataFlowAnalysis)(
309- &IRDB, &TH, &ICF, &PT, EntryPoints);
306+ } else if (std::holds_alternative<IDEPluginConstructor>(DFA)) {
307+ auto Problem = std::get<IDEPluginConstructor>(DFA)(&IRDB, &TH, &ICF, &PT,
308+ EntryPoints);
310309 IDESolver_P<std::remove_reference<decltype (*Problem)>::type> Solver (
311310 *Problem);
312311 Solver.solve ();
313312 emitRequestedDataFlowResults (Solver);
314- } else if (std::holds_alternative<IntraMonoPluginConstructor>(
315- _DataFlowAnalysis)) {
313+ } else if (std::holds_alternative<IntraMonoPluginConstructor>(DFA)) {
316314
317- auto Problem = std::get<IntraMonoPluginConstructor>(_DataFlowAnalysis )(
315+ auto Problem = std::get<IntraMonoPluginConstructor>(DFA )(
318316 &IRDB, &TH, &ICF, &PT, EntryPoints);
319317 IntraMonoSolver_P<std::remove_reference<decltype (*Problem)>::type> Solver (
320318 *Problem);
321319 Solver.solve ();
322320 emitRequestedDataFlowResults (Solver);
323- } else if (std::holds_alternative<InterMonoPluginConstructor>(
324- _DataFlowAnalysis)) {
325- auto Problem = std::get<InterMonoPluginConstructor>(_DataFlowAnalysis)(
321+ } else if (std::holds_alternative<InterMonoPluginConstructor>(DFA)) {
322+ auto Problem = std::get<InterMonoPluginConstructor>(DFA)(
326323 &IRDB, &TH, &ICF, &PT, EntryPoints);
327324 InterMonoSolver_P<std::remove_reference<decltype (*Problem)>::type, K>
328325 Solver (*Problem);
0 commit comments