Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::ConstraintNode Class Reference

#include <ConsGNode.h>

Inheritance diagram for SVF::ConstraintNode:
SVF::GenericNode< ConstraintNode, ConstraintEdge > SVF::SVFValue

Public Types

typedef ConstraintEdge::ConstraintEdgeSetTy::iterator iterator
typedef ConstraintEdge::ConstraintEdgeSetTy::const_iterator const_iterator
Public Types inherited from SVF::GenericNode< ConstraintNode, ConstraintEdge >
typedef ConstraintNode NodeType
typedef ConstraintEdge EdgeType
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
 Edge kind.
typedef GEdgeSetTy::iterator iterator
typedef GEdgeSetTy::const_iterator const_iterator
Public Types inherited from SVF::SVFValue
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , ArgValNode ,
  FunValNode , GepValNode , RetValNode , VarargValNode ,
  GlobalValNode , ConstDataValNode , BlackHoleValNode , ConstFPValNode ,
  ConstIntValNode , ConstNullptrValNode , DummyValNode , IntrinsicValNode ,
  AsmPCValNode , ObjNode , GepObjNode , BaseObjNode ,
  FunObjNode , HeapObjNode , StackObjNode , GlobalObjNode ,
  ConstDataObjNode , ConstFPObjNode , ConstIntObjNode , ConstNullptrObjNode ,
  DummyObjNode , Cmp , BinaryOp , UnaryOp ,
  Branch , DummyVProp , NPtr , FRet ,
  ARet , AParm , FParm , Addr ,
  Copy , Gep , Store , Load ,
  TPhi , TIntraPhi , TInterPhi , FPIN ,
  FPOUT , APIN , APOUT , MPhi ,
  MIntraPhi , MInterPhi , CallNodeKd , CDNodeKd ,
  CFLNodeKd , CHNodeKd , ConstraintNodeKd , TCTNodeKd ,
  BasicBlockKd , OtherKd
}

Public Member Functions

 ConstraintNode (NodeID i)
bool isPWCNode () const
 Whether a node involves in PWC, if so, all its points-to elements should become field-insensitive.
void setPWCNode ()
bool isdirectEdge (ConstraintEdge::ConstraintEdgeK kind)
 Direct and Indirect SVFIR edges.
bool isIndirectEdge (ConstraintEdge::ConstraintEdgeK kind)
const ConstraintEdge::ConstraintEdgeSetTy & getDirectInEdges () const
 Return constraint edges.
const ConstraintEdge::ConstraintEdgeSetTy & getDirectOutEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getCopyInEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getCopyOutEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getGepInEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getGepOutEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getLoadInEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getLoadOutEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getStoreInEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getStoreOutEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getAddrInEdges () const
const ConstraintEdge::ConstraintEdgeSetTy & getAddrOutEdges () const
iterator directOutEdgeBegin ()
 Iterators.
iterator directOutEdgeEnd ()
iterator directInEdgeBegin ()
iterator directInEdgeEnd ()
const_iterator directOutEdgeBegin () const
const_iterator directOutEdgeEnd () const
const_iterator directInEdgeBegin () const
const_iterator directInEdgeEnd () const
ConstraintEdge::ConstraintEdgeSetTy & incomingAddrEdges ()
ConstraintEdge::ConstraintEdgeSetTy & outgoingAddrEdges ()
const_iterator outgoingAddrsBegin () const
const_iterator outgoingAddrsEnd () const
const_iterator incomingAddrsBegin () const
const_iterator incomingAddrsEnd () const
const_iterator outgoingLoadsBegin () const
const_iterator outgoingLoadsEnd () const
const_iterator incomingLoadsBegin () const
const_iterator incomingLoadsEnd () const
const_iterator outgoingStoresBegin () const
const_iterator outgoingStoresEnd () const
const_iterator incomingStoresBegin () const
const_iterator incomingStoresEnd () const
void addIncomingCopyEdge (CopyCGEdge *inEdge)
 Add constraint graph edges.
