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

#include <ICFGNode.h>

Inheritance diagram for SVF::FunEntryICFGNode:
SVF::InterICFGNode SVF::ICFGNode SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFBaseNode

Public Types

typedef std::vector< const SVFVar * > FormalParmNodeVec
 
- 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::SVFBaseNode
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , FunValNode ,
  GepValNode , RetNode , VarargNode , DummyValNode ,
  ObjNode , GepObjNode , BaseObjNode , FunObjNode ,
  HeapObjNode , StackObjNode , 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 , OtherKd
}
 

Public Member Functions

 FunEntryICFGNode (NodeID id, const SVFFunction *f)
 
const SVFFunctiongetFun () const override
 Return function.
 
const FormalParmNodeVecgetFormalParms () const
 Return the set of formal parameters.
 
void addFormalParms (const SVFVar *fp)
 Add formal parameters.
 
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)
 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::SVFBaseNode
 SVFBaseNode (NodeID i, GNodeK k, SVFType *ty=nullptr)
 
NodeID getId () const
 Get ID.
 
GNodeK getNodeKind () const
 Get node kind.
 
virtual const SVFTypegetType () 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 InterICFGNode *node)
 
static bool classof (const ICFGNode *node)
 
static bool classof (const GenericICFGNodeTy *node)
 
static bool classof (const SVFBaseNode *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 SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::ICFGNode
static bool classof (const ICFGNode *)
 
static bool classof (const GenericICFGNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFBaseNode *)
 

Private Member Functions

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

Private Attributes

FormalParmNodeVec FPNodes
 

Friends

class SVFIRWriter
 
class SVFIRReader
 

Additional Inherited Members

- Static Protected Member Functions inherited from SVF::SVFBaseNode
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 isObjVarKinds (GNodeK n)
 
static bool isBaseObjVarKinds (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 SVFFunctionfun
 
const SVFBasicBlockbb
 
VFGNodeList VFGNodes
 
SVFStmtList pagEdges
 
- Protected Attributes inherited from SVF::SVFBaseNode
NodeID id
 Node ID.
 
GNodeK nodeKind
 Node kind.
 
const SVFTypetype
 SVF type.
 
std::string sourceLoc
 Source code information of this value.
 

Detailed Description

Function entry ICFGNode containing a set of FormalParmVFGNodes of a function

Definition at line 278 of file ICFGNode.h.

Member Typedef Documentation

◆ FormalParmNodeVec

Definition at line 284 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ FunEntryICFGNode() [1/2]

SVF::FunEntryICFGNode::FunEntryICFGNode ( NodeID  id)
inlineprivate

Constructor to create empty FunEntryICFGNode (for SVFIRReader/deserialization)

Definition at line 289 of file ICFGNode.h.

InterICFGNode(NodeID id, ICFGNodeK k)
Constructor.
Definition ICFGNode.h:243

◆ FunEntryICFGNode() [2/2]

FunEntryICFGNode::FunEntryICFGNode ( NodeID  id,
const SVFFunction f 
)

Definition at line 40 of file ICFG.cpp.

41{
42 fun = f;
43 // if function is implemented
44 if (f->begin() != f->end())
45 {
46 bb = f->getEntryBlock();
47 }
48}
const SVFFunction * fun
Definition ICFGNode.h:148
const SVFBasicBlock * bb
Definition ICFGNode.h:149
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ addFormalParms()

void SVF::FunEntryICFGNode::addFormalParms ( const SVFVar fp)
inline

Add formal parameters.

Definition at line 307 of file ICFGNode.h.

308 {
309 FPNodes.push_back(fp);
310 }
FormalParmNodeVec FPNodes
Definition ICFGNode.h:286

◆ classof() [1/5]

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

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

Definition at line 314 of file ICFGNode.h.

315 {
316 return true;
317 }

◆ classof() [2/5]

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

Definition at line 329 of file ICFGNode.h.

330 {
331 return node->getNodeKind() == FunEntryBlock;
332 }

◆ classof() [3/5]

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

Definition at line 324 of file ICFGNode.h.

325 {
326 return node->getNodeKind() == FunEntryBlock;
327 }

◆ classof() [4/5]

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

Definition at line 319 of file ICFGNode.h.

320 {
321 return node->getNodeKind() == FunEntryBlock;
322 }

◆ classof() [5/5]

static bool SVF::FunEntryICFGNode::classof ( const SVFBaseNode node)
inlinestatic

Definition at line 334 of file ICFGNode.h.

335 {
336 return node->getNodeKind() == FunEntryBlock;
337 }

◆ getFormalParms()

const FormalParmNodeVec & SVF::FunEntryICFGNode::getFormalParms ( ) const
inline

Return the set of formal parameters.

Definition at line 301 of file ICFGNode.h.

302 {
303 return FPNodes;
304 }

◆ getFun()

const SVFFunction * SVF::FunEntryICFGNode::getFun ( ) const
inlineoverridevirtual

Return function.

Reimplemented from SVF::ICFGNode.

Definition at line 295 of file ICFGNode.h.

296 {
297 return fun;
298 }

◆ getSourceLoc()

const std::string SVF::FunEntryICFGNode::getSourceLoc ( ) const
inlineoverridevirtual

Reimplemented from SVF::SVFBaseNode.

Definition at line 342 of file ICFGNode.h.

343 {
344 return "function entry: " + fun->getSourceLoc();
345 }
virtual const std::string getSourceLoc() const
Definition SVFValue.h:280

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 99 of file ICFG.cpp.

100{
101 std::string str;
102 std::stringstream rawstr(str);
103 rawstr << "FunEntryICFGNode" << getId();
104 rawstr << " {fun: " << getFun()->getName();
105 if (isExtCall(getFun())==false)
106 rawstr << getFun()->getSourceLoc();
107 rawstr << "}";
108 for (const SVFStmt *stmt : getSVFStmts())
109 rawstr << "\n" << stmt->toString();
110 return rawstr.str();
111}
const SVFFunction * getFun() const override
Return function.
Definition ICFGNode.h:295
const std::string toString() const override
Definition ICFG.cpp:99
const SVFStmtList & getSVFStmts() const
Definition ICFGNode.h:117
NodeID getId() const
Get ID.
const std::string & getName() const
Definition SVFValue.h:243
bool isExtCall(const SVFFunction *fun)
Definition SVFUtil.h:278

Friends And Related Symbol Documentation

◆ SVFIRReader

Definition at line 281 of file ICFGNode.h.

◆ SVFIRWriter

Definition at line 280 of file ICFGNode.h.

Member Data Documentation

◆ FPNodes

FormalParmNodeVec SVF::FunEntryICFGNode::FPNodes
private

Definition at line 286 of file ICFGNode.h.


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