Static Value-Flow Analysis
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SVF::FunExitICFGNode Class Reference

#include <ICFGNode.h>

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

Public Member Functions

 FunExitICFGNode (NodeID id, const FunObjVar *f)
 
const FunObjVargetFun () const override
 Return function.
 
const SVFVargetFormalRet () 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 SVFBasicBlockgetBB () const
 Return the basic block of this ICFGNode.
 
void dump () const
 
void addVFGNode (const VFGNode *vfgNode)
 
const VFGNodeListgetVFGNodes () const
 
void addSVFStmt (const SVFStmt *edge)
 
const SVFStmtListgetSVFStmts () const
 
- 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)
 
const std::string valueOnlyToString () 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< NodeTy, EdgeTy >
static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFValue *)
 

Private Member Functions

 FunExitICFGNode (NodeID id)
 Constructor to create empty FunExitICFGNode (for SVFIRReader/deserialization)
 

Private Attributes

const SVFVarformalRet
 

Friends

class SVFIRWriter
 
class SVFIRReader
 

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< 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
}
 
- 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 FunObjVarfun
 
const SVFBasicBlockbb
 
VFGNodeList VFGNodes
 
SVFStmtList pagEdges
 
- 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

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

Definition at line 348 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ FunExitICFGNode() [1/2]

SVF::FunExitICFGNode::FunExitICFGNode ( NodeID  id)
inlineprivate

Constructor to create empty FunExitICFGNode (for SVFIRReader/deserialization)

Definition at line 357 of file ICFGNode.h.

const SVFVar * formalRet
Definition ICFGNode.h:354
InterICFGNode(NodeID id, ICFGNodeK k)
Constructor.
Definition ICFGNode.h:243

◆ FunExitICFGNode() [2/2]

FunExitICFGNode::FunExitICFGNode ( NodeID  id,
const FunObjVar f 
)

Definition at line 49 of file ICFG.cpp.

50 : InterICFGNode(id, FunExitBlock), formalRet(nullptr)
51{
52 fun = f;
53 // if function is implemented
54 if (f->begin() != f->end())
55 {
56 bb = f->getExitBB();
57 }
58}
const SVFBasicBlock * bb
Definition ICFGNode.h:149
const FunObjVar * fun
Definition ICFGNode.h:148
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ addFormalRet()

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

Add formal return parameter.

Definition at line 375 of file ICFGNode.h.

376 {
377 formalRet = fr;
378 }

◆ classof() [1/5]

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

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

Definition at line 382 of file ICFGNode.h.

383 {
384 return true;
385 }

◆ classof() [2/5]

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

Definition at line 397 of file ICFGNode.h.

398 {
399 return node->getNodeKind() == FunExitBlock;
400 }

◆ classof() [3/5]

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

Definition at line 387 of file ICFGNode.h.

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

◆ classof() [4/5]

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

Definition at line 392 of file ICFGNode.h.

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

◆ classof() [5/5]

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

Definition at line 402 of file ICFGNode.h.

403 {
404 return node->getNodeKind() == FunExitBlock;
405 }

◆ getFormalRet()

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

Return formal return parameter.

Definition at line 369 of file ICFGNode.h.

370 {
371 return formalRet;
372 }

◆ getFun()

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

Return function.

Reimplemented from SVF::ICFGNode.

Definition at line 363 of file ICFGNode.h.

364 {
365 return fun;
366 }

◆ getSourceLoc()

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

Reimplemented from SVF::SVFValue.

Definition at line 134 of file ICFG.cpp.

135{
136 return "function ret: " + fun->getSourceLoc();
137}
virtual const std::string getSourceLoc() const
Definition SVFValue.h:194

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 117 of file ICFG.cpp.

118{
119 const FunObjVar *fun = getFun();
120 std::string str;
121 std::stringstream rawstr(str);
122 rawstr << "FunExitICFGNode" << getId();
123 rawstr << " {fun: " << fun->getName();
124 // ensure the enclosing function has exit basic block
125 if (!isExtCall(fun) && fun->hasReturn())
127 rawstr << intraICFGNode->getSourceLoc();
128 rawstr << "}";
129 for (const SVFStmt *stmt : getSVFStmts())
130 rawstr << "\n" << stmt->toString();
131 return rawstr.str();
132}
const std::string toString() const override
Definition ICFG.cpp:117
const FunObjVar * getFun() const override
Return function.
Definition ICFGNode.h:363
const SVFBasicBlock * getExitBB() const
bool hasReturn() const
const SVFStmtList & getSVFStmts() const
Definition ICFGNode.h:117
const ICFGNode * front() const
NodeID getId() const
Get ID.
Definition SVFValue.h:158
virtual const std::string & getName() const
Definition SVFValue.h:184
bool isExtCall(const FunObjVar *fun)
Definition SVFUtil.cpp:437

Friends And Related Symbol Documentation

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 351 of file ICFGNode.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 350 of file ICFGNode.h.

Member Data Documentation

◆ formalRet

const SVFVar* SVF::FunExitICFGNode::formalRet
private

Definition at line 354 of file ICFGNode.h.


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