Skip to content

Commit 5230c1f

Browse files
fabianbs96vulder
andauthored
Rework Folder Structure (#574)
* Move generic stuff out of PhasarLLVM + add separate libraries for phasar_* and phasar_llvm_* * Move Mono * Remove unnecessary stuff + minor * Make demangling more precise * Rename phasar_phasarllvm_utils to phasar_llvm_utils + rename phasar-llvm to phasar-cli * pre-commit * Changes according to review + get rid of LLVMShorthands in InitialSeeds * update BreakingChanges.md * Fixes linking issues * Update breakingChanges.md with linker-related changes --------- Co-authored-by: Florian Sattler <[email protected]>
1 parent ef202dc commit 5230c1f

File tree

353 files changed

+1463
-1712
lines changed

Some content is hidden

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

353 files changed

+1463
-1712
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
/img @pdschubert
1616

17-
/include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEInstInteractionAnalysis.h @pdschubert @vulder
18-
/include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/ @fabianbs96
19-
/include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEExtendedTaintAnalysis.h @fabianbs96
20-
/lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEExtendedTaintAnalysis.cpp @fabianbs96
21-
/lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/ @fabianbs96
17+
/include/phasar/PhasarLLVM/DataFlow/IfdsIde/Problems/IDEInstInteractionAnalysis.h @pdschubert @vulder
18+
/include/phasar/PhasarLLVM/DataFlow/IfdsIde/Problems/ExtendedTaintAnalysis/ @fabianbs96
19+
/include/phasar/PhasarLLVM/DataFlow/IfdsIde/Problems/IDEExtendedTaintAnalysis.h @fabianbs96
20+
/lib/PhasarLLVM/DataFlow/IfdsIde/Problems/IDEExtendedTaintAnalysis.cpp @fabianbs96
21+
/lib/PhasarLLVM/DataFlow/IfdsIde/Problems/ExtendedTaintAnalysis/ @fabianbs96
2222

2323
/include/phasar/PhasarLLVM/AnalysisStrategy/ @pdschubert
2424

BreakingChanges.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@
22

33
## development HEAD
44

5-
- `LLVMPointsTo*` has been renamed to `LLVMAlias*`
5+
- Renamed `phasar/PhasarLLVM/DataFlowSolver/` to either `phasar/DataFlow/` or `phasar/PhasarLLVM/DataFlow/` depending on whether the components need LLVMCore. Analoguous changes in `lib/` and `unittests/`.
6+
An incomplete list of moved/renamed files:
7+
- `phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/*` => `phasar/DataFlow/IfdsIde/Solver/*`
8+
- `phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h` => `phasar/DataFlow/IfdsIde/IDETabulationProblem.h`
9+
- `phasar/DB/LLVMProjectIRDB.h` => `phasar/PhasarLLVM/DB/LLVMProjectIRDB.h`
10+
- ...
11+
- Renamed and split up some libraries:
12+
- `phasar_phasarllvm_utils` => `phasar_llvm_utils`
13+
- `phasar_typehierarchy` => `phasar_llvm_typehierarchy`
14+
- `phasar_ifdside` => `phasar_llvm_ifdside`
15+
- `phasar_controlflow` has its LLVM dependent stuff moved to `phasar_llvm_controlflow`
16+
- `phasar_db` has its LLVM dependent stuff moved to `phasar_llvm_db`
17+
- `phasar_pointer` has its LLVM dependent stuff moved to `phasar_llvm_pointer`
18+
- Renamed the phasar tool `phasar-llvm` to `phasar-cli`
19+
- `LLVMPointsTo[.*]` has been renamed to `LLVMAlias[.*]`
620
- The ctor of `LLVMAliasSet` now takes the `LLVMProjectIRDB` as pointer instead of a reference to better document that it may capture the IRDB by reference.
721
- The `PointsToInfo` interface has been replaced by the CRTP interface `AliasInfoBase`. Introduced two type-erased implementation of that interface: `AliasInfo` and `AliasInfoRef`. In most cases you should replace `PointsToInfo*` and `LLVMPointsToInfo*` by `AliasInfoRef`, bzw. `LLVMAliasInfoRef`.
822
- Introduced a new interface `PointsToInfoBase` and type-erased implementations `PointstoInfo` and `PointsToInfoRef`. Don't confuse them with the old `PointsToInfo`!!! (However, they have different APIs, so you should encounter compilation errors then)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ endif()
309309

310310
set(INCLUDE_INSTALL_DIR include/ CACHE PATH "Install dir of headers")
311311

312-
# Install targets of phasar-llvm, other executables, and libraries are to be
312+
# Install targets of phasar-cli, other executables, and libraries are to be
313313
# found in the individual subdirectories of tools/
314314

315315
# Install Phasar include directory

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ RUN mkdir -p build && cd build && \
5858
-G Ninja && \
5959
cmake --build .
6060

61-
ENTRYPOINT [ "./build/tools/phasar-llvm/phasar-llvm" ]
61+
ENTRYPOINT [ "./build/tools/phasar-cli/phasar-cli" ]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ Use them as a reference if you wish to modify PhASAR and recompile it.
131131

132132
After compilation using cmake the following two binaries can be found in the build/ directory:
133133

134-
+ phasar-llvm - the actual PhASAR command-line tool
134+
+ phasar-cli - the actual PhASAR command-line tool (previously called `phasar-llvm`)
135135
+ myphasartool - an example tool that shows how tools can be build on top of PhASAR
136136

137137
Use the command:
138138

139-
`$ ./phasar-llvm --help`
139+
`$ ./phasar-cli --help`
140140

141141
in order to display the manual and help message.
142142

@@ -167,7 +167,7 @@ C++'s long compile times are always a pain. As shown in the above, when using cm
167167
### Running a test solver
168168
To test if everything works as expected please run the following command:
169169

170-
`$ phasar-llvm --module test/build_systems_tests/installation_tests/module.ll -D ifds-solvertest`
170+
`$ phasar-cli -m test/build_systems_tests/installation_tests/module.ll -D ifds-solvertest`
171171

172172
If you obtain output other than a segmentation fault or an exception terminating the program abnormally everything works as expected.
173173

cmake/phasar_macros.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ function(add_phasar_unittest test_name)
1616
LINK_PUBLIC
1717
phasar_config
1818
phasar_controller
19+
phasar_llvm_controlflow
1920
phasar_controlflow
20-
phasar_phasarllvm_utils
21+
phasar_llvm_utils
2122
phasar_analysis_strategy
22-
phasar_ifdside
23+
phasar_llvm_ifdside
2324
phasar_utils
2425
phasar_mono
26+
phasar_llvm_db
2527
phasar_db
2628
# phasar_clang
2729
phasar_passes
30+
phasar_llvm_pointer
2831
phasar_pointer
29-
phasar_typehierarchy
32+
phasar_llvm_typehierarchy
33+
phasar_llvm
3034
phasar_taintconfig
3135
nlohmann_json_schema_validator
3236
${SQLITE3_LIBRARY}

examples/llvm-hello-world/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#include <memory>
2-
#include <string>
3-
41
#include "llvm/IR/DebugLoc.h"
52
#include "llvm/IR/Function.h"
63
#include "llvm/IR/Instruction.h"
@@ -15,6 +12,9 @@
1512
#include "llvm/Support/SourceMgr.h"
1613
#include "llvm/Support/raw_ostream.h"
1714

15+
#include <memory>
16+
#include <string>
17+
1818
int main(int argc, char **argv) {
1919
if (argc != 2) {
2020
llvm::errs() << "usage: <prog> <IR file>\n";

include/phasar/PhasarLLVM/AnalysisStrategy/Strategies.h renamed to include/phasar/AnalysisStrategy/Strategies.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace psr {
2424
enum class AnalysisStrategy {
2525
None,
2626
#define ANALYSIS_STRATEGY_TYPES(NAME, CMDFLAG, DESC) NAME,
27-
#include "phasar/PhasarLLVM/AnalysisStrategy/Strategies.def"
27+
#include "phasar/AnalysisStrategy/Strategies.def"
2828

2929
};
3030

include/phasar/PhasarLLVM/AnalysisStrategy/VariationalAnalysis.h renamed to include/phasar/AnalysisStrategy/VariationalAnalysis.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_VARIATIONALANALYSIS_H_
1111
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_VARIATIONALANALYSIS_H_
1212

13-
#include "phasar/PhasarLLVM/AnalysisStrategy/AnalysisSetup.h"
14-
#include "phasar/PhasarLLVM/DataFlowSolver/Mono/Solver/IntraMonoSolver.h"
13+
#include "phasar/AnalysisStrategy/AnalysisSetup.h"
1514

1615
#include <type_traits>
1716

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
namespace psr {
1919
enum class CallGraphAnalysisType {
2020
#define CALL_GRAPH_ANALYSIS_TYPE(NAME, CMDFLAG, DESC) NAME,
21-
#include "phasar/PhasarLLVM/ControlFlow/Resolver/CallGraphAnalysisType.def"
21+
#include "phasar/ControlFlow/CallGraphAnalysisType.def"
2222
Invalid
2323
};
2424

include/phasar/PhasarLLVM/ControlFlow/ICFGBase.h renamed to include/phasar/ControlFlow/ICFGBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_ICFGBASE_H
1111
#define PHASAR_PHASARLLVM_CONTROLFLOW_ICFGBASE_H
1212

13-
#include "phasar/PhasarLLVM/ControlFlow/CFGBase.h"
13+
#include "phasar/ControlFlow/CFGBase.h"
1414
#include "phasar/Utils/TypeTraits.h"
1515

1616
#include "llvm/ADT/StringRef.h"

include/phasar/PhasarLLVM/ControlFlow/SpecialMemberFunctionType.h renamed to include/phasar/ControlFlow/SpecialMemberFunctionType.h

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

3030
enum class SpecialMemberFunctionType {
3131
#define SPECIAL_MEMBER_FUNCTION_TYPES(NAME, TYPE) TYPE,
32-
#include "phasar/PhasarLLVM/ControlFlow/SpecialMemberFunctionType.def"
32+
#include "phasar/ControlFlow/SpecialMemberFunctionType.def"
3333
};
3434

3535
std::string toString(SpecialMemberFunctionType SMFT);

include/phasar/Controller/AnalysisController.h

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

13+
#include "phasar/AnalysisStrategy/Strategies.h"
1314
#include "phasar/Controller/AnalysisControllerEmitterOptions.h"
14-
#include "phasar/DB/LLVMProjectIRDB.h"
15-
#include "phasar/PhasarLLVM/AnalysisStrategy/HelperAnalyses.h"
16-
#include "phasar/PhasarLLVM/AnalysisStrategy/SimpleAnalysisConstructor.h"
17-
#include "phasar/PhasarLLVM/AnalysisStrategy/Strategies.h"
15+
#include "phasar/DataFlow/IfdsIde/IFDSIDESolverConfig.h"
16+
#include "phasar/DataFlow/IfdsIde/Solver/IDESolver.h"
17+
#include "phasar/DataFlow/IfdsIde/Solver/IFDSSolver.h"
18+
#include "phasar/DataFlow/IfdsIde/SolverResults.h"
19+
#include "phasar/DataFlow/Mono/Solver/InterMonoSolver.h"
20+
#include "phasar/DataFlow/Mono/Solver/IntraMonoSolver.h"
1821
#include "phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h"
19-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
20-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h"
21-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IFDSSolver.h"
22-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/SolverResults.h"
23-
#include "phasar/PhasarLLVM/DataFlowSolver/Mono/Solver/InterMonoSolver.h"
24-
#include "phasar/PhasarLLVM/DataFlowSolver/Mono/Solver/IntraMonoSolver.h"
22+
#include "phasar/PhasarLLVM/DB/LLVMProjectIRDB.h"
23+
#include "phasar/PhasarLLVM/HelperAnalyses.h"
2524
#include "phasar/PhasarLLVM/Pointer/LLVMAliasSet.h"
26-
#include "phasar/PhasarLLVM/Pointer/LLVMBasedAliasAnalysis.h"
25+
#include "phasar/PhasarLLVM/SimpleAnalysisConstructor.h"
2726
#include "phasar/PhasarLLVM/TaintConfig/TaintConfig.h"
2827
#include "phasar/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.h"
2928
#include "phasar/PhasarLLVM/Utils/DataFlowAnalysisType.h"

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctionComposer.h renamed to include/phasar/DataFlow/IfdsIde/EdgeFunctionComposer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONCOMPOSER_H
1111
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONCOMPOSER_H
1212

13-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctionUtils.h"
14-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctions.h"
13+
#include "phasar/DataFlow/IfdsIde/EdgeFunctionUtils.h"
14+
#include "phasar/DataFlow/IfdsIde/EdgeFunctions.h"
1515

1616
#include <memory>
1717

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctionUtils.h renamed to include/phasar/DataFlow/IfdsIde/EdgeFunctionUtils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* Philipp Schubert, Fabian Schiebel and others
88
*****************************************************************************/
99

10-
#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONUTILS_H_
11-
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONUTILS_H_
10+
#ifndef PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H_
11+
#define PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H_
1212

13-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctions.h"
14-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/JoinLattice.h"
13+
#include "phasar/DataFlow/IfdsIde/EdgeFunctions.h"
1514
#include "phasar/Utils/ByRef.h"
15+
#include "phasar/Utils/JoinLattice.h"
1616

1717
#include <memory>
1818

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctions.h renamed to include/phasar/DataFlow/IfdsIde/EdgeFunctions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONS_H_
1818
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONS_H_
1919

20-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/JoinLattice.h"
2120
#include "phasar/Utils/ByRef.h"
21+
#include "phasar/Utils/JoinLattice.h"
2222
#include "phasar/Utils/TypeTraits.h"
2323

2424
#include "llvm/ADT/ArrayRef.h"

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h renamed to include/phasar/DataFlow/IfdsIde/IDETabulationProblem.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@
1010
#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_IDETABULATIONPROBLEM_H_
1111
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_IDETABULATIONPROBLEM_H_
1212

13+
#include "phasar/ControlFlow/ICFGBase.h"
1314
#include "phasar/DB/ProjectIRDBBase.h"
14-
#include "phasar/PhasarLLVM/ControlFlow/ICFGBase.h"
15-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctions.h"
16-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/FlowFunctions.h"
17-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h"
18-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/InitialSeeds.h"
19-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/JoinLattice.h"
20-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/SolverResults.h"
21-
#include "phasar/PhasarLLVM/Utils/Printer.h"
15+
#include "phasar/DataFlow/IfdsIde/EdgeFunctions.h"
16+
#include "phasar/DataFlow/IfdsIde/FlowFunctions.h"
17+
#include "phasar/DataFlow/IfdsIde/IFDSIDESolverConfig.h"
18+
#include "phasar/DataFlow/IfdsIde/InitialSeeds.h"
19+
#include "phasar/DataFlow/IfdsIde/SolverResults.h"
20+
#include "phasar/Utils/JoinLattice.h"
21+
#include "phasar/Utils/Printer.h"
2222
#include "phasar/Utils/Soundness.h"
2323

2424
#include <cassert>
2525
#include <memory>
26+
#include <optional>
2627
#include <set>
2728
#include <string>
2829
#include <type_traits>
@@ -55,13 +56,11 @@ class IDETabulationProblem : public FlowFunctions<AnalysisDomainTy, Container>,
5556

5657
using ConfigurationTy = HasNoConfigurationType;
5758

58-
explicit IDETabulationProblem(const db_t *IRDB,
59+
explicit IDETabulationProblem(const ProjectIRDBBase<db_t> *IRDB,
5960
std::vector<std::string> EntryPoints,
6061
std::optional<d_t> ZeroValue)
6162
: IRDB(IRDB), EntryPoints(std::move(EntryPoints)),
6263
ZeroValue(std::move(ZeroValue)) {
63-
static_assert(std::is_base_of_v<ProjectIRDBBase<db_t>, db_t>,
64-
"db_t must implement the ProjectIRDBBase interface!");
6564
assert(IRDB != nullptr);
6665
}
6766

@@ -128,7 +127,7 @@ class IDETabulationProblem : public FlowFunctions<AnalysisDomainTy, Container>,
128127
return generateFlow(std::move(FactToGenerate), getZeroValue());
129128
}
130129

131-
const db_t *IRDB{};
130+
const ProjectIRDBBase<db_t> *IRDB{};
132131
std::vector<std::string> EntryPoints;
133132
std::optional<d_t> ZeroValue;
134133

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSIDESolverConfig.h renamed to include/phasar/DataFlow/IfdsIde/IFDSIDESolverConfig.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ enum class SolverConfigOptions : uint32_t {
4242
struct IFDSIDESolverConfig {
4343
IFDSIDESolverConfig() noexcept = default;
4444
IFDSIDESolverConfig(SolverConfigOptions Options) noexcept;
45-
~IFDSIDESolverConfig() = default;
46-
IFDSIDESolverConfig(const IFDSIDESolverConfig &) noexcept = default;
47-
IFDSIDESolverConfig &
48-
operator=(const IFDSIDESolverConfig &) noexcept = default;
49-
IFDSIDESolverConfig(IFDSIDESolverConfig &&) noexcept = default;
50-
IFDSIDESolverConfig &operator=(IFDSIDESolverConfig &&) noexcept = default;
5145

5246
[[nodiscard]] bool followReturnsPastSeeds() const;
5347
[[nodiscard]] bool autoAddZero() const;

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSTabulationProblem.h renamed to include/phasar/DataFlow/IfdsIde/IFDSTabulationProblem.h

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

13-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctionUtils.h"
14-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h"
15-
#include "phasar/PhasarLLVM/Domain/AnalysisDomain.h"
16-
#include "phasar/PhasarLLVM/Utils/BinaryDomain.h"
13+
#include "phasar/DataFlow/IfdsIde/EdgeFunctionUtils.h"
14+
#include "phasar/DataFlow/IfdsIde/IDETabulationProblem.h"
15+
#include "phasar/Domain/AnalysisDomain.h"
16+
#include "phasar/Domain/BinaryDomain.h"
1717

1818
#include <set>
1919
#include <string>
@@ -40,7 +40,7 @@ class IFDSTabulationProblem
4040
using typename Base::t_t;
4141
using typename Base::v_t;
4242

43-
explicit IFDSTabulationProblem(const db_t *IRDB,
43+
explicit IFDSTabulationProblem(const ProjectIRDBBase<db_t> *IRDB,
4444
std::vector<std::string> EntryPoints,
4545
d_t ZeroValue)
4646
: Base(IRDB, std::move(EntryPoints), std::move(ZeroValue)) {}

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/InitialSeeds.h renamed to include/phasar/DataFlow/IfdsIde/InitialSeeds.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_INITIALSEEDS_H
1111
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_INITIALSEEDS_H
1212

13-
#include "phasar/PhasarLLVM/Utils/BinaryDomain.h"
14-
#include "phasar/PhasarLLVM/Utils/LLVMShorthands.h"
13+
#include "phasar/Domain/BinaryDomain.h"
14+
#include "phasar/Utils/TypeTraits.h"
15+
16+
#include "llvm/Support/Compiler.h"
1517

1618
#include <map>
1719
#include <set>
@@ -72,19 +74,21 @@ template <typename N, typename D, typename L> class InitialSeeds {
7274
[[nodiscard]] const GeneralizedSeeds &getSeeds() const & { return Seeds; }
7375
[[nodiscard]] GeneralizedSeeds getSeeds() && { return std::move(Seeds); }
7476

75-
void dump(llvm::raw_ostream &OS = llvm::errs()) {
77+
void dump(llvm::raw_ostream &OS = llvm::errs()) const {
7678

7779
auto printNode = [&](auto &&Node) { // NOLINT
78-
if constexpr (std::is_same_v<const llvm::Instruction *, N>) {
79-
OS << llvmIRToString(Node);
80+
if constexpr (std::is_pointer_v<N> &&
81+
is_llvm_printable_v<std::remove_pointer_t<N>>) {
82+
OS << *Node;
8083
} else {
8184
OS << Node;
8285
}
8386
};
8487

8588
auto printFact = [&](auto &&Node) { // NOLINT
86-
if constexpr (std::is_same_v<const llvm::Value *, D>) {
87-
OS << llvmIRToString(Node);
89+
if constexpr (std::is_pointer_v<D> &&
90+
is_llvm_printable_v<std::remove_pointer_t<D>>) {
91+
OS << *Node;
8892
} else {
8993
OS << Node;
9094
}

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/FlowEdgeFunctionCache.h renamed to include/phasar/DataFlow/IfdsIde/Solver/FlowEdgeFunctionCache.h

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

13-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctions.h"
14-
#include "phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h"
13+
#include "phasar/DataFlow/IfdsIde/EdgeFunctions.h"
14+
#include "phasar/DataFlow/IfdsIde/IDETabulationProblem.h"
1515
#include "phasar/Utils/EquivalenceClassMap.h"
1616
#include "phasar/Utils/Logger.h"
1717
#include "phasar/Utils/PAMMMacros.h"
@@ -26,6 +26,10 @@
2626
#include <type_traits>
2727
#include <utility>
2828

29+
namespace llvm {
30+
class Value;
31+
} // namespace llvm
32+
2933
namespace psr {
3034
template <typename KeyT> class DefaultMapKeyCompressor {
3135
public:

0 commit comments

Comments
 (0)