74 return pag->getPTASVFStmtSet(kind);
81 return pag->getReturnNode(value);
86 return pag->getVarargNode(value);
138 assert(
false &&
"no other kind!");
168 assert(
false &&
"no other kind!");
232 NodeToRepMap::const_iterator it =
nodeToRepMap.find(
id);
285 return (gepIn || gepOut);
292 if (0 == normalGepCGEdge->getConstantFieldIdx())
301 return pag->getIndirectCallsites();
305 return pag->getBlackHoleNode();
309 return pag->isBlkObjOrConstantObj(
id);
313 return pag->getAllFieldsObjVars(
id);
317 return pag->getBaseObjVarID(
id);
327 NodeID gep =
pag->getGepObjVar(
id, apOffset);
u32_t getMaxFieldOffsetLimit() const
Get max field offset limit.
GenericNode< ConstraintNode, ConstraintEdge >::GEdgeSetTy ConstraintEdgeSetTy
Constraint edge type.
NodeID getNextCollapseNode()
void setPWCNode(NodeID nodeId)
bool moveInEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
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.
void view()
View graph from the debugger.
NodeID getBaseObjVarID(NodeID id)
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
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 getVarargNode(const FunObjVar *value) const
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 getReturnNode(const FunObjVar *value) const
Wrappers used internally, not expose to Andersen Pass.
NodeID getFIObjVar(NodeID id)
Get a field-insensitive node of a memory object.
ConstraintGraph(SVFIR *p)
Constructor.
NodeBS & getSubs(NodeID node)
bool isPWCNode(NodeID nodeId)
Check/Set PWC (positive weight cycle) flag.
bool isBlkObjOrConstantObj(NodeID id)
SVFStmt::SVFStmtSetTy & getSVFStmtSet(SVFStmt::PEDGEK kind)
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.
void addGNode(NodeID id, NodeType *node)
void removeGNode(NodeType *node)
bool hasGNode(NodeID id) const
NodeType * getGNode(NodeID id) const
OrderedMap< const CallICFGNode *, NodeID > CallSiteToFunPtrMap
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
std::map< Key, Value, Compare, Allocator > OrderedMap
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
SVF::ConstraintNode * NodeRef