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::SVFStmtSetTygetSVFStmtSet (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 204 of file ConsG.cpp.

205{
209 return nullptr;
211
212 bool inserted = AddrCGEdgeSet.insert(edge).second;
213 (void)inserted; // Suppress warning of unused variable under release build
214 assert(inserted && "new AddrCGEdge not added??");
215
216 srcNode->addOutgoingAddrEdge(edge);
217 dstNode->addIncomingAddrEdge(edge);
218 return edge;
219}
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:76

◆ 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 224 of file ConsG.cpp.

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

◆ addLoadCGEdge()

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

Add Load edge.

Add Load edge

Definition at line 290 of file ConsG.cpp.

291{
295 return nullptr;
296
298
299 bool inserted = LoadCGEdgeSet.insert(edge).second;
300 (void)inserted; // Suppress warning of unused variable under release build
301 assert(inserted && "new LoadCGEdge not added??");
302
303 srcNode->addOutgoingLoadEdge(edge);
304 dstNode->addIncomingLoadEdge(edge);
305 return edge;
306}
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 247 of file ConsG.cpp.

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

◆ addStoreCGEdge()

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

Add Store edge.

Add Store edge

Definition at line 311 of file ConsG.cpp.

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

◆ addVariantGepCGEdge()

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

Add variant gep edge

Definition at line 269 of file ConsG.cpp.

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

◆ 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* callPE = SVFUtil::cast<CallPE>(*iter);
90 for(u32_t i = 0; i < callPE->getOpVarNum(); i++)
91 addCopyCGEdge(callPE->getOpVarID(i), callPE->getResID());
92 }
93
95 for (SVFStmt::SVFStmtSetTy::iterator iter = rets.begin(), eiter =
96 rets.end(); iter != eiter; ++iter)
97 {
98 const RetPE* edge = SVFUtil::cast<RetPE>(*iter);
99 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
100 }
101
103 for (SVFStmt::SVFStmtSetTy::iterator iter = tdfks.begin(), eiter =
104 tdfks.end(); iter != eiter; ++iter)
105 {
106 const TDForkPE* forkPE = SVFUtil::cast<TDForkPE>(*iter);
107 for(u32_t i = 0; i < forkPE->getOpVarNum(); i++)
108 addCopyCGEdge(forkPE->getOpVarID(i), forkPE->getResID());
109 }
110
112 for (SVFStmt::SVFStmtSetTy::iterator iter = tdjns.begin(), eiter =
113 tdjns.end(); iter != eiter; ++iter)
114 {
115 const TDJoinPE* edge = SVFUtil::cast<TDJoinPE>(*iter);
116 addCopyCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
117 }
118
120 for (SVFStmt::SVFStmtSetTy::iterator iter = ngeps.begin(), eiter =
121 ngeps.end(); iter != eiter; ++iter)
122 {
123 GepStmt* edge = SVFUtil::cast<GepStmt>(*iter);
124 if(edge->isVariantFieldGep())
125 addVariantGepCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
126 else
127 addNormalGepCGEdge(edge->getRHSVarID(),edge->getLHSVarID(),edge->getAccessPath());
128 }
129
131 for (SVFStmt::SVFStmtSetTy::iterator iter = loads.begin(), eiter =
132 loads.end(); iter != eiter; ++iter)
133 {
134 LoadStmt* edge = SVFUtil::cast<LoadStmt>(*iter);
135 addLoadCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
136 }
137
139 for (SVFStmt::SVFStmtSetTy::iterator iter = stores.begin(), eiter =
140 stores.end(); iter != eiter; ++iter)
141 {
142 StoreStmt* edge = SVFUtil::cast<StoreStmt>(*iter);
143 addStoreCGEdge(edge->getRHSVarID(),edge->getLHSVarID());
144 }
145
147}
unsigned u32_t
Definition CommandLine.h:18
LoadCGEdge * addLoadCGEdge(NodeID src, NodeID dst)
Add Load edge.
Definition ConsG.cpp:290
AddrCGEdge * addAddrCGEdge(NodeID src, NodeID dst)
Add a SVFIR edge into Edge map.
Definition ConsG.cpp:204
void addConstraintNode(ConstraintNode *node, NodeID id)
Definition ConsG.h:109
CopyCGEdge * addCopyCGEdge(NodeID src, NodeID dst)
Add Copy edge.
Definition ConsG.cpp:224
StoreCGEdge * addStoreCGEdge(NodeID src, NodeID dst)
Add Store edge.
Definition ConsG.cpp:311
VariantGepCGEdge * addVariantGepCGEdge(NodeID src, NodeID dst)
Definition ConsG.cpp:269
SVFStmt::SVFStmtSetTy & getSVFStmtSet(SVFStmt::PEDGEK kind)
Definition ConsG.h:72
NormalGepCGEdge * addNormalGepCGEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Gep edge.
Definition ConsG.cpp:247
iterator begin()
Iterators.
IDToNodeMapTy::iterator iterator
Node Iterators.
NodeID getOpVarID(u32_t pos) const
NodeID getResID() const
u32_t getOpVarNum() const
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 152 of file ConsG.cpp.

