Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SVF::ConstraintGraph Class Reference

#include <ConsG.h>

Inheritance diagram for SVF::ConstraintGraph:
SVF::GenericGraph< ConstraintNode, ConstraintEdge >

Public Types

typedef OrderedMap< NodeID, ConstraintNode * > ConstraintNodeIDToNodeMapTy
 
typedef ConstraintEdge::ConstraintEdgeSetTy::iterator ConstraintNodeIter
 
typedef Map< NodeID, NodeIDNodeToRepMap
 
typedef Map< NodeID, NodeBSNodeToSubsMap
 
typedef FIFOWorkList< NodeIDWorkList
 
- Public Types inherited from SVF::GenericGraph< ConstraintNode, ConstraintEdge >
typedef ConstraintNode NodeType
 
typedef ConstraintEdge EdgeType
 
typedef OrderedMap< NodeID, NodeType * > IDToNodeMapTy
 NodeID to GenericNode map.
 
typedef IDToNodeMapTy::iterator iterator
 Node Iterators.
 
typedef IDToNodeMapTy::const_iterator const_iterator
 

Public Member Functions

 ConstraintGraph (SVFIR *p)
 Constructor.
 
virtual ~ConstraintGraph ()
 Destructor.
 
ConstraintNodegetConstraintNode (NodeID id) const
 Get/add/remove constraint node.
 
void addConstraintNode (ConstraintNode *node, NodeID id)
 
bool hasConstraintNode (NodeID id) const
 
void removeConstraintNode (ConstraintNode *node)
 
bool hasEdge (ConstraintNode *src, ConstraintNode *dst, ConstraintEdge::ConstraintEdgeK kind)
 
ConstraintEdgegetEdge (ConstraintNode *src, ConstraintNode *dst, ConstraintEdge::ConstraintEdgeK kind)
 Get an edge via its src and dst nodes and kind.
 
AddrCGEdgeaddAddrCGEdge (NodeID src, NodeID dst)
 Add a SVFIR edge into Edge map.
 
CopyCGEdgeaddCopyCGEdge (NodeID src, NodeID dst)
 Add Copy edge.
 
NormalGepCGEdgeaddNormalGepCGEdge (NodeID src, NodeID dst, const AccessPath &ap)
 Add Gep edge.
 
VariantGepCGEdgeaddVariantGepCGEdge (NodeID src, NodeID dst)
 
LoadCGEdgeaddLoadCGEdge (NodeID src, NodeID dst)
 Add Load edge.
 
StoreCGEdgeaddStoreCGEdge (NodeID src, NodeID dst)
 Add Store edge.
 
ConstraintEdge::ConstraintEdgeSetTygetAddrCGEdges ()
 Get SVFIR edge.
 
ConstraintEdge::ConstraintEdgeSetTygetDirectCGEdges ()
 Get Copy/call/ret/gep edges.
 
ConstraintEdge::ConstraintEdgeSetTygetLoadCGEdges ()
 Get Load edges.
 
ConstraintEdge::ConstraintEdgeSetTygetStoreCGEdges ()
 Get Store edges.
 
void reTargetDstOfEdge (ConstraintEdge *edge, ConstraintNode *newDstNode)
 Used for cycle elimination.
 
void reTargetSrcOfEdge (ConstraintEdge *edge, ConstraintNode *newSrcNode)
 Remove edge from old src target, change edge dst id and add modified edge into new src.
 
void removeAddrEdge (AddrCGEdge *edge)
 Remove addr edge from their src and dst edge sets.
 
void removeDirectEdge (ConstraintEdge *edge)
 Remove direct edge from their src and dst edge sets.
 
void removeLoadEdge (LoadCGEdge *edge)
 Remove load edge from their src and dst edge sets.
 
void removeStoreEdge (StoreCGEdge *edge)
 Remove store edge from their src and dst edge sets.
 
NodeID sccRepNode (NodeID id) const
 SCC rep/sub nodes methods.
 
NodeBSsccSubNodes (NodeID id)
 
void setRep (NodeID node, NodeID rep)
 
void setSubs (NodeID node, NodeBS &subs)
 
void resetSubs (NodeID node)
 
NodeBSgetSubs (NodeID node)
 
NodeID getRep (NodeID node)
 
void resetRep (NodeID node)
 
bool moveInEdgesToRepNode (ConstraintNode *node, ConstraintNode *rep)
 
bool moveOutEdgesToRepNode (ConstraintNode *node, ConstraintNode *rep)
 
bool moveEdgesToRepNode (ConstraintNode *node, ConstraintNode *rep)
 
bool isZeroOffsettedGepCGEdge (ConstraintEdge *edge) const
 Check if a given edge is a NormalGepCGEdge with 0 offset.
 
const SVFIR::CallSiteToFunPtrMapgetIndirectCallsites () const
 Wrappers for invoking SVFIR methods.
 
NodeID getBlackHoleNode ()
 
bool isBlkObjOrConstantObj (NodeID id)
 
NodeBSgetAllFieldsObjVars (NodeID id)
 
NodeID getBaseObjVarID (NodeID id)
 
bool isSingleFieldObj (NodeID id) const
 
NodeID getGepObjVar (NodeID id, const APOffset &apOffset)
 Get a field of a memory object.
 
NodeID getFIObjVar (NodeID id)
 Get a field-insensitive node of a memory object.
 
bool isPWCNode (NodeID nodeId)
 Check/Set PWC (positive weight cycle) flag.
 
void setPWCNode (NodeID nodeId)
 
bool hasNodesToBeCollapsed () const
 Add/get nodes to be collapsed.
 
void addNodeToBeCollapsed (NodeID id)
 
NodeID getNextCollapseNode ()
 
void dump (std::string name)
 Dump graph into dot file.
 
void print ()
 Print CG into terminal.
 
void view ()
 View graph from the debugger.
 
- Public Member Functions inherited from SVF::GenericGraph< ConstraintNode, ConstraintEdge >
 GenericGraph ()
 Constructor.
 
virtual ~GenericGraph ()
 Destructor.
 
void destroy ()
 Release memory.
 
iterator begin ()
 Iterators.
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void addGNode (NodeID id, NodeType *node)
 Add a Node.
 
NodeTypegetGNode (NodeID id) const
 Get a node.
 
bool hasGNode (NodeID id) const
 Has a node.
 
void removeGNode (NodeType *node)
 Delete a node.
 
