Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::FunExitICFGNode Class Reference

#include <ICFGNode.h>

Inheritance diagram for SVF::FunExitICFGNode:
SVF::InterICFGNode SVF::ICFGNode SVF::GenericNode< ICFGNode, ICFGEdge > SVF::SVFValue

Public Member Functions

 FunExitICFGNode (NodeID id, const FunObjVar *f, const SVFBasicBlock *b)
const FunObjVar * getFun () const override
 Return function.
const SVFVar * getFormalRet () const
 Return formal return parameter.
void addFormalRet (const SVFVar *fr)
 Add formal return parameter.
const std::string toString () const override
const std::string getSourceLoc () const override
Public Member Functions inherited from SVF::InterICFGNode
 InterICFGNode (NodeID id, ICFGNodeK k)
 Constructor.
Public Member Functions inherited from SVF::ICFGNode
 ICFGNode (NodeID i, GNodeK k)
 Constructor.
virtual const SVFBasicBlock * getBB () const
 Return the basic block of this ICFGNode.
void dump () const
void addVFGNode (const VFGNode *vfgNode)
const VFGNodeList & getVFGNodes () const
void addSVFStmt (const SVFStmt *edge)
const SVFStmtList & getSVFStmts () const
Public Member Functions inherited from SVF::GenericNode< ICFGNode, ICFGEdge >
 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)
EdgeType * hasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges.
EdgeType * hasOutgoingEdge (EdgeType *edge) const
const GEdgeSetTy & getOutEdges () const
const GEdgeSetTy & getInEdges () 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 SVFType * getType () 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)
const std::string valueOnlyToString () const
const bool hasLLVMValue () const

Static Public Member Functions

