Skip to content

Commit e48c771

Browse files
fabianbs96vulder
andauthored
Remove boost::program_options (#534)
* Remove boost::program_options from phasar-llvm * Remove boost PO from CMakeLists.txt * pre-commit * Fix PAMM * some cleanup * pre-commit * Fixes compile errors around logger statments * Fixes include guard to a standard compliant one It seems that the build process of LLVM gets confused here. * Links phasar_controlflow into phasar_mono Co-authored-by: Florian Sattler <vuld3r@gmail.com>
1 parent 9b908ca commit e48c771

38 files changed

+550
-600
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ endif()
125125
find_package(Threads)
126126

127127
# Boost
128-
find_package(Boost 1.65.1 COMPONENTS graph program_options ${BOOST_THREAD} REQUIRED)
129-
#find_package(Boost 1.72.0 COMPONENTS graph program_options ${BOOST_THREAD} REQUIRED)
128+
find_package(Boost 1.65.1 COMPONENTS graph ${BOOST_THREAD} REQUIRED)
129+
#find_package(Boost 1.72.0 COMPONENTS graph ${BOOST_THREAD} REQUIRED)
130130
include_directories(${Boost_INCLUDE_DIRS})
131131

132132
# Disable clang-tidy for the external projects

include/phasar/Config/Configuration.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121

2222
#include "llvm/ADT/iterator_range.h"
2323

24-
#include "boost/program_options.hpp"
25-
2624
#include <filesystem>
25+
#include <set>
2726
#include <string>
2827

2928
#define XSTR(S) STR(S)
@@ -105,13 +104,6 @@ class PhasarConfig {
105104
SpecialFuncNames.insert(std::move(SFName));
106105
}
107106

108-
/// Variables map of the parsed command-line parameters
109-
// NOLINTNEXTLINE(readability-identifier-naming)
110-
[[nodiscard]] static boost::program_options::variables_map &VariablesMap() {
111-
static boost::program_options::variables_map VMap;
112-
return VMap;
113-
}
114-
115107
~PhasarConfig() = default;
116108
PhasarConfig(const PhasarConfig &) = delete;
117109
PhasarConfig operator=(const PhasarConfig &) = delete;

include/phasar/Controller/AnalysisController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "phasar/PhasarLLVM/AnalysisStrategy/Strategies.h"
1919
#include "phasar/PhasarLLVM/AnalysisStrategy/WholeProgramAnalysis.h"
2020
#include "phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h"
21+
#include "phasar/PhasarLLVM/ControlFlow/Resolver/CallGraphAnalysisType.h"
2122
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
2223
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h"
2324
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IFDSSolver.h"

include/phasar/PhasarLLVM/AnalysisStrategy/Strategies.def

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
*****************************************************************************/
99

1010
#ifndef ANALYSIS_STRATEGY_TYPES
11-
#define ANALYSIS_STRATEGY_TYPES(NAME, CMDFLAG, TYPE)
11+
#define ANALYSIS_STRATEGY_TYPES(NAME, CMDFLAG, DESC)
1212
#endif
1313

14-
ANALYSIS_STRATEGY_TYPES("DemandDrivenAnalysis", "DD", DemandDriven)
15-
ANALYSIS_STRATEGY_TYPES("IncrementalUpdateAnalysis", "INC", Incremental)
16-
ANALYSIS_STRATEGY_TYPES("ModuleWiseAnalysis", "MWA", ModuleWise)
17-
ANALYSIS_STRATEGY_TYPES("VariationalAnalysis", "VAR", Variational)
18-
ANALYSIS_STRATEGY_TYPES("WholeProgramAnalysis", "WPA", WholeProgram)
19-
ANALYSIS_STRATEGY_TYPES("None", "none", None)
14+
ANALYSIS_STRATEGY_TYPES(WholeProgram, "WPA", "Whole-program analysis (default)")
15+
ANALYSIS_STRATEGY_TYPES(DemandDriven, "DD", "Demand-driven analysis")
16+
ANALYSIS_STRATEGY_TYPES(Incremental, "INC", "Incremental-update analysis")
17+
ANALYSIS_STRATEGY_TYPES(ModuleWise, "MWA", "Module-wise analysis")
18+
ANALYSIS_STRATEGY_TYPES(Variational, "VAR", "Variational analysis")
2019

2120
#undef ANALYSIS_STRATEGY_TYPES

include/phasar/PhasarLLVM/AnalysisStrategy/Strategies.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_STRATEGIES_H
1111
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_STRATEGIES_H
1212

13+
#include "llvm/Support/raw_ostream.h"
14+
1315
#include <string>
1416

1517
namespace psr {
1618

1719
enum class AnalysisStrategy {
18-
#define ANALYSIS_STRATEGY_TYPES(NAME, CMDFLAG, TYPE) TYPE,
20+
None,
21+
#define ANALYSIS_STRATEGY_TYPES(NAME, CMDFLAG, DESC) NAME,
1922
#include "phasar/PhasarLLVM/AnalysisStrategy/Strategies.def"
23+
2024
};
2125

2226
std::string toString(const AnalysisStrategy &S);

include/phasar/PhasarLLVM/AnalysisStrategy/WholeProgramAnalysis.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_WHOLEPROGRAMANALYSIS_H_
1111
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_WHOLEPROGRAMANALYSIS_H_
1212

13+
#include "phasar/DB/ProjectIRDB.h"
14+
#include "phasar/PhasarLLVM/AnalysisStrategy/AnalysisSetup.h"
15+
#include "phasar/PhasarLLVM/ControlFlow/Resolver/CallGraphAnalysisType.h"
16+
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
17+
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h"
18+
1319
#include <iosfwd>
1420
#include <memory>
1521
#include <set>
1622
#include <string>
1723
#include <type_traits>
1824
#include <utility>
1925

20-
#include "phasar/DB/ProjectIRDB.h"
21-
#include "phasar/PhasarLLVM/AnalysisStrategy/AnalysisSetup.h"
22-
#include "phasar/PhasarLLVM/ControlFlow/Resolver/CallGraphAnalysisType.h"
23-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
24-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h"
25-
2626
namespace psr {
2727

2828
template <typename Solver, typename ProblemDescription,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/******************************************************************************
2+
* Copyright (c) 2019 Philipp Schubert.
3+
* All rights reserved. This program and the accompanying materials are made
4+
* available under the terms of LICENSE.txt.
5+
*
6+
* Contributors:
7+
* Philipp Schubert and others
8+
*****************************************************************************/
9+
10+
#ifndef CALL_GRAPH_ANALYSIS_TYPE
11+
#define CALL_GRAPH_ANALYSIS_TYPE(NAME, CMDFLAG, DESC)
12+
#endif
13+
14+
CALL_GRAPH_ANALYSIS_TYPE(NORESOLVE, "nores", "Don't resolve indirect- and virtual calls")
15+
CALL_GRAPH_ANALYSIS_TYPE(CHA, "cha", "Class hierarchy analysis")
16+
CALL_GRAPH_ANALYSIS_TYPE(RTA, "rta", "Rapid type analysis")
17+
CALL_GRAPH_ANALYSIS_TYPE(DTA, "dta", "Declared type analysis")
18+
CALL_GRAPH_ANALYSIS_TYPE(VTA, "vta", "Variable type analysis")
19+
CALL_GRAPH_ANALYSIS_TYPE(OTF, "otf", "On-the-fly analysis based on points-to info")
20+
21+
#undef CALL_GRAPH_ANALYSIS_TYPE

include/phasar/PhasarLLVM/ControlFlow/Resolver/CallGraphAnalysisType.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
#define PHASAR_PHASARLLVM_CALLGRAPHANALYSISTYPE_H
1212

1313
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/Support/raw_ostream.h"
1415

1516
#include <string>
1617

17-
namespace llvm {
18-
class raw_ostream;
19-
} // namespace llvm
20-
2118
namespace psr {
2219
enum class CallGraphAnalysisType {
23-
#define ANALYSIS_SETUP_CALLGRAPH_TYPE(NAME, CMDFLAG, TYPE) TYPE,
24-
#include "phasar/PhasarLLVM/Utils/AnalysisSetups.def"
20+
#define CALL_GRAPH_ANALYSIS_TYPE(NAME, CMDFLAG, DESC) NAME,
21+
#include "phasar/PhasarLLVM/ControlFlow/Resolver/CallGraphAnalysisType.def"
2522
Invalid
2623
};
2724

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSTabulationProblem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class IFDSTabulationProblem
6565
PointsToInfo<v_t, n_t> *PT;
6666
d_t ZeroValue;
6767
std::set<std::string> EntryPoints;
68-
[[maybe_unused]] Soundness SF = Soundness::Unused;
68+
[[maybe_unused]] Soundness SF = Soundness::Soundy;
6969

7070
public:
7171
using ConfigurationTy = HasNoConfigurationType;

include/phasar/PhasarLLVM/DataFlowSolver/Mono/IntraMonoProblem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class IntraMonoProblem : public NodePrinter<AnalysisDomainTy>,
6161
const c_t *CF;
6262
const PointsToInfo<v_t, n_t> *PT;
6363
std::set<std::string> EntryPoints;
64-
[[maybe_unused]] Soundness S = Soundness::Unused;
64+
[[maybe_unused]] Soundness S = Soundness::Soundy;
6565

6666
public:
6767
// denote that a problem does not require a configuration (type/file)

0 commit comments

Comments
 (0)