u32_t getTotalNodeNum () const
 Get total number of node/edge.
 
u32_t getTotalEdgeNum () const
 
void incNodeNum ()
 Increase number of node/edge.
 
void incEdgeNum ()
 

Protected Member Functions

void buildCG ()
 
void destroy ()
 
void clearSolitaries ()
 
SVFStmt::SVFStmtSetTygetPAGEdgeSet (SVFStmt::PEDGEK kind)
 
NodeID getReturnNode (const FunObjVar *value) const
 Wrappers used internally, not expose to Andersen Pass.
 
NodeID getVarargNode (const FunObjVar *value) const
 

Protected Attributes

SVFIRpag
 
NodeToRepMap nodeToRepMap
 
NodeToSubsMap nodeToSubsMap
 
WorkList nodesToBeCollapsed
 
EdgeID edgeIndex
 
ConstraintEdge::ConstraintEdgeSetTy AddrCGEdgeSet
 
ConstraintEdge::ConstraintEdgeSetTy directEdgeSet
 
ConstraintEdge::ConstraintEdgeSetTy LoadCGEdgeSet
 
ConstraintEdge::ConstraintEdgeSetTy StoreCGEdgeSet
 
- Protected Attributes inherited from SVF::GenericGraph< ConstraintNode, ConstraintEdge >
IDToNodeMapTy IDToNodeMap
 node map
 

Additional Inherited Members

- Public Attributes inherited from SVF::GenericGraph< ConstraintNode, ConstraintEdge >
u32_t edgeNum
 total num of node
 
u32_t nodeNum
 total num of edge
 

Detailed Description

Constraint graph for Andersen's analysis ConstraintNodes are same as PAGNodes ConstraintEdges are self-defined edges (initialized with ConstraintEdges)

Definition at line 44 of file ConsG.h.

Member Typedef Documentation

◆ ConstraintNodeIDToNodeMapTy

Definition at line 48 of file ConsG.h.

◆ ConstraintNodeIter

typedef ConstraintEdge::ConstraintEdgeSetTy::iterator SVF::ConstraintGraph::ConstraintNodeIter

Definition at line 49 of file ConsG.h.

◆ NodeToRepMap

Definition at line 50 of file ConsG.h.

◆ NodeToSubsMap

Definition at line 51 of file ConsG.h.

◆ WorkList

Definition at line 52 of file ConsG.h.

Constructor & Destructor Documentation

◆ ConstraintGraph()

SVF::ConstraintGraph::ConstraintGraph ( SVFIR p)
inline

Constructor.

Definition at line 92 of file ConsG.h.

92 : pag(p), edgeIndex(0)
93 {
94 buildCG();
95 }
cJSON * p
Definition cJSON.cpp:2559

◆ ~ConstraintGraph()

virtual SVF::ConstraintGraph::~ConstraintGraph ( )
inlinevirtual

Destructor.

Definition at line 97 of file ConsG.h.

98 {
99 destroy();
100 }

Member Function Documentation

◆ addAddrCGEdge()

AddrCGEdge * ConstraintGraph::addAddrCGEdge ( NodeID  src,
NodeID  dst 
)

Add a SVFIR edge into Edge map.

Add Address edge

Add an address edge

Definition at line 201 of file ConsG.cpp.

202{
206 return nullptr;
208
209 bool inserted = AddrCGEdgeSet.insert(edge).second;
210 (void)inserted; // Suppress warning of unused variable under release build
211 assert(inserted && "new AddrCGEdge not added??");
212
213 srcNode->addOutgoingAddrEdge(edge);
214 dstNode->addIncomingAddrEdge(edge);
215 return edge;
216}
ConstraintEdge::ConstraintEdgeSetTy AddrCGEdgeSet
Definition ConsG.h:61
bool hasEdge(ConstraintNode *src, ConstraintNode *dst, ConstraintEdge::ConstraintEdgeK kind)
Definition ConsG.h:125
ConstraintNode * getConstraintNode(NodeID id) const
Get/add/remove constraint node.
Definition ConsG.h:104
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ addConstraintNode()

void SVF::ConstraintGraph::addConstraintNode ( ConstraintNode node,
NodeID  id 
)
inline

Definition at line 109 of file ConsG.h.

110 {
111 addGNode(id,node);
112 }
void addGNode(NodeID id, NodeType *node)
Add a Node.

◆ addCopyCGEdge()

CopyCGEdge * ConstraintGraph::addCopyCGEdge ( NodeID  src,
NodeID  dst 
)

Add Copy edge.

Add Copy edge

Definition at line 221 of file ConsG.cpp.

222{
223
227 return nullptr;
228
230
231 bool inserted = directEdgeSet.insert(edge).second;
232 (void)inserted; // Suppress warning of unused variable under release build
233 assert(inserted && "new CopyCGEdge not added??");
234
235 srcNode->addOutgoingCopyEdge(edge);
236 dstNode->addIncomingCopyEdge(edge);
237 return edge;
238}
ConstraintEdge::ConstraintEdgeSetTy directEdgeSet
Definition ConsG.h:62

◆ addLoadCGEdge()

LoadCGEdge * ConstraintGraph::addLoadCGEdge ( NodeID  src,
NodeID  dst 
)

Add Load edge.

Add Load edge

Definition at line 287 of file ConsG.cpp.

288{
292 return nullptr;
293
295
296 bool inserted = LoadCGEdgeSet.insert(edge).second;
297 (void)inserted; // Suppress warning of unused variable under release build
298 assert(inserted && "new LoadCGEdge not added??");
299
300 srcNode->addOutgoingLoadEdge(edge);
301 dstNode->addIncomingLoadEdge(edge);
302 return edge;
303}
ConstraintEdge::ConstraintEdgeSetTy LoadCGEdgeSet
Definition ConsG.h:63

◆ addNodeToBeCollapsed()

void SVF::ConstraintGraph::addNodeToBeCollapsed ( NodeID  id)
inline

Definition at line 361 of file ConsG.h.

362 {
364 }
WorkList nodesToBeCollapsed
Definition ConsG.h:58
bool push(const Data &data)
Definition WorkList.h:180

◆ addNormalGepCGEdge()

NormalGepCGEdge * ConstraintGraph::addNormalGepCGEdge ( NodeID  src,
NodeID  dst,
const AccessPath ap 
)

Add Gep edge.

Add Gep edge

