11#include " MyIFDSProblem.h"
22#include < iostream>
3+ #include < phasar/DB/ProjectIRDB.h>
34#include < phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h>
4- #include < phasar/PhasarLLVM/IfdsIde/FlowFunctions/Gen.h>
5- #include < phasar/PhasarLLVM/IfdsIde/FlowFunctions/Identity.h>
6- #include < phasar/PhasarLLVM/IfdsIde/FlowFunctions/KillAll.h>
5+ #include < phasar/PhasarLLVM/DataFlowSolver/IfdsIde/FlowFunctions/Gen.h>
6+ #include < phasar/PhasarLLVM/DataFlowSolver/IfdsIde/FlowFunctions/Identity.h>
7+ #include < phasar/PhasarLLVM/DataFlowSolver/IfdsIde/FlowFunctions/KillAll.h>
8+ #include < phasar/PhasarLLVM/Pointer/LLVMPointsToInfo.h>
9+ #include < phasar/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.h>
710
811using namespace std ;
912using namespace psr ;
1013
1114// Factory function that is used to create an instance by the Phasar framework.
1215unique_ptr<IFDSTabulationProblemPlugin>
13- makeMyIFDSProblem (LLVMBasedICFG &I, vector<string> EntryPoints) {
16+ makeMyIFDSProblem (const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
17+ const LLVMBasedICFG *ICF, const LLVMPointsToInfo *PT,
18+ std::set<std::string> EntryPoints) {
1419 return unique_ptr<IFDSTabulationProblemPlugin>(
15- new MyIFDSProblem (I , EntryPoints));
20+ new MyIFDSProblem (IRDB, TH, ICF, PT , EntryPoints));
1621}
1722
1823// Is executed on plug-in load and has to register this plug-in to Phasar.
@@ -24,8 +29,12 @@ __attribute__((constructor)) void init() {
2429// Is executed on unload, can be used to unregister the plug-in.
2530__attribute__ ((destructor)) void fini() { cout << " fini - MyIFDSProblem\n " ; }
2631
27- MyIFDSProblem::MyIFDSProblem (LLVMBasedICFG &I, vector<string> EntryPoints)
28- : IFDSTabulationProblemPlugin(I, EntryPoints) {}
32+ MyIFDSProblem::MyIFDSProblem (const ProjectIRDB *IRDB,
33+ const LLVMTypeHierarchy *TH,
34+ const LLVMBasedICFG *ICF,
35+ const LLVMPointsToInfo *PT,
36+ std::set<std::string> EntryPoints)
37+ : IFDSTabulationProblemPlugin(IRDB, TH, ICF, PT, EntryPoints) {}
2938
3039shared_ptr<FlowFunction<const llvm::Value *>>
3140MyIFDSProblem::getNormalFlowFunction (const llvm::Instruction *curr,
@@ -101,8 +110,9 @@ MyIFDSProblem::initialSeeds() {
101110 cout << " MyIFDSProblem::initialSeeds()\n " ;
102111 map<const llvm::Instruction *, set<const llvm::Value *>> SeedMap;
103112 for (auto &EntryPoint : EntryPoints) {
104- SeedMap.insert (std::make_pair (&icfg.getMethod (EntryPoint)->front ().front (),
105- set<const llvm::Value *>({zeroValue ()})));
113+ SeedMap.insert (
114+ std::make_pair (&ICF->getFunction (EntryPoint)->front ().front (),
115+ set<const llvm::Value *>({getZeroValue ()})));
106116 }
107117 return SeedMap;
108118}
0 commit comments