153{
156 for(auto cs_pair : pag->getIndirectCallsites())
157 {
158 const RetICFGNode* retBlockNode = cs_pair.first->getRetICFGNode();
161 }
162
164 for (auto it = this->begin(); it != this->end(); ++it)
165 {
166 if (it->second->hasIncomingEdge() || it->second->hasOutgoingEdge())
167 continue;
168 if (pag->getSVFVar(it->first)->isPointer())
169 continue;
170 if (retFromIndCalls.find(it->first)!=retFromIndCalls.end())
171 continue;
172 nodesToRemove.insert(it->second);
173 }
174
175 for (auto node : nodesToRemove)
177}
const SVFIR::CallSiteToFunPtrMap & getIndirectCallsites() const
Wrappers for invoking SVFIR methods.
Definition ConsG.h:299
void removeConstraintNode(ConstraintNode *node)
Definition ConsG.h:118
const ValVar * getCallSiteRet(const RetICFGNode *cs) const
Get callsite return.
Definition SVFIR.h:405
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
Definition SVFIR.h:133
bool callsiteHasRet(const RetICFGNode *cs) const
Definition SVFIR.h:411
NodeID getId() const
Get ID.
Definition SVFValue.h:163
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 182 of file ConsG.cpp.

183{
184}

◆ dump()

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

Dump graph into dot file.

Dump constraint graph

Definition at line 593 of file ConsG.cpp.

594{
596}
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:572

◆ 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:552

◆ 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:522
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:167

◆ 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:451

◆ 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 }

◆ 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

◆ getSVFStmtSet()