Definition at line 244 of file ConsG.cpp.

245{
249 return nullptr;
250
253
254 bool inserted = directEdgeSet.insert(edge).second;
255 (void)inserted; // Suppress warning of unused variable under release build
256 assert(inserted && "new NormalGepCGEdge not added??");
257
258 srcNode->addOutgoingGepEdge(edge);
259 dstNode->addIncomingGepEdge(edge);
260 return edge;
261}

◆ addStoreCGEdge()

StoreCGEdge * ConstraintGraph::addStoreCGEdge ( NodeID  src,
NodeID  dst 
)

Add Store edge.

Add Store edge

Definition at line 308 of file ConsG.cpp.

309{
313 return nullptr;
314
316
317 bool inserted = StoreCGEdgeSet.insert(edge).second;
318 (void)inserted; // Suppress warning of unused variable under release build
319 assert(inserted && "new StoreCGEdge not added??");
320
321 srcNode->addOutgoingStoreEdge(edge);
322 dstNode->addIncomingStoreEdge(edge);
323 return edge;
324}
ConstraintEdge::ConstraintEdgeSetTy StoreCGEdgeSet
Definition ConsG.h:64

◆ addVariantGepCGEdge()

VariantGepCGEdge * ConstraintGraph::addVariantGepCGEdge ( NodeID  src,
NodeID  dst 
)

Add variant gep edge

Definition at line 266 of file ConsG.cpp.

267{
271 return nullptr;
272
274
275 bool inserted = directEdgeSet.insert(edge).second;
276 (void)inserted; // Suppress warning of unused variable under release build
277 assert(inserted && "new VariantGepCGEdge not added??");
278
279 srcNode->addOutgoingGepEdge(edge);
280 dstNode->addIncomingGepEdge(edge);
281 return edge;
282}

◆ buildCG()

void ConstraintGraph::buildCG ( )
protected

Start building constraint graph

Definition at line 40 of file ConsG.cpp.

41{
42
43 // initialize nodes
44 for(SVFIR::iterator it = pag->begin(), eit = pag->end(); it!=eit; ++it)
45 {
46 addConstraintNode(new ConstraintNode(it->first), it->first);
47 }
48
49 // initialize edges
51 for (SVFStmt::SVFStmtSetTy::iterator iter = addrs.begin(), eiter =
52 addrs.end(); iter != eiter; ++iter)
53 {
54 const AddrStmt* edge = SVFUtil::cast<AddrStmt>(*iter);
55 addAddrCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
56 }
57
59 for (SVFStmt::SVFStmtSetTy::iterator iter = copys.begin(), eiter =
60 copys.end(); iter != eiter; ++iter)
61 {
62 const CopyStmt* edge = SVFUtil::cast<CopyStmt>(*iter);
63 if(edge->isBitCast() || edge->isValueCopy())
64 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
65 }
66
68 for (SVFStmt::SVFStmtSetTy::iterator iter = phis.begin(), eiter =
69 phis.end(); iter != eiter; ++iter)
70 {
71 const PhiStmt* edge = SVFUtil::cast<PhiStmt>(*iter);
72 for(const auto opVar : edge->getOpndVars())
73 addCopyCGEdge(opVar->getId(),edge->getResID());
74 }
75
77 for (SVFStmt::SVFStmtSetTy::iterator iter = selects.begin(), eiter =
78 selects.end(); iter != eiter; ++iter)
79 {
80 const SelectStmt* edge = SVFUtil::cast<SelectStmt>(*iter);
81 for(const auto opVar : edge->getOpndVars())
82 addCopyCGEdge(opVar->getId(),edge->getResID());
83 }
84
86 for (SVFStmt::SVFStmtSetTy::iterator iter = calls.begin(), eiter =
87 calls.end(); iter != eiter; ++iter)
88 {
89 const CallPE* edge = SVFUtil::cast<CallPE>(*iter);
90 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
91 }
92
94 for (SVFStmt::SVFStmtSetTy::iterator iter = rets.begin(), eiter =
95 rets.end(); iter != eiter; ++iter)
96 {
97 const RetPE* edge = SVFUtil::cast<RetPE>(*iter);
98 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
99 }
100
102 for (SVFStmt::SVFStmtSetTy::iterator iter = tdfks.begin(), eiter =
103 tdfks.end(); iter != eiter; ++iter)
104 {
105 const TDForkPE* edge = SVFUtil::cast<TDForkPE>(*iter);
106 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
107 }
108
110 for (SVFStmt::SVFStmtSetTy::iterator iter = tdjns.begin(), eiter =
111 tdjns.end(); iter != eiter; ++iter)
112 {
113 const TDJoinPE* edge = SVFUtil::cast<TDJoinPE>(*iter);
114 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
115 }
116
118 for (SVFStmt::SVFStmtSetTy::iterator iter = ngeps.begin(), eiter =
119 ngeps.end(); iter != eiter; ++iter)
120 {
121 GepStmt* edge = SVFUtil::cast<GepStmt>(*iter);
122 if(edge->isVariantFieldGep())
123 addVariantGepCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
124 else
125 addNormalGepCGEdge(edge->getRHSVarID(),edge->getLHSVarID(),edge->getAccessPath());
126 }
127
129 for (SVFStmt::SVFStmtSetTy::iterator iter = loads.begin(), eiter =
130 loads.end(); iter != eiter; ++iter)
131 {
132 LoadStmt* edge = SVFUtil::cast<LoadStmt>(*iter);
133 addLoadCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
134 }
135
137 for (SVFStmt::SVFStmtSetTy::iterator iter = stores.begin(), eiter =
138 stores.end(); iter != eiter; ++iter)
139 {
140 StoreStmt* edge = SVFUtil::cast<StoreStmt>(*iter);
141 addStoreCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
142 }
143
145}
LoadCGEdge * addLoadCGEdge(NodeID src, NodeID dst)
Add Load edge.
Definition ConsG.cpp:287
SVFStmt::SVFStmtSetTy & getPAGEdgeSet(SVFStmt::PEDGEK kind)
Definition ConsG.h:72
AddrCGEdge * addAddrCGEdge(NodeID src, NodeID dst)
Add a SVFIR edge into Edge map.
Definition ConsG.cpp:201
void addConstraintNode(ConstraintNode *node, NodeID id)
Definition ConsG.h:109
CopyCGEdge * addCopyCGEdge(NodeID src, NodeID dst)
Add Copy edge.
Definition ConsG.cpp:221
StoreCGEdge * addStoreCGEdge(NodeID src, NodeID dst)
Add Store edge.
Definition ConsG.cpp:308
VariantGepCGEdge * addVariantGepCGEdge(NodeID src, NodeID dst)
Definition ConsG.cpp:266
NormalGepCGEdge * addNormalGepCGEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Gep edge.
Definition ConsG.cpp:244
iterator begin()
Iterators.
IDToNodeMapTy::iterator iterator
Node Iterators.
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy

