Static Value-Flow Analysis
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SVF::InterPHIVFGNode Class Reference

#include <VFGNode.h>

Inheritance diagram for SVF::InterPHIVFGNode:
SVF::PHIVFGNode SVF::VFGNode SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFBaseNode

Public Member Functions

 InterPHIVFGNode (NodeID id, const FormalParmVFGNode *fp)
 Constructor interPHI for formal parameter. More...
 
 InterPHIVFGNode (NodeID id, const ActualRetVFGNode *ar)
 Constructor interPHI for actual return. More...
 
bool isFormalParmPHI () const
 
bool isActualRetPHI () const
 
const SVFFunctiongetFun () const override
 Get the function of this SVFGNode. More...
 
const CallICFGNodegetCallSite () const
 
const std::string toString () const override
 
- Public Member Functions inherited from SVF::PHIVFGNode
 PHIVFGNode (NodeID id, const PAGNode *r, VFGNodeK k=TPhi)
 Constructor. More...
 
bool isPTANode () const
 Whether this phi node is of pointer type (used for pointer analysis). More...
 
const PAGNodegetOpVer (u32_t pos) const
 Operands at a llvm PHINode. More...
 
void setOpVer (u32_t pos, const PAGNode *node)
 
const PAGNodegetRes () const
 
u32_t getOpVerNum () const
 
OPVers::const_iterator opVerBegin () const
 
OPVers::const_iterator opVerEnd () const
 
const NodeBS getDefSVFVars () const override
 Return the left hand side SVF Vars. More...
 
const SVFValuegetValue () const override
 Return the corresponding LLVM value, if possible, nullptr otherwise. More...
 
- Public Member Functions inherited from SVF::VFGNode
 VFGNode (NodeID i, VFGNodeK k)
 Constructor. More...
 
virtual const ICFGNodegetICFGNode () const
 Return corresponding ICFG node. More...
 
virtual void setICFGNode (const ICFGNode *node)
 Set corresponding ICFG node. More...
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 GenericNode (NodeID i, GNodeK k)
 Constructor. More...
 
virtual ~GenericNode ()
 Destructor. More...
 
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 necessary. 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)
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges. More...
 
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. More...
 
GNodeK getNodeKind () const
 Get node kind. More...
 
virtual const SVFTypegetType () const
 
virtual void setSourceLoc (const std::string &sourceCodeInfo)
 
virtual const std::string getSourceLoc () const
 
const std::string valueOnlyToString () const
 

Static Public Member Functions

static bool classof (const InterPHIVFGNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const PHIVFGNode *node)
 
static bool classof (const VFGNode *node)
 
