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

#include <ICFGNode.h>

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

Public Types

typedef std::vector< const ValVar * > ActualParmNodeVec
 
- 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

 CallICFGNode (NodeID id, const SVFBasicBlock *b, const SVFType *ty, const SVFFunction *cf, bool iv, bool ivc, s32_t vfi, const std::string &fnv)
 
const RetICFGNodegetRetICFGNode () const
 Return callsite.
 
void setRetICFGNode (const RetICFGNode *r)
 Return callsite.
 
const SVFFunctiongetCaller () const
 Return callsite.
 
const SVFBasicBlockgetParent () const
 Return Basic Block.
 
bool isIndirectCall () const
 Return true if this is an indirect call.
 
const ActualParmNodeVecgetActualParms () const
 Return the set of actual parameters.
 
void addActualParms (const ValVar *ap)
 Add actual parameters.
 
const ValVargetArgument (u32_t ArgNo) const
 Parameter operations.
 
u32_t arg_size () const
 
bool arg_empty () const
 
u32_t getNumArgOperands () const
 
const SVFFunctiongetCalledFunction () const
 
bool isVarArg () const
 
bool isVirtualCall () const
 
void setVtablePtr (SVFVar *v)
 
const SVFVargetVtablePtr () const
 
s32_t getFunIdxInVtable () const
 
const std::string & getFunNameOfVirtualCall () const
 
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 SVFFunctiongetFun () const
 Return the function of this ICFGNode.
 
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 CallICFGNode *)
 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 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 *)
 

Protected Member Functions

 CallICFGNode (NodeID id)
 the function name of this virtual call
 

Protected Attributes

const RetICFGNoderet
 
ActualParmNodeVec APNodes
 
const SVFFunctioncalledFunc
 arguments
 
bool isvararg
 called function
 
bool isVirCallInst
 is variable argument
 
SVFVarvtabPtr
 is virtual call inst
 
s32_t virtualFunIdx
 virtual table pointer
 
std::string funNameOfVcall
 virtual function index of the virtual table(s) at a virtual call
 
- 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.
 

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)
 

Detailed Description

Call ICFGNode containing a set of ActualParmVFGNodes at a callsite

Definition at line 422 of file ICFGNode.h.

Member Typedef Documentation

◆ ActualParmNodeVec

Definition at line 428 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ CallICFGNode() [1/2]

SVF::CallICFGNode::CallICFGNode ( NodeID  id)
inlineprotected

the function name of this virtual call

Constructor to create empty CallICFGNode (for SVFIRReader/deserialization)

Definition at line 441 of file ICFGNode.h.

441: InterICFGNode(id, FunCallBlock), ret{} {}
const RetICFGNode * ret
Definition ICFGNode.h:431
InterICFGNode(NodeID id, ICFGNodeK k)
Constructor.
Definition ICFGNode.h:243

◆ CallICFGNode() [2/2]

SVF::CallICFGNode::CallICFGNode ( NodeID  id,
const SVFBasicBlock b,
const SVFType ty,
const SVFFunction cf,
bool  iv,
bool  ivc,
s32_t  vfi,
const std::string &  fnv 
)
inline

Definition at line 444 of file ICFGNode.h.

447 : InterICFGNode(id, FunCallBlock), ret(nullptr), calledFunc(cf),
448 isvararg(iv), isVirCallInst(ivc), vtabPtr(nullptr),
450 {
451 fun = b->getFunction();
452 bb = b;
453 type = ty;
454 }
const cJSON *const b
Definition cJSON.h:255
bool isVirCallInst
is variable argument
Definition ICFGNode.h:435
SVFVar * vtabPtr
is virtual call inst
Definition ICFGNode.h:436
s32_t virtualFunIdx
virtual table pointer
Definition ICFGNode.h:437
std::string funNameOfVcall
virtual function index of the virtual table(s) at a virtual call
Definition ICFGNode.h:438
bool isvararg
called function
Definition ICFGNode.h:434
const SVFFunction * calledFunc
arguments
Definition ICFGNode.h:433
const SVFFunction * fun
Definition ICFGNode.h:148
const SVFBasicBlock * bb
Definition ICFGNode.h:149
const SVFType * type
SVF type.
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ addActualParms()

void SVF::CallICFGNode::addActualParms ( const ValVar ap)
inline

Add actual parameters.

Definition at line 494 of file ICFGNode.h.

495 {
496 APNodes.push_back(ap);
497 }
ActualParmNodeVec APNodes
Definition ICFGNode.h:432

◆ arg_empty()

bool SVF::CallICFGNode::arg_empty ( ) const
inline

Definition at line 509 of file ICFGNode.h.

510 {
511 return APNodes.empty();
512 }

◆ arg_size()

u32_t SVF::CallICFGNode::arg_size ( ) const
inline

Definition at line 505 of file ICFGNode.h.

506 {
507 return APNodes.size();
508 }

◆ classof() [1/5]

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

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

Definition at line 560 of file ICFGNode.h.

561 {
562 return true;
563 }

◆ classof() [2/5]

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

Definition at line 575 of file ICFGNode.h.

576 {
577 return node->getNodeKind() == FunCallBlock;
578 }

◆ classof() [3/5]

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

Definition at line 565 of file ICFGNode.h.

566 {
567 return node->getNodeKind() == FunCallBlock;
568 }

◆ classof() [4/5]

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

Definition at line 570 of file ICFGNode.h.

571 {
572 return node->getNodeKind() == FunCallBlock;
573 }

◆ classof() [5/5]

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

Definition at line 580 of file ICFGNode.h.

581 {
582 return node->getNodeKind() == FunCallBlock;
583 }

◆ getActualParms()

const ActualParmNodeVec & SVF::CallICFGNode::getActualParms ( ) const
inline

Return the set of actual parameters.

Definition at line 488 of file ICFGNode.h.

489 {
490 return APNodes;
491 }

◆ getArgument()

const ValVar * SVF::CallICFGNode::getArgument ( u32_t  ArgNo) const
inline

Parameter operations.

Definition at line 500 of file ICFGNode.h.

501 {
502 return getActualParms()[ArgNo];
503 }
const ActualParmNodeVec & getActualParms() const
Return the set of actual parameters.
Definition ICFGNode.h:488

◆ getCalledFunction()

const SVFFunction * SVF::CallICFGNode::getCalledFunction ( ) const
inline

Definition at line 518 of file ICFGNode.h.

519 {
520 return calledFunc;
521 }

◆ getCaller()

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

Return callsite.

Definition at line 470 of file ICFGNode.h.

471 {
472 return getFun();
473 }
virtual const SVFFunction * getFun() const
Return the function of this ICFGNode.
Definition ICFGNode.h:76

◆ getFunIdxInVtable()

s32_t SVF::CallICFGNode::getFunIdxInVtable ( ) const
inline

Definition at line 544 of file ICFGNode.h.

545 {
546 assert(isVirtualCall() && "not a virtual call?");
547 assert(virtualFunIdx >=0 && "virtual function idx is less than 0? not set yet?");
548 return virtualFunIdx;
549 }
bool isVirtualCall() const
Definition ICFGNode.h:527

◆ getFunNameOfVirtualCall()

const std::string & SVF::CallICFGNode::getFunNameOfVirtualCall ( ) const
inline

Definition at line 551 of file ICFGNode.h.

552 {
553 assert(isVirtualCall() && "not a virtual call?");
554 return funNameOfVcall;
555 }

◆ getNumArgOperands()

u32_t SVF::CallICFGNode::getNumArgOperands ( ) const
inline

Definition at line 514 of file ICFGNode.h.

515 {
516 return arg_size();
517 }
u32_t arg_size() const
Definition ICFGNode.h:505

◆ getParent()

const SVFBasicBlock * SVF::CallICFGNode::getParent ( ) const
inline

Return Basic Block.

Definition at line 476 of file ICFGNode.h.

477 {
478 return getBB();
479 }
virtual const SVFBasicBlock * getBB() const
Return the basic block of this ICFGNode.
Definition ICFGNode.h:82

◆ getRetICFGNode()

const RetICFGNode * SVF::CallICFGNode::getRetICFGNode ( ) const
inline

Return callsite.

Definition at line 457 of file ICFGNode.h.

458 {
459 assert(ret && "RetICFGNode not set?");
460 return ret;
461 }

◆ getSourceLoc()

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

Reimplemented from SVF::SVFBaseNode.

Definition at line 588 of file ICFGNode.h.

589 {
590 return "CallICFGNode: " + ICFGNode::getSourceLoc();
591 }
virtual const std::string getSourceLoc() const

◆ getVtablePtr()

const SVFVar * SVF::CallICFGNode::getVtablePtr ( ) const
inline

Definition at line 537 of file ICFGNode.h.

538 {
539 assert(isVirtualCall() && "not a virtual call?");
540 return vtabPtr;
541 }

◆ isIndirectCall()

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

Return true if this is an indirect call.

Definition at line 482 of file ICFGNode.h.

483 {
484 return nullptr == calledFunc;
485 }

◆ isVarArg()

bool SVF::CallICFGNode::isVarArg ( ) const
inline

Definition at line 523 of file ICFGNode.h.

524 {
525 return isvararg;
526 }

◆ isVirtualCall()

bool SVF::CallICFGNode::isVirtualCall ( ) const
inline

Definition at line 527 of file ICFGNode.h.

528 {
529 return isVirCallInst;
530 }

◆ setRetICFGNode()

void SVF::CallICFGNode::setRetICFGNode ( const RetICFGNode r)
inline

Return callsite.

Definition at line 464 of file ICFGNode.h.

465 {
466 ret = r;
467 }

◆ setVtablePtr()

void SVF::CallICFGNode::setVtablePtr ( SVFVar v)
inline

Definition at line 532 of file ICFGNode.h.

533 {
534 vtabPtr = v;
535 }

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 131 of file ICFG.cpp.

132{
133 std::string str;
134 std::stringstream rawstr(str);
135 rawstr << "CallICFGNode" << getId();
136 rawstr << " {fun: " << getFun()->getName() << ICFGNode::getSourceLoc() << "}";
137 for (const SVFStmt *stmt : getSVFStmts())
138 rawstr << "\n" << stmt->toString();
139 if(getSVFStmts().empty())
140 rawstr << "\n" << valueOnlyToString();
141 return rawstr.str();
142}
const std::string toString() const override
Definition ICFG.cpp:131
const SVFStmtList & getSVFStmts() const
Definition ICFGNode.h:117
NodeID getId() const
Get ID.
const std::string valueOnlyToString() const
Definition LLVMUtil.cpp:746
const std::string & getName() const
Definition SVFValue.h:243

Friends And Related Symbol Documentation

◆ SVFIRReader

Definition at line 425 of file ICFGNode.h.

◆ SVFIRWriter

Definition at line 424 of file ICFGNode.h.

Member Data Documentation

◆ APNodes

ActualParmNodeVec SVF::CallICFGNode::APNodes
protected

Definition at line 432 of file ICFGNode.h.

◆ calledFunc

const SVFFunction* SVF::CallICFGNode::calledFunc
protected

arguments

Definition at line 433 of file ICFGNode.h.

◆ funNameOfVcall

std::string SVF::CallICFGNode::funNameOfVcall
protected

virtual function index of the virtual table(s) at a virtual call

Definition at line 438 of file ICFGNode.h.

◆ isvararg

bool SVF::CallICFGNode::isvararg
protected

called function

Definition at line 434 of file ICFGNode.h.

◆ isVirCallInst

bool SVF::CallICFGNode::isVirCallInst
protected

is variable argument

Definition at line 435 of file ICFGNode.h.

◆ ret

const RetICFGNode* SVF::CallICFGNode::ret
protected

Definition at line 431 of file ICFGNode.h.

◆ virtualFunIdx

s32_t SVF::CallICFGNode::virtualFunIdx
protected

virtual table pointer

Definition at line 437 of file ICFGNode.h.

◆ vtabPtr

SVFVar* SVF::CallICFGNode::vtabPtr
protected

is virtual call inst

Definition at line 436 of file ICFGNode.h.


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