SVFStmt::SVFStmtSetTy & SVF::ConstraintGraph::getSVFStmtSet ( 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:301

◆ 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:535

◆ 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:496

◆ 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:476
bool moveOutEdgesToRepNode(ConstraintNode *node, ConstraintNode *rep)
Definition ConsG.cpp:534

◆ 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 476 of file ConsG.cpp.

477{
478 std::vector<ConstraintEdge*> sccEdges;
479 std::vector<ConstraintEdge*> nonSccEdges;
480 for (ConstraintNode::const_iterator it = node->InEdgeBegin(), eit = node->InEdgeEnd(); it != eit;
481 ++it)
482 {
484 if(sccRepNode(subInEdge->getSrcID()) != rep->getId())
485 nonSccEdges.push_back(subInEdge);
486 else
487 {
488 sccEdges.push_back(subInEdge);
489 }
490 }
491 // if this edge is outside scc, then re-target edge dst to rep
492 while(!nonSccEdges.empty())
493 {
495 nonSccEdges.pop_back();
497 }
498
499 bool criticalGepInsideSCC = false;
500 // if this edge is inside scc, then remove this edge and two end nodes
501 while(!sccEdges.empty())
502 {
503 ConstraintEdge* edge = sccEdges.back();
504 sccEdges.pop_back();
506 if(SVFUtil::isa<CopyCGEdge>(edge))
508 else if (SVFUtil::isa<GepCGEdge>(edge))
509 {
510 // If the GEP is critical (i.e. may have a non-zero offset),
511 // then it brings impact on field-sensitivity.
513 {
515 }
517 }
518 else if(SVFUtil::isa<LoadCGEdge, StoreCGEdge>(edge))
520 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
521 {
523 }
524 else
525 assert(false && "no such edge");
526 }
528}
void reTargetDstOfEdge(ConstraintEdge *edge, ConstraintNode *newDstNode)
Used for cycle elimination.
Definition ConsG.cpp:337
void removeDirectEdge(ConstraintEdge *edge)
Remove direct edge from their src and dst edge sets.
Definition ConsG.cpp:461
void removeAddrEdge(AddrCGEdge *edge)
Remove addr edge from their src and dst edge sets.
Definition ConsG.cpp:422
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 534 of file ConsG.cpp.

535{
536
537 std::vector<ConstraintEdge*> sccEdges;
538 std::vector<ConstraintEdge*> nonSccEdges;
539
540 for (ConstraintNode::const_iterator it = node->OutEdgeBegin(), eit = node->OutEdgeEnd(); it != eit;
541 ++it)
542 {
544 if(sccRepNode(subOutEdge->getDstID()) != rep->getId())
545 nonSccEdges.push_back(subOutEdge);
546 else
547 {
548 sccEdges.push_back(subOutEdge);
549 }
550 }
551 // if this edge is outside scc, then re-target edge src to rep
552 while(!nonSccEdges.empty())
553 {
555 nonSccEdges.pop_back();
557 }
558 bool criticalGepInsideSCC = false;
559 // if this edge is inside scc, then remove this edge and two end nodes
560 while(!sccEdges.empty())
561 {
562 ConstraintEdge* edge = sccEdges.back();
563 sccEdges.pop_back();
565 if(SVFUtil::isa<CopyCGEdge>(edge))
567 else if (SVFUtil::isa<GepCGEdge>(edge))
568 {
569 // If the GEP is critical (i.e. may have a non-zero offset),
570 // then it brings impact on field-sensitivity.
572 {
574 }
576 }
577 else if(SVFUtil::isa<LoadCGEdge, StoreCGEdge>(edge))
579 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
580 {
582 }
583 else
584 assert(false && "no such edge");
585 }
587}
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:381
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 601 of file ConsG.cpp.

602{
603
604 outs() << "-----------------ConstraintGraph--------------------------------------\n";
605
607 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = addrs.begin(),
608 eiter = addrs.end(); iter != eiter; ++iter)
609 {
610 outs() << (*iter)->getSrcID() << " -- Addr --> " << (*iter)->getDstID()
611 << "\n";
612 }
613
615 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = directs.begin(),
616 eiter = directs.end(); iter != eiter; ++iter)
617 {
618 if (CopyCGEdge* copy = SVFUtil::dyn_cast<CopyCGEdge>(*iter))
619 {
620 outs() << copy->getSrcID() << " -- Copy --> " << copy->getDstID()
621 << "\n";
622 }
623 else if (NormalGepCGEdge* ngep = SVFUtil::dyn_cast<NormalGepCGEdge>(*iter))
624 {
625 outs() << ngep->getSrcID() << " -- NormalGep (" << ngep->getConstantFieldIdx()
626 << ") --> " << ngep->getDstID() << "\n";
627 }
628 else if (VariantGepCGEdge* vgep = SVFUtil::dyn_cast<VariantGepCGEdge>(*iter))
629 {
630 outs() << vgep->getSrcID() << " -- VarintGep --> "
631 << vgep->getDstID() << "\n";
632 }
633 else
634 assert(false && "wrong constraint edge kind!");
635 }
636
638 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = loads.begin(),
639 eiter = loads.end(); iter != eiter; ++iter)
640 {
641 outs() << (*iter)->getSrcID() << " -- Load --> " << (*iter)->getDstID()
642 << "\n";
643 }
644
646 for (ConstraintEdge::ConstraintEdgeSetTy::iterator iter = stores.begin(),
647 eiter = stores.end(); iter != eiter; ++iter)
648 {
649 outs() << (*iter)->getSrcID() << " -- Store --> " << (*iter)->getDstID()
650 << "\n";
651 }
652
653 outs()
654 << "--------------------------------------------------------------\n";
655
656}
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 422 of file ConsG.cpp.