◆ clearSolitaries()

void ConstraintGraph::clearSolitaries ( )
protected

Remove nodes that are neither pointers nor connected with any edge

We don't remove return SVFVar from an indirect callsite

Definition at line 150 of file ConsG.cpp.

151{
154 for(auto cs_pair : pag->getIndirectCallsites())
155 {
156 const RetICFGNode* retBlockNode = cs_pair.first->getRetICFGNode();
159 }
160
162 for (auto it = this->begin(); it != this->end(); ++it)
163 {
164 if (it->second->hasIncomingEdge() || it->second->hasOutgoingEdge())
165 continue;
166 if (pag->getSVFVar(it->first)->isPointer())
167 continue;
168 if (retFromIndCalls.find(it->first)!=retFromIndCalls.end())
169 continue;
170 nodesToRemove.insert(it->second);
171 }
172
173 for (auto node : nodesToRemove)
175}
const SVFIR::CallSiteToFunPtrMap & getIndirectCallsites() const
Wrappers for invoking SVFIR methods.
Definition ConsG.h:299
void removeConstraintNode(ConstraintNode *node)
Definition ConsG.h:118
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
Definition SVFIR.h:131
bool callsiteHasRet(const RetICFGNode *cs) const
Definition SVFIR.h:393
const SVFVar * getCallSiteRet(const RetICFGNode *cs) const
Get callsite return.
Definition SVFIR.h:387
NodeID getId() const
Get ID.
Definition SVFValue.h:160
virtual bool isPointer() const
Check if this variable represents a pointer.
Set< NodeID > NodeSet

◆ destroy()

void ConstraintGraph::destroy ( )
protected

Memory has been cleaned up at GenericGraph

Definition at line 180 of file ConsG.cpp.

181{
182}

◆ dump()

void ConstraintGraph::dump ( std::string  name)

Dump graph into dot file.

Dump constraint graph

Definition at line 590 of file ConsG.cpp.

591{
593}
const char *const name
Definition cJSON.h:264
static void WriteGraphToFile(SVF::OutStream &O, const std::string &GraphName, const GraphType &GT, bool simple=false)
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52

◆ getAddrCGEdges()

ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintGraph::getAddrCGEdges ( )
inline

Get SVFIR edge.

Get Address edges

Definition at line 191 of file ConsG.h.

192 {
193 return AddrCGEdgeSet;
194 }

◆ getAllFieldsObjVars()

NodeBS & SVF::ConstraintGraph::getAllFieldsObjVars ( NodeID  id)
inline

Definition at line 311 of file ConsG.h.

312 {
313 return pag->getAllFieldsObjVars(id);
314 }
NodeBS & getAllFieldsObjVars(const BaseObjVar *obj)
Get all fields of an object.
Definition SVFIR.cpp:558

◆ getBaseObjVarID()

NodeID SVF::ConstraintGraph::getBaseObjVarID ( NodeID  id)
inline

Definition at line 315 of file ConsG.h.

316 {
317 return pag->getBaseObjVarID(id);
318 }
NodeID getBaseObjVarID(NodeID id) const
Base and Offset methods for Value and Object node.
Definition SVFIR.h:534

◆ getBlackHoleNode()

NodeID SVF::ConstraintGraph::getBlackHoleNode ( )
inline

Definition at line 303 of file ConsG.h.

304 {
305 return pag->getBlackHoleNode();
306 }
NodeID getBlackHoleNode() const
Definition IRGraph.h:247

◆ getConstraintNode()

ConstraintNode * SVF::ConstraintGraph::getConstraintNode ( NodeID  id) const
inline

Get/add/remove constraint node.

Definition at line 104 of file ConsG.h.

105 {
106 id = sccRepNode(id);
107 return getGNode(id);
108 }
NodeID sccRepNode(NodeID id) const
SCC rep/sub nodes methods.
Definition ConsG.h:230
NodeType * getGNode(NodeID id) const
Get a node.

◆ getDirectCGEdges()

ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintGraph::getDirectCGEdges ( )
inline

Get Copy/call/ret/gep edges.

Definition at line 196 of file ConsG.h.

197 {
198 return directEdgeSet;
199 }

◆ getEdge()

ConstraintEdge * SVF::ConstraintGraph::getEdge ( ConstraintNode src,
ConstraintNode dst,
ConstraintEdge::ConstraintEdgeK  kind 
)
inline

Get an edge via its src and dst nodes and kind.

Definition at line 143 of file ConsG.h.

144 {
145 ConstraintEdge edge(src,dst,kind);
147 {
148 auto eit = directEdgeSet.find(&edge);
149 return *eit;
150 }
151 else if(kind == ConstraintEdge::Addr)
152 {
153 auto eit = AddrCGEdgeSet.find(&edge);
154 return *eit;
155 }
156 else if(kind == ConstraintEdge::Store)
157 {
158 auto eit = StoreCGEdgeSet.find(&edge);
159 return *eit;
160 }
161 else if(kind == ConstraintEdge::Load)
162 {
163 auto eit = LoadCGEdgeSet.find(&edge);
164 return *eit;
165 }
166 else
167 {
168 assert(false && "no other kind!");
169 return nullptr;
170 }
171 }

◆ getFIObjVar()

NodeID SVF::ConstraintGraph::getFIObjVar ( NodeID  id)
inline

Get a field-insensitive node of a memory object.

The fi obj in PAG must be either an existing node or merged to another rep node in ConsG

Definition at line 334 of file ConsG.h.

335 {
336 NodeID fi = pag->getFIObjVar(id);
338 assert((hasConstraintNode(fi) || sccRepNode(fi) != fi) && "non-existing fi obj??");
339 return fi;
340 }
bool hasConstraintNode(NodeID id) const
Definition ConsG.h:113
NodeID getFIObjVar(const BaseObjVar *obj) const
Get a field-insensitive obj SVFIR node according to a mem obj.
Definition SVFIR.h:504
u32_t NodeID
Definition GeneralType.h:56

◆ getGepObjVar()

NodeID SVF::ConstraintGraph::getGepObjVar ( NodeID  id,
const APOffset apOffset 
)
inline

Get a field of a memory object.

Create a node when it is (1) not exist on graph and (2) not merged

Definition at line 325 of file ConsG.h.

326 {
327 NodeID gep = pag->getGepObjVar(id, apOffset);
329 if(sccRepNode(gep)==gep && hasConstraintNode(gep)==false)
330 addConstraintNode(new ConstraintNode(gep),gep);
331 return gep;
332 }
const GepObjVar * getGepObjVar(NodeID id) const
Definition SVFIR.h:155

◆ getIndirectCallsites()

const SVFIR::CallSiteToFunPtrMap & SVF::ConstraintGraph::getIndirectCallsites ( ) const
inline

Wrappers for invoking SVFIR methods.

Definition at line 299 of file ConsG.h.

300 {
301 return pag->getIndirectCallsites();
302 }
const CallSiteToFunPtrMap & getIndirectCallsites() const
Add/get indirect callsites.
Definition SVFIR.h:433

◆ getLoadCGEdges()

ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintGraph::getLoadCGEdges ( )
inline

Get Load edges.

Definition at line 201 of file ConsG.h.

202 {
203 return LoadCGEdgeSet;
204 }

◆ getNextCollapseNode()

NodeID SVF::ConstraintGraph::getNextCollapseNode ( )
inline

Definition at line 365 of file ConsG.h.

366 {
367 return nodesToBeCollapsed.pop();
368 }

◆ getPAGEdgeSet()

SVFStmt::SVFStmtSetTy & SVF::ConstraintGraph::getPAGEdgeSet ( SVFStmt::PEDGEK  kind)
inlineprotected

Definition at line 72 of file ConsG.h.

73 {
74 return pag->getPTASVFStmtSet(kind);
75 }
SVFStmt::SVFStmtSetTy & getPTASVFStmtSet(SVFStmt::PEDGEK kind)
Get PTA edges set according to its kind.
Definition SVFIR.h:289

◆ getRep()

NodeID SVF::ConstraintGraph::getRep ( NodeID  node)
inline

Definition at line 259 of file ConsG.h.

260 {
261 return nodeToRepMap[node];
262 }
NodeToRepMap nodeToRepMap
Definition ConsG.h:56

◆ getReturnNode()

NodeID SVF::ConstraintGraph::getReturnNode ( const FunObjVar value) const
inlineprotected

Wrappers used internally, not expose to Andersen Pass.

Definition at line 79 of file ConsG.h.

80 {
81 return pag->getReturnNode(value);
82 }
NodeID getReturnNode(const FunObjVar *func) const
GetReturnNode - Return the unique node representing the return value of a function.
Definition IRGraph.cpp:60

◆ getStoreCGEdges()

ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintGraph::getStoreCGEdges ( )
inline

Get Store edges.

Definition at line 206 of file ConsG.h.

207 {
208 return StoreCGEdgeSet;
209 }

◆ getSubs()

NodeBS & SVF::ConstraintGraph::getSubs ( NodeID  node)
inline

Definition at line 255 of file ConsG.h.

256 {
257 return nodeToSubsMap[node];
258 }
NodeToSubsMap nodeToSubsMap
Definition ConsG.h:57

◆ getVarargNode()

NodeID SVF::ConstraintGraph::getVarargNode ( const FunObjVar value) const
inlineprotected

Definition at line 84 of file ConsG.h.

85 {
86 return pag->getVarargNode(value);
87 }
NodeID getVarargNode(const FunObjVar *func) const
getVarargNode - Return the unique node representing the variadic argument of a variadic function.
Definition IRGraph.cpp:67

◆ hasConstraintNode()

bool SVF::ConstraintGraph::hasConstraintNode ( NodeID  id) const
inline

Definition at line 113 of file ConsG.h.

114 {
115 id = sccRepNode(id);
116 return hasGNode(id);
117 }

◆ hasEdge()

bool SVF::ConstraintGraph::hasEdge ( ConstraintNode src,
ConstraintNode dst,
ConstraintEdge::ConstraintEdgeK  kind 
)
inline

Definition at line 125 of file ConsG.h.

126 {
127 ConstraintEdge edge(src,dst,kind);
128 if(kind == ConstraintEdge::Copy ||
130 return directEdgeSet.find(&edge) != directEdgeSet.end();
131 else if(kind == ConstraintEdge::Addr)
132 return AddrCGEdgeSet.find(&edge) != AddrCGEdgeSet.end();
133 else if(kind == ConstraintEdge::Store)
134 return StoreCGEdgeSet.find(&edge) != StoreCGEdgeSet.end();
135 else if(kind == ConstraintEdge::Load)
136 return LoadCGEdgeSet.find(&edge) != LoadCGEdgeSet.end();
137 else
138 assert(false && "no other kind!");
139 return false;
140 }

◆ hasNodesToBeCollapsed()

bool SVF::ConstraintGraph::hasNodesToBeCollapsed ( ) const
inline

Add/get nodes to be collapsed.

Definition at line 357 of file ConsG.h.

358 {
359 return (!nodesToBeCollapsed.empty());
360 }
bool empty() const
Definition WorkList.h:161

◆ isBlkObjOrConstantObj()

bool SVF::ConstraintGraph::isBlkObjOrConstantObj ( NodeID  id)
inline

Definition at line 307 of file ConsG.h.

308 {
309 return pag->isBlkObjOrConstantObj(id);
310 }
bool isBlkObjOrConstantObj(NodeID id) const
Get black hole and constant id.
Definition SVFIR.h:517

◆ isPWCNode()

bool SVF::ConstraintGraph::isPWCNode ( NodeID  nodeId)
inline

Check/Set PWC (positive weight cycle) flag.

Definition at line 345 of file ConsG.h.

346 {
348 }
bool isPWCNode() const
Whether a node involves in PWC, if so, all its points-to elements should become field-insensitive.
Definition ConsGNode.h:81

◆ isSingleFieldObj()

bool SVF::ConstraintGraph::isSingleFieldObj ( NodeID  id) const
inline

Definition at line 319 of file ConsG.h.

320 {
321 const BaseObjVar* baseObj = pag->getBaseObject(id);
322 return (baseObj->getMaxFieldOffsetLimit() == 1);
323 }
const BaseObjVar * getBaseObject(NodeID id) const
Definition SVFIR.h:478

◆ isZeroOffsettedGepCGEdge()

bool SVF::ConstraintGraph::isZeroOffsettedGepCGEdge ( ConstraintEdge edge) const
inline

Check if a given edge is a NormalGepCGEdge with 0 offset.

Definition at line 289 of file ConsG.h.

290 {
291 if (NormalGepCGEdge *normalGepCGEdge = SVFUtil::dyn_cast<NormalGepCGEdge>(edge))
292 if (0 == normalGepCGEdge->getConstantFieldIdx())
293 return true;
294 return false;
295 }

◆ moveEdgesToRepNode()

bool SVF::ConstraintGraph::moveEdgesToRepNode ( ConstraintNode node,
ConstraintNode rep 
)
inline

Move incoming/outgoing direct edges of a sub node to its rep node Return TRUE if there's a gep edge inside this SCC (PWC).

Definition at line 281 of file ConsG.h.

282 {
283 bool gepIn = moveInEdgesToRepNode(node, rep);
284 bool gepOut = moveOutEdgesToRepNode(node, rep);
285 return (gepIn || gepOut);
286 }
bool moveInEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
Definition ConsG.cpp:473
bool moveOutEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
Definition ConsG.cpp:531

◆ moveInEdgesToRepNode()

bool ConstraintGraph::moveInEdgesToRepNode ( ConstraintNode node,
ConstraintNode rep 
)

Move incoming direct edges of a sub node which is outside the SCC to its rep node Remove incoming direct edges of a sub node which is inside the SCC from its rep node Return TRUE if there's a gep edge inside this SCC (PWC).

Move incoming direct edges of a sub node which is outside SCC to its rep node Remove incoming direct edges of a sub node which is inside SCC from its rep node

only copy and gep edge can be removed

Definition at line 473 of file ConsG.cpp.

474{
475 std::vector<ConstraintEdge*> sccEdges;
476 std::vector<ConstraintEdge*> nonSccEdges;
477 for (ConstraintNode::const_iterator it = node->InEdgeBegin(), eit = node->InEdgeEnd(); it != eit;
478 ++it)
479 {
481 if(sccRepNode(subInEdge->getSrcID()) != rep->getId())
482 nonSccEdges.push_back(subInEdge);
483 else
484 {
485 sccEdges.push_back(subInEdge);
486 }
487 }
488 // if this edge is outside scc, then re-target edge dst to rep
489 while(!nonSccEdges.empty())
490 {
492 nonSccEdges.pop_back();
494 }
495
496 bool criticalGepInsideSCC = false;
497 // if this edge is inside scc, then remove this edge and two end nodes
498 while(!sccEdges.empty())
499 {
500 ConstraintEdge* edge = sccEdges.back();
501 sccEdges.pop_back();
503 if(SVFUtil::isa<CopyCGEdge>(edge))
505 else if (SVFUtil::isa<GepCGEdge>(edge))
506 {
507 // If the GEP is critical (i.e. may have a non-zero offset),
508 // then it brings impact on field-sensitivity.
510 {
512 }
514 }
515 else if(SVFUtil::isa<LoadCGEdge, StoreCGEdge>(edge))
517 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
518 {
520 }
521 else
522 assert(false && "no such edge");
523 }
525}
void reTargetDstOfEdge(ConstraintEdge *edge, ConstraintNode *newDstNode)
Used for cycle elimination.
Definition ConsG.cpp:334
void removeDirectEdge(ConstraintEdge *edge)
Remove direct edge from their src and dst edge sets.
Definition ConsG.cpp:458
void removeAddrEdge(AddrCGEdge *edge)
Remove addr edge from their src and dst edge sets.
Definition ConsG.cpp:419
bool isZeroOffsettedGepCGEdge(ConstraintEdge *edge) const
Check if a given edge is a NormalGepCGEdge with 0 offset.
Definition ConsG.h:289
ConstraintEdge::ConstraintEdgeSetTy::const_iterator const_iterator
Definition ConsGNode.h:45
iterator InEdgeBegin()
iterator InEdgeEnd()

◆ moveOutEdgesToRepNode()

bool ConstraintGraph::moveOutEdgesToRepNode ( ConstraintNode node,
ConstraintNode rep 
)

Move outgoing direct edges of a sub node which is outside the SCC to its rep node Remove outgoing direct edges of sub node which is inside the SCC from its rep node Return TRUE if there's a gep edge inside this SCC (PWC).

Move outgoing direct edges of a sub node which is outside SCC to its rep node Remove outgoing direct edges of a sub node which is inside SCC from its rep node

only copy and gep edge can be removed

Definition at line 531 of file ConsG.cpp.

532{
533
534 std::vector<ConstraintEdge*> sccEdges;
535 std::vector<ConstraintEdge*> nonSccEdges;
536
537 for (ConstraintNode::const_iterator it = node->OutEdgeBegin(), eit = node->OutEdgeEnd(); it != eit;
538 ++it)
539 {
541 if(sccRepNode(subOutEdge->getDstID()) != rep->getId())
542 nonSccEdges.push_back(subOutEdge);
543 else
544 {
545 sccEdges.push_back(subOutEdge);
546 }
547 }
548 // if this edge is outside scc, then re-target edge src to rep
549 while(!nonSccEdges.empty())
550 {
552 nonSccEdges.pop_back();
554 }
555 bool criticalGepInsideSCC = false;
556 // if this edge is inside scc, then remove this edge and two end nodes
557 while(!sccEdges.empty())
558 {
559 ConstraintEdge* edge = sccEdges.back();
560 sccEdges.pop_back();
562 if(SVFUtil::isa<CopyCGEdge>(edge))
564 else if (SVFUtil::isa<GepCGEdge>(edge))
565 {
566 // If the GEP is critical (i.e. may have a non-zero offset),
567 // then it brings impact on field-sensitivity.
569 {
571 }
573 }
574 else if(SVFUtil::isa<LoadCGEdge, StoreCGEdge>(edge))
576 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
577 {
579 }
580 else
581 assert(false && "no such edge");
582 }
584}
void reTargetSrcOfEdge(ConstraintEdge *edge, ConstraintNode *newSrcNode)
Remove edge from old src target, change edge dst id and add modified edge into new src.
Definition ConsG.cpp:378
iterator OutEdgeEnd()
iterator OutEdgeBegin()
iterators

◆ print()

void ConstraintGraph::print ( )

Print CG into terminal.

Print this constraint graph including its nodes and edges

Definition at line 598 of file ConsG.cpp.

599{
600
601 outs() << "-----------------ConstraintGraph--------------------------------------\n";
602
604 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = addrs.begin(),
605 eiter = addrs.end(); iter != eiter; ++iter)
606 {
607 outs() << (*iter)->getSrcID() << " -- Addr --> " << (*iter)->getDstID()
608 << "\n";
609 }
610
612 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = directs.begin(),
613 eiter = directs.end(); iter != eiter; ++iter)
614 {
615 if (CopyCGEdge* copy = SVFUtil::dyn_cast<CopyCGEdge>(*iter))
616 {
617 outs() << copy->getSrcID() << " -- Copy --> " << copy->getDstID()
618 << "\n";
619 }
620 else if (NormalGepCGEdge* ngep = SVFUtil::dyn_cast<NormalGepCGEdge>(*iter))
621 {
622 outs() << ngep->getSrcID() << " -- NormalGep (" << ngep->getConstantFieldIdx()
623 << ") --> " << ngep->getDstID() << "\n";
624 }
625 else if (VariantGepCGEdge* vgep = SVFUtil::dyn_cast<VariantGepCGEdge>(*iter))
626 {
627 outs() << vgep->getSrcID() << " -- VarintGep --> "
628 << vgep->getDstID() << "\n";
629 }
630 else
631 assert(false && "wrong constraint edge kind!");
632 }
633
635 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = loads.begin(),
636 eiter = loads.end(); iter != eiter; ++iter)
637 {
638 outs() << (*iter)->getSrcID() << " -- Load --> " << (*iter)->getDstID()
639 << "\n";
640 }
641
643 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = stores.begin(),
644 eiter = stores.end(); iter != eiter; ++iter)
645 {
646 outs() << (*iter)->getSrcID() << " -- Store --> " << (*iter)->getDstID()
647 << "\n";
648 }
649
650 outs()
651 << "--------------------------------------------------------------\n";
652
653}
copy vgep
Definition PAGGrammar.txt:9
copy
Definition cJSON.cpp:414
GenericNode< ConstraintNode, ConstraintEdge >::GEdgeSetTy ConstraintEdgeSetTy
Constraint edge type.
Definition ConsGEdge.h:85
ConstraintEdge::ConstraintEdgeSetTy & getStoreCGEdges()
Get Store edges.
Definition ConsG.h:206
ConstraintEdge::ConstraintEdgeSetTy & getDirectCGEdges()
Get Copy/call/ret/gep edges.
Definition ConsG.h:196
ConstraintEdge::ConstraintEdgeSetTy & getLoadCGEdges()
Get Load edges.
Definition ConsG.h:201
ConstraintEdge::ConstraintEdgeSetTy & getAddrCGEdges()
Get SVFIR edge.
Definition ConsG.h:191

◆ removeAddrEdge()

void ConstraintGraph::removeAddrEdge ( AddrCGEdge edge)

Remove addr edge from their src and dst edge sets.

Remove addr edge from their src and dst edge sets

Definition at line 419 of file ConsG.cpp.

420{
423 u32_t num = AddrCGEdgeSet.erase(edge);
424 (void)num; // Suppress warning of unused variable under release build
425 assert(num && "edge not in the set, can not remove!!!");
426 delete edge;
427}
unsigned u32_t
Definition CommandLine.h:18
bool removeIncomingAddrEdge(AddrCGEdge *inEdge)
Definition ConsGNode.h:314
bool removeOutgoingAddrEdge(AddrCGEdge *outEdge)
Remove constraint graph edges.
Definition ConsGNode.h:305

◆ removeConstraintNode()

void SVF::ConstraintGraph::removeConstraintNode ( ConstraintNode node)
inline

Definition at line 118 of file ConsG.h.

119 {
120 removeGNode(node);
121 }
void removeGNode(NodeType *node)
Delete a node.

◆ removeDirectEdge()

void ConstraintGraph::removeDirectEdge ( ConstraintEdge edge)

Remove direct edge from their src and dst edge sets.

Remove edges from their src and dst edge sets

Definition at line 458 of file ConsG.cpp.

459{
460
463 u32_t num = directEdgeSet.erase(edge);
464 (void)num; // Suppress warning of unused variable under release build
465 assert(num && "edge not in the set, can not remove!!!");
466 delete edge;
467}
bool removeOutgoingDirectEdge(ConstraintEdge *outEdge)
Definition ConsGNode.h:323
bool removeIncomingDirectEdge(ConstraintEdge *inEdge)
Definition ConsGNode.h:336

◆ removeLoadEdge()

void ConstraintGraph::removeLoadEdge ( LoadCGEdge edge)

Remove load edge from their src and dst edge sets.

Remove load edge from their src and dst edge sets

Definition at line 432 of file ConsG.cpp.

433{
436 u32_t num = LoadCGEdgeSet.erase(edge);
437 (void)num; // Suppress warning of unused variable under release build
438 assert(num && "edge not in the set, can not remove!!!");
439 delete edge;
440}
bool removeOutgoingLoadEdge(LoadCGEdge *outEdge)
Definition ConsGNode.h:349
bool removeIncomingLoadEdge(LoadCGEdge *inEdge)
Definition ConsGNode.h:358

◆ removeStoreEdge()

void ConstraintGraph::removeStoreEdge ( StoreCGEdge edge)

Remove store edge from their src and dst edge sets.

Remove store edge from their src and dst edge sets

Definition at line 445 of file ConsG.cpp.

446{
449 u32_t num = StoreCGEdgeSet.erase(edge);
450 (void)num; // Suppress warning of unused variable under release build
451 assert(num && "edge not in the set, can not remove!!!");
452 delete edge;
453}
bool removeOutgoingStoreEdge(StoreCGEdge *outEdge)
Definition ConsGNode.h:367
bool removeIncomingStoreEdge(StoreCGEdge *inEdge)
Definition ConsGNode.h:376

◆ resetRep()

void SVF::ConstraintGraph::resetRep ( NodeID  node)
inline

Definition at line 263 of file ConsG.h.

264 {
265 nodeToRepMap.erase(node);
266 }

◆ resetSubs()

