Skip to content

Commit

Permalink
refactor icfg builder
Browse files Browse the repository at this point in the history
  • Loading branch information
jumormt committed Oct 9, 2024
1 parent 2af9828 commit f98501e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions svf-llvm/include/SVF-LLVM/ICFGBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class ICFGBuilder
public:
typedef FIFOWorkList<const Instruction*> WorkList;

ICFGBuilder(ICFG* i): icfg(i)
ICFGBuilder(): icfg(new ICFG())
{

}
void build();
ICFG* build();

private:

Expand Down
3 changes: 2 additions & 1 deletion svf-llvm/lib/ICFGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using namespace SVFUtil;
/*!
* Create ICFG nodes and edges
*/
void ICFGBuilder::build()
ICFG* ICFGBuilder::build()
{
DBOUT(DGENERAL, outs() << pasMsg("\t Building ICFG ...\n"));
// Add the unique global ICFGNode at the entry of a program (before the main method).
Expand Down Expand Up @@ -78,6 +78,7 @@ void ICFGBuilder::build()

}
connectGlobalToProgEntry();
return icfg;
}

void ICFGBuilder::checkICFGNodesVisited(const Function* fun)
Expand Down
5 changes: 2 additions & 3 deletions svf-llvm/lib/LLVMModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ void LLVMModuleSet::build()

createSVFDataStructure();
initSVFFunction();
icfg = new ICFG();
ICFGBuilder icfgbuilder(icfg);
icfgbuilder.build();
ICFGBuilder icfgbuilder;
icfg = icfgbuilder.build();
}

void LLVMModuleSet::createSVFDataStructure()
Expand Down

0 comments on commit f98501e

Please sign in to comment.