Static Value-Flow Analysis
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
SVF::ValVar Class Reference

#include <SVFVariables.h>

Inheritance diagram for SVF::ValVar:
SVF::SVFVar SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFBaseNode SVF::DummyValVar SVF::GepValVar SVF::RetPN SVF::VarArgPN

Public Member Functions

 ValVar (const SVFValue *val, NodeID i, PNODEK ty=ValNode, const SVFBaseNode *node=nullptr)
 Constructor. More...
 
const std::string getValueName () const
 Return name of a LLVM value. More...
 
const SVFBaseNodegetGNode () const
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::SVFVar
 SVFVar (const SVFValue *val, NodeID i, PNODEK k)
 Constructor. More...
 
virtual ~SVFVar ()
 Destructor. More...
 
const SVFValuegetValue () const
 Get/has methods of the components. More...
 
virtual const SVFTypegetType () const
 Return type of the value. More...
 
bool hasValue () const
 
virtual bool isPointer () const
 Whether it is a pointer. More...
 
bool isConstDataOrAggDataButNotNullPtr () const
 
bool isIsolatedNode () const
 Whether this is an isolated node on the SVFIR graph. More...
 
virtual const SVFFunctiongetFunction () const
 Return the function that this SVFVar resides in. Return nullptr if it is a global or constantexpr node. More...
 
SVFStmt::SVFStmtSetTygetIncomingEdges (SVFStmt::PEDGEK kind)
 Get incoming SVFIR statements (edges) More...
 
SVFStmt::SVFStmtSetTygetOutgoingEdges (SVFStmt::PEDGEK kind)
 Get outgoing SVFIR statements (edges) More...
 
bool hasIncomingEdges (SVFStmt::PEDGEK kind) const
 Has incoming SVFIR statements (edges) More...
 
bool hasOutgoingEdges (SVFStmt::PEDGEK kind) const
 Has outgoing SVFIR statements (edges) More...
 
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin (SVFStmt::PEDGEK kind) const
 Get incoming SVFStmt iterator. More...
 
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd (SVFStmt::PEDGEK kind) const
 Get incoming SVFStmt iterator. More...
 
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin (SVFStmt::PEDGEK kind) const
 Get outgoing SVFStmt iterator. More...
 
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd (SVFStmt::PEDGEK kind) const
 Get outgoing SVFStmt iterator. More...
 
void dump () const
 Dump to console for debugging. More...
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 GenericNode (NodeID i, GNodeK k)
 Constructor. More...
 
virtual ~GenericNode ()
 Destructor. More...
 
bool hasIncomingEdge () const
 Has incoming/outgoing edge set. More...
 
bool hasOutgoingEdge () const
 
iterator OutEdgeBegin ()
 iterators More...
 
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. More...
 
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. More...
 
bool addOutgoingEdge (EdgeType *outEdge)
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges. More...
 
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. More...
 
GNodeK getNodeKind () const
 Get node kind. More...
 
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 ValVar *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const SVFVar *node)
 
static bool classof (const GenericPAGNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::SVFVar
static bool classof (const SVFVar *)
 
static bool classof (const GenericPAGNodeTy *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 *)
 

Protected Member Functions

 ValVar (NodeID i, PNODEK ty=ValNode)
 Constructor to create an empty ValVar (for SVFIRReader/deserialization) More...
 
- Protected Member Functions inherited from SVF::SVFVar
 SVFVar (NodeID i, PNODEK k)
 whether it is a pointer (top-level or address-taken) More...
 

Private Attributes

const SVFBaseNodegNode
 

Friends

class SVFIRWriter
 
class SVFIRReader
 

Additional Inherited Members

- Public Types inherited from SVF::SVFVar
typedef GNodeK PNODEK
 
typedef s64_t GEdgeKind
 
- Public Types inherited from SVF::GenericNode< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
 Edge kind. More...
 
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 , GepValNode ,
  RetNode , VarargNode , DummyValNode , ObjNode ,
  GepObjNode , FIObjNode , 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
}
 
- Static Protected Member Functions inherited from SVF::SVFBaseNode
static bool isICFGNodeKinds (GNodeK n)
 Helper functions to check node kinds. More...
 
static bool isInterICFGNodeKind (GNodeK n)
 
static bool isSVFVarKind (GNodeK n)
 
static bool isValVarKinds (GNodeK n)
 
static bool isObjVarKinds (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::SVFVar
const SVFValuevalue
 value of this SVFIR node More...
 
SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap
 
SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap
 
bool isPtr
 
- Protected Attributes inherited from SVF::SVFBaseNode
NodeID id
 Node ID. More...
 
GNodeK nodeKind
 Node kind. More...
 
const SVFTypetype
 SVF type. More...
 
std::string sourceLoc
 Source code information of this value. More...
 

Detailed Description

Definition at line 266 of file SVFVariables.h.

Constructor & Destructor Documentation

◆ ValVar() [1/2]

SVF::ValVar::ValVar ( NodeID  i,
PNODEK  ty = ValNode 
)
inlineprotected

Constructor to create an empty ValVar (for SVFIRReader/deserialization)

Definition at line 275 of file SVFVariables.h.

275 : SVFVar(i, ty), gNode(nullptr) {}
SVFVar(NodeID i, PNODEK k)
whether it is a pointer (top-level or address-taken)
Definition: SVFVariables.h:73
const SVFBaseNode * gNode
Definition: SVFVariables.h:272

◆ ValVar() [2/2]

SVF::ValVar::ValVar ( const SVFValue val,
NodeID  i,
PNODEK  ty = ValNode,
const SVFBaseNode node = nullptr 
)
inline

Constructor.

Definition at line 299 of file SVFVariables.h.

300  : SVFVar(val, i, ty), gNode(node)
301  {
302  }

Member Function Documentation

◆ classof() [1/4]

static bool SVF::ValVar::classof ( const GenericPAGNodeTy node)
inlinestatic

Definition at line 288 of file SVFVariables.h.

289  {
290  return isValVarKinds(node->getNodeKind());
291  }
static bool isValVarKinds(GNodeK n)
Definition: GenericGraph.h:323

◆ classof() [2/4]

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

Definition at line 292 of file SVFVariables.h.

293  {
294  return isValVarKinds(node->getNodeKind());
295  }

◆ classof() [3/4]

static bool SVF::ValVar::classof ( const SVFVar node)
inlinestatic

Definition at line 284 of file SVFVariables.h.

285  {
286  return isValVarKinds(node->getNodeKind());
287  }

◆ classof() [4/4]

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

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

Definition at line 280 of file SVFVariables.h.

281  {
282  return true;
283  }

◆ getGNode()

const SVFBaseNode* SVF::ValVar::getGNode ( ) const
inline

Definition at line 311 of file SVFVariables.h.

312  {
313  return gNode;
314  }

◆ getValueName()

const std::string SVF::ValVar::getValueName ( ) const
inlinevirtual

Return name of a LLVM value.

Implements SVF::SVFVar.

Reimplemented in SVF::DummyValVar, SVF::VarArgPN, SVF::RetPN, and SVF::GepValVar.

Definition at line 304 of file SVFVariables.h.

305  {
306  if (value)
307  return value->getName();
308  return "";
309  }
const std::string & getName() const
Definition: SVFValue.h:243
const SVFValue * value
value of this SVFIR node
Definition: SVFVariables.h:67

◆ toString()

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

Reimplemented from SVF::SVFVar.

Reimplemented in SVF::DummyValVar, SVF::VarArgPN, SVF::RetPN, and SVF::GepValVar.

Definition at line 108 of file SVFVariables.cpp.

109 {
110  std::string str;
111  std::stringstream rawstr(str);
112  rawstr << "ValVar ID: " << getId();
114  {
115  rawstr << "\n";
116  rawstr << value->toString();
117  }
118  return rawstr.str();
119 }
const char *const string
Definition: cJSON.h:172
static const Option< bool > ShowSVFIRValue
Definition: Options.h:122
NodeID getId() const
Get ID.
Definition: GenericGraph.h:260
std::string toString() const
Needs to be implemented by a SVF front end.
Definition: LLVMUtil.cpp:663

Friends And Related Function Documentation

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 269 of file SVFVariables.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 268 of file SVFVariables.h.

Member Data Documentation

◆ gNode

const SVFBaseNode* SVF::ValVar::gNode
private

Definition at line 272 of file SVFVariables.h.


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