Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public 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::SVFValue

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::SVFValue
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , ArgValNode ,
  FunValNode , GepValNode , RetValNode , VarargValNode ,
  GlobalValNode , ConstAggValNode , ConstDataValNode , BlackHoleValNode ,
  ConstFPValNode , ConstIntValNode , ConstNullptrValNode , DummyValNode ,
  ObjNode , GepObjNode , BaseObjNode , FunObjNode ,
  HeapObjNode , StackObjNode , GlobalObjNode , ConstAggObjNode ,
  ConstDataObjNode , ConstFPObjNode , ConstIntObjNode , ConstNullptrObjNode ,
  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 , BasicBlockKd , OtherKd
}
 

Public Member Functions

 CallICFGNode (NodeID id, const SVFBasicBlock *b, const SVFType *ty, const FunObjVar *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 FunObjVargetCaller () 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 FunObjVargetCalledFunction () 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
 
void setIndFunPtr (const SVFVar *indFun)
 
const SVFVargetIndFunPtr () const
 
- 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 FunObjVargetFun () 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, const SVFType *svfType=nullptr)
 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::SVFValue
 SVFValue (NodeID i, GNodeK k, const SVFType *ty=nullptr)
 
NodeID getId () const
 Get ID.
 
GNodeK getNodeKind () const
 Get node kind.
 
virtual const SVFTypegetType () const
 
virtual void setName (const std::string &nameInfo)
 
virtual void setName (std::string &&nameInfo)
 
virtual const std::string & getName () const
 
virtual void setSourceLoc (const std::string &sourceCodeInfo)
 
const std::string valueOnlyToString () const
 
const bool hasLLVMValue () 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 SVFValue *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 SVFValue *node)
 
- Static Public Member Functions inherited from SVF::ICFGNode
static bool classof (const ICFGNode *)
 
static bool classof (const GenericICFGNodeTy *node)
 
static bool classof (const SVFValue *node)
 
- Static Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFValue *)
 

Protected Attributes

const RetICFGNoderet
 
ActualParmNodeVec APNodes
 
const FunObjVarcalledFunc
 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
 
const SVFVarindFunPtr
 the function name of this virtual call
 
- Protected Attributes inherited from SVF::ICFGNode
const FunObjVarfun
 
const SVFBasicBlockbb
 
VFGNodeList VFGNodes
 
SVFStmtList pagEdges
 
- Protected Attributes inherited from SVF::SVFValue
NodeID id
 Node ID.
 
GNodeK nodeKind
 Node kind.
 
const SVFTypetype
 SVF type.
 
std::string name
 
std::string sourceLoc
 Source code information of this value.
 

Friends

class GraphDBClient
 

Additional Inherited Members

- Static Protected Member Functions inherited from SVF::SVFValue
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 isConstantDataValVar (GNodeK n)
 
static bool isObjVarKinds (GNodeK n)
 
static bool isBaseObjVarKinds (GNodeK n)
 
