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

#include <CHG.h>

Inheritance diagram for SVF::CHNode:
SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFBaseNode

Public Types

enum  CLASSATTR { PURE_ABSTRACT = 0x1 , MULTI_INHERITANCE = 0x2 , TEMPLATE = 0x04 }
 
typedef std::vector< const SVFFunction * > FuncVector
 
- Public Types inherited from SVF::GenericNode< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy 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::SVFBaseNode
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , FunValNode ,
  GepValNode , RetNode , VarargNode , GlobalValNode ,
  ConstantDataValNode , BlackHoleNode , ConstantFPValNode , ConstantIntValNode ,
  ConstantNullptrValNode , DummyValNode , ObjNode , GepObjNode ,
  BaseObjNode , FunObjNode , HeapObjNode , StackObjNode ,
  GlobalObjNode , ConstantDataObjNode , ConstantFPObjNode , ConstantIntObjNode ,
  ConstantNullptrObjNode , 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 , DCHNodeKd , OtherKd
}
 

Public Member Functions

 CHNode (const std::string &name, NodeID i=0, GNodeK k=CHNodeKd)
 
 ~CHNode ()
 
std::string getName () const
 
void setFlag (CLASSATTR mask)
 Flags.
 
bool hasFlag (CLASSATTR mask) const
 
void setPureAbstract ()
 Attribute.
 
void setMultiInheritance ()
 
void setTemplate ()
 
bool isPureAbstract () const
 
bool isMultiInheritance () const
 
bool isTemplate () const
 
void addVirtualFunctionVector (FuncVector vfuncvec)
 
const std::vector< FuncVector > & getVirtualFunctionVectors () const
 
void getVirtualFunctions (u32_t idx, FuncVector &virtualFunctions) const
 
const SVFGlobalValuegetVTable () const
 
void setVTable (const SVFGlobalValue *vtbl)
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 GenericNode (NodeID i, GNodeK k)
 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
 
virtual iterator directOutEdgeBegin ()
 Iterators used for SCC detection, overwrite it in child class if necessary.
 
virtual iterator directOutEdgeEnd ()
 
virtual iterator directInEdgeBegin ()
 
virtual iterator directInEdgeEnd ()
 
virtual const_iterator directOutEdgeBegin () const
 
virtual const_iterator directOutEdgeEnd () const
 
virtual const_iterator directInEdgeBegin () const
 
virtual const_iterator directInEdgeEnd () const
 
bool addIncomingEdge (EdgeType *inEdge)
 Add incoming and outgoing edges.
 
bool addOutgoingEdge (EdgeType *outEdge)
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges.
 
EdgeTypehasOutgoingEdge (EdgeType *edge) const
 
const GEdgeSetTygetOutEdges () const
 
const GEdgeSetTygetInEdges () const
 
u32_t removeIncomingEdge (EdgeType *edge)
 
u32_t removeOutgoingEdge (EdgeType *edge)
 
- Public Member Functions inherited from SVF::SVFBaseNode
 SVFBaseNode (NodeID i, GNodeK k, SVFType *ty=nullptr)
 
NodeID getId () const
 Get ID.
 
GNodeK getNodeKind () const
 Get node kind.
 
virtual const SVFTypegetType () const
 
virtual void setSourceLoc (const std::string &sourceCodeInfo)
 
virtual const std::string getSourceLoc () const
 
const std::string valueOnlyToString () const
 

Static Public Member Functions

