45 std::stringstream rawstr(str);
46 rawstr <<
"VFGNode ID: " <<
getId() <<
" ";
53 std::stringstream rawstr(str);
54 rawstr <<
"StmtVFGNode ID: " <<
getId() <<
" ";
69 std::stringstream rawstr(str);
70 rawstr <<
"LoadVFGNode ID: " <<
getId() <<
" ";
82 nb |= iedge->getPointsTo();
91 std::stringstream rawstr(str);
92 rawstr <<
"StoreVFGNode ID: " <<
getId() <<
" ";
107 std::stringstream rawstr(str);
108 rawstr <<
"CopyVFGNode ID: " <<
getId() <<
" ";
123 std::stringstream rawstr(str);
124 rawstr <<
"CmpVFGNode ID: " <<
getId() <<
" ";
125 rawstr <<
"SVFStmt: [" <<
res->getId() <<
" = cmp(";
128 rawstr << it->second->getId() <<
", ";
130 rawstr <<
" " <<
res->valueOnlyToString();
144 std::stringstream rawstr(str);
145 rawstr <<
"BinaryOPVFGNode ID: " <<
getId() <<
" ";
146 rawstr <<
"SVFStmt: [" <<
res->getId() <<
" = Binary(";
149 rawstr << it->second->getId() <<
", ";
151 rawstr <<
" " <<
res->valueOnlyToString();
165 std::stringstream rawstr(str);
166 rawstr <<
"UnaryOPVFGNode ID: " <<
getId() <<
" ";
167 rawstr <<
"SVFStmt: [" <<
res->getId() <<
" = Unary(";
170 rawstr << it->second->getId() <<
", ";
172 rawstr <<
" " <<
res->valueOnlyToString();
184 std::stringstream rawstr(str);
185 rawstr <<
"BranchVFGNode ID: " <<
getId() <<
" ";
186 rawstr <<
"SVFStmt: [" <<
brstmt->toString() <<
"\t";
200 std::stringstream rawstr(str);
201 rawstr <<
"GepVFGNode ID: " <<
getId() <<
" ";
216 std::stringstream rawstr(str);
217 rawstr <<
"PHIVFGNode ID: " <<
getId() <<
" ";
218 rawstr <<
"SVFVar: [" <<
res->getId() <<
" = PHI(";
221 rawstr << it->second->getId() <<
", ";
223 rawstr <<
" " <<
res->valueOnlyToString();
231 std::stringstream rawstr(str);
232 rawstr <<
"IntraPHIVFGNode ID: " <<
getId() <<
" ";
233 rawstr <<
"SVFVar: [" <<
res->getId() <<
" = PHI(";
236 rawstr << it->second->getId() <<
", ";
238 rawstr <<
" " <<
res->valueOnlyToString();
252 std::stringstream rawstr(str);
253 rawstr <<
"AddrVFGNode ID: " <<
getId() <<
" ";
262 std::stringstream rawstr(str);
263 rawstr <<
"ArgumentVFGNode ID: " <<
getId() <<
" ";
264 rawstr <<
param->toString();
278 std::stringstream rawstr(str);
279 rawstr <<
"ActualParmVFGNode ID: " <<
getId() <<
" ";
281 rawstr <<
param->toString();
295 std::stringstream rawstr(str);
296 rawstr <<
"FormalParmVFGNode ID: " <<
getId() <<
" ";
298 rawstr <<
param->toString();
312 std::stringstream rawstr(str);
313 rawstr <<
"ActualRetVFGNode ID: " <<
getId() <<
" ";
315 rawstr <<
param->toString();
330 std::stringstream rawstr(str);
331 rawstr <<
"FormalRetVFGNode ID: " <<
getId() <<
" ";
333 rawstr <<
param->toString();
341 std::stringstream rawstr(str);
343 rawstr <<
"FormalParmPHI ID: " <<
getId() <<
" SVFVar ID: " <<
res->getId() <<
"\n" <<
res->valueOnlyToString();
345 rawstr <<
"ActualRetPHI ID: " <<
getId() <<
" SVFVar ID: " <<
res->getId() <<
"\n" <<
res->valueOnlyToString();
359 std::stringstream rawstr(str);
360 rawstr <<
"NullPtrVFGNode ID: " <<
getId();
361 rawstr <<
" SVFVar ID: " <<
node->getId() <<
"\n";
369 std::stringstream rawstr(str);
377 std::stringstream rawstr(str);
385 std::stringstream rawstr(str);
386 rawstr <<
"IntraDirSVFGEdge: [" <<
getDstID() <<
"<--" <<
getSrcID() <<
"]\t";
393 std::stringstream rawstr(str);
394 rawstr <<
"CallDirSVFGEdge CallSite ID: " <<
getCallSiteId() <<
" [";
402 std::stringstream rawstr(str);
403 rawstr <<
"RetDirSVFGEdge CallSite ID: " <<
getCallSiteId() <<
" [";
460 for (SVFStmt::SVFStmtSetTy::iterator iter = addrs.begin(), eiter =
461 addrs.end(); iter != eiter; ++iter)
468 for (SVFStmt::SVFStmtSetTy::iterator iter = copys.begin(), eiter =
469 copys.end(); iter != eiter; ++iter)
472 assert(!
isPhiCopyEdge(edge) &&
"Copy edges can not be a PhiNode (or from PhiNode)");
478 for (SVFStmt::SVFStmtSetTy::iterator iter = ngeps.begin(), eiter =
479 ngeps.end(); iter != eiter; ++iter)
486 for (SVFStmt::SVFStmtSetTy::iterator iter = loads.begin(), eiter =
487 loads.end(); iter != eiter; ++iter)
494 for (SVFStmt::SVFStmtSetTy::iterator iter = stores.begin(), eiter =
495 stores.end(); iter != eiter; ++iter)
501 for (SVFStmt::SVFStmtSetTy::iterator iter = forks.begin(), eiter =
502 forks.end(); iter != eiter; ++iter)
510 for(SVFIR::CSToArgsListMap::iterator it =
pag->getCallSiteArgsMap().begin(), eit =
pag->getCallSiteArgsMap().end(); it !=eit; ++it)
513 for(SVFIR::ValVarList::iterator pit = it->second.begin(), epit = it->second.end(); pit!=epit; ++pit)
515 const ValVar* svfVar = *pit;
522 for(SVFIR::CSToRetMap::iterator it =
pag->getCallSiteRets().begin(), eit =
pag->getCallSiteRets().end(); it !=eit; ++it)
535 for(SVFIR::FunToArgsListMap::iterator it =
pag->getFunArgsMap().begin(), eit =
pag->getFunArgsMap().end(); it !=eit; ++it)
539 for(SVFIR::ValVarList::iterator pit = it->second.begin(), epit = it->second.end(); pit!=epit; ++pit)
541 const ValVar* param = *pit;
545 const CallPE* callPE =
pag->getCallPEForFormalParm(param);
551 const ValVar* varParam =
pag->getValVar(
pag->getVarargNode(func));
555 const CallPE* varCallPE =
pag->getCallPEForFormalParm(varParam);
561 for (SVFIR::FunToRetMap::iterator it =
pag->getFunRets().begin(), eit =
pag->getFunRets().end(); it != eit; ++it)
565 const ValVar* uniqueFunRetNode = it->second;
576 retPEs.insert(retPE);
586 for (SVFStmt::SVFStmtSetTy::iterator iter = phis.begin(), eiter =
587 phis.end(); iter != eiter; ++iter)
595 for (SVFStmt::SVFStmtSetTy::iterator iter = selects.begin(), eiter =
596 selects.end(); iter != eiter; ++iter)
604 for (SVFStmt::SVFStmtSetTy::iterator iter = binaryops.begin(), eiter =
605 binaryops.end(); iter != eiter; ++iter)
613 for (SVFStmt::SVFStmtSetTy::iterator iter = unaryops.begin(), eiter =
614 unaryops.end(); iter != eiter; ++iter)
622 for (SVFStmt::SVFStmtSetTy::iterator iter = brs.begin(), eiter =
623 brs.end(); iter != eiter; ++iter)
631 for (SVFStmt::SVFStmtSetTy::iterator iter = cmps.begin(), eiter =
632 cmps.end(); iter != eiter; ++iter)
651 assert(edge->
isDirectVFGEdge() &&
"this should be a direct value flow edge!");
659 return (
addVFGEdge(directEdge) ? directEdge :
nullptr);
682 return (
addVFGEdge(callEdge) ? callEdge :
nullptr);
702 return (
addVFGEdge(retEdge) ? retEdge :
nullptr);
715 NodeID nodeId = it->first;
724 if (stmtNode->getSrcNode()->isConstDataOrAggDataButNotNullPtr() ==
false)
730 for (
const auto &varType: gepStmt->getOffsetVarAndGepTypePairVec())
732 if(varType.first->isConstDataOrAggDataButNotNullPtr() ||
isInterestedSVFVar(varType.first) ==
false)
746 for (PHIVFGNode::OPVers::const_iterator it = phiNode->opVerBegin(), eit = phiNode->opVerEnd(); it != eit; it++)
748 if (it->second->isConstDataOrAggDataButNotNullPtr() ==
false)
754 for (BinaryOPVFGNode::OPVers::const_iterator it = binaryNode->opVerBegin(), eit = binaryNode->opVerEnd(); it != eit; it++)
756 if (it->second->isConstDataOrAggDataButNotNullPtr() ==
false)
762 for (UnaryOPVFGNode::OPVers::const_iterator it = unaryNode->opVerBegin(), eit = unaryNode->opVerEnd(); it != eit; it++)
764 if (it->second->isConstDataOrAggDataButNotNullPtr() ==
false)
770 for (CmpVFGNode::OPVers::const_iterator it = cmpNode->opVerBegin(), eit = cmpNode->opVerEnd(); it != eit; it++)
772 if (it->second->isConstDataOrAggDataButNotNullPtr() ==
false)
778 const ValVar* cond = branchNode->getBranchStmt()->getCondition();
784 if (actualParm->getParam()->isConstDataOrAggDataButNotNullPtr() ==
false)
789 if(
const CallPE* callPE = formalParm->getCallPE())
791 for(
u32_t i = 0; i < callPE->getOpVarNum(); i++)
808 for(RetPESet::const_iterator it = calleeRet->retPEBegin(), eit = calleeRet->retPEEnd(); it!=eit; ++it)
811 const CallICFGNode* callBlockNode = (*it)->getCallSite();
824 for (SVFStmt::SVFStmtSetTy::iterator iter = forks.begin(), eiter =
825 forks.end(); iter != eiter; ++iter)
841 for (SVFStmt::SVFStmtSetTy::iterator iter = joins.begin(), eiter =
842 joins.end(); iter != eiter; ++iter)
860 if (outEdge && inEdge)
862 assert(outEdge == inEdge &&
"edges not match");
878 if (outEdge && inEdge)
880 assert(outEdge == inEdge &&
"edges not match");
895 if (outEdge && inEdge)
897 assert(outEdge == inEdge &&
"edges not match");
934 CallGraph::CallEdgeMap::const_iterator iter = pta->
getIndCallMap().begin();
935 CallGraph::CallEdgeMap::const_iterator eiter = pta->
getIndCallMap().end();
936 for (; iter != eiter; iter++)
939 assert(newcs->
isIndirectCall() &&
"this is not an indirect call?");
941 for (PointerAnalysis::FunctionSet::const_iterator func_iter = functions.begin(); func_iter != functions.end(); func_iter++)
959 if (
pag->hasCallSiteArgsMap(callBlockNode) &&
pag->hasFunArgsList(callee) &&
964 SVFIR::ValVarList::const_iterator csArgIt = csArgList.begin(), csArgEit = csArgList.end();
965 SVFIR::ValVarList::const_iterator funArgIt = funArgList.begin(), funArgEit = funArgList.end();
966 for (; funArgIt != funArgEit && csArgIt != csArgEit; funArgIt++, csArgIt++)
968 const ValVar *cs_arg = *csArgIt;
969 const ValVar *fun_arg = *funArgIt;
973 assert(funArgIt == funArgEit &&
"function has more arguments than call site");
977 NodeID varFunArg =
pag->getVarargNode(callee);
978 const ValVar* varFunArgNode =
pag->getValVar(varFunArg);
981 for (; csArgIt != csArgEit; csArgIt++)
983 const ValVar *cs_arg = *csArgIt;
992 if (
pag->funHasRet(callee) &&
pag->callsiteHasRet(retBlockNode))
994 const ValVar* cs_return =
pag->getCallSiteRet(retBlockNode);
995 const ValVar* fun_return =
pag->getFunRet(callee);
1008 return addr->getDstNode();
1010 return copy->getDstNode();
1012 return gep->getDstNode();
1014 return load->getDstNode();
1016 return phi->getRes();
1018 return cmp->getRes();
1020 return bop->getRes();
1022 return uop->getRes();
1024 return ap->getParam();
1026 return fp->getParam();
1028 return ar->getRev();
1030 return fr->getRet();
1032 return nullVFG->getSVFVar();
1034 assert(
false &&
"unexpected node kind!");
1045 return fp->getFun();
1049 if(phi->isFormalParmPHI())
1050 return phi->getFun();
1114 std::stringstream rawstr(str);
1117 rawstr << stmtNode->toString();
1121 rawstr << tphi->toString();
1125 rawstr << fp->toString();
1129 rawstr << ap->toString();
1133 rawstr << ar->toString();
1137 rawstr << fr->toString();
1141 rawstr <<
"NullPtr";
1145 rawstr << bop->toString();
1149 rawstr << uop->toString();
1153 rawstr << cmp->toString();;
1157 rawstr << branchNode->toString();
1160 assert(
false &&
"what else kinds of nodes do we have??");
1162 return rawstr.str();
1170 std::stringstream rawstr(str);
1173 rawstr << stmtNode->toString();
1177 rawstr << bop->toString();
1181 rawstr << uop->toString();
1185 rawstr << cmp->toString();
1189 rawstr << phi->toString();
1193 rawstr << fp->toString();
1197 rawstr << ap->toString();
1201 rawstr << nptr->toString();
1205 rawstr << ar->toString();
1209 rawstr << fr->toString();
1213 rawstr << mr->toString();
1217 rawstr << branchNode->toString();
1220 assert(
false &&
"what else kinds of nodes do we have??");
1222 return rawstr.str();
1228 std::stringstream rawstr(str);
1230 rawstr <<
"shape=record";
1234 const SVFStmt* edge = stmtNode->getSVFStmt();
1237 rawstr <<
",color=green";
1241 rawstr <<
",color=black";
1245 rawstr <<
",color=black,style=dotted";
1249 rawstr <<
",color=\"purple:purple\"";
1253 rawstr <<
",color=blue";
1257 rawstr <<
",color=red";
1261 assert(0 &&
"No such kind edge!!");
1267 rawstr <<
",color=grey";
1271 rawstr <<
",color=grey";
1275 rawstr <<
",color=grey";
1279 rawstr <<
",color=black";
1283 rawstr <<
",color=grey";
1287 rawstr <<
",color=yellow,penwidth=2";
1291 rawstr <<
",color=yellow,penwidth=2";
1295 rawstr <<
",color=yellow,penwidth=2";
1299 rawstr <<
",color=yellow,penwidth=2";
1303 rawstr <<
",color=orange,penwidth=2";
1307 rawstr <<
",color=gold,penwidth=2";
1310 assert(
false &&
"no such kind of node!!");
1312 return rawstr.str();
1315 template<
class EdgeIter>
1318 VFGEdge* edge = *(EI.getCurrent());
1319 assert(edge &&
"No edge found!!");
1323 return "style=solid,color=red";
1325 return "style=solid,color=blue";
1327 return "style=solid";
1332 return "style=dashed,color=red";
1334 return "style=dashed,color=blue";
1336 return "style=dashed";
1340 assert(
false &&
"what else edge we have?");
1345 template<
class EdgeIter>
1348 VFGEdge* edge = *(EI.getCurrent());
1349 assert(edge &&
"No edge found!!");
1352 std::stringstream rawstr(str);
1354 rawstr << dirCall->getCallSiteId();
1356 rawstr << dirRet->getCallSiteId();
1358 return rawstr.str();
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
const std::string toString() const override
const ValVar * getParam() const
Return parameter.
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const CallICFGNode * getCallSite() const
Return callsite.
const CallICFGNode * getCallSite() const
Return callsite.
const std::string toString() const override
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const ValVar * getRev() const
Receive parameter at callsite.
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const std::string toString() const override
const std::string toString() const override
ArgumentVFGNode(NodeID id, const ValVar *p, VFGNodeK k)
Constructor.
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const ValVar * getRes() const
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
const std::string toString() const override
OPVers::const_iterator opVerBegin() const
OPVers::const_iterator opVerEnd() const
const ValVar * getBranchInst() const
virtual const std::string toString() const override
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const BranchStmt * brstmt
CallSiteID getCallSiteId() const
Return callsite ID.
virtual const std::string toString() const
const RetICFGNode * getRetICFGNode() const
Return callsite.
const std::string getSourceLoc() const override
bool isIndirectCall() const
Return true if this is an indirect call.
const CallICFGNode * getOpCallICFGNode(u32_t op_idx) const
Return the CallICFGNode of the i-th operand.
OPVers::const_iterator opVerBegin() const
const std::string toString() const override
const ValVar * getRes() const
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
OPVers::const_iterator opVerEnd() const
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const std::string toString() const override
virtual const std::string toString() const
bool hasIncomingEdge() const
Has incoming/outgoing edge set.
bool hasOutgoingEdge() const
const GEdgeSetTy & getOutEdges() const
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const std::string toString() const override
static void WriteGraphToFile(SVF::OutStream &O, const std::string &GraphName, const GraphType >, bool simple=false)
virtual const FunObjVar * getFun() const
Return the function of this ICFGNode.
bool isFormalParmPHI() const
const std::string toString() const override
virtual const std::string toString() const
const std::string toString() const override
const std::string toString() const override
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const ValVar * getRes() const
Result SVFVar.
const ValVar * getOpVar(u32_t pos) const
Operand SVFVars.
u32_t getOpVarNum() const
const SVFVar * getSVFVar() const
Return corresponding SVFVar.
const std::string toString() const override
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
static const Option< bool > EnableThreadCallGraph
OPVers::const_iterator opVerBegin() const
PHIVFGNode(NodeID id, const ValVar *r, VFGNodeK k=TPhi)
Constructor.
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const std::string toString() const override
OPVers::const_iterator opVerEnd() const
const ValVar * getRes() const
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Set< const FunObjVar * > FunctionSet
CallEdgeMap & getIndCallMap()
Get callees from an indirect callsite.
virtual const std::string toString() const
CallSiteID getCallSiteId() const
Return callsite ID.
const CallICFGNode * getCallSite() const
const ValVar * getLHSVar() const
std::vector< const ValVar * > ValVarList
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
const SVFVar * getValue() const
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
virtual const std::string toString() const
NodeID getId() const
Get ID.
virtual const std::string & getName() const
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
const SVFStmt * getSVFStmt() const
const std::string toString() const override
NodeID getDstNodeID() const
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const std::string toString() const override
const ValVar * getRHSVar() const
const ValVar * getLHSVar() const
const ValVar * getRes() const
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
const ValVar * getRes() const
OPVers::const_iterator opVerBegin() const
virtual const std::string toString() const override
OPVers::const_iterator opVerEnd() const
static GEdgeFlag makeEdgeFlagWithInvokeID(GEdgeKind k, CallSiteID cs)
Compute the unique edgeFlag value from edge kind and CallSiteID.
bool isRetDirectVFGEdge() const
bool isDirectVFGEdge() const
Get methods of the components.
virtual const std::string toString() const
bool isCallDirectVFGEdge() const
virtual const std::string toString() const
VFGNode(NodeID i, VFGNodeK k)
Constructor.
FormalRetVFGNode * getFormalRetVFGNode(const SVFVar *fret) const
VFGEdge::VFGEdgeSetTy VFGEdgeSetTy
void updateCallGraph(PointerAnalysis *pta)
Update VFG based on pointer analysis results.
NodeID getDef(const ValVar *valVar) const
VFGEdge * addInterEdgeFromAPToFP(ActualParmVFGNode *src, FormalParmVFGNode *dst, CallSiteID csId)
Add inter VF edge from actual to formal parameters.
void addStoreVFGNode(const StoreStmt *store)
VFGEdge * addInterEdgeFromFRToAR(FormalRetVFGNode *src, ActualRetVFGNode *dst, CallSiteID csId)
Add inter VF edge from callee return to callsite receive parameter.
void addBranchVFGNode(const BranchStmt *edge)
Add a BranchVFGNode.
ActualParmVFGNode * getActualParmVFGNode(const SVFVar *aparm, const CallICFGNode *cs) const
const SVFVar * getLHSTopLevPtr(const VFGNode *node) const
VFGNodeIDToNodeMapTy::iterator iterator
VFGEdge * addRetEdge(NodeID srcId, NodeID dstId, CallSiteID csId)
virtual void connectAParamAndFParam(const ValVar *csArg, const ValVar *funArg, const CallICFGNode *cbn, CallSiteID csId, VFGEdgeSetTy &edges)
Connect VFG nodes between caller and callee for indirect call site.
void addVFGNodes()
Create VFG nodes.
void addLoadVFGNode(const LoadStmt *load)
Add a Load VFG node.
CallSiteID getCallSiteID(const CallICFGNode *cs, const FunObjVar *func) const
Get callsite given a callsiteID.
VFGEdge * addIntraDirectVFEdge(NodeID srcId, NodeID dstId)
void checkIntraEdgeParents(const VFGNode *srcNode, const VFGNode *dstNode)
sanitize Intra edges, verify that both nodes belong to the same function.
void addCopyVFGNode(const CopyStmt *copy)
Add a Copy VFG node.
void addGepVFGNode(const GepStmt *gep)
Add a Gep VFG node.
bool isPhiCopyEdge(const SVFStmt *copy) const
bool hasDef(const ValVar *valVar) const
void addFormalParmVFGNode(const ValVar *fparm, const FunObjVar *fun, const CallPE *callPE)
Add a formal parameter VFG node.
virtual void connectFRetAndARet(const ValVar *funReturn, const ValVar *csReturn, CallSiteID csId, VFGEdgeSetTy &edges)
Connect formal-ret and actual ret.
void addUnaryOPVFGNode(const UnaryOPStmt *edge)
Add a UnaryOperator VFG node.
SVFIR * getPAG() const
Return SVFIR.
void addCmpVFGNode(const CmpStmt *edge)
Add a Compare VFG node.
FormalParmVFGNode * getFormalParmVFGNode(const SVFVar *fparm) const
bool addVFGEdge(VFGEdge *edge)
Add VFG edge.
VFGNode * getVFGNode(NodeID id) const
Get a VFG node.
void addActualParmVFGNode(const ValVar *aparm, const CallICFGNode *cs)
const FunObjVar * isFunEntryVFGNode(const VFGNode *node) const
Whether a node is function entry VFGNode.
VFG(CallGraph *callgraph, VFGK k=FULLSVFG)
Constructor.
VFGEdge * addCallEdge(NodeID srcId, NodeID dstId, CallSiteID csId)
void addNullPtrVFGNode(const ValVar *svfVar)
virtual SVFStmt::SVFStmtSetTy & getSVFStmtSet(SVFStmt::PEDGEK kind)
Get SVFStmt set.
void addFormalRetVFGNode(const ValVar *uniqueFunRet, const FunObjVar *fun, RetPESet &retPEs)
FormalRetVFGNode::RetPESet RetPESet
VFGEdge * hasIntraVFGEdge(VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind)
Whether we has a SVFG edge.
void addBinaryOPVFGNode(const BinaryOPStmt *edge)
Add a BinaryOperator VFG node.
void addAddrVFGNode(const AddrStmt *addr)
Add an Address VFG node.
void addActualRetVFGNode(const ValVar *ret, const CallICFGNode *cs)
Add a callsite Receive VFG node.
VFGEdge * hasInterVFGEdge(VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind, CallSiteID csId)
virtual bool isInterestedSVFVar(const SVFVar *node) const
void connectDirectVFGEdges()
Create edges between VFG nodes within a function.
VFGEdge * getIntraVFGEdge(const VFGNode *src, const VFGNode *dst, VFGEdge::VFGEdgeK kind)
Get a SVFG edge according to src and dst.
ActualRetVFGNode * getActualRetVFGNode(const SVFVar *aret) const
void view()
Dump graph into dot file.
VFGEdge * hasThreadVFGEdge(VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind)
void dump(const std::string &file, bool simple=false)
Dump graph into dot file.
bool hasBlackHoleConstObjAddrAsDef(const ValVar *valVar) const
Whether a SVFVar has a blackhole or const object as its definition.
virtual void connectCallerAndCallee(const CallICFGNode *cs, const FunObjVar *callee, VFGEdgeSetTy &edges)
Connect VFG nodes between caller and callee for indirect call site.
void destroy()
Clean up memory.
void addIntraPHIVFGNode(const MultiOpndStmt *edge)
Add an llvm PHI VFG node.
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)
LLVM_NODISCARD bool isa(const Y &Val)
bool matchArgs(const CallICFGNode *cs, const FunObjVar *callee)
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)
void ViewGraph(const GraphType &G, const std::string &name, bool ShortNames=false, GraphProgram::Name Program=GraphProgram::DOT)
static std::string getCompleteNodeLabel(NodeType *node, VFG *)
Return label of a VFG node with MemSSA information.
static std::string getNodeAttributes(NodeType *node, VFG *)
static std::string getEdgeSourceLabel(NodeType *, EdgeIter EI)
DOTGraphTraits(bool isSimple=false)
static std::string getEdgeAttributes(NodeType *, EdgeIter EI, VFG *)
std::string getNodeLabel(NodeType *node, VFG *graph)
static std::string getSimpleNodeLabel(NodeType *node, VFG *)
Return label of a VFG node without MemSSA information.
static std::string getGraphName(VFG *)
Return name of the graph.