Skip to content

Commit

Permalink
remove all fields in CallGraphBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
hwg committed Oct 11, 2024
1 parent 45579ac commit ff5b75d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
4 changes: 2 additions & 2 deletions svf-llvm/lib/LLVMModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ void LLVMModuleSet::build()
ICFGBuilder icfgbuilder;
icfg = icfgbuilder.build();

CallGraphBuilder callGraphBuilder(&(svfModule->getFunctionSet()), icfg);
callgraph = callGraphBuilder.buildSVFIRCallGraph();
CallGraphBuilder callGraphBuilder;
callgraph = callGraphBuilder.buildSVFIRCallGraph(svfModule);
}

void LLVMModuleSet::createSVFDataStructure()
Expand Down
16 changes: 2 additions & 14 deletions svf/include/Util/CallGraphBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,10 @@ class SVFModule;
class CallGraphBuilder
{
public:
typedef SVFModule::FunctionSetType FunctionSetType;

protected:
const FunctionSetType* svfFunctionSet;
ICFG* icfg;

public:

CallGraphBuilder(FunctionSetType* fs, ICFG* i): svfFunctionSet(fs),icfg(i)
{
}

CallGraphBuilder();
CallGraphBuilder()=default;

/// Buidl SVFIR callgraoh
CallGraph* buildSVFIRCallGraph();
CallGraph* buildSVFIRCallGraph(SVFModule* svfModule);

/// Build thread-aware callgraph
ThreadCallGraph* buildThreadCallGraph();
Expand Down
8 changes: 2 additions & 6 deletions svf/lib/Util/CallGraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
using namespace SVF;
using namespace SVFUtil;

CallGraph* CallGraphBuilder::buildSVFIRCallGraph()
CallGraph* CallGraphBuilder::buildSVFIRCallGraph(SVFModule* svfModule)
{
CallGraph* callgraph = new CallGraph();
for (const SVFFunction* svfFunc: *svfFunctionSet){
for (const SVFFunction* svfFunc: svfModule->getFunctionSet()){
callgraph->addCallGraphNode(svfFunc);
}

Expand Down Expand Up @@ -111,7 +111,3 @@ ThreadCallGraph* CallGraphBuilder::buildThreadCallGraph()

return cg;
}
CallGraphBuilder::CallGraphBuilder() {
icfg = PAG::getPAG()->getICFG();
svfFunctionSet = nullptr;
}

0 comments on commit ff5b75d

Please sign in to comment.