static bool classof (const GenericVFGNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::PHIVFGNode
static bool classof (const PHIVFGNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const VFGNode *node)
 
static bool classof (const GenericVFGNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::VFGNode
static bool classof (const VFGNode *)
 
static bool classof (const GenericVFGNodeTy *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 *)
 

Private Attributes

const SVFFunctionfun
 
const CallICFGNodecallInst
 

Additional Inherited Members

- Public Types inherited from SVF::PHIVFGNode
typedef Map< u32_t, const PAGNode * > OPVers
 
- Public Types inherited from SVF::VFGNode
typedef GNodeK VFGNodeK
 
typedef VFGEdge::VFGEdgeSetTy::iterator iterator
 
typedef VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
 
typedef Set< const CallPE * > CallPESet
 
typedef Set< const RetPE * > RetPESet
 
- Public Types inherited from SVF::GenericNode< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
 Edge kind. More...
 
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 , GepValNode ,
  RetNode , VarargNode , DummyValNode , ObjNode ,
  GepObjNode , FIObjNode , 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
}
 
- Static Protected Member Functions inherited from SVF::SVFBaseNode
static bool isICFGNodeKinds (GNodeK n)
 Helper functions to check node kinds. More...
 
static bool isInterICFGNodeKind (GNodeK n)
 
static bool isSVFVarKind (GNodeK n)
 
static bool isValVarKinds (GNodeK n)
 
static bool isObjVarKinds (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)
 
- Protected Attributes inherited from SVF::PHIVFGNode
const PAGNoderes
 
OPVers opVers
 
- Protected Attributes inherited from SVF::VFGNode
const ICFGNodeicfgNode
 
- Protected Attributes inherited from SVF::SVFBaseNode
NodeID id
 Node ID. More...
 
GNodeK nodeKind
 Node kind. More...
 
const SVFTypetype
 SVF type. More...
 
std::string sourceLoc
 Source code information of this value. More...
 

Detailed Description

Definition at line 1150 of file VFGNode.h.

Constructor & Destructor Documentation

◆ InterPHIVFGNode() [1/2]

SVF::InterPHIVFGNode::InterPHIVFGNode ( NodeID  id,
const FormalParmVFGNode fp 
)
inline

Constructor interPHI for formal parameter.

Definition at line 1155 of file VFGNode.h.

1155 : PHIVFGNode(id, fp->getParam(), TInterPhi),fun(fp->getFun()),callInst(nullptr) {}
const SVFFunction * fun
Definition: VFGNode.h:1208
const CallICFGNode * callInst
Definition: VFGNode.h:1209
PHIVFGNode(NodeID id, const PAGNode *r, VFGNodeK k=TPhi)
Constructor.
Definition: VFG.cpp:428

◆ InterPHIVFGNode() [2/2]

SVF::InterPHIVFGNode::InterPHIVFGNode ( NodeID  id,
const ActualRetVFGNode ar 
)
inline

Constructor interPHI for actual return.

Definition at line 1157 of file VFGNode.h.

1157 : PHIVFGNode(id, ar->getRev(), TInterPhi), fun(ar->getCaller()),callInst(ar->getCallSite()) {}

Member Function Documentation

◆ classof() [1/5]

static bool SVF::InterPHIVFGNode::classof ( const GenericVFGNodeTy node)
inlinestatic

Definition at line 1195 of file VFGNode.h.

1196  {
1197  return node->getNodeKind() == TInterPhi;
1198  }

◆ classof() [2/5]

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

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

Definition at line 1183 of file VFGNode.h.

1184  {
1185  return true;
1186  }

◆ classof() [3/5]

static bool SVF::InterPHIVFGNode::classof ( const PHIVFGNode node)
inlinestatic

Definition at line 1187 of file VFGNode.h.

1188  {
1189  return node->getNodeKind() == TInterPhi;
1190  }

◆ classof() [4/5]

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

Definition at line 1199 of file VFGNode.h.

1200  {
1201  return node->getNodeKind() == TInterPhi;
1202  }

◆ classof() [5/5]

static bool SVF::InterPHIVFGNode::classof ( const VFGNode node)
inlinestatic

Definition at line 1191 of file VFGNode.h.

1192  {
1193  return node->getNodeKind() == TInterPhi;
1194  }

◆ getCallSite()

const CallICFGNode* SVF::InterPHIVFGNode::getCallSite ( ) const
inline

Definition at line 1175 of file VFGNode.h.

1176  {
1177  assert(isActualRetPHI() && "expect a actual return phi");
1178  return callInst;
1179  }
bool isActualRetPHI() const
Definition: VFGNode.h:1164

◆ getFun()

const SVFFunction* SVF::InterPHIVFGNode::getFun ( ) const
inlineoverridevirtual

Get the function of this SVFGNode.

Reimplemented from SVF::VFGNode.

Definition at line 1169 of file VFGNode.h.

1170  {
1171  assert((isFormalParmPHI() || isActualRetPHI()) && "expect a formal parameter phi");
1172  return fun;
1173  }
bool isFormalParmPHI() const
Definition: VFGNode.h:1159

◆ isActualRetPHI()

bool SVF::InterPHIVFGNode::isActualRetPHI ( ) const
inline

Definition at line 1164 of file VFGNode.h.

1165  {
1166  return (fun!=nullptr) && (callInst != nullptr);
1167  }

◆ isFormalParmPHI()

bool SVF::InterPHIVFGNode::isFormalParmPHI ( ) const
inline

Definition at line 1159 of file VFGNode.h.

1160  {
1161  return (fun!=nullptr) && (callInst == nullptr);
1162  }

◆ toString()

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

Reimplemented from SVF::PHIVFGNode.

Definition at line 351 of file VFG.cpp.

352 {
353  std::string str;
354  std::stringstream rawstr(str);
355  if(isFormalParmPHI())
356  rawstr << "FormalParmPHI ID: " << getId() << " PAGNode ID: " << res->getId() << "\n" << res->getValue()->toString();
357  else
358  rawstr << "ActualRetPHI ID: " << getId() << " PAGNode ID: " << res->getId() << "\n" << res->getValue()->toString();
359  return rawstr.str();
360 }
const char *const string
Definition: cJSON.h:172
const PAGNode * res
Definition: VFGNode.h:674
NodeID getId() const
Get ID.
Definition: GenericGraph.h:260
std::string toString() const
Needs to be implemented by a SVF front end.
Definition: LLVMUtil.cpp:663
const SVFValue * getValue() const
Get/has methods of the components.
Definition: SVFVariables.h:83

Member Data Documentation

◆ callInst

const CallICFGNode* SVF::InterPHIVFGNode::callInst
private

Definition at line 1209 of file VFGNode.h.

◆ fun

const SVFFunction* SVF::InterPHIVFGNode::fun
private

Definition at line 1208 of file VFGNode.h.


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