Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | 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)
 the function name of this virtual call
 
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
 
- 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
 

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
 
- 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.
 

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

Member Typedef Documentation

◆ ActualParmNodeVec

Definition at line 403 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

the function name of this virtual call

Definition at line 416 of file ICFGNode.h.

419 : InterICFGNode(id, FunCallBlock), ret(nullptr), calledFunc(cf),
420 isvararg(iv), isVirCallInst(ivc), vtabPtr(nullptr),
422 {
423 fun = b->getFunction();
424 bb = b;
425 type = ty;
426 }
const cJSON *const b
Definition cJSON.h:255
bool isVirCallInst
is variable argument
Definition ICFGNode.h:410
const FunObjVar * calledFunc
arguments
Definition ICFGNode.h:408
const RetICFGNode * ret
Definition ICFGNode.h:406
SVFVar * vtabPtr
is virtual call inst
Definition ICFGNode.h:411
s32_t virtualFunIdx
virtual table pointer
Definition ICFGNode.h:412
std::string funNameOfVcall
virtual function index of the virtual table(s) at a virtual call
Definition ICFGNode.h:413
bool isvararg
called function
Definition ICFGNode.h:409
const SVFBasicBlock * bb
Definition ICFGNode.h:147
const FunObjVar * fun
Definition ICFGNode.h:146
InterICFGNode(NodeID id, ICFGNodeK k)
Constructor.
Definition ICFGNode.h:236
const SVFType * type
SVF type.
Definition SVFValue.h:207
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 466 of file ICFGNode.h.

467 {
468 APNodes.push_back(ap);
469 }
ActualParmNodeVec APNodes
Definition ICFGNode.h:407

◆ arg_empty()

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

Definition at line 481 of file ICFGNode.h.

482 {
483 return APNodes.empty();
484 }

◆ arg_size()

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

Definition at line 477 of file ICFGNode.h.

478 {
479 return APNodes.size();
480 }

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

533 {
534 return true;
535 }

◆ classof() [2/5]

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

Definition at line 547 of file ICFGNode.h.

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

◆ classof() [3/5]

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

Definition at line 537 of file ICFGNode.h.

538 {
539 return node->getNodeKind() == FunCallBlock;
540 }

◆ classof() [4/5]

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

Definition at line 542 of file ICFGNode.h.

543 {
544 return node->getNodeKind() == FunCallBlock;
545 }

◆ classof() [5/5]

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

Definition at line 552 of file ICFGNode.h.

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

◆ getActualParms()

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

Return the set of actual parameters.

Definition at line 460 of file ICFGNode.h.

461 {
462 return APNodes;
463 }

◆ getArgument()

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

Parameter operations.

Definition at line 472 of file ICFGNode.h.

473 {
474 return getActualParms()[ArgNo];
475 }
const ActualParmNodeVec & getActualParms() const
Return the set of actual parameters.
Definition ICFGNode.h:460

◆ getCalledFunction()

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

Definition at line 490 of file ICFGNode.h.

491 {
492 return calledFunc;
493 }

◆ getCaller()

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

Return callsite.

Definition at line 442 of file ICFGNode.h.

443 {
444 return getFun();
445 }
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 516 of file ICFGNode.h.

517 {
518 assert(isVirtualCall() && "not a virtual call?");
519 assert(virtualFunIdx >=0 && "virtual function idx is less than 0? not set yet?");
520 return virtualFunIdx;
521 }
bool isVirtualCall() const
Definition ICFGNode.h:499

◆ getFunNameOfVirtualCall()

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

Definition at line 523 of file ICFGNode.h.

524 {
525 assert(isVirtualCall() && "not a virtual call?");
526 return funNameOfVcall;
527 }

◆ getNumArgOperands()

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

Definition at line 486 of file ICFGNode.h.

487 {
488 return arg_size();
489 }
u32_t arg_size() const
Definition ICFGNode.h:477

◆ getParent()

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

Return Basic Block.

Definition at line 448 of file ICFGNode.h.

449 {
450 return getBB();
451 }
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 429 of file ICFGNode.h.

430 {
431 assert(ret && "RetICFGNode not set?");
432 return ret;
433 }

◆ getSourceLoc()

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

Reimplemented from SVF::SVFValue.

Definition at line 560 of file ICFGNode.h.

561 {
562 return "CallICFGNode: " + ICFGNode::getSourceLoc();
563 }
virtual const std::string getSourceLoc() const
Definition SVFValue.h:196

◆ getVtablePtr()

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

Definition at line 509 of file ICFGNode.h.

510 {
511 assert(isVirtualCall() && "not a virtual call?");
512 return vtabPtr;
513 }

◆ isIndirectCall()

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

Return true if this is an indirect call.

Definition at line 454 of file ICFGNode.h.

455 {
456 return nullptr == calledFunc;
457 }

◆ isVarArg()

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

Definition at line 495 of file ICFGNode.h.

496 {
497 return isvararg;
498 }

◆ isVirtualCall()

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

Definition at line 499 of file ICFGNode.h.

500 {
501 return isVirCallInst;
502 }

◆ setRetICFGNode()

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

Return callsite.

Definition at line 436 of file ICFGNode.h.

437 {
438 ret = r;
439 }

◆ setVtablePtr()

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

Definition at line 504 of file ICFGNode.h.

505 {
506 vtabPtr = v;
507 }

◆ toString()

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

Reimplemented from SVF::ICFGNode.

Definition at line 139 of file ICFG.cpp.

140{
141 std::string str;
142 std::stringstream rawstr(str);
143 rawstr << "CallICFGNode" << getId();
144 rawstr << " {fun: " << getFun()->getName() << ICFGNode::getSourceLoc() << "}";
145 for (const SVFStmt *stmt : getSVFStmts())
146 rawstr << "\n" << stmt->toString();
147 if(getSVFStmts().empty())
148 rawstr << "\n" << valueOnlyToString();
149 return rawstr.str();
150}
const std::string toString() const override
Definition ICFG.cpp:139
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:735

Member Data Documentation

◆ APNodes

ActualParmNodeVec SVF::CallICFGNode::APNodes
protected

Definition at line 407 of file ICFGNode.h.

◆ calledFunc

const FunObjVar* SVF::CallICFGNode::calledFunc
protected

arguments

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

◆ isvararg

bool SVF::CallICFGNode::isvararg
protected

called function

Definition at line 409 of file ICFGNode.h.

◆ isVirCallInst

bool SVF::CallICFGNode::isVirCallInst
protected

is variable argument

Definition at line 410 of file ICFGNode.h.

◆ ret

const RetICFGNode* SVF::CallICFGNode::ret
protected

Definition at line 406 of file ICFGNode.h.

◆ virtualFunIdx

s32_t SVF::CallICFGNode::virtualFunIdx
protected

virtual table pointer

Definition at line 412 of file ICFGNode.h.

◆ vtabPtr

SVFVar* SVF::CallICFGNode::vtabPtr
protected

is virtual call inst

Definition at line 411 of file ICFGNode.h.


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