void addIncomingGepEdge (GepCGEdge *inEdge)
void addOutgoingCopyEdge (CopyCGEdge *outEdge)
void addOutgoingGepEdge (GepCGEdge *outEdge)
void addIncomingAddrEdge (AddrCGEdge *inEdge)
void addIncomingLoadEdge (LoadCGEdge *inEdge)
void addIncomingStoreEdge (StoreCGEdge *inEdge)
bool addIncomingDirectEdge (ConstraintEdge *inEdge)
void addOutgoingAddrEdge (AddrCGEdge *outEdge)
bool addOutgoingLoadEdge (LoadCGEdge *outEdge)
bool addOutgoingStoreEdge (StoreCGEdge *outEdge)
bool addOutgoingDirectEdge (ConstraintEdge *outEdge)
bool removeOutgoingAddrEdge (AddrCGEdge *outEdge)
 Remove constraint graph edges.
bool removeIncomingAddrEdge (AddrCGEdge *inEdge)
bool removeOutgoingDirectEdge (ConstraintEdge *outEdge)
bool removeIncomingDirectEdge (ConstraintEdge *inEdge)
bool removeOutgoingLoadEdge (LoadCGEdge *outEdge)
bool removeIncomingLoadEdge (LoadCGEdge *inEdge)
bool removeOutgoingStoreEdge (StoreCGEdge *outEdge)
bool removeIncomingStoreEdge (StoreCGEdge *inEdge)
virtual const std::string toString () const
Public Member Functions inherited from SVF::GenericNode< ConstraintNode, ConstraintEdge >
 GenericNode (NodeID i, GNodeK k, const SVFType *svfType=nullptr)
 Constructor.
virtual ~GenericNode ()
 Destructor.
bool hasIncomingEdge () const
 Has incoming/outgoing edge set.
bool hasOutgoingEdge () const
iterator OutEdgeBegin ()
 iterators
iterator OutEdgeEnd ()
iterator InEdgeBegin ()
iterator InEdgeEnd ()
const_iterator OutEdgeBegin () const
const_iterator OutEdgeEnd () const
const_iterator InEdgeBegin () const
const_iterator InEdgeEnd () const
bool addIncomingEdge (EdgeType *inEdge)
 Add incoming and outgoing edges.
bool addOutgoingEdge (EdgeType *outEdge)
EdgeType * hasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges.
EdgeType * hasOutgoingEdge (EdgeType *edge) const
const GEdgeSetTy & getOutEdges () const
const GEdgeSetTy & getInEdges () const
u32_t removeIncomingEdge (EdgeType *edge)
u32_t removeOutgoingEdge (EdgeType *edge)
Public Member Functions inherited from SVF::SVFValue
 SVFValue (NodeID i, GNodeK k, const SVFType *ty=nullptr)
NodeID getId () const
 Get ID.
GNodeK getNodeKind () const
 Get node kind.
virtual const SVFType * getType () const
virtual void setName (const std::string &nameInfo)
virtual void setName (std::string &&nameInfo)
virtual const std::string & getName () const
virtual void setSourceLoc (const std::string &sourceCodeInfo)
virtual const std::string getSourceLoc () const
const std::string valueOnlyToString () const
const bool hasLLVMValue () const

Static Public Member Functions

static bool classof (const ConstraintNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof (const GenericICFGNodeTy *node)
static bool classof (const SVFValue *node)
Static Public Member Functions inherited from SVF::GenericNode< ConstraintNode, ConstraintEdge >
static bool classof (const GenericNode< ConstraintNode, ConstraintEdge > *)
static bool classof (const SVFValue *)

Public Attributes

bool _isPWCNode
NodeBS strides
 For stride-based field representation.
NodeBS baseIds

Private Attributes

ConstraintEdge::ConstraintEdgeSetTy loadInEdges
 all incoming load edge of this node
ConstraintEdge::ConstraintEdgeSetTy loadOutEdges
 all outgoing load edge of this node
ConstraintEdge::ConstraintEdgeSetTy storeInEdges
 all incoming store edge of this node
ConstraintEdge::ConstraintEdgeSetTy storeOutEdges
 all outgoing store edge of this node
ConstraintEdge::ConstraintEdgeSetTy directInEdges
ConstraintEdge::ConstraintEdgeSetTy directOutEdges
ConstraintEdge::ConstraintEdgeSetTy copyInEdges
ConstraintEdge::ConstraintEdgeSetTy copyOutEdges
ConstraintEdge::ConstraintEdgeSetTy gepInEdges
ConstraintEdge::ConstraintEdgeSetTy gepOutEdges
ConstraintEdge::ConstraintEdgeSetTy addressInEdges
 all incoming address edge of this node
ConstraintEdge::ConstraintEdgeSetTy addressOutEdges
 all outgoing address edge of this node

Friends

OutStream & operator<< (OutStream &o, const ConstraintNode &node)
 Overloading operator << for dumping node.

Additional Inherited Members

Static Protected Member Functions inherited from SVF::SVFValue
static bool isICFGNodeKinds (GNodeK n)
 Helper functions to check node kinds.
static bool isInterICFGNodeKind (GNodeK n)
static bool isSVFVarKind (GNodeK n)
static bool isValVarKinds (GNodeK n)
static bool isConstantDataValVar (GNodeK n)
static bool isObjVarKinds (GNodeK n)
static bool isBaseObjVarKinds (GNodeK n)
static bool isConstantDataObjVarKinds (GNodeK n)
static bool isVFGNodeKinds (GNodeK n)
static bool isArgumentVFGNodeKinds (GNodeK n)
static bool isStmtVFGNodeKinds (GNodeK n)
static bool isPHIVFGNodeKinds (GNodeK n)
static bool isMRSVFGNodeKinds (GNodeK n)
static bool isMSSAPHISVFGNodeKinds (GNodeK n)
Protected Attributes inherited from SVF::SVFValue
NodeID id
 Node ID.
GNodeK nodeKind
 Node kind.
const SVFType * type
 SVF type.
std::string name
std::string sourceLoc
 Source code information of this value.

Detailed Description

Definition at line 40 of file ConsGNode.h.

Member Typedef Documentation

◆ const_iterator

typedef ConstraintEdge::ConstraintEdgeSetTy::const_iterator SVF::ConstraintNode::const_iterator

Definition at line 45 of file ConsGNode.h.

◆ iterator

typedef ConstraintEdge::ConstraintEdgeSetTy::iterator SVF::ConstraintNode::iterator

Definition at line 44 of file ConsGNode.h.

Constructor & Destructor Documentation

◆ ConstraintNode()

SVF::ConstraintNode::ConstraintNode ( NodeID i)
inline

Definition at line 74 of file ConsGNode.h.

75 {
76
77 }
GenericNode< ConstraintNode, ConstraintEdge > GenericConsNodeTy
Definition ConsGNode.h:39

Member Function Documentation

◆ addIncomingAddrEdge()

void SVF::ConstraintNode::addIncomingAddrEdge ( AddrCGEdge * inEdge)
inline

Definition at line 247 of file ConsGNode.h.

248 {
249 addressInEdges.insert(inEdge);
250 addIncomingEdge(inEdge);
251 }
ConstraintEdge::ConstraintEdgeSetTy addressInEdges
all incoming address edge of this node
Definition ConsGNode.h:66

◆ addIncomingCopyEdge()

void SVF::ConstraintNode::addIncomingCopyEdge ( CopyCGEdge * inEdge)
inline

Add constraint graph edges.

Definition at line 227 of file ConsGNode.h.

228 {
229 addIncomingDirectEdge(inEdge);
230 copyInEdges.insert(inEdge);
231 }
bool addIncomingDirectEdge(ConstraintEdge *inEdge)
Definition ConsGNode.h:262
ConstraintEdge::ConstraintEdgeSetTy copyInEdges
Definition ConsGNode.h:60

◆ addIncomingDirectEdge()

bool SVF::ConstraintNode::addIncomingDirectEdge ( ConstraintEdge * inEdge)
inline

Definition at line 262 of file ConsGNode.h.

263 {
264 assert(inEdge->getDstID() == this->getId());
265 bool added1 = directInEdges.insert(inEdge).second;
266 bool added2 = addIncomingEdge(inEdge);
267 bool both_added = added1 & added2;
268 assert(both_added && "edge not added, duplicated adding!!");
269 return both_added;
270 }
ConstraintEdge::ConstraintEdgeSetTy directInEdges
Definition ConsGNode.h:57

◆ addIncomingGepEdge()

void SVF::ConstraintNode::addIncomingGepEdge ( GepCGEdge * inEdge)
inline

Definition at line 232 of file ConsGNode.h.

233 {
234 addIncomingDirectEdge(inEdge);
235 gepInEdges.insert(inEdge);
236 }
ConstraintEdge::ConstraintEdgeSetTy gepInEdges
Definition ConsGNode.h:63

◆ addIncomingLoadEdge()

void SVF::ConstraintNode::addIncomingLoadEdge ( LoadCGEdge * inEdge)
inline

Definition at line 252 of file ConsGNode.h.

253 {
254 loadInEdges.insert(inEdge);
255 addIncomingEdge(inEdge);
256 }
ConstraintEdge::ConstraintEdgeSetTy loadInEdges
all incoming load edge of this node
Definition ConsGNode.h:49

◆ addIncomingStoreEdge()

void SVF::ConstraintNode::addIncomingStoreEdge ( StoreCGEdge * inEdge)
inline

Definition at line 257 of file ConsGNode.h.

258 {
259 storeInEdges.insert(inEdge);
260 addIncomingEdge(inEdge);
261 }
ConstraintEdge::ConstraintEdgeSetTy storeInEdges
all incoming store edge of this node
Definition ConsGNode.h:52

◆ addOutgoingAddrEdge()

void SVF::ConstraintNode::addOutgoingAddrEdge ( AddrCGEdge * outEdge)
inline

Definition at line 271 of file ConsGNode.h.

272 {
273 addressOutEdges.insert(outEdge);
274 addOutgoingEdge(outEdge);
275 }
ConstraintEdge::ConstraintEdgeSetTy addressOutEdges
all outgoing address edge of this node
Definition ConsGNode.h:67

◆ addOutgoingCopyEdge()

void SVF::ConstraintNode::addOutgoingCopyEdge ( CopyCGEdge * outEdge)
inline

Definition at line 237 of file ConsGNode.h.

238 {
239 addOutgoingDirectEdge(outEdge);
240 copyOutEdges.insert(outEdge);
241 }
ConstraintEdge::ConstraintEdgeSetTy copyOutEdges
Definition ConsGNode.h:61
bool addOutgoingDirectEdge(ConstraintEdge *outEdge)
Definition ConsGNode.h:292

◆ addOutgoingDirectEdge()

bool SVF::ConstraintNode::addOutgoingDirectEdge ( ConstraintEdge * outEdge)
inline

Definition at line 292 of file ConsGNode.h.

293 {
294 assert(outEdge->getSrcID() == this->getId());
295 bool added1 = directOutEdges.insert(outEdge).second;
296 bool added2 = addOutgoingEdge(outEdge);
297 bool both_added = added1 & added2;
298 assert(both_added && "edge not added, duplicated adding!!");
299 return both_added;
300 }
ConstraintEdge::ConstraintEdgeSetTy directOutEdges
Definition ConsGNode.h:58

◆ addOutgoingGepEdge()

void SVF::ConstraintNode::addOutgoingGepEdge ( GepCGEdge * outEdge)
inline

Definition at line 242 of file ConsGNode.h.

243 {
244 addOutgoingDirectEdge(outEdge);
245 gepOutEdges.insert(outEdge);
246 }
ConstraintEdge::ConstraintEdgeSetTy gepOutEdges
Definition ConsGNode.h:64

◆ addOutgoingLoadEdge()

bool SVF::ConstraintNode::addOutgoingLoadEdge ( LoadCGEdge * outEdge)
inline

Definition at line 276 of file ConsGNode.h.

277 {
278 bool added1 = loadOutEdges.insert(outEdge).second;
279 bool added2 = addOutgoingEdge(outEdge);
280 bool both_added = added1 & added2;
281 assert(both_added && "edge not added, duplicated adding!!");
282 return both_added;
283 }
ConstraintEdge::ConstraintEdgeSetTy loadOutEdges
all outgoing load edge of this node
Definition ConsGNode.h:50

◆ addOutgoingStoreEdge()

bool SVF::ConstraintNode::addOutgoingStoreEdge ( StoreCGEdge * outEdge)
inline

Definition at line 284 of file ConsGNode.h.

285 {
286 bool added1 = storeOutEdges.insert(outEdge).second;
287 bool added2 = addOutgoingEdge(outEdge);
288 bool both_added = added1 & added2;
289 assert(both_added && "edge not added, duplicated adding!!");
290 return both_added;
291 }
ConstraintEdge::ConstraintEdgeSetTy storeOutEdges
all outgoing store edge of this node
Definition ConsGNode.h:53

◆ classof() [1/3]

bool SVF::ConstraintNode::classof ( const ConstraintNode * )
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 399 of file ConsGNode.h.

400 {
401 return true;
402 }

◆ classof() [2/3]

bool SVF::ConstraintNode::classof ( const GenericICFGNodeTy * node)
inlinestatic

Definition at line 404 of file ConsGNode.h.

405 {
406 return node->getNodeKind() == ConstraintNodeKd;
407 }

◆ classof() [3/3]

bool SVF::ConstraintNode::classof ( const SVFValue * node)
inlinestatic

Definition at line 409 of file ConsGNode.h.

410 {
411 return node->getNodeKind() == ConstraintNodeKd;
412 }

◆ directInEdgeBegin() [1/2]

ConstraintNode::iterator ConstraintNode::directInEdgeBegin ( )
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 686 of file ConsG.cpp.

687{
688 if (Options::DetectPWC())
689 return directInEdges.begin();
690 else
691 return copyInEdges.begin();
692}
static Option< bool > DetectPWC
Definition Options.h:208

◆ directInEdgeBegin() [2/2]

ConstraintNode::const_iterator ConstraintNode::directInEdgeBegin ( ) const
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 718 of file ConsG.cpp.

719{
720 if (Options::DetectPWC())
721 return directInEdges.begin();
722 else
723 return copyInEdges.begin();
724}

◆ directInEdgeEnd() [1/2]

ConstraintNode::iterator ConstraintNode::directInEdgeEnd ( )
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 694 of file ConsG.cpp.

695{
696 if (Options::DetectPWC())
697 return directInEdges.end();
698 else
699 return copyInEdges.end();
700}

◆ directInEdgeEnd() [2/2]

ConstraintNode::const_iterator ConstraintNode::directInEdgeEnd ( ) const
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 726 of file ConsG.cpp.

727{
728 if (Options::DetectPWC())
729 return directInEdges.end();
730 else
731 return copyInEdges.end();
732}

◆ directOutEdgeBegin() [1/2]

ConstraintNode::iterator ConstraintNode::directOutEdgeBegin ( )
virtual

Iterators.

Iterators of direct edges for ConsGNode.

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 670 of file ConsG.cpp.

671{
672 if (Options::DetectPWC())
673 return directOutEdges.begin();
674 else
675 return copyOutEdges.begin();
676}

◆ directOutEdgeBegin() [2/2]

ConstraintNode::const_iterator ConstraintNode::directOutEdgeBegin ( ) const
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 702 of file ConsG.cpp.

703{
704 if (Options::DetectPWC())
705 return directOutEdges.begin();
706 else
707 return copyOutEdges.begin();
708}

◆ directOutEdgeEnd() [1/2]

ConstraintNode::iterator ConstraintNode::directOutEdgeEnd ( )
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 678 of file ConsG.cpp.

679{
680 if (Options::DetectPWC())
681 return directOutEdges.end();
682 else
683 return copyOutEdges.end();
684}

◆ directOutEdgeEnd() [2/2]

ConstraintNode::const_iterator ConstraintNode::directOutEdgeEnd ( ) const
virtual

Reimplemented from SVF::GenericNode< ConstraintNode, ConstraintEdge >.

Definition at line 710 of file ConsG.cpp.

711{
712 if (Options::DetectPWC())
713 return directOutEdges.end();
714 else
715 return copyOutEdges.end();
716}

◆ getAddrInEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getAddrInEdges ( ) const
inline

Definition at line 143 of file ConsGNode.h.

144 {
145 return addressInEdges;
146 }

◆ getAddrOutEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getAddrOutEdges ( ) const
inline

Definition at line 147 of file ConsGNode.h.

148 {
149 return addressOutEdges;
150 }

◆ getCopyInEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getCopyInEdges ( ) const
inline

Definition at line 111 of file ConsGNode.h.

112 {
113 return copyInEdges;
114 }

◆ getCopyOutEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getCopyOutEdges ( ) const
inline

Definition at line 115 of file ConsGNode.h.

116 {
117 return copyOutEdges;
118 }

◆ getDirectInEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getDirectInEdges ( ) const
inline

Return constraint edges.

Definition at line 103 of file ConsGNode.h.

104 {
105 return directInEdges;
106 }

◆ getDirectOutEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getDirectOutEdges ( ) const
inline

Definition at line 107 of file ConsGNode.h.

108 {
109 return directOutEdges;
110 }

◆ getGepInEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getGepInEdges ( ) const
inline

Definition at line 119 of file ConsGNode.h.

120 {
121 return gepInEdges;
122 }

◆ getGepOutEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getGepOutEdges ( ) const
inline

Definition at line 123 of file ConsGNode.h.

124 {
125 return gepOutEdges;
126 }

◆ getLoadInEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getLoadInEdges ( ) const
inline

Definition at line 127 of file ConsGNode.h.

128 {
129 return loadInEdges;
130 }

◆ getLoadOutEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getLoadOutEdges ( ) const
inline

Definition at line 131 of file ConsGNode.h.

132 {
133 return loadOutEdges;
134 }

◆ getStoreInEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getStoreInEdges ( ) const
inline

Definition at line 135 of file ConsGNode.h.

136 {
137 return storeInEdges;
138 }

◆ getStoreOutEdges()

const ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::getStoreOutEdges ( ) const
inline

Definition at line 139 of file ConsGNode.h.

140 {
141 return storeOutEdges;
142 }

◆ incomingAddrEdges()

ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::incomingAddrEdges ( )
inline

Definition at line 164 of file ConsGNode.h.

165 {
166 return addressInEdges;
167 }

◆ incomingAddrsBegin()

const_iterator SVF::ConstraintNode::incomingAddrsBegin ( ) const
inline

Definition at line 181 of file ConsGNode.h.

182 {
183 return addressInEdges.begin();
184 }

◆ incomingAddrsEnd()

const_iterator SVF::ConstraintNode::incomingAddrsEnd ( ) const
inline

Definition at line 185 of file ConsGNode.h.

186 {
187 return addressInEdges.end();
188 }

◆ incomingLoadsBegin()

const_iterator SVF::ConstraintNode::incomingLoadsBegin ( ) const
inline

Definition at line 198 of file ConsGNode.h.

199 {
200 return loadInEdges.begin();
201 }

◆ incomingLoadsEnd()

const_iterator SVF::ConstraintNode::incomingLoadsEnd ( ) const
inline

Definition at line 202 of file ConsGNode.h.

203 {
204 return loadInEdges.end();
205 }

◆ incomingStoresBegin()

const_iterator SVF::ConstraintNode::incomingStoresBegin ( ) const
inline

Definition at line 215 of file ConsGNode.h.

216 {
217 return storeInEdges.begin();
218 }

◆ incomingStoresEnd()

const_iterator SVF::ConstraintNode::incomingStoresEnd ( ) const
inline

Definition at line 219 of file ConsGNode.h.

220 {
221 return storeInEdges.end();
222 }

◆ isdirectEdge()

bool SVF::ConstraintNode::isdirectEdge ( ConstraintEdge::ConstraintEdgeK kind)
inline

Direct and Indirect SVFIR edges.

Definition at line 92 of file ConsGNode.h.

◆ isIndirectEdge()

bool SVF::ConstraintNode::isIndirectEdge ( ConstraintEdge::ConstraintEdgeK kind)
inline

Definition at line 96 of file ConsGNode.h.

97 {
98 return (kind == ConstraintEdge::Load || kind == ConstraintEdge::Store);
99 }

◆ isPWCNode()

bool SVF::ConstraintNode::isPWCNode ( ) const
inline

Whether a node involves in PWC, if so, all its points-to elements should become field-insensitive.

Definition at line 81 of file ConsGNode.h.

82 {
83 return _isPWCNode;
84 }

◆ outgoingAddrEdges()

ConstraintEdge::ConstraintEdgeSetTy & SVF::ConstraintNode::outgoingAddrEdges ( )
inline

Definition at line 168 of file ConsGNode.h.

169 {
170 return addressOutEdges;
171 }

◆ outgoingAddrsBegin()

const_iterator SVF::ConstraintNode::outgoingAddrsBegin ( ) const
inline

Definition at line 173 of file ConsGNode.h.

174 {
175 return addressOutEdges.begin();
176 }

◆ outgoingAddrsEnd()

const_iterator SVF::ConstraintNode::outgoingAddrsEnd ( ) const
inline

Definition at line 177 of file ConsGNode.h.

178 {
179 return addressOutEdges.end();
180 }

◆ outgoingLoadsBegin()

const_iterator SVF::ConstraintNode::outgoingLoadsBegin ( ) const
inline

Definition at line 190 of file ConsGNode.h.

191 {
192 return loadOutEdges.begin();
193 }

◆ outgoingLoadsEnd()

const_iterator SVF::ConstraintNode::outgoingLoadsEnd ( ) const
inline

Definition at line 194 of file ConsGNode.h.

195 {
196 return loadOutEdges.end();
197 }

◆ outgoingStoresBegin()

const_iterator SVF::ConstraintNode::outgoingStoresBegin ( ) const
inline

Definition at line 207 of file ConsGNode.h.

208 {
209 return storeOutEdges.begin();
210 }

◆ outgoingStoresEnd()

const_iterator SVF::ConstraintNode::outgoingStoresEnd ( ) const
inline

Definition at line 211 of file ConsGNode.h.

212 {
213 return storeOutEdges.end();
214 }

◆ removeIncomingAddrEdge()

bool SVF::ConstraintNode::removeIncomingAddrEdge ( AddrCGEdge * inEdge)
inline

Definition at line 314 of file ConsGNode.h.

315 {
316 u32_t num1 = addressInEdges.erase(inEdge);
317 u32_t num2 = removeIncomingEdge(inEdge);
318 bool removed = (num1 > 0) & (num2 > 0);
319 assert(removed && "edge not in the set, can not remove!!!");
320 return removed;
321 }
unsigned u32_t
Definition GeneralType.h:67

◆ removeIncomingDirectEdge()

bool SVF::ConstraintNode::removeIncomingDirectEdge ( ConstraintEdge * inEdge)
inline

Definition at line 336 of file ConsGNode.h.

337 {
338 if (SVFUtil::isa<GepCGEdge>(inEdge))
339 gepInEdges.erase(inEdge);
340 else
341 copyInEdges.erase(inEdge);
342 u32_t num1 = directInEdges.erase(inEdge);
343 u32_t num2 = removeIncomingEdge(inEdge);
344 bool removed = (num1 > 0) & (num2 > 0);
345 assert(removed && "edge not in the set, can not remove!!!");
346 return removed;
347 }
LLVM_NODISCARD bool isa(const Y &Val)
Definition Casting.h:241

◆ removeIncomingLoadEdge()

bool SVF::ConstraintNode::removeIncomingLoadEdge ( LoadCGEdge * inEdge)
inline

Definition at line 358 of file ConsGNode.h.

359 {
360 u32_t num1 = loadInEdges.erase(inEdge);
361 u32_t num2 = removeIncomingEdge(inEdge);
362 bool removed = (num1 > 0) & (num2 > 0);
363 assert(removed && "edge not in the set, can not remove!!!");
364 return removed;
365 }

◆ removeIncomingStoreEdge()

bool SVF::ConstraintNode::removeIncomingStoreEdge ( StoreCGEdge * inEdge)
inline

Definition at line 376 of file ConsGNode.h.

377 {
378 u32_t num1 = storeInEdges.erase(inEdge);
379 u32_t num2 = removeIncomingEdge(inEdge);
380 bool removed = (num1 > 0) & (num2 > 0);
381 assert(removed && "edge not in the set, can not remove!!!");
382 return removed;
383 }

◆ removeOutgoingAddrEdge()

bool SVF::ConstraintNode::removeOutgoingAddrEdge ( AddrCGEdge * outEdge)
inline

Remove constraint graph edges.

Definition at line 305 of file ConsGNode.h.

306 {
307 u32_t num1 = addressOutEdges.erase(outEdge);
308 u32_t num2 = removeOutgoingEdge(outEdge);
309 bool removed = (num1 > 0) & (num2 > 0);
310 assert(removed && "edge not in the set, can not remove!!!");
311 return removed;
312 }

◆ removeOutgoingDirectEdge()

bool SVF::ConstraintNode::removeOutgoingDirectEdge ( ConstraintEdge * outEdge)
inline

Definition at line 323 of file ConsGNode.h.

324 {
325 if (SVFUtil::isa<GepCGEdge>(outEdge))
326 gepOutEdges.erase(outEdge);
327 else
328 copyOutEdges.erase(outEdge);
329 u32_t num1 = directOutEdges.erase(outEdge);
330 u32_t num2 = removeOutgoingEdge(outEdge);
331 bool removed = (num1 > 0) & (num2 > 0);
332 assert(removed && "edge not in the set, can not remove!!!");
333 return removed;
334 }

◆ removeOutgoingLoadEdge()

bool SVF::ConstraintNode::removeOutgoingLoadEdge ( LoadCGEdge * outEdge)
inline

Definition at line 349 of file ConsGNode.h.

350 {
351 u32_t num1 = loadOutEdges.erase(outEdge);
352 u32_t num2 = removeOutgoingEdge(outEdge);
353 bool removed = (num1 > 0) & (num2 > 0);
354 assert(removed && "edge not in the set, can not remove!!!");
355 return removed;
356 }

◆ removeOutgoingStoreEdge()

bool SVF::ConstraintNode::removeOutgoingStoreEdge ( StoreCGEdge * outEdge)
inline

Definition at line 367 of file ConsGNode.h.

368 {
369 u32_t num1 = storeOutEdges.erase(outEdge);
370 u32_t num2 = removeOutgoingEdge(outEdge);
371 bool removed = (num1 > 0) & (num2 > 0);
372 assert(removed && "edge not in the set, can not remove!!!");
373 return removed;
374 }

◆ setPWCNode()

void SVF::ConstraintNode::setPWCNode ( )
inline

Definition at line 85 of file ConsGNode.h.

86 {
87 _isPWCNode = true;
88 }

◆ toString()

const std::string ConstraintNode::toString ( ) const
virtual

Definition at line 735 of file ConsG.cpp.

736{
737 return SVFIR::getPAG()->getSVFVar(getId())->toString();
738}
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
Definition SVFIR.h:136
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
Definition SVFIR.h:121
NodeID getId() const
Get ID.
Definition SVFValue.h:158
virtual const std::string toString() const
Get string representation.

◆ operator<<

OutStream & operator<< ( OutStream & o,
const ConstraintNode & node )
friend

Overloading operator << for dumping node.

Definition at line 390 of file ConsGNode.h.

391 {
392 o << node.toString();
393 return o;
394 }

Member Data Documentation

◆ _isPWCNode

bool SVF::ConstraintNode::_isPWCNode

Definition at line 46 of file ConsGNode.h.

◆ addressInEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::addressInEdges
private

all incoming address edge of this node

Definition at line 66 of file ConsGNode.h.

◆ addressOutEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::addressOutEdges
private

all outgoing address edge of this node

Definition at line 67 of file ConsGNode.h.

◆ baseIds

NodeBS SVF::ConstraintNode::baseIds

Definition at line 72 of file ConsGNode.h.

◆ copyInEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::copyInEdges
private

Definition at line 60 of file ConsGNode.h.

◆ copyOutEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::copyOutEdges
private

Definition at line 61 of file ConsGNode.h.

◆ directInEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::directInEdges
private

Copy/call/ret/gep incoming edge of this node, To be noted: this set is only used when SCC detection, and node merges

Definition at line 57 of file ConsGNode.h.

◆ directOutEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::directOutEdges
private

Definition at line 58 of file ConsGNode.h.

◆ gepInEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::gepInEdges
private

Definition at line 63 of file ConsGNode.h.

◆ gepOutEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::gepOutEdges
private

Definition at line 64 of file ConsGNode.h.

◆ loadInEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::loadInEdges
private

all incoming load edge of this node

Definition at line 49 of file ConsGNode.h.

◆ loadOutEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::loadOutEdges
private

all outgoing load edge of this node

Definition at line 50 of file ConsGNode.h.

◆ storeInEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::storeInEdges
private

all incoming store edge of this node

Definition at line 52 of file ConsGNode.h.

◆ storeOutEdges

ConstraintEdge::ConstraintEdgeSetTy SVF::ConstraintNode::storeOutEdges
private

all outgoing store edge of this node

Definition at line 53 of file ConsGNode.h.

◆ strides

NodeBS SVF::ConstraintNode::strides

For stride-based field representation.

Definition at line 71 of file ConsGNode.h.


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