void SVF::ConstraintGraph::resetSubs ( NodeID  node)
inline

Definition at line 251 of file ConsG.h.

252 {
253 nodeToSubsMap.erase(node);
254 }

◆ reTargetDstOfEdge()

void ConstraintGraph::reTargetDstOfEdge ( ConstraintEdge edge,
ConstraintNode newDstNode 
)

Used for cycle elimination.

Remove edge from old dst target, change edge dst id and add modified edge into new dst

Re-target dst node of an edge

(1) Remove edge from old dst target, (2) Change edge dst id and (3) Add modified edge into new dst

Definition at line 334 of file ConsG.cpp.

335{
336 NodeID newDstNodeID = newDstNode->getId();
337 NodeID srcId = edge->getSrcID();
338 if(LoadCGEdge* load = SVFUtil::dyn_cast<LoadCGEdge>(edge))
339 {
340 removeLoadEdge(load);
342 }
343 else if(StoreCGEdge* store = SVFUtil::dyn_cast<StoreCGEdge>(edge))
344 {
345 removeStoreEdge(store);
347 }
348 else if(CopyCGEdge* copy = SVFUtil::dyn_cast<CopyCGEdge>(edge))
349 {
352 }
353 else if(NormalGepCGEdge* gep = SVFUtil::dyn_cast<NormalGepCGEdge>(edge))
354 {
355 const AccessPath ap = gep->getAccessPath();
358 }
359 else if(VariantGepCGEdge* gep = SVFUtil::dyn_cast<VariantGepCGEdge>(edge))
360 {
363 }
364 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
365 {
367 }
368 else
369 assert(false && "no other edge type!!");
370}
void removeLoadEdge(LoadCGEdge *edge)
Remove load edge from their src and dst edge sets.
Definition ConsG.cpp:432
void removeStoreEdge(StoreCGEdge *edge)
Remove store edge from their src and dst edge sets.
Definition ConsG.cpp:445

◆ reTargetSrcOfEdge()

void ConstraintGraph::reTargetSrcOfEdge ( ConstraintEdge edge,
ConstraintNode newSrcNode 
)

Remove edge from old src target, change edge dst id and add modified edge into new src.

Re-target src node of an edge (1) Remove edge from old src target, (2) Change edge src id and (3) Add modified edge into new src

Definition at line 378 of file ConsG.cpp.

379{
380 NodeID newSrcNodeID = newSrcNode->getId();
381 NodeID dstId = edge->getDstID();
382 if(LoadCGEdge* load = SVFUtil::dyn_cast<LoadCGEdge>(edge))
383 {
384 removeLoadEdge(load);
386 }
387 else if(StoreCGEdge* store = SVFUtil::dyn_cast<StoreCGEdge>(edge))
388 {
389 removeStoreEdge(store);
391 }
392 else if(CopyCGEdge* copy = SVFUtil::dyn_cast<CopyCGEdge>(edge))
393 {
396 }
397 else if(NormalGepCGEdge* gep = SVFUtil::dyn_cast<NormalGepCGEdge>(edge))
398 {
399 const AccessPath ap = gep->getAccessPath();
402 }
403 else if(VariantGepCGEdge* gep = SVFUtil::dyn_cast<VariantGepCGEdge>(edge))
404 {
407 }
408 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
409 {
411 }
412 else
413 assert(false && "no other edge type!!");
414}

◆ sccRepNode()

NodeID SVF::ConstraintGraph::sccRepNode ( NodeID  id) const
inline

SCC rep/sub nodes methods.

Definition at line 230 of file ConsG.h.

231 {
232 NodeToRepMap::const_iterator it = nodeToRepMap.find(id);
233 if(it==nodeToRepMap.end())
234 return id;
235 else
236 return it->second;
237 }

◆ sccSubNodes()

NodeBS & SVF::ConstraintGraph::sccSubNodes ( NodeID  id)
inline

Definition at line 238 of file ConsG.h.

239 {
240 nodeToSubsMap[id].set(id);
241 return nodeToSubsMap[id];
242 }

◆ setPWCNode()

void SVF::ConstraintGraph::setPWCNode ( NodeID  nodeId)
inline

Definition at line 349 of file ConsG.h.

350 {
352 }

◆ setRep()

void SVF::ConstraintGraph::setRep ( NodeID  node,
NodeID  rep 
)
inline

Definition at line 243 of file ConsG.h.

244 {
245 nodeToRepMap[node] = rep;
246 }

◆ setSubs()

void SVF::ConstraintGraph::setSubs ( NodeID  node,
NodeBS subs 
)
inline

Definition at line 247 of file ConsG.h.

248 {
249 nodeToSubsMap[node] |= subs;
250 }

◆ view()

void ConstraintGraph::view ( )

View graph from the debugger.

View dot graph of Constraint graph from debugger.

Definition at line 658 of file ConsG.cpp.

659{
660 SVF::ViewGraph(this, "Constraint Graph");
661}
void ViewGraph(const GraphType &G, const std::string &name, bool ShortNames=false, GraphProgram::Name Program=GraphProgram::DOT)

Member Data Documentation

◆ AddrCGEdgeSet

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintGraph::AddrCGEdgeSet
protected

Definition at line 61 of file ConsG.h.

◆ directEdgeSet

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintGraph::directEdgeSet
protected

Definition at line 62 of file ConsG.h.

◆ edgeIndex

EdgeID SVF::ConstraintGraph::edgeIndex
protected

Definition at line 59 of file ConsG.h.

◆ LoadCGEdgeSet

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintGraph::LoadCGEdgeSet
protected

Definition at line 63 of file ConsG.h.

◆ nodesToBeCollapsed

WorkList SVF::ConstraintGraph::nodesToBeCollapsed
protected

Definition at line 58 of file ConsG.h.

◆ nodeToRepMap

NodeToRepMap SVF::ConstraintGraph::nodeToRepMap
protected

Definition at line 56 of file ConsG.h.

◆ nodeToSubsMap

NodeToSubsMap SVF::ConstraintGraph::nodeToSubsMap
protected

Definition at line 57 of file ConsG.h.

◆ pag

SVFIR* SVF::ConstraintGraph::pag
protected

Definition at line 55 of file ConsG.h.

◆ StoreCGEdgeSet

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintGraph::StoreCGEdgeSet
protected

Definition at line 64 of file ConsG.h.


The documentation for this class was generated from the following files: