30#ifndef INCLUDE_UTIL_ICFG_H_
31#define INCLUDE_UTIL_ICFG_H_
58 typedef ICFGNodeIDToNodeMapTy::iterator
iterator;
108 void dump(
const std::string& file,
bool simple =
false);
153 edge->getDstNode()->removeIncomingEdge(
edge);
154 edge->getSrcNode()->removeOutgoingEdge(
edge);
171 assert((
srcfun ==
dstfun) &&
"src and dst nodes of an intra edge should in the same function!" );
263 std::vector<const ICFGNode*>& subNodes =
_subNodes[
sub];
264 if(std::find(subNodes.begin(), subNodes.end(), rep) == subNodes.end())
266 subNodes.push_back(rep);
void setRetICFGNode(const RetICFGNode *r)
Return callsite.
void addGNode(NodeID id, NodeType *node)
Add a Node.
void removeGNode(NodeType *node)
Delete a node.
bool hasGNode(NodeID id) const
Has a node.
NodeType * getGNode(NodeID id) const
Get a node.
GenericNode< ICFGNode, ICFGEdge >::GEdgeSetTy ICFGEdgeSetTy
void view()
View graph from the debugger.
FunEntryICFGNode * getFunEntryICFGNode(const SVFFunction *fun)
Add a function entry node.
const ICFGNode * getRepNode(const ICFGNode *node) const
virtual void addICFGNode(ICFGNode *node)
Add a ICFG node.
bool hasICFGNode(NodeID id) const
Whether has the ICFGNode.
ICFGEdge::ICFGEdgeSetTy ICFGEdgeSetTy
Map< const SVFFunction *, FunExitICFGNode * > FunToFunExitNodeMapTy
ICFGEdge * hasThreadICFGEdge(ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind)
FunEntryICFGNode * getFunEntryBlock(const SVFFunction *fun)
Get/Add a function entry node.
FunExitICFGNode * getFunExitBlock(const SVFFunction *fun)
Get/Add a function exit node.
const ICFGNodeToSVFLoopVec & getIcfgNodeToSVFLoopVec() const
void removeICFGNode(ICFGNode *node)
Remove a ICFGNode.
Map< const ICFGNode *, SVFLoopVec > ICFGNodeToSVFLoopVec
Map< const SVFFunction *, FunEntryICFGNode * > FunToFunEntryNodeMapTy
bool addICFGEdge(ICFGEdge *edge)
Add ICFG edge, only used by addIntraEdge, addCallEdge, addRetEdge etc.
friend class ICFGSimplification
ICFGNodeIDToNodeMapTy::iterator iterator
virtual RetICFGNode * addRetICFGNode(CallICFGNode *call)
virtual FunEntryICFGNode * addFunEntryICFGNode(const SVFFunction *svfFunc)
void removeICFGEdge(ICFGEdge *edge)
Remove a ICFG edge.
virtual CallICFGNode * addCallICFGNode(const SVFBasicBlock *bb, const SVFType *ty, const SVFFunction *calledFunc, bool isVararg, bool isvcall, s32_t vcallIdx, const std::string &funNameOfVcall)
void updateCallGraph(PTACallGraph *callgraph)
update ICFG for indirect calls
ICFGEdge * getICFGEdge(const ICFGNode *src, const ICFGNode *dst, ICFGEdge::ICFGEdgeK kind)
Get a SVFG edge according to src and dst.
ICFGNode * getICFGNode(NodeID id) const
Get a ICFG node.
FunToFunEntryNodeMapTy FunToFunEntryNodeMap
map a function to its FunExitICFGNode
virtual IntraICFGNode * addIntraICFGNode(const SVFBasicBlock *bb, bool isRet)
void checkIntraEdgeParents(const ICFGNode *srcNode, const ICFGNode *dstNode)
sanitize Intra edges, verify that both nodes belong to the same function.
Map< const ICFGNode *, const ICFGNode * > _repNode
map a subnode to its representative node(1st node of basicblock)
ICFGEdge * addCallEdge(ICFGNode *srcNode, ICFGNode *dstNode)
ICFGNodeToSVFLoopVec icfgNodeToSVFLoopVec
map ICFG node to the SVF loops where it resides
ICFGEdge * hasInterICFGEdge(ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind)
void addNodeToSVFLoop(const ICFGNode *node, const SVFLoop *loop)
Insert (node, loop) to icfgNodeToSVFLoopVec.
GlobalICFGNode * globalBlockNode
unique basic block for all globals
ICFGNodeIDToNodeMapTy::const_iterator const_iterator
void dump(const std::string &file, bool simple=false)
Dump graph into dot file.
ICFGEdge * addRetEdge(ICFGNode *srcNode, ICFGNode *dstNode)
const std::vector< const ICFGNode * > & getSubNodes(const ICFGNode *node) const
ICFGEdge * hasIntraICFGEdge(ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind)
Whether we has a SVFG edge.
FunToFunExitNodeMapTy FunToFunExitNodeMap
map a function to its FunEntryICFGNode
ICFGEdge * addConditionalIntraEdge(ICFGNode *srcNode, ICFGNode *dstNode, s64_t branchCondVal)
OrderedMap< NodeID, ICFGNode * > ICFGNodeIDToNodeMapTy
void updateSubAndRep(const ICFGNode *rep, const ICFGNode *sub)
Map< const ICFGNode *, std::vector< const ICFGNode * > > _subNodes
map a node(1st node of basicblock) to its subnodes
std::vector< const SVFLoop * > SVFLoopVec
virtual FunExitICFGNode * addFunExitICFGNode(const SVFFunction *svfFunc)
ICFGEdge * addIntraEdge(ICFGNode *srcNode, ICFGNode *dstNode)
Add intraprocedural and interprocedural control-flow edges.
bool isInLoop(const ICFGNode *node)
Whether node is in a loop.
~ICFG() override
Destructor.
void updateRepNode(const ICFGNode *rep, const ICFGNode *sub)
when ICFG is simplified, some node would be removed, this map records the removed node to its rep nod...
void addSubNode(const ICFGNode *rep, const ICFGNode *sub)
when ICFG is simplified, SubNode would merge repNode, then update the map
GlobalICFGNode * getGlobalICFGNode() const
FunExitICFGNode * getFunExitICFGNode(const SVFFunction *fun)
Add a function exit node.
SVFLoopVec & getSVFLoops(const ICFGNode *node)
Get loops where a node resides.
NodeID getId() const
Get ID.
llvm::IRBuilder IRBuilder
GenericGraph< ICFGNode, ICFGEdge > GenericICFGTy