SVF
Public Types | Public Member Functions | Private Attributes | List of all members
SVF::FunEntryBlockNode Class Reference

#include <ICFGNode.h>

Inheritance diagram for SVF::FunEntryBlockNode:
SVF::InterBlockNode SVF::ICFGNode SVF::GenericNode< NodeTy, EdgeTy >

Public Types

typedef std::vector< const PAGNode * > FormalParmNodeVec
 
- Public Types inherited from SVF::ICFGNode
enum  ICFGNodeK {
  IntraBlock, FunEntryBlock, FunExitBlock, FunCallBlock,
  FunRetBlock, GlobalBlock
}
 
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 PAGEdge * > PAGEdgeList
 
- Public Types inherited from SVF::GenericNode< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef s32_t GNodeK
 Edge kind. More...
 
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
 
typedef GEdgeSetTy::iterator iterator
 
typedef GEdgeSetTy::const_iterator const_iterator
 

Public Member Functions

 FunEntryBlockNode (NodeID id, const SVFFunction *f)
 
const SVFFunctiongetFun () const
 Return function. More...
 
const FormalParmNodeVecgetFormalParms () const
 Return the set of formal parameters. More...
 
void addFormalParms (const PAGNode *fp)
 Add formal parameters. More...
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::InterBlockNode
 InterBlockNode (NodeID id, ICFGNodeK k)
 Constructor. More...
 
- Public Member Functions inherited from SVF::ICFGNode
 ICFGNode (NodeID i, ICFGNodeK k)
 Constructor. More...
 
virtual const BasicBlockgetBB () const
 Return the function of this ICFGNode. More...
 
void dump () const
 
void addVFGNode (const VFGNode *vfgNode)
 
const VFGNodeListgetVFGNodes () const
 
void addPAGEdge (const PAGEdge *edge)
 
const PAGEdgeListgetPAGEdges () const
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 GenericNode (NodeID i, GNodeK k)
 Constructor. More...
 
virtual ~GenericNode ()
 Destructor. More...
 
NodeID getId () const
 Get ID. More...
 
GNodeK getNodeKind () const
 Get node kind. More...
 
const GEdgeSetTygetOutEdges () const
 
const GEdgeSetTygetInEdges () const
 
bool hasIncomingEdge () const
 Has incoming/outgoing edge set. More...
 
bool hasOutgoingEdge () const
 
iterator OutEdgeBegin ()
 iterators More...
 
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 necessory. More...
 
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. More...
 
bool addOutgoingEdge (EdgeType *outEdge)
 
Size_t removeIncomingEdge (EdgeType *edge)
 
Size_t removeOutgoingEdge (EdgeType *edge)
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges. More...
 
EdgeTypehasOutgoingEdge (EdgeType *edge) const
 

Static Public Member Functions

static bool classof (const FunEntryBlockNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const InterBlockNode *node)
 
static bool classof (const ICFGNode *node)
 
static bool classof (const GenericICFGNodeTy *node)
 
- Static Public Member Functions inherited from SVF::InterBlockNode
static bool classof (const InterBlockNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const ICFGNode *node)
 
static bool classof (const GenericICFGNodeTy *node)
 

Private Attributes

FormalParmNodeVec FPNodes
 

Additional Inherited Members

- Protected Attributes inherited from SVF::ICFGNode
const SVFFunctionfun
 
const BasicBlockbb
 
VFGNodeList VFGNodes
 
PAGEdgeList pagEdges
 

Detailed Description

Function entry ICFGNode containing a set of FormalParmVFGNodes of a function

Definition at line 251 of file ICFGNode.h.

Member Typedef Documentation

◆ FormalParmNodeVec

typedef std::vector<const PAGNode *> SVF::FunEntryBlockNode::FormalParmNodeVec

Definition at line 255 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ FunEntryBlockNode()

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

Definition at line 41 of file ICFG.cpp.

42 {
43  fun = f;
44  // if function is implemented
45  if (f->getLLVMFun()->begin() != f->getLLVMFun()->end()) {
46  bb = &(f->getLLVMFun()->getEntryBlock());
47  }
48 }
const SVFFunction * fun
Definition: ICFGNode.h:132
const BasicBlock * bb
Definition: ICFGNode.h:133
InterBlockNode(NodeID id, ICFGNodeK k)
Constructor.
Definition: ICFGNode.h:218
Function * getLLVMFun() const
Definition: BasicTypes.h:245

Member Function Documentation

◆ addFormalParms()

void SVF::FunEntryBlockNode::addFormalParms ( const PAGNode fp)
inline

Add formal parameters.

Definition at line 274 of file ICFGNode.h.

275  {
276  FPNodes.push_back(fp);
277  }
FormalParmNodeVec FPNodes
Definition: ICFGNode.h:257

◆ classof() [1/4]

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

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

Definition at line 281 of file ICFGNode.h.

282  {
283  return true;
284  }

◆ classof() [2/4]

static bool SVF::FunEntryBlockNode::classof ( const InterBlockNode node)
inlinestatic

Definition at line 286 of file ICFGNode.h.

287  {
288  return node->getNodeKind() == FunEntryBlock;
289  }

◆ classof() [3/4]

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

Definition at line 291 of file ICFGNode.h.

292  {
293  return node->getNodeKind() == FunEntryBlock;
294  }

◆ classof() [4/4]

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

Definition at line 296 of file ICFGNode.h.

297  {
298  return node->getNodeKind() == FunEntryBlock;
299  }

◆ getFormalParms()

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

Return the set of formal parameters.

Definition at line 268 of file ICFGNode.h.

269  {
270  return FPNodes;
271  }
FormalParmNodeVec FPNodes
Definition: ICFGNode.h:257

◆ getFun()

const SVFFunction* SVF::FunEntryBlockNode::getFun ( ) const
inlinevirtual

Return function.

Reimplemented from SVF::ICFGNode.

Definition at line 262 of file ICFGNode.h.

263  {
264  return fun;
265  }
const SVFFunction * fun
Definition: ICFGNode.h:132

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 89 of file ICFG.cpp.

89  {
90  std::string str;
91  raw_string_ostream rawstr(str);
92  rawstr << "FunEntryBlockNode ID: " << getId();
93  if (isExtCall(getFun()))
94  rawstr << " Entry(" << ")\n";
95  else
96  rawstr << " Entry(" << getSourceLoc(getFun()->getLLVMFun()) << ")\n";
97  rawstr << " {fun: " << getFun()->getName() << "}";
98  return rawstr.str();
99 }
std::string getSourceLoc(const Value *val)
Return source code including line number and file name from debug information.
Definition: SVFUtil.cpp:259
const llvm::StringRef getName() const
llvm::raw_string_ostream raw_string_ostream
Definition: BasicTypes.h:100
NodeID getId() const
Get ID.
Definition: GenericGraph.h:164
const SVFFunction * getFun() const
Return function.
Definition: ICFGNode.h:262
bool isExtCall(const SVFFunction *fun)
Definition: LLVMUtil.h:64

Member Data Documentation

◆ FPNodes

FormalParmNodeVec SVF::FunEntryBlockNode::FPNodes
private

Definition at line 257 of file ICFGNode.h.


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