Skip to content

Commit 543dfd7

Browse files
authored
Merge branch 'development' into f-FixConfigUB
2 parents 635dfe2 + ba0e60a commit 543dfd7

61 files changed

Lines changed: 477 additions & 2400 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 5 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 system program_options ${BOOST_THREAD} REQUIRED)
129-
#find_package(Boost 1.72.0 COMPONENTS graph system program_options ${BOOST_THREAD} REQUIRED)
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)
130130
include_directories(${Boost_INCLUDE_DIRS})
131131

132132
# Disable clang-tidy for the external projects
@@ -290,8 +290,6 @@ llvm_map_components_to_libnames(llvm_libs
290290
# phasar-based binaries
291291
add_subdirectory(tools)
292292

293-
set(PHASAR_PLUGINS_LIB phasar_plugins)
294-
295293
# Add Phasar unittests and build all IR test code
296294
if (PHASAR_BUILD_UNITTESTS)
297295
message("Phasar unittests")
@@ -409,7 +407,6 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MIN
409407
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
410408
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost_program_options (>= 1.66.0),
411409
# libboost_graph (>= 1.66.0),
412-
# libboost_system (>= 1.66.0),
413410
# libboost_thread (>= 1.66.0),
414411
# libsqlite3 (>= 4.5.0),
415412
# libpthread (>= 4.5.0),

cmake/phasar_macros.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ function(add_phasar_unittest test_name)
2626
phasar_experimental
2727
# phasar_clang
2828
phasar_passes
29-
# FIXME: cmake variable ${PHASAR_PLUGINS_LIB} is empty although it should contain phasar_plugins
30-
phasar_plugins
31-
# ${PHASAR_PLUGINS_LIB}
3229
phasar_pointer
3330
phasar_typehierarchy
3431
phasar_taintconfig

examples/plugins/Makefile

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/plugins/MyIFDSProblem.cxx

Lines changed: 0 additions & 128 deletions
This file was deleted.

examples/plugins/MyIFDSProblem.h

Lines changed: 0 additions & 74 deletions
This file was deleted.

include/phasar/Controller/AnalysisController.h

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@
1616

1717
#include "phasar/DB/ProjectIRDB.h"
1818
#include "phasar/PhasarLLVM/AnalysisStrategy/Strategies.h"
19+
#include "phasar/PhasarLLVM/AnalysisStrategy/WholeProgramAnalysis.h"
1920
#include "phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h"
2021
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
22+
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h"
23+
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IFDSSolver.h"
24+
#include "phasar/PhasarLLVM/DataFlowSolver/Mono/Solver/InterMonoSolver.h"
25+
#include "phasar/PhasarLLVM/DataFlowSolver/Mono/Solver/IntraMonoSolver.h"
2126
#include "phasar/PhasarLLVM/Pointer/LLVMBasedPointsToAnalysis.h"
2227
#include "phasar/PhasarLLVM/Pointer/LLVMPointsToSet.h"
28+
#include "phasar/PhasarLLVM/TaintConfig/TaintConfig.h"
2329
#include "phasar/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.h"
2430
#include "phasar/PhasarLLVM/Utils/DataFlowAnalysisType.h"
2531
#include "phasar/Utils/EnumFlags.h"
@@ -51,7 +57,7 @@ class AnalysisController {
5157
LLVMTypeHierarchy TH;
5258
LLVMPointsToSet PT;
5359
LLVMBasedICFG ICF;
54-
std::vector<DataFlowAnalysisKind> DataFlowAnalyses;
60+
std::vector<DataFlowAnalysisType> DataFlowAnalyses;
5561
std::vector<std::string> AnalysisConfigs;
5662
std::set<std::string> EntryPoints;
5763
[[maybe_unused]] AnalysisStrategy Strategy;
@@ -81,6 +87,67 @@ class AnalysisController {
8187

8288
void emitRequestedHelperAnalysisResults();
8389

90+
void executeIFDSUninitVar();
91+
void executeIFDSConst();
92+
void executeIFDSTaint();
93+
void executeIFDSType();
94+
void executeIFDSSolverTest();
95+
void executeIFDSLinearConst();
96+
void executeIFDSFieldSensTaint();
97+
void executeIDEXTaint();
98+
void executeIDEOpenSSLTS();
99+
void executeIDECSTDIOTS();
100+
void executeIDELinearConst();
101+
void executeIDESolverTest();
102+
void executeIDEIIA();
103+
void executeIntraMonoFullConstant();
104+
void executeIntraMonoSolverTest();
105+
void executeInterMonoSolverTest();
106+
void executeInterMonoTaint();
107+
108+
template <typename AnalysisTy, bool WithConfig = false>
109+
void executeIntraMonoAnalysis() {
110+
executeAnalysis<IntraMonoSolver_P<AnalysisTy>, AnalysisTy, WithConfig>();
111+
}
112+
113+
template <typename AnalysisTy, bool WithConfig = false>
114+
void executeInterMonoAnalysis() {
115+
executeAnalysis<InterMonoSolver_P<AnalysisTy, 3>, AnalysisTy, WithConfig>();
116+
}
117+
118+
template <typename AnalysisTy, bool WithConfig = false>
119+
void executeIFDSAnalysis() {
120+
executeAnalysis<IFDSSolver_P<AnalysisTy>, AnalysisTy, WithConfig>();
121+
}
122+
123+
template <typename AnalysisTy, bool WithConfig = false>
124+
void executeIDEAnalysis() {
125+
executeAnalysis<IDESolver_P<AnalysisTy>, AnalysisTy, WithConfig>();
126+
}
127+
128+
template <class Solver_P, typename AnalysisTy, bool WithConfig>
129+
void executeAnalysis() {
130+
if constexpr (WithConfig) {
131+
std::string AnalysisConfigPath =
132+
(0 < AnalysisConfigs.size()) ? AnalysisConfigs[0] : "";
133+
auto Config =
134+
!AnalysisConfigPath.empty()
135+
? TaintConfig(IRDB, parseTaintConfig(AnalysisConfigPath))
136+
: TaintConfig(IRDB);
137+
WholeProgramAnalysis<Solver_P, AnalysisTy> WPA(
138+
SolverConfig, IRDB, &Config, EntryPoints, &PT, &ICF, &TH);
139+
WPA.solve();
140+
emitRequestedDataFlowResults(WPA);
141+
WPA.releaseAllHelperAnalyses();
142+
} else {
143+
WholeProgramAnalysis<Solver_P, AnalysisTy> WPA(
144+
SolverConfig, IRDB, EntryPoints, &PT, &ICF, &TH);
145+
WPA.solve();
146+
emitRequestedDataFlowResults(WPA);
147+
WPA.releaseAllHelperAnalyses();
148+
}
149+
}
150+
84151
std::unique_ptr<llvm::raw_fd_ostream>
85152
openFileStream(llvm::StringRef Filename);
86153

@@ -121,7 +188,7 @@ class AnalysisController {
121188

122189
public:
123190
AnalysisController(ProjectIRDB &IRDB,
124-
std::vector<DataFlowAnalysisKind> DataFlowAnalyses,
191+
std::vector<DataFlowAnalysisType> DataFlowAnalyses,
125192
std::vector<std::string> AnalysisConfigs,
126193
PointerAnalysisType PTATy, CallGraphAnalysisType CGTy,
127194
Soundness SoundnessLevel, bool AutoGlobalSupport,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class raw_ostream;
1717
namespace psr {
1818

1919
/// A common superclass of edge-facts used by non-template IDETabulationProblems
20-
/// (for example in plugins)
2120
class EdgeFact {
2221
public:
2322
virtual ~EdgeFact() = default;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace psr {
1717

1818
/// A common superclass of dataflow-facts used by non-template tabulation
19-
/// problems (for example in plugins)
19+
/// problems
2020
class FlowFact {
2121
public:
2222
virtual ~FlowFact() = default;

0 commit comments

Comments
 (0)