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

#include <ICFGNode.h>

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

Public Member Functions

 FunExitBlockNode (NodeID id, const SVFFunction *f)
 
const SVFFunctiongetFun () const
 Return function. More...
 
const PAGNodegetFormalRet () const
 Return actual return parameter. More...
 
void addFormalRet (const PAGNode *fr)
 Add actual return parameter. 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 ICFGNode *node)
 
static bool classof (const InterBlockNode *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

const SVFFunctionfun
 
const PAGNodeformalRet
 

Additional Inherited Members

- 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
 
- Protected Attributes inherited from SVF::ICFGNode
const SVFFunctionfun
 
const BasicBlockbb
 
VFGNodeList VFGNodes
 
PAGEdgeList pagEdges
 

Detailed Description

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

Definition at line 308 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ FunExitBlockNode()

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

Definition at line 50 of file ICFG.cpp.

50  : InterBlockNode(id, FunExitBlock), fun(f), formalRet(nullptr)
51 {
52  fun = f;
53  // if function is implemented
54  if (f->getLLVMFun()->begin() != f->getLLVMFun()->end()) {
56  }
57 
58 }
const PAGNode * formalRet
Definition: ICFGNode.h:313
const BasicBlock * getFunExitBB(const Function *fun)
Definition: LLVMUtil.h:494
const BasicBlock * bb
Definition: ICFGNode.h:133
InterBlockNode(NodeID id, ICFGNodeK k)
Constructor.
Definition: ICFGNode.h:218
Function * getLLVMFun() const
Definition: BasicTypes.h:245
const SVFFunction * fun
Definition: ICFGNode.h:312

Member Function Documentation

◆ addFormalRet()

void SVF::FunExitBlockNode::addFormalRet ( const PAGNode fr)
inline

Add actual return parameter.

Definition at line 330 of file ICFGNode.h.

331  {
332  formalRet = fr;
333  }
const PAGNode * formalRet
Definition: ICFGNode.h:313

◆ classof() [1/4]

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

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

Definition at line 337 of file ICFGNode.h.

338  {
339  return true;
340  }

◆ classof() [2/4]

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

Definition at line 342 of file ICFGNode.h.

343  {
344  return node->getNodeKind() == FunExitBlock;
345  }

◆ classof() [3/4]

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

Definition at line 347 of file ICFGNode.h.

348  {
349  return node->getNodeKind() == FunExitBlock;
350  }

◆ classof() [4/4]

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

Definition at line 352 of file ICFGNode.h.

353  {
354  return node->getNodeKind() == FunExitBlock;
355  }

◆ getFormalRet()

const PAGNode* SVF::FunExitBlockNode::getFormalRet ( ) const
inline

Return actual return parameter.

Definition at line 324 of file ICFGNode.h.

325  {
326  return formalRet;
327  }
const PAGNode * formalRet
Definition: ICFGNode.h:313

◆ getFun()

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

Return function.

Reimplemented from SVF::ICFGNode.

Definition at line 318 of file ICFGNode.h.

319  {
320  return fun;
321  }
const SVFFunction * fun
Definition: ICFGNode.h:312

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 101 of file ICFG.cpp.

101  {
102  std::string str;
103  raw_string_ostream rawstr(str);
104  rawstr << "FunExitBlockNode ID: " << getId();
105  if (isExtCall(getFun()))
106  rawstr << " Exit(" << ")\n";
107  else
108  rawstr << " Exit(" << getSourceLoc(getFunExitBB(getFun()->getLLVMFun())->getFirstNonPHI()) << ")\n";
109  rawstr << " {fun: " << getFun()->getName() << "}";
110  return rawstr.str();
111 }
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
const BasicBlock * getFunExitBB(const Function *fun)
Definition: LLVMUtil.h:494
const SVFFunction * getFun() const
Return function.
Definition: ICFGNode.h:318
NodeID getId() const
Get ID.
Definition: GenericGraph.h:164
bool isExtCall(const SVFFunction *fun)
Definition: LLVMUtil.h:64

Member Data Documentation

◆ formalRet

const PAGNode* SVF::FunExitBlockNode::formalRet
private

Definition at line 313 of file ICFGNode.h.

◆ fun

const SVFFunction* SVF::FunExitBlockNode::fun
private

Definition at line 312 of file ICFGNode.h.


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