59 std::stringstream rawstr(str);
60 rawstr <<
"ThreadForkEdge ";
70 std::stringstream rawstr(str);
71 rawstr <<
"ThreadJoinEdge ";
87 PointerAnalysis::CallEdgeMap::const_iterator iter = pta->
getIndCallMap().begin();
88 PointerAnalysis::CallEdgeMap::const_iterator eiter = pta->
getIndCallMap().end();
89 for (; iter != eiter; iter++)
93 for (CallGraph::FunctionSet::const_iterator func_iter =
94 functions.begin(); func_iter != functions.end(); func_iter++)
104 const ValVar* forkedval =
tdAPI->getForkedFun(*it);
135 const SVFVar* jointhread =
tdAPI->getJoinedThread(*it);
140 const SVFVar* forkthread =
tdAPI->getForkedThread(*it);
141 if (
tdAPI->isAliasedForkJoin(pta, forkthread, jointhread, aliasCache))
164 assert(forkee &&
"callee does not exist");
219 for (CallSiteSet::const_iterator it = forkset.begin(), eit = forkset.end(); it != eit; ++it)
236 assert(cs->
getCaller() == joinFunNode->
getFunction() &&
"callee instruction not inside caller??");
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
bool isFunction() const
object attributes methods
void addInDirectCallSite(const CallICFGNode *call)
void addDirectCallSite(const CallICFGNode *call)
Add direct and indirect callsite.
CallSiteID getCallSiteID() const
Get direct and indirect calls.
const FunObjVar * getFunction() const
Get function of this call node.
void addIndirectCallGraphEdge(const CallICFGNode *cs, const FunObjVar *callerFun, const FunObjVar *calleeFun)
Add indirect call edges.
CallGraphEdge * hasGraphEdge(CallGraphEdge *cgEdge) const
Whether we have already created this call graph edge.
void addEdge(CallGraphEdge *edge)
Add call graph edge.
const CallGraphNode * getCallGraphNode(const std::string &name) const
Get call graph node.
CallSiteID addCallSite(const CallICFGNode *cs, const FunObjVar *callee)
Add CallSiteID.
CallGraph(CGEK k=NormCallGraph)
Constructor.
Set< const FunObjVar * > FunctionSet
const FunObjVar * getCaller() const
Return callsite.
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
const FunObjVar * getDefFunForMultipleModule() const
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
NodeType * getSrcNode() const
NodeType * getDstNode() const
const BaseObjVar * getBaseObject(NodeID id) const
const ObjVar * getObjVar(NodeID id) const
virtual const PointsTo & getPts(NodeID ptr)=0
Get points-to targets of a pointer. It needs to be implemented in child class.
CallEdgeMap & getIndCallMap()
Get callees from an indirect callsite.
NodeBS toNodeBS() const
Returns this points-to set as a NodeBS.
NodeID getId() const
Get ID.
virtual const std::string & getName() const
SparseBitVectorIterator iterator
CallSiteSet::const_iterator forksitesEnd() const
bool addDirectForkEdge(const CallICFGNode *cs)
Add direct/indirect thread fork edges.
virtual ~ThreadCallGraph()
Destructor.
CallSiteSet::const_iterator forksitesBegin() const
Fork sites iterators.
void updateJoinEdge(PointerAnalysis *pta)
Update join edge using pointer analysis results.
CallSiteSet::const_iterator joinsitesEnd() const
bool hasThreadJoinEdge(const CallICFGNode *cs) const
Get call graph edge via call instruction.
void addThreadJoinEdgeSetMap(const CallICFGNode *cs, ThreadJoinEdge *edge)
map call instruction to its PTACallGraphEdge map
ForkEdgeSet::const_iterator getForkEdgeEnd(const CallICFGNode *cs) const
ForkEdgeSet::const_iterator getForkEdgeBegin(const CallICFGNode *cs) const
void addDirectJoinEdge(const CallICFGNode *cs, const CallSiteSet &forksite)
Add thread join edges.
bool addIndirectForkEdge(const CallICFGNode *cs, const FunObjVar *callee)
bool hasThreadForkEdge(const CallICFGNode *cs) const
Get call graph edge via call instruction.
CallSiteSet::const_iterator joinsitesBegin() const
Join sites iterators.
ThreadAPI * getThreadAPI() const
Thread API.
void addThreadForkEdgeSetMap(const CallICFGNode *cs, ThreadForkEdge *edge)
map call instruction to its PTACallGraphEdge map
void updateCallGraph(PointerAnalysis *pta)
Update call graph using pointer results.
ThreadCallGraph(const CallGraph &cg)
Constructor.
ThreadAPI * tdAPI
Thread API.
CallInstToJoinEdgesMap callinstToThreadJoinEdgesMap
Map a call instruction to its corresponding join edges.
virtual const std::string toString() const
virtual const std::string toString() const
std::string pasMsg(const std::string &msg)
Print each pass/phase message by converting a string into blue string output.
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
std::ostream & outs()
Overwrite llvm::outs().
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
If fork join the same thread.