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

#include <SVFVariables.h>

Inheritance diagram for SVF::GepValVar:
SVF::ValVar SVF::SVFVar SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFValue

Public Member Functions

 GepValVar (const ValVar *baseNode, NodeID i, const AccessPath &ap, const SVFType *ty, const ICFGNode *node)
 Constructor.
 
APOffset getConstantFieldIdx () const
 offset of the base value variable
 
const ValVargetBaseNode (void) const
 Return the base object from which this GEP node came from.
 
const std::string getValueName () const
 Return name of a LLVM value.
 
virtual bool isPointer () const
 Check if this variable represents a pointer.
 
const SVFTypegetType () const
 
virtual const FunObjVargetFunction () const
 Get containing function, or null for globals/constants.
 
virtual const std::string toString () const
 Get string representation.
 
virtual bool isConstDataOrAggDataButNotNullPtr () const
 Check if this variable represents constant data/metadata but not null pointer.
 
virtual bool ptrInUncalledFunction () const
 Check if this pointer is in an uncalled function.
 
virtual bool isConstDataOrAggData () const
 Check if this variable represents constant/aggregate data.
 
- Public Member Functions inherited from SVF::ValVar
 ValVar (NodeID i, const SVFType *svfType, const ICFGNode *node, PNODEK ty=ValNode)
 Constructor.
 
const std::string getValueName () const
 Return name of a LLVM value.
 
const ICFGNodegetICFGNode () const
 
- Public Member Functions inherited from SVF::SVFVar
 SVFVar (NodeID i, const SVFType *svfType, PNODEK k)
 Standard constructor with ID, type and kind.
 
virtual ~SVFVar ()
 Virtual destructor.
 
virtual bool isIsolatedNode () const
 Check if this node is isolated (no edges) in the SVFIR graph.
 
SVFStmt::SVFStmtSetTygetIncomingEdges (SVFStmt::PEDGEK kind)
 Edge accessors and checkers.
 
SVFStmt::SVFStmtSetTygetOutgoingEdges (SVFStmt::PEDGEK kind)
 
bool hasIncomingEdges (SVFStmt::PEDGEK kind) const
 
bool hasOutgoingEdges (SVFStmt::PEDGEK kind) const
 
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin (SVFStmt::PEDGEK kind) const
 Edge iterators.
 
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd (SVFStmt::PEDGEK kind) const
 
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin (SVFStmt::PEDGEK kind) const
 
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd (SVFStmt::PEDGEK kind) const
 
void dump () const
 Debug dump to console.
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 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
 
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::SVFValue
 SVFValue (NodeID i, GNodeK k, const SVFType *ty=nullptr)
 
NodeID getId () const
 Get ID.
 
GNodeK getNodeKind () const
 Get node kind.
 
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
 

Static Public Member Functions

static bool classof (const GepValVar *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 
static bool classof (const ValVar *node)
 
static bool classof (const SVFVar *node)
 
static bool classof (const GenericPAGNodeTy *node)
 
static bool classof (const SVFValue *node)
 
- Static Public Member Functions inherited from SVF::ValVar
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 SVFValue *node)
 
- Static Public Member Functions inherited from SVF::SVFVar
static bool classof (const SVFVar *)
 Type checking support for LLVM-style RTTI.
 
static bool classof (const GenericPAGNodeTy *node)
 
static bool classof (const SVFValue *node)
 
- Static Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFValue *)
 

Private Attributes

AccessPath ap
 
const ValVarbase
 
const SVFTypegepValType
 

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::SVFValue
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , ArgValNode ,
  FunValNode , GepValNode , RetValNode , VarargValNode ,
  GlobalValNode , ConstAggValNode , ConstDataValNode , BlackHoleValNode ,
  ConstFPValNode , ConstIntValNode , ConstNullptrValNode , DummyValNode ,
  ObjNode , GepObjNode , BaseObjNode , FunObjNode ,
  HeapObjNode , StackObjNode , GlobalObjNode , ConstAggObjNode ,
  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 ,
  DCHNodeKd , BasicBlockKd , OtherKd
}
 
- Protected Member Functions inherited from SVF::SVFVar
 SVFVar (NodeID i, PNODEK k)
 Empty constructor for deserialization.
 
- 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::SVFVar
SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap
 Maps tracking incoming and outgoing edges by kind.
 
SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap
 
- Protected Attributes inherited from SVF::SVFValue
NodeID id
 Node ID.
 
GNodeK nodeKind
 Node kind.
 
const SVFTypetype
 SVF type.
 
std::string name
 
std::string sourceLoc
 Source code information of this value.
 

Detailed Description

Definition at line 411 of file SVFVariables.h.

Constructor & Destructor Documentation

◆ GepValVar()

GepValVar::GepValVar ( const ValVar baseNode,
NodeID  i,
const AccessPath ap,
const SVFType ty,
const ICFGNode node 
)

Constructor.

Definition at line 159 of file SVFVariables.cpp.

162{
163
164}
AccessPath ap
const SVFType * gepValType
const ValVar * base
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ classof() [1/5]

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

Definition at line 434 of file SVFVariables.h.

435 {
436 return node->getNodeKind() == SVFVar::GepValNode;
437 }

◆ classof() [2/5]

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

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

Definition at line 422 of file SVFVariables.h.

423 {
424 return true;
425 }

◆ classof() [3/5]

static bool SVF::GepValVar::classof ( const SVFValue node)
inlinestatic

Definition at line 438 of file SVFVariables.h.

439 {
440 return node->getNodeKind() == SVFVar::GepValNode;
441 }

◆ classof() [4/5]

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

Definition at line 430 of file SVFVariables.h.

431 {
432 return node->getNodeKind() == SVFVar::GepValNode;
433 }

◆ classof() [5/5]

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

Definition at line 426 of file SVFVariables.h.

427 {
428 return node->getNodeKind() == SVFVar::GepValNode;
429 }

◆ getBaseNode()

const ValVar * SVF::GepValVar::getBaseNode ( void  ) const
inline

Return the base object from which this GEP node came from.

Definition at line 455 of file SVFVariables.h.

456 {
457 return base;
458 }

◆ getConstantFieldIdx()

APOffset SVF::GepValVar::getConstantFieldIdx ( ) const
inline

offset of the base value variable

Definition at line 449 of file SVFVariables.h.

450 {
452 }
APOffset getConstantStructFldIdx() const
Get methods.
Definition AccessPath.h:97

◆ getFunction()

virtual const FunObjVar * SVF::GepValVar::getFunction ( ) const
inlinevirtual

Get containing function, or null for globals/constants.

Reimplemented from SVF::ValVar.

Definition at line 477 of file SVFVariables.h.

478 {
479 return base->getFunction();
480 }
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.

◆ getType()

const SVFType * SVF::GepValVar::getType ( ) const
inlinevirtual

Reimplemented from SVF::SVFValue.

Definition at line 472 of file SVFVariables.h.

473 {
474 return gepValType;
475 }

◆ getValueName()

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

Return name of a LLVM value.

Implements SVF::SVFVar.

Definition at line 461 of file SVFVariables.h.

462 {
463 return getName() + "_" +
464 std::to_string(getConstantFieldIdx());
465 }
APOffset getConstantFieldIdx() const
offset of the base value variable
virtual const std::string & getName() const
Definition SVFValue.h:186

◆ isConstDataOrAggData()

virtual bool SVF::GepValVar::isConstDataOrAggData ( ) const
inlinevirtual

Check if this variable represents constant/aggregate data.

Reimplemented from SVF::SVFVar.

Definition at line 493 of file SVFVariables.h.

494 {
495 return base->isConstDataOrAggData();
496 }
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.

◆ isConstDataOrAggDataButNotNullPtr()

virtual bool SVF::GepValVar::isConstDataOrAggDataButNotNullPtr ( ) const
inlinevirtual

Check if this variable represents constant data/metadata but not null pointer.

Reimplemented from SVF::SVFVar.

Definition at line 484 of file SVFVariables.h.

485 {
487 }
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.

◆ isPointer()

virtual bool SVF::GepValVar::isPointer ( ) const
inlinevirtual

Check if this variable represents a pointer.

Reimplemented from SVF::SVFVar.

Definition at line 467 of file SVFVariables.h.

468 {
469 return base->isPointer();
470 }
virtual bool isPointer() const
Check if this variable represents a pointer.

◆ ptrInUncalledFunction()

virtual bool SVF::GepValVar::ptrInUncalledFunction ( ) const
inlinevirtual

Check if this pointer is in an uncalled function.

Reimplemented from SVF::SVFVar.

Definition at line 488 of file SVFVariables.h.

489 {
490 return base->ptrInUncalledFunction();
491 }
virtual bool ptrInUncalledFunction() const
Check if this pointer is in an uncalled function.

◆ toString()

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

Get string representation.

Reimplemented from SVF::ValVar.

Definition at line 166 of file SVFVariables.cpp.

167{
168 std::string str;
169 std::stringstream rawstr(str);
170 rawstr << "GepValVar ID: " << getId() << " with offset_" + std::to_string(getConstantFieldIdx());
172 {
173 rawstr << "\n";
175 }
176 return rawstr.str();
177}
const ValVar * getBaseNode(void) const
Return the base object from which this GEP node came from.
static const Option< bool > ShowSVFIRValue
Definition Options.h:119
NodeID getId() const
Get ID.
Definition SVFValue.h:160
const std::string valueOnlyToString() const
Definition LLVMUtil.cpp:735

Member Data Documentation

◆ ap

AccessPath SVF::GepValVar::ap
private

Definition at line 415 of file SVFVariables.h.

◆ base

const ValVar* SVF::GepValVar::base
private

Definition at line 416 of file SVFVariables.h.

◆ gepValType

const SVFType* SVF::GepValVar::gepValType
private

Definition at line 417 of file SVFVariables.h.


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