static bool classof (const CHNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 
static bool classof (const GenericCHNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFBaseNode *)
 

Private Attributes

const SVFGlobalValuevtable
 
std::string className
 
size_t flags
 
std::vector< FuncVectorvirtualFunctionVectors
 

Friends

class SVFIRWriter
 
class SVFIRReader
 

Additional Inherited Members

- Static Protected Member Functions inherited from SVF::SVFBaseNode
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::SVFBaseNode
NodeID id
 Node ID.
 
GNodeK nodeKind
 Node kind.
 
const SVFTypetype
 SVF type.
 
std::string sourceLoc
 Source code information of this value.
 

Detailed Description

Definition at line 108 of file CHG.h.

Member Typedef Documentation

◆ FuncVector

Definition at line 121 of file CHG.h.

Member Enumeration Documentation

◆ CLASSATTR

Enumerator
PURE_ABSTRACT 
MULTI_INHERITANCE 
TEMPLATE 

Definition at line 114 of file CHG.h.

115 {
116 PURE_ABSTRACT = 0x1, // pure virtual abstract class
117 MULTI_INHERITANCE = 0x2, // multi inheritance class
118 TEMPLATE = 0x04 // template class
119 } CLASSATTR;
@ TEMPLATE
Definition CHG.h:118
@ PURE_ABSTRACT
Definition CHG.h:116
@ MULTI_INHERITANCE
Definition CHG.h:117

Constructor & Destructor Documentation

◆ CHNode()

SVF::CHNode::CHNode ( const std::string &  name,
NodeID  i = 0,
GNodeK  k = CHNodeKd 
)
inline

Definition at line 123 of file CHG.h.

123 :
124 GenericCHNodeTy(i, k), vtable(nullptr), className(name), flags(0)
125 {
126 }
const char *const name
Definition cJSON.h:264
const SVFGlobalValue * vtable
Definition CHG.h:213
size_t flags
Definition CHG.h:215
std::string className
Definition CHG.h:214
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
GenericNode< CHNode, CHEdge > GenericCHNodeTy
Definition CHG.h:107

◆ ~CHNode()

SVF::CHNode::~CHNode ( )
inline

Definition at line 127 of file CHG.h.

128 {
129 }

Member Function Documentation

◆ addVirtualFunctionVector()

void SVF::CHNode::addVirtualFunctionVector ( FuncVector  vfuncvec)
inline

Definition at line 174 of file CHG.h.

175 {
177 }
std::vector< FuncVector > virtualFunctionVectors
Definition CHG.h:228

◆ classof() [1/3]

static bool SVF::CHNode::classof ( const CHNode )
inlinestatic

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

Definition at line 196 of file CHG.h.

197 {
198 return true;
199 }

◆ classof() [2/3]

static bool SVF::CHNode::classof ( const GenericCHNodeTy node)
inlinestatic

Definition at line 201 of file CHG.h.

202 {
203 return node->getNodeKind() == CHNodeKd;
204 }

◆ classof() [3/3]

static bool SVF::CHNode::classof ( const SVFBaseNode node)
inlinestatic

Definition at line 206 of file CHG.h.

207 {
208 return node->getNodeKind() == CHNodeKd;
209 }

◆ getName()

std::string SVF::CHNode::getName ( ) const
inline

Definition at line 130 of file CHG.h.

131 {
132 return className;
133 }

◆ getVirtualFunctions()

void CHNode::getVirtualFunctions ( u32_t  idx,
FuncVector virtualFunctions 
) const

Definition at line 208 of file CHG.cpp.

209{
211 eit = virtualFunctionVectors.end(); it != eit; ++it)
212 {
213 if ((*it).size() > idx)
214 virtualFunctions.push_back((*it)[idx]);
215 }
216}

◆ getVirtualFunctionVectors()

const std::vector< FuncVector > & SVF::CHNode::getVirtualFunctionVectors ( ) const
inline

Definition at line 178 of file CHG.h.

179 {
181 }

◆ getVTable()

const SVFGlobalValue * SVF::CHNode::getVTable ( ) const
inline

Definition at line 184 of file CHG.h.

185 {
186 return vtable;
187 }

◆ hasFlag()

bool SVF::CHNode::hasFlag ( CLASSATTR  mask) const
inline

Definition at line 140 of file CHG.h.

141 {
142 return (flags & mask) == mask;
143 }

◆ isMultiInheritance()

bool SVF::CHNode::isMultiInheritance ( ) const
inline

Definition at line 164 of file CHG.h.

165 {
167 }
bool hasFlag(CLASSATTR mask) const
Definition CHG.h:140

◆ isPureAbstract()

bool SVF::CHNode::isPureAbstract ( ) const
inline

Definition at line 160 of file CHG.h.

161 {
162 return hasFlag(PURE_ABSTRACT);
163 }

◆ isTemplate()

bool SVF::CHNode::isTemplate ( ) const
inline

Definition at line 168 of file CHG.h.

169 {
170 return hasFlag(TEMPLATE);
171 }

◆ setFlag()

void SVF::CHNode::setFlag ( CLASSATTR  mask)
inline

Flags.

Definition at line 136 of file CHG.h.

137 {
138 flags |= mask;
139 }

◆ setMultiInheritance()

void SVF::CHNode::setMultiInheritance ( )
inline

Definition at line 152 of file CHG.h.

153 {
155 }
void setFlag(CLASSATTR mask)
Flags.
Definition CHG.h:136

◆ setPureAbstract()

void SVF::CHNode::setPureAbstract ( )
inline

Attribute.

Definition at line 148 of file CHG.h.

149 {
151 }

◆ setTemplate()

void SVF::CHNode::setTemplate ( )
inline

Definition at line 156 of file CHG.h.

157 {
159 }

◆ setVTable()

void SVF::CHNode::setVTable ( const SVFGlobalValue vtbl)
inline

Definition at line 189 of file CHG.h.

190 {
191 vtable = vtbl;
192 }

Friends And Related Symbol Documentation

◆ SVFIRReader

Definition at line 111 of file CHG.h.

◆ SVFIRWriter

Definition at line 110 of file CHG.h.

Member Data Documentation

◆ className

std::string SVF::CHNode::className
private

Definition at line 214 of file CHG.h.

◆ flags

size_t SVF::CHNode::flags
private

Definition at line 215 of file CHG.h.

◆ virtualFunctionVectors

std::vector<FuncVector> SVF::CHNode::virtualFunctionVectors
private

Definition at line 228 of file CHG.h.

◆ vtable

const SVFGlobalValue* SVF::CHNode::vtable
private

Definition at line 213 of file CHG.h.


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