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::RetValPN Class Reference

#include <SVFVariables.h>

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

Public Member Functions

 RetValPN (NodeID i, const FunObjVar *node, const SVFType *svfType, const ICFGNode *icn)
 Constructor.
 
const FunObjVargetCallGraphNode () const
 
virtual const FunObjVargetFunction () const
 Get containing function, or null for globals/constants.
 
virtual bool isPointer () const
 Check if this variable represents a pointer.
 
const std::string getValueName () const
 Return name of a LLVM value.
 
virtual const std::string toString () const
 Get string representation.
 
- 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
 
std::string getValVarNodeFieldsStmt () 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 isConstDataOrAggDataButNotNullPtr () const
 Check if this variable represents constant data/metadata but not null pointer.
 
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
 
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.
 
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 const SVFTypegetType () const
 
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
 
const bool hasLLVMValue () const
 

Static Public Member Functions

static bool classof (const RetValPN *)
 
static bool classof (const SVFVar *node)
 
static bool classof (const ValVar *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 *)
 

Protected Member Functions

void setCallGraphNode (const FunObjVar *node)
 
- Protected Member Functions inherited from SVF::SVFVar
const SVFStmt::KindToSVFStmtMapTygetInEdgeKindToSetMap () const
 
const SVFStmt::KindToSVFStmtMapTygetOutEdgeKindToSetMap () const
 

Private Attributes

const FunObjVarcallGraphNode
 

Friends

class GraphDBClient
 

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 ,
  IntrinsicValNode , BasicBlockValNode , AsmPCValNode , 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
}
 
- 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 2011 of file SVFVariables.h.

Constructor & Destructor Documentation

◆ RetValPN()

RetValPN::RetValPN ( NodeID  i,
const FunObjVar node,
const SVFType svfType,
const ICFGNode icn 
)

Constructor.

Definition at line 216 of file SVFVariables.cpp.

218{
219 assert((node->isDeclaration() || icn) &&
220 "RetValPN of a defined function must have a valid ICFGNode");
221}
bool isDeclaration() const
const FunObjVar * callGraphNode
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

Member Function Documentation

◆ classof() [1/5]

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

Definition at line 2038 of file SVFVariables.h.

2039 {
2040 return node->getNodeKind() == SVFVar::RetValNode;
2041 }

◆ classof() [2/5]

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

Definition at line 2026 of file SVFVariables.h.

2027 {
2028 return true;
2029 }

◆ classof() [3/5]

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

Definition at line 2042 of file SVFVariables.h.

2043 {
2044 return node->getNodeKind() == SVFVar::RetValNode;
2045 }

◆ classof() [4/5]

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

Definition at line 2030 of file SVFVariables.h.

2031 {
2032 return node->getNodeKind() == SVFVar::RetValNode;
2033 }

◆ classof() [5/5]

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

Definition at line 2034 of file SVFVariables.h.

2035 {
2036 return node->getNodeKind() == SVFVar::RetValNode;
2037 }

◆ getCallGraphNode()

const FunObjVar * SVF::RetValPN::getCallGraphNode ( ) const
inline

Definition at line 2052 of file SVFVariables.h.

2053 {
2054 return callGraphNode;
2055 }

◆ getFunction()

const FunObjVar * RetValPN::getFunction ( ) const
virtual

Get containing function, or null for globals/constants.

Reimplemented from SVF::ValVar.

Definition at line 223 of file SVFVariables.cpp.

224{
225 return callGraphNode;
226}

◆ getValueName()

const std::string RetValPN::getValueName ( ) const
virtual

Return name of a LLVM value.

Implements SVF::SVFVar.

Definition at line 234 of file SVFVariables.cpp.

235{
236 return callGraphNode->getName() + "_ret";
237}
virtual const std::string & getName() const
Definition SVFValue.h:189

◆ isPointer()

bool RetValPN::isPointer ( ) const
virtual

Check if this variable represents a pointer.

Reimplemented from SVF::SVFVar.

Definition at line 228 of file SVFVariables.cpp.

229{
231}
const SVFType * getReturnType() const
Returns the FunctionType.
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
bool isPointerTy() const
Definition SVFType.h:294

◆ setCallGraphNode()

void SVF::RetValPN::setCallGraphNode ( const FunObjVar node)
inlineprotected

Definition at line 2016 of file SVFVariables.h.

2017 {
2018 callGraphNode = node;
2019 }

◆ toString()

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

Get string representation.

Reimplemented from SVF::ValVar.

Definition at line 529 of file SVFVariables.cpp.

530{
531 std::string str;
532 std::stringstream rawstr(str);
533 rawstr << "RetValPN ID: " << getId() << " unique return node for function " << callGraphNode->getName();
534 return rawstr.str();
535}
NodeID getId() const
Get ID.
Definition SVFValue.h:163

Friends And Related Symbol Documentation

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 2013 of file SVFVariables.h.

Member Data Documentation

◆ callGraphNode

const FunObjVar* SVF::RetValPN::callGraphNode
private

Definition at line 2022 of file SVFVariables.h.


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