static bool isConstantDataObjVarKinds (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 406 of file ICFGNode.h.

Member Typedef Documentation

◆ ActualParmNodeVec

Definition at line 411 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ CallICFGNode()

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

Definition at line 426 of file ICFGNode.h.

429 : InterICFGNode(id, FunCallBlock), ret(nullptr), calledFunc(cf),
430 isvararg(iv), isVirCallInst(ivc), vtabPtr(nullptr),
432 {
433 fun = b->getFunction();
434 bb = b;
435 type = ty;
436 }
const cJSON *const b
Definition cJSON.h:255
bool isVirCallInst
is variable argument
Definition ICFGNode.h:418
const FunObjVar * calledFunc
arguments
Definition ICFGNode.h:416
const RetICFGNode * ret
Definition ICFGNode.h:414
SVFVar * vtabPtr
is virtual call inst
Definition ICFGNode.h:419
s32_t virtualFunIdx
virtual table pointer
Definition ICFGNode.h:420
std::string funNameOfVcall
virtual function index of the virtual table(s) at a virtual call
Definition ICFGNode.h:421
bool isvararg
called function
Definition ICFGNode.h:417
const SVFBasicBlock * bb
Definition ICFGNode.h:145
const FunObjVar * fun
Definition ICFGNode.h:144
InterICFGNode(NodeID id, ICFGNodeK k)
Constructor.
Definition ICFGNode.h:236
const SVFType * type
SVF type.
Definition SVFValue.h:208
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 476 of file ICFGNode.h.

477 {
478 APNodes.push_back(ap);
479 }
ActualParmNodeVec APNodes
Definition ICFGNode.h:415

◆ arg_empty()

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

Definition at line 491 of file ICFGNode.h.

492 {
493 return APNodes.empty();
494 }

◆ arg_size()

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

Definition at line 487 of file ICFGNode.h.

488 {
489 return APNodes.size();
490 }

◆ 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 542 of file ICFGNode.h.

543 {
544 return true;
545 }

◆ classof() [2/5]

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

Definition at line 557 of file ICFGNode.h.

558 {
559 return node->getNodeKind() == FunCallBlock;
560 }

◆ classof() [3/5]

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

Definition at line 547 of file ICFGNode.h.

548 {
549 return node->getNodeKind() == FunCallBlock;
550 }

◆ classof() [4/5]

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

Definition at line 552 of file ICFGNode.h.

553 {
554 return node->getNodeKind() == FunCallBlock;
555 }

◆ classof() [5/5]

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

Definition at line 562 of file ICFGNode.h.

563 {
564 return node->getNodeKind() == FunCallBlock;
565 }

◆ getActualParms()

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

Return the set of actual parameters.

Definition at line 470 of file ICFGNode.h.

471 {
472 return APNodes;
473 }

◆ getArgument()

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

Parameter operations.

Definition at line 482 of file ICFGNode.h.

483 {
484 return getActualParms()[ArgNo];
485 }
const ActualParmNodeVec & getActualParms() const
Return the set of actual parameters.
Definition ICFGNode.h:470

◆ getCalledFunction()

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

Definition at line 500 of file ICFGNode.h.

501 {
502 return calledFunc;
503 }

◆ getCaller()

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

Return callsite.

Definition at line 452 of file ICFGNode.h.

453 {
454 return getFun();
455 }
virtual const FunObjVar * getFun() const
Return the function of this ICFGNode.
Definition ICFGNode.h:74

◆ getFunIdxInVtable()

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

Definition at line 526 of file ICFGNode.h.

527 {
528 assert(isVirtualCall() && "not a virtual call?");
529 assert(virtualFunIdx >=0 && "virtual function idx is less than 0? not set yet?");
530 return virtualFunIdx;
531 }
bool isVirtualCall() const
Definition ICFGNode.h:509

◆ getFunNameOfVirtualCall()

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

Definition at line 533 of file ICFGNode.h.

534 {
535 assert(isVirtualCall() && "not a virtual call?");
536 return funNameOfVcall;
537 }

◆ getIndFunPtr()

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

Definition at line 581 of file ICFGNode.h.

582 {
583 assert(isIndirectCall() && "not a indirect call?");
584 return indFunPtr;
585 }
const SVFVar * indFunPtr
the function name of this virtual call
Definition ICFGNode.h:422
bool isIndirectCall() const
Return true if this is an indirect call.
Definition ICFGNode.h:464

◆ getNumArgOperands()

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

Definition at line 496 of file ICFGNode.h.

497 {
498 return arg_size();
499 }
u32_t arg_size() const
Definition ICFGNode.h:487

◆ getParent()

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

Return Basic Block.

Definition at line 458 of file ICFGNode.h.

459 {
460 return getBB();
461 }
virtual const SVFBasicBlock * getBB() const
Return the basic block of this ICFGNode.
Definition ICFGNode.h:80

◆ getRetICFGNode()

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

Return callsite.

Definition at line 439 of file ICFGNode.h.

440 {
441 assert(ret && "RetICFGNode not set?");
442 return ret;
443 }

◆ getSourceLoc()

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

Reimplemented from SVF::SVFValue.

Definition at line 570 of file ICFGNode.h.

571 {
572 return "CallICFGNode: " + ICFGNode::getSourceLoc();
573 }
virtual const std::string getSourceLoc() const
Definition SVFValue.h:196

◆ getVtablePtr()

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

Definition at line 519 of file ICFGNode.h.

520 {
521 assert(isVirtualCall() && "not a virtual call?");
522 return vtabPtr;
523 }

◆ isIndirectCall()

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

Return true if this is an indirect call.

Definition at line 464 of file ICFGNode.h.

465 {
466 return nullptr == calledFunc;
467 }

◆ isVarArg()

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

Definition at line 505 of file ICFGNode.h.

506 {
507 return isvararg;
508 }

◆ isVirtualCall()

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

Definition at line 509 of file ICFGNode.h.

510 {
511 return isVirCallInst;
512 }

◆ setIndFunPtr()

void SVF::CallICFGNode::setIndFunPtr ( const SVFVar indFun)
inline

Definition at line 575 of file ICFGNode.h.

576 {
577 assert(isIndirectCall() && "not a indirect call?");
579 }

◆ setRetICFGNode()

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

Return callsite.

Definition at line 446 of file ICFGNode.h.

447 {
448 ret = r;
449 }

◆ setVtablePtr()

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

Definition at line 514 of file ICFGNode.h.

515 {
516 vtabPtr = v;
517 }

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 128 of file ICFG.cpp.

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

Friends And Related Symbol Documentation

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 408 of file ICFGNode.h.

Member Data Documentation

◆ APNodes

ActualParmNodeVec SVF::CallICFGNode::APNodes
protected

Definition at line 415 of file ICFGNode.h.

◆ calledFunc

const FunObjVar* SVF::CallICFGNode::calledFunc
protected

arguments

Definition at line 416 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 421 of file ICFGNode.h.

◆ indFunPtr

const SVFVar* SVF::CallICFGNode::indFunPtr
protected

the function name of this virtual call

Definition at line 422 of file ICFGNode.h.

◆ isvararg

bool SVF::CallICFGNode::isvararg
protected

called function

Definition at line 417 of file ICFGNode.h.

◆ isVirCallInst

bool SVF::CallICFGNode::isVirCallInst
protected

is variable argument

Definition at line 418 of file ICFGNode.h.

◆ ret

const RetICFGNode* SVF::CallICFGNode::ret
protected

Definition at line 414 of file ICFGNode.h.

◆ virtualFunIdx

s32_t SVF::CallICFGNode::virtualFunIdx
protected

virtual table pointer

Definition at line 420 of file ICFGNode.h.

◆ vtabPtr

SVFVar* SVF::CallICFGNode::vtabPtr
protected

is virtual call inst

Definition at line 419 of file ICFGNode.h.


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