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

#include <SVFVariables.h>

Inheritance diagram for SVF::GepObjVar:
SVF::ObjVar SVF::SVFVar SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFValue

Public Member Functions

 GepObjVar (const BaseObjVar *baseObj, NodeID i, const APOffset &apOffset, PNODEK ty=GepObjNode)
 Constructor.
 
APOffset getConstantFieldIdx () const
 offset of the mem object
 
NodeID getBaseNode (void) const
 Return the base object from which this GEP node came from.
 
const BaseObjVargetBaseObj () const
 
virtual const SVFTypegetType () const
 Return the type of this gep object.
 
const std::string getValueName () const
 Return name of a LLVM value.
 
virtual const FunObjVargetFunction () const
 Get containing function, or null for globals/constants.
 
virtual const std::string toString () const
 Get string representation.
 
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.
 
virtual bool isConstDataOrAggDataButNotNullPtr () const
 Check if this variable represents constant data/metadata but not null pointer.
 
virtual bool isPointer () const
 Check if this variable represents a pointer.
 
- 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 GepObjVar *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 
static bool classof (const ObjVar *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::ObjVar
static bool classof (const ObjVar *)
 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

APOffset apOffset = 0
 
const BaseObjVarbase
 

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::ObjVar
 ObjVar (NodeID i, const SVFType *svfType, PNODEK ty=ObjNode)
 Constructor.
 
- 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 699 of file SVFVariables.h.

Constructor & Destructor Documentation

◆ GepObjVar()

SVF::GepObjVar::GepObjVar ( const BaseObjVar baseObj,
NodeID  i,
const APOffset apOffset,
PNODEK  ty = GepObjNode 
)
inline

Constructor.

Definition at line 733 of file SVFVariables.h.

735 : ObjVar(i, baseObj->getType(), ty), apOffset(apOffset), base(baseObj)
736 {
737 }
const BaseObjVar * base
APOffset apOffset
ObjVar(NodeID i, const SVFType *svfType, PNODEK ty=ObjNode)
Constructor.
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ classof() [1/5]

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

Definition at line 722 of file SVFVariables.h.

723 {
724 return node->getNodeKind() == SVFVar::GepObjNode;
725 }

◆ classof() [2/5]

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

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

Definition at line 710 of file SVFVariables.h.

711 {
712 return true;
713 }

◆ classof() [3/5]

static bool SVF::GepObjVar::classof ( const ObjVar node)
inlinestatic

Definition at line 714 of file SVFVariables.h.

715 {
716 return node->getNodeKind() == SVFVar::GepObjNode;
717 }

◆ classof() [4/5]

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

Definition at line 726 of file SVFVariables.h.

727 {
728 return node->getNodeKind() == SVFVar::GepObjNode;
729 }

◆ classof() [5/5]

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

Definition at line 718 of file SVFVariables.h.

719 {
720 return node->getNodeKind() == SVFVar::GepObjNode;
721 }

◆ getBaseNode()

NodeID SVF::GepObjVar::getBaseNode ( void  ) const
inline

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

Definition at line 746 of file SVFVariables.h.

747 {
748 return base->getId();
749 }
NodeID getId() const
Get the memory object id.

◆ getBaseObj()

const BaseObjVar * SVF::GepObjVar::getBaseObj ( ) const
inline

Definition at line 751 of file SVFVariables.h.

752 {
753 return base;
754 }

◆ getConstantFieldIdx()

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

offset of the mem object

Definition at line 740 of file SVFVariables.h.

741 {
742 return apOffset;
743 }

◆ getFunction()

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

Get containing function, or null for globals/constants.

Reimplemented from SVF::SVFVar.

Definition at line 766 of file SVFVariables.h.

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

◆ getType()

const SVFType * GepObjVar::getType ( ) const
inlinevirtual

Return the type of this gep object.

Reimplemented from SVF::SVFValue.

Definition at line 213 of file SVFVariables.cpp.

214{
216}
const SVFType * getFlatternedElemType(const SVFType *baseType, u32_t flatten_idx)
Return the type of a flattened element given a flattened index.
Definition IRGraph.cpp:123
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
Definition SVFIR.h:114
const SVFType * type
SVF type.
Definition SVFValue.h:207

◆ getValueName()

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

Return name of a LLVM value.

Reimplemented from SVF::ObjVar.

Definition at line 761 of file SVFVariables.h.

762 {
763 return getName() + "_" + std::to_string(apOffset);
764 }
virtual const std::string & getName() const
Definition SVFValue.h:186

◆ isConstDataOrAggData()

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

Check if this variable represents constant/aggregate data.

Reimplemented from SVF::SVFVar.

Definition at line 778 of file SVFVariables.h.

779 {
780 return base->isConstDataOrAggData();
781 }
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.

◆ isConstDataOrAggDataButNotNullPtr()

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

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

Reimplemented from SVF::SVFVar.

Definition at line 783 of file SVFVariables.h.

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

◆ isPointer()

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

Check if this variable represents a pointer.

Reimplemented from SVF::SVFVar.

Definition at line 788 of file SVFVariables.h.

789 {
790 return base->isPointer();
791 }
virtual bool isPointer() const
Check if this variable represents a pointer.

◆ ptrInUncalledFunction()

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

Check if this pointer is in an uncalled function.

Reimplemented from SVF::SVFVar.

Definition at line 773 of file SVFVariables.h.

774 {
775 return base->ptrInUncalledFunction();
776 }
virtual bool ptrInUncalledFunction() const
Check if this pointer is in an uncalled function.

◆ toString()

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

Get string representation.

Reimplemented from SVF::ObjVar.

Definition at line 200 of file SVFVariables.cpp.

201{
202 std::string str;
203 std::stringstream rawstr(str);
204 rawstr << "GepObjVar ID: " << getId() << " with offset_" + std::to_string(apOffset);
206 {
207 rawstr << "\n";
209 }
210 return rawstr.str();
211}
const BaseObjVar * getBaseObj() const
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

◆ apOffset

APOffset SVF::GepObjVar::apOffset = 0
private

Definition at line 703 of file SVFVariables.h.

◆ base

const BaseObjVar* SVF::GepObjVar::base
private

Definition at line 705 of file SVFVariables.h.


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