423{
426 u32_t num = AddrCGEdgeSet.erase(edge);
427 (void)num; // Suppress warning of unused variable under release build
428 assert(num && "edge not in the set, can not remove!!!");
429 delete edge;
430}
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 461 of file ConsG.cpp.

462{
463
466 u32_t num = directEdgeSet.erase(edge);
467 (void)num; // Suppress warning of unused variable under release build
468 assert(num && "edge not in the set, can not remove!!!");
469 delete edge;
470}
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 435 of file ConsG.cpp.

436{
439 u32_t num = LoadCGEdgeSet.erase(edge);
440 (void)num; // Suppress warning of unused variable under release build
441 assert(num && "edge not in the set, can not remove!!!");
442 delete edge;
443}
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 448 of file ConsG.cpp.

449{
452 u32_t num = StoreCGEdgeSet.erase(edge);
453 (void)num; // Suppress warning of unused variable under release build
454 assert(num && "edge not in the set, can not remove!!!");
455 delete edge;
456}
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 337 of file ConsG.cpp.

338{
339 NodeID newDstNodeID = newDstNode->getId();
340 NodeID srcId = edge->getSrcID();
341 if(LoadCGEdge* load = SVFUtil::dyn_cast<LoadCGEdge>(edge))
342 {
343 removeLoadEdge(load);
345 }
346 else if(StoreCGEdge* store = SVFUtil::dyn_cast<StoreCGEdge>(edge))
347 {
348 removeStoreEdge(store);
350 }
351 else if(CopyCGEdge* copy = SVFUtil::dyn_cast<CopyCGEdge>(edge))
352 {
355 }
356 else if(NormalGepCGEdge* gep = SVFUtil::dyn_cast<NormalGepCGEdge>(edge))
357 {
358 const AccessPath ap = gep->getAccessPath();
361 }
362 else if(VariantGepCGEdge* gep = SVFUtil::dyn_cast<VariantGepCGEdge>(edge))
363 {
366 }
367 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
368 {
370 }
371 else
372 assert(false && "no other edge type!!");
373}
void removeLoadEdge(LoadCGEdge *edge)
Remove load edge from their src and dst edge sets.
Definition ConsG.cpp:435
void removeStoreEdge(StoreCGEdge *edge)
Remove store edge from their src and dst edge sets.
Definition ConsG.cpp:448

◆ 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 381 of file ConsG.cpp.

382{
383 NodeID newSrcNodeID = newSrcNode->getId();
384 NodeID dstId = edge->getDstID();
385 if(LoadCGEdge* load = SVFUtil::dyn_cast<LoadCGEdge>(edge))
386 {
387 removeLoadEdge(load);
389 }
390 else if(StoreCGEdge* store = SVFUtil::dyn_cast<StoreCGEdge>(edge))
391 {
392 removeStoreEdge(store);
394 }
395 else if(CopyCGEdge* copy = SVFUtil::dyn_cast<CopyCGEdge>(edge))
396 {
399 }
400 else if(NormalGepCGEdge* gep = SVFUtil::dyn_cast<NormalGepCGEdge>(edge))
401 {
402 const AccessPath ap = gep->getAccessPath();
405 }
406 else if(VariantGepCGEdge* gep = SVFUtil::dyn_cast<VariantGepCGEdge>(edge))
407 {
410 }
411 else if(AddrCGEdge* addr = SVFUtil::dyn_cast<AddrCGEdge>(edge))
412 {
414 }
415 else
416 assert(false && "no other edge type!!");
417}

◆ 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 661 of file ConsG.cpp.

662{
663 SVF::ViewGraph(this, "Constraint Graph");
664}
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: