Static Value-Flow Analysis
Loading...
Searching...
No Matches
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::ConstantDataValVar SVF::DummyValVar SVF::FunValVar SVF::GepValVar SVF::GlobalValVar SVF::RetPN SVF::VarArgPN SVF::BlackHoleVar SVF::ConstantFPValVar SVF::ConstantIntValVar SVF::ConstantNullPtrValVar

Public Member Functions

 ValVar (const SVFValue *val, NodeID i, PNODEK ty=ValNode, const ICFGNode *node=nullptr)
 Constructor.
 
const std::string getValueName () const
 Return name of a LLVM value.
 
const ICFGNodegetICFGNode () const
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::SVFVar
 SVFVar (const SVFValue *val, NodeID i, PNODEK k)
 Constructor.
 
virtual ~SVFVar ()
 Destructor.
 
const SVFValuegetValue () const
 Get/has methods of the components.
 
virtual const SVFTypegetType () const
 Return type of the value.
 
bool hasValue () const
 
virtual bool isPointer () const
 Whether it is a pointer.
 
bool isConstDataOrAggDataButNotNullPtr () const
 
virtual bool isIsolatedNode () const
 Whether this is an isolated node on the SVFIR graph.
 
virtual const SVFFunctiongetFunction () const
 
SVFStmt::SVFStmtSetTygetIncomingEdges (SVFStmt::PEDGEK kind)
 Get incoming SVFIR statements (edges)
 
SVFStmt::SVFStmtSetTygetOutgoingEdges (SVFStmt::PEDGEK kind)
 Get outgoing SVFIR statements (edges)
 
bool hasIncomingEdges (SVFStmt::PEDGEK kind) const
 Has incoming SVFIR statements (edges)
 
bool hasOutgoingEdges (SVFStmt::PEDGEK kind) const
 Has outgoing SVFIR statements (edges)
 
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin (SVFStmt::PEDGEK kind) const
 Get incoming SVFStmt iterator.
 
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd (SVFStmt::PEDGEK kind) const
 Get incoming SVFStmt iterator.
 
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin (SVFStmt::PEDGEK kind) const
 Get outgoing SVFStmt iterator.
 
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd (SVFStmt::PEDGEK kind) const
 Get outgoing SVFStmt iterator.
 
void dump () const
 Dump to console for debugging.
 
- 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 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:
 
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)
 
- Protected Member Functions inherited from SVF::SVFVar
 SVFVar (NodeID i, PNODEK k)
 function containing this variable
 

Private Attributes

const ICFGNodeicfgNode
 

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.
 
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
}
 
- 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::SVFVar
const SVFValuevalue
 value of this SVFIR node
 
SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap
 
SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap
 
bool isPtr
 
const SVFFunctionfunc
 whether it is a pointer (top-level or address-taken)
 
- 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 277 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 286 of file SVFVariables.h.

286: SVFVar(i, ty), icfgNode(nullptr) {}
SVFVar(NodeID i, PNODEK k)
function containing this variable
const ICFGNode * icfgNode
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ValVar() [2/2]

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

Constructor.

Definition at line 310 of file SVFVariables.h.

311 : SVFVar(val, i, ty), icfgNode(node)
312 {
313 }

Member Function Documentation

◆ classof() [1/4]

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

Definition at line 299 of file SVFVariables.h.

300 {
301 return isValVarKinds(node->getNodeKind());
302 }
static bool isValVarKinds(GNodeK n)

◆ classof() [2/4]

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

Definition at line 303 of file SVFVariables.h.

304 {
305 return isValVarKinds(node->getNodeKind());
306 }

◆ classof() [3/4]

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

Definition at line 295 of file SVFVariables.h.

296 {
297 return isValVarKinds(node->getNodeKind());
298 }

◆ 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 291 of file SVFVariables.h.

292 {
293 return true;
294 }

◆ getICFGNode()

const ICFGNode * SVF::ValVar::getICFGNode ( ) const
inline

Definition at line 322 of file SVFVariables.h.

323 {
324 return icfgNode;
325 }

◆ getValueName()

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

Return name of a LLVM value.

Implements SVF::SVFVar.

Reimplemented in SVF::VarArgPN.

Definition at line 315 of file SVFVariables.h.

316 {
317 if (value)
318 return value->getName();
319 return "";
320 }
const std::string & getName() const
Definition SVFValue.h:243
const SVFValue * value
value of this SVFIR node

◆ toString()

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

Reimplemented from SVF::SVFVar.

Reimplemented in SVF::GepValVar, SVF::FunValVar, SVF::GlobalValVar, SVF::ConstantDataValVar, SVF::BlackHoleVar, SVF::ConstantFPValVar, SVF::ConstantIntValVar, SVF::ConstantNullPtrValVar, SVF::RetPN, SVF::VarArgPN, and SVF::DummyValVar.

Definition at line 121 of file SVFVariables.cpp.

122{
123 std::string str;
124 std::stringstream rawstr(str);
125 rawstr << "ValVar ID: " << getId();
127 {
128 rawstr << "\n";
129 rawstr << value->toString();
130 }
131 return rawstr.str();
132}
static const Option< bool > ShowSVFIRValue
Definition Options.h:122
NodeID getId() const
Get ID.
std::string toString() const
Needs to be implemented by a SVF front end.
Definition LLVMUtil.cpp:721

Friends And Related Symbol Documentation

◆ SVFIRReader

Definition at line 280 of file SVFVariables.h.

◆ SVFIRWriter

Definition at line 279 of file SVFVariables.h.

Member Data Documentation

◆ icfgNode

const ICFGNode* SVF::ValVar::icfgNode
private

Definition at line 283 of file SVFVariables.h.


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