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

#include <ICFGNode.h>

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

Public Types

typedef std::vector< const PAGNode * > ActualParmVFGNodeVec
 
- 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

 CallBlockNode (NodeID id, const Instruction *c)
 
const InstructiongetCallSite () const
 Return callsite. More...
 
const RetBlockNodegetRetBlockNode () const
 Return callsite. More...
 
void setRetBlockNode (const RetBlockNode *r)
 Return callsite. More...
 
const SVFFunctiongetCaller () const
 Return callsite. More...
 
const BasicBlockgetParent () const
 Return Basic Block. More...
 
bool isIndirectCall () const
 Return true if this is an indirect call. More...
 
const ActualParmVFGNodeVecgetActualParms () const
 Return the set of actual parameters. More...
 
void addActualParms (const PAGNode *ap)
 Add actual 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 SVFFunctiongetFun () const
 Return the function of this ICFGNode. 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 CallBlockNode *)
 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 Instructioncs
 
const RetBlockNoderet
 
ActualParmVFGNodeVec APNodes
 

Additional Inherited Members

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

Detailed Description

Call ICFGNode containing a set of ActualParmVFGNodes at a callsite

Definition at line 364 of file ICFGNode.h.

Member Typedef Documentation

◆ ActualParmVFGNodeVec

typedef std::vector<const PAGNode *> SVF::CallBlockNode::ActualParmVFGNodeVec

Definition at line 368 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ CallBlockNode()

SVF::CallBlockNode::CallBlockNode ( NodeID  id,
const Instruction c 
)
inline

Definition at line 374 of file ICFGNode.h.

374  : InterBlockNode(id, FunCallBlock), cs(c), ret(nullptr)
375  {
377  bb = cs->getParent();
378  }
const SVFFunction * fun
Definition: ICFGNode.h:132
const RetBlockNode * ret
Definition: ICFGNode.h:371
const BasicBlock * bb
Definition: ICFGNode.h:133
InterBlockNode(NodeID id, ICFGNodeK k)
Constructor.
Definition: ICFGNode.h:218
static LLVMModuleSet * getLLVMModuleSet()
Definition: LLVMModule.h:69
const Instruction * cs
Definition: ICFGNode.h:370
const SVFFunction * getSVFFunction(const Function *fun) const
Definition: LLVMModule.h:110

Member Function Documentation

◆ addActualParms()

void SVF::CallBlockNode::addActualParms ( const PAGNode ap)
inline

Add actual parameters.

Definition at line 424 of file ICFGNode.h.

425  {
426  APNodes.push_back(ap);
427  }
ActualParmVFGNodeVec APNodes
Definition: ICFGNode.h:372

◆ classof() [1/4]

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

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

Definition at line 431 of file ICFGNode.h.

432  {
433  return true;
434  }

◆ classof() [2/4]

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

Definition at line 436 of file ICFGNode.h.

437  {
438  return node->getNodeKind() == FunCallBlock;
439  }

◆ classof() [3/4]

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

Definition at line 441 of file ICFGNode.h.

442  {
443  return node->getNodeKind() == FunCallBlock;
444  }

◆ classof() [4/4]

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

Definition at line 446 of file ICFGNode.h.

447  {
448  return node->getNodeKind() == FunCallBlock;
449  }

◆ getActualParms()

const ActualParmVFGNodeVec& SVF::CallBlockNode::getActualParms ( ) const
inline

Return the set of actual parameters.

Definition at line 418 of file ICFGNode.h.

419  {
420  return APNodes;
421  }
ActualParmVFGNodeVec APNodes
Definition: ICFGNode.h:372

◆ getCaller()

const SVFFunction* SVF::CallBlockNode::getCaller ( ) const
inline

Return callsite.

Definition at line 400 of file ICFGNode.h.

401  {
402  return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(cs->getFunction());
403  }
static LLVMModuleSet * getLLVMModuleSet()
Definition: LLVMModule.h:69
const Instruction * cs
Definition: ICFGNode.h:370
const SVFFunction * getSVFFunction(const Function *fun) const
Definition: LLVMModule.h:110

◆ getCallSite()

const Instruction* SVF::CallBlockNode::getCallSite ( ) const
inline

Return callsite.

Definition at line 381 of file ICFGNode.h.

382  {
383  return cs;
384  }
const Instruction * cs
Definition: ICFGNode.h:370

◆ getParent()

const BasicBlock* SVF::CallBlockNode::getParent ( ) const
inline

Return Basic Block.

Definition at line 406 of file ICFGNode.h.

407  {
408  return cs->getParent();
409  }
const Instruction * cs
Definition: ICFGNode.h:370

◆ getRetBlockNode()

const RetBlockNode* SVF::CallBlockNode::getRetBlockNode ( ) const
inline

Return callsite.

Definition at line 387 of file ICFGNode.h.

388  {
389  assert(ret && "RetBlockNode not set?");
390  return ret;
391  }
#define assert(ex)
Definition: util.h:141
const RetBlockNode * ret
Definition: ICFGNode.h:371

◆ isIndirectCall()

bool SVF::CallBlockNode::isIndirectCall ( ) const
inline

Return true if this is an indirect call.

Definition at line 412 of file ICFGNode.h.

413  {
414  return nullptr == SVFUtil::getCallee(cs);
415  }
const SVFFunction * getCallee(const CallSite cs)
Return callee of a callsite. Return null if this is an indirect call.
Definition: SVFUtil.h:221
const Instruction * cs
Definition: ICFGNode.h:370

◆ setRetBlockNode()

void SVF::CallBlockNode::setRetBlockNode ( const RetBlockNode r)
inline

Return callsite.

Definition at line 394 of file ICFGNode.h.

395  {
396  ret = r;
397  }
const RetBlockNode * ret
Definition: ICFGNode.h:371

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 114 of file ICFG.cpp.

114  {
115  std::string str;
116  raw_string_ostream rawstr(str);
117  rawstr << "CallBlockNode ID: " << getId();
118  rawstr << value2String(getCallSite()) << " {fun: " << getFun()->getName() << "}";
119  return rawstr.str();
120 }
virtual const SVFFunction * getFun() const
Return the function of this ICFGNode.
Definition: ICFGNode.h:80
const llvm::StringRef getName() const
llvm::raw_string_ostream raw_string_ostream
Definition: BasicTypes.h:100
const std::string value2String(const Value *value)
Definition: SVFUtil.cpp:359
const Instruction * getCallSite() const
Return callsite.
Definition: ICFGNode.h:381
NodeID getId() const
Get ID.
Definition: GenericGraph.h:164

Member Data Documentation

◆ APNodes

ActualParmVFGNodeVec SVF::CallBlockNode::APNodes
private

Definition at line 372 of file ICFGNode.h.

◆ cs

const Instruction* SVF::CallBlockNode::cs
private

Definition at line 370 of file ICFGNode.h.

◆ ret

const RetBlockNode* SVF::CallBlockNode::ret
private

Definition at line 371 of file ICFGNode.h.


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