static bool classof (const FunEntryICFGNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof (const ICFGNode *node)
static bool classof (const InterICFGNode *node)
static bool classof (const GenericICFGNodeTy *node)
static bool classof (const SVFValue *node)
Static Public Member Functions inherited from SVF::InterICFGNode
static bool classof (const InterICFGNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof (const ICFGNode *node)
static bool classof (const GenericICFGNodeTy *node)
static bool classof (const SVFValue *node)
Static Public Member Functions inherited from SVF::ICFGNode
static bool classof (const ICFGNode *)
static bool classof (const GenericICFGNodeTy *node)
static bool classof (const SVFValue *node)
Static Public Member Functions inherited from SVF::GenericNode< ICFGNode, ICFGEdge >
static bool classof (const GenericNode< ICFGNode, ICFGEdge > *)
static bool classof (const SVFValue *)

Private Attributes

const SVFVar * formalRet

Friends

class GraphDBClient

Additional Inherited Members

Public Types inherited from SVF::ICFGNode
typedef ICFGEdge::ICFGEdgeSetTy::iterator iterator
typedef ICFGEdge::ICFGEdgeSetTy::const_iterator const_iterator
typedef Set< const CallPE * > CallPESet
typedef Set< const RetPE * > RetPESet
typedef std::list< const VFGNode * > VFGNodeList
typedef std::list< const SVFStmt * > SVFStmtList
typedef GNodeK ICFGNodeK
Public Types inherited from SVF::GenericNode< ICFGNode, ICFGEdge >
typedef ICFGNode NodeType
typedef ICFGEdge 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 , ConstDataValNode , BlackHoleValNode , ConstFPValNode ,
  ConstIntValNode , ConstNullptrValNode , DummyValNode , IntrinsicValNode ,
  AsmPCValNode , ObjNode , GepObjNode , BaseObjNode ,
  FunObjNode , HeapObjNode , StackObjNode , GlobalObjNode ,
  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 ,
  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::ICFGNode
const FunObjVar * fun
const SVFBasicBlock * bb
VFGNodeList VFGNodes
SVFStmtList pagEdges
Protected Attributes inherited from SVF::SVFValue
NodeID id
 Node ID.
GNodeK nodeKind
 Node kind.
const SVFType * type
 SVF type.
std::string name
std::string sourceLoc
 Source code information of this value.

Detailed Description

Function exit ICFGNode containing (at most one) FormalRetVFGNodes of a function

Definition at line 338 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ FunExitICFGNode()

SVF::FunExitICFGNode::FunExitICFGNode ( NodeID id,
const FunObjVar * f,
const SVFBasicBlock * b )
inline

Definition at line 346 of file ICFGNode.h.

347 : InterICFGNode(id, FunExitBlock), formalRet(nullptr)
348 {
349 this->fun = f;
350 this->bb = b;
351 }
const cJSON *const b
Definition cJSON.h:255
const SVFVar * formalRet
Definition ICFGNode.h:343
const SVFBasicBlock * bb
Definition ICFGNode.h:146
const FunObjVar * fun
Definition ICFGNode.h:145
InterICFGNode(NodeID id, ICFGNodeK k)
Constructor.
Definition ICFGNode.h:237

Member Function Documentation

◆ addFormalRet()

void SVF::FunExitICFGNode::addFormalRet ( const SVFVar * fr)
inline

Add formal return parameter.

Definition at line 366 of file ICFGNode.h.

367 {
368 formalRet = fr;
369 }

◆ classof() [1/5]

bool SVF::FunExitICFGNode::classof ( const FunEntryICFGNode * )
inlinestatic

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

Definition at line 373 of file ICFGNode.h.

374 {
375 return true;
376 }

◆ classof() [2/5]

bool SVF::FunExitICFGNode::classof ( const GenericICFGNodeTy * node)
inlinestatic

Definition at line 388 of file ICFGNode.h.

389 {
390 return node->getNodeKind() == FunExitBlock;
391 }

◆ classof() [3/5]

bool SVF::FunExitICFGNode::classof ( const ICFGNode * node)
inlinestatic

Definition at line 378 of file ICFGNode.h.

379 {
380 return node->getNodeKind() == FunExitBlock;
381 }

◆ classof() [4/5]

bool SVF::FunExitICFGNode::classof ( const InterICFGNode * node)
inlinestatic

Definition at line 383 of file ICFGNode.h.

384 {
385 return node->getNodeKind() == FunExitBlock;
386 }

◆ classof() [5/5]

bool SVF::FunExitICFGNode::classof ( const SVFValue * node)
inlinestatic

Definition at line 393 of file ICFGNode.h.

394 {
395 return node->getNodeKind() == FunExitBlock;
396 }

◆ getFormalRet()

const SVFVar * SVF::FunExitICFGNode::getFormalRet ( ) const
inline

Return formal return parameter.

Definition at line 360 of file ICFGNode.h.

361 {
362 return formalRet;
363 }

◆ getFun()

const FunObjVar * SVF::FunExitICFGNode::getFun ( ) const
inlineoverridevirtual

Return function.

Reimplemented from SVF::ICFGNode.

Definition at line 354 of file ICFGNode.h.

355 {
356 return fun;
357 }

◆ getSourceLoc()

const std::string FunExitICFGNode::getSourceLoc ( ) const
overridevirtual

Reimplemented from SVF::SVFValue.

Definition at line 124 of file ICFG.cpp.

125{
126 return "function ret: " + fun->getSourceLoc();
127}

◆ toString()

const std::string FunExitICFGNode::toString ( ) const
overridevirtual

Reimplemented from SVF::ICFGNode.

Definition at line 107 of file ICFG.cpp.

108{
109 const FunObjVar *fun = getFun();
110 std::string str;
111 std::stringstream rawstr(str);
112 rawstr << "FunExitICFGNode" << getId();
113 rawstr << " {fun: " << fun->getName();
114 // ensure the enclosing function has exit basic block
115 if (!isExtCall(fun) && fun->hasReturn())
116 if(const IntraICFGNode* intraICFGNode = dyn_cast<IntraICFGNode>(fun->getExitBB()->front()))
117 rawstr << intraICFGNode->getSourceLoc();
118 rawstr << "}";
119 for (const SVFStmt *stmt : getSVFStmts())
120 rawstr << "\n" << stmt->toString();
121 return rawstr.str();
122}
const FunObjVar * getFun() const override
Return function.
Definition ICFGNode.h:354
const SVFStmtList & getSVFStmts() const
Definition ICFGNode.h:116
NodeID getId() const
Get ID.
Definition SVFValue.h:158
bool isExtCall(const FunObjVar *fun)
Definition SVFUtil.cpp:526
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
Definition Casting.h:405

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 340 of file ICFGNode.h.

Member Data Documentation

◆ formalRet

const SVFVar* SVF::FunExitICFGNode::formalRet
private

Definition at line 343 of file ICFGNode.h.


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