37 using namespace SVFUtil;
47 for (
const auto&
item : *callgraph)
51 for (
const ICFGNode* inst : svfbb->getICFGNodeList())
55 const CallICFGNode* callBlockNode = cast<CallICFGNode>(inst);
73 for (
const auto&
item: *svfirCallGraph)
77 for (
const ICFGNode* inst : svfbb->getICFGNodeList())
79 if (SVFUtil::isa<CallICFGNode>(inst) && tdAPI->
isTDFork(SVFUtil::cast<CallICFGNode>(inst)))
98 for (
const auto&
item: *svfirCallGraph)
102 for (
const ICFGNode* node : svfbb->getICFGNodeList())
104 if (SVFUtil::isa<CallICFGNode>(node) && tdAPI->
isTDJoin(SVFUtil::cast<CallICFGNode>(node)))
106 const CallICFGNode* cs = SVFUtil::cast<CallICFGNode>(node);
ThreadCallGraph * buildThreadCallGraph()
Build thread-aware callgraph.
PTACallGraph * buildSVFIRCallGraph(SVFModule *svfModule)
Buidl SVFIR callgraoh.
const SVFFunction * getCalledFunction() const
void addDirectCallGraphEdge(const CallICFGNode *call, const SVFFunction *callerFun, const SVFFunction *calleeFun)
Add direct/indirect call edges.
void addCallGraphNode(const SVFFunction *fun)
const SVFFunction * getFunction() const
const std::vector< const SVFBasicBlock * > & getBasicBlockList() const
PTACallGraph * getCallGraph()
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
const FunctionSetType & getFunctionSet() const
const SVFValue * getValue() const
Get/has methods of the components.
bool isTDFork(const CallICFGNode *inst) const
Return true if this call create a new thread.
bool isTDJoin(const CallICFGNode *inst) const
Return true if this call wait for a worker thread.
static ThreadAPI * getThreadAPI()
Return a static reference.
const SVFVar * getForkedFun(const CallICFGNode *inst) const
bool addDirectForkEdge(const CallICFGNode *cs)
Add direct/indirect thread fork edges.
bool addForksite(const CallICFGNode *cs)
Add fork sites which directly or indirectly create a thread.
bool addJoinsite(const CallICFGNode *cs)
void addThreadForkEdgeSetMap(const CallICFGNode *cs, ThreadForkEdge *edge)
map call instruction to its PTACallGraphEdge map
bool isNonInstricCallSite(const ICFGNode *inst)
Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls.