143 assert(
false &&
"no other kind!");
173 assert(
false &&
"no other kind!");
GenericNode< ConstraintNode, ConstraintEdge >::GEdgeSetTy ConstraintEdgeSetTy
Constraint edge type.
NodeID getNextCollapseNode()
void setPWCNode(NodeID nodeId)
bool moveInEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
NodeID getValueNode(const SVFValue *value) const
Wrappers used internally, not expose to Andersen Pass.
ConstraintEdge::ConstraintEdgeSetTy StoreCGEdgeSet
void setSubs(NodeID node, NodeBS &subs)
ConstraintEdge::ConstraintEdgeSetTy::iterator ConstraintNodeIter
virtual ~ConstraintGraph()
Destructor.
void addNodeToBeCollapsed(NodeID id)
ConstraintEdge::ConstraintEdgeSetTy directEdgeSet
ConstraintEdge::ConstraintEdgeSetTy LoadCGEdgeSet
LoadCGEdge * addLoadCGEdge(NodeID src, NodeID dst)
Add Load edge.
SVFStmt::SVFStmtSetTy & getPAGEdgeSet(SVFStmt::PEDGEK kind)
void view()
View graph from the debugger.
bool isSingleFieldObj(NodeID id) const
NodeID sccRepNode(NodeID id) const
SCC rep/sub nodes methods.
ConstraintEdge::ConstraintEdgeSetTy & getStoreCGEdges()
Get Store edges.
ConstraintEdge::ConstraintEdgeSetTy & getDirectCGEdges()
Get Copy/call/ret/gep edges.
void reTargetDstOfEdge(ConstraintEdge *edge, ConstraintNode *newDstNode)
Used for cycle elimination.
OrderedMap< NodeID, ConstraintNode * > ConstraintNodeIDToNodeMapTy
NodeID getVarargNode(const SVFFunction *value) const
AddrCGEdge * addAddrCGEdge(NodeID src, NodeID dst)
Add a SVFIR edge into Edge map.
ConstraintEdge::ConstraintEdgeSetTy AddrCGEdgeSet
void addConstraintNode(ConstraintNode *node, NodeID id)
bool hasEdge(ConstraintNode *src, ConstraintNode *dst, ConstraintEdge::ConstraintEdgeK kind)
void resetSubs(NodeID node)
ConstraintEdge::ConstraintEdgeSetTy & getLoadCGEdges()
Get Load edges.
CopyCGEdge * addCopyCGEdge(NodeID src, NodeID dst)
Add Copy edge.
StoreCGEdge * addStoreCGEdge(NodeID src, NodeID dst)
Add Store edge.
NodeID getGepObjVar(NodeID id, const APOffset &apOffset)
Get a field of a memory object.
VariantGepCGEdge * addVariantGepCGEdge(NodeID src, NodeID dst)
const SVFIR::CallSiteToFunPtrMap & getIndirectCallsites() const
Wrappers for invoking SVFIR methods.
NodeID getBaseObjVar(NodeID id)
NodeID getFIObjVar(NodeID id)
Get a field-insensitive node of a memory object.
ConstraintGraph(SVFIR *p)
Constructor.
NodeBS & getSubs(NodeID node)
NodeID getReturnNode(const SVFFunction *value) const
bool isPWCNode(NodeID nodeId)
Check/Set PWC (positive weight cycle) flag.
bool isBlkObjOrConstantObj(NodeID id)
void removeConstraintNode(ConstraintNode *node)
void removeDirectEdge(ConstraintEdge *edge)
Remove direct edge from their src and dst edge sets.
void resetRep(NodeID node)
bool moveOutEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
void removeLoadEdge(LoadCGEdge *edge)
Remove load edge from their src and dst edge sets.
ConstraintNode * getConstraintNode(NodeID id) const
Get/add/remove constraint node.
ConstraintEdge * getEdge(ConstraintNode *src, ConstraintNode *dst, ConstraintEdge::ConstraintEdgeK kind)
Get an edge via its src and dst nodes and kind.
bool hasNodesToBeCollapsed() const
Add/get nodes to be collapsed.
void print()
Print CG into terminal.
void reTargetSrcOfEdge(ConstraintEdge *edge, ConstraintNode *newSrcNode)
Remove edge from old src target, change edge dst id and add modified edge into new src.
bool moveEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
void removeStoreEdge(StoreCGEdge *edge)
Remove store edge from their src and dst edge sets.
bool hasConstraintNode(NodeID id) const
NormalGepCGEdge * addNormalGepCGEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Gep edge.
NodeToRepMap nodeToRepMap
NodeID getBlackHoleNode()
NodeBS & sccSubNodes(NodeID id)
void setRep(NodeID node, NodeID rep)
ConstraintEdge::ConstraintEdgeSetTy & getAddrCGEdges()
Get SVFIR edge.
Map< NodeID, NodeBS > NodeToSubsMap
void removeAddrEdge(AddrCGEdge *edge)
Remove addr edge from their src and dst edge sets.
NodeID getRep(NodeID node)
FIFOWorkList< NodeID > WorkList
WorkList nodesToBeCollapsed
bool isZeroOffsettedGepCGEdge(ConstraintEdge *edge) const
Check if a given edge is a NormalGepCGEdge with 0 offset.
NodeBS & getAllFieldsObjVars(NodeID id)
NodeToSubsMap nodeToSubsMap
void dump(std::string name)
Dump graph into dot file.
Map< NodeID, NodeID > NodeToRepMap
bool isPWCNode() const
Whether a node involves in PWC, if so, all its points-to elements should become field-insensitive.
bool push(const Data &data)
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.
NodeID getBlackHoleNode() const
NodeID getValueNode(const SVFValue *V)
NodeID getVarargNode(const SVFFunction *func) const
getVarargNode - Return the unique node representing the variadic argument of a variadic function.
NodeID getReturnNode(const SVFFunction *func) const
GetReturnNode - Return the unique node representing the return value of a function.
u32_t getMaxFieldOffsetLimit() const
Get max field offset limit.
SVFStmt::SVFStmtSetTy & getPTASVFStmtSet(SVFStmt::PEDGEK kind)
Get PTA edges set according to its kind.
NodeID getFIObjVar(const MemObj *obj) const
Get a field-insensitive obj SVFIR node according to a mem obj.
OrderedMap< const CallICFGNode *, NodeID > CallSiteToFunPtrMap
NodeBS & getAllFieldsObjVars(const MemObj *obj)
Get all fields of an object.
NodeID getBaseObjVar(NodeID id) const
Base and Offset methods for Value and Object node.
const MemObj * getBaseObj(NodeID id) const
const CallSiteToFunPtrMap & getIndirectCallsites() const
Add/get indirect callsites.
bool isBlkObjOrConstantObj(NodeID id) const
NodeID getGepObjVar(const MemObj *obj, const APOffset &ap)
Get a field SVFIR Object node according to base mem obj and offset.
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
llvm::IRBuilder IRBuilder
SVF::ConstraintNode * NodeRef