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

#include <PAGNode.h>

Inheritance diagram for SVF::GepObjPN:
SVF::ObjPN SVF::PAGNode SVF::GenericNode< NodeTy, EdgeTy > SVF::CloneGepObjPN

Public Member Functions

 GepObjPN (const MemObj *mem, NodeID i, const LocationSet &l, PNODEK ty=GepObjNode)
 Constructor. More...
 
const LocationSetgetLocationSet () const
 offset of the mem object More...
 
void setBaseNode (NodeID base)
 Set the base object from which this GEP node came from. More...
 
NodeID getBaseNode (void) const
 Return the base object from which this GEP node came from. More...
 
virtual const llvm::Type * getType () const
 Return the type of this gep object. More...
 
const std::string getValueName () const
 Return name of a LLVM value. More...
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::ObjPN
const MemObjgetMemObj () const
 Return memory object. More...
 
- Public Member Functions inherited from SVF::PAGNode
 PAGNode (const Value *val, NodeID i, PNODEK k)
 address-taken pointer More...
 
virtual ~PAGNode ()
 Destructor. More...
 
const ValuegetValue () const
 Get/has methods of the components. More...
 
bool hasValue () const
 
virtual bool isPointer () const
 Whether it is a pointer. More...
 
bool isTopLevelPtr () const
 Whether it is a top-level pointer. More...
 
bool isAddressTakenPtr () const
 Whether it is an address-taken pointer. More...
 
bool isConstantData () const
 
bool isIsolatedNode () const
 Whether this is an isoloated node on the PAG graph. More...
 
virtual const FunctiongetFunction () const
 Return the function that this PAGNode resides in. Return nullptr if it is a global or constantexpr node. More...
 
PAGEdge::PAGEdgeSetTygetIncomingEdges (PAGEdge::PEDGEK kind)
 Get incoming PAG edges. More...
 
PAGEdge::PAGEdgeSetTygetOutgoingEdges (PAGEdge::PEDGEK kind)
 Get outgoing PAG edges. More...
 
bool hasIncomingEdges (PAGEdge::PEDGEK kind) const
 Has incoming PAG edges. More...
 
bool hasIncomingVariantGepEdge () const
 Has incoming VariantGepEdges. More...
 
PAGEdge::PAGEdgeSetTy::iterator getIncomingEdgesBegin (PAGEdge::PEDGEK kind) const
 Get incoming PAGEdge iterator. More...
 
PAGEdge::PAGEdgeSetTy::iterator getIncomingEdgesEnd (PAGEdge::PEDGEK kind) const
 Get incoming PAGEdge iterator. More...
 
bool hasOutgoingEdges (PAGEdge::PEDGEK kind) const
 Has outgoing PAG edges. More...
 
PAGEdge::PAGEdgeSetTy::iterator getOutgoingEdgesBegin (PAGEdge::PEDGEK kind) const
 Get outgoing PAGEdge iterator. More...
 
PAGEdge::PAGEdgeSetTy::iterator getOutgoingEdgesEnd (PAGEdge::PEDGEK kind) const
 Get outgoing PAGEdge iterator. More...
 
void addInEdge (PAGEdge *inEdge)
 add methods of the components More...
 
void addOutEdge (PAGEdge *outEdge)
 
virtual const std::string getNodeAttrForDotDisplay () const
 Get shape and/or color of node for .dot display. More...
 
void dump () const
 Dump to console for debugging. More...
 
- 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 GepObjPN *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const ObjPN *node)
 
static bool classof (const PAGNode *node)
 
static bool classof (const GenericPAGNodeTy *node)
 
- Static Public Member Functions inherited from SVF::ObjPN
static bool classof (const ObjPN *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const PAGNode *node)
 
static bool classof (const GenericPAGNodeTy *node)
 

Private Attributes

LocationSet ls
 
NodeID base = 0
 

Additional Inherited Members

- Public Types inherited from SVF::PAGNode
enum  PNODEK {
  ValNode, ObjNode, RetNode, VarargNode,
  GepValNode, GepObjNode, FIObjNode, DummyValNode,
  DummyObjNode, CloneGepObjNode, CloneFIObjNode, CloneDummyObjNode
}
 
- 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
 
- Protected Member Functions inherited from SVF::ObjPN
 ObjPN (const Value *val, NodeID i, const MemObj *m, PNODEK ty=ObjNode)
 Constructor. More...
 
- Protected Attributes inherited from SVF::ObjPN
const MemObjmem
 
- Protected Attributes inherited from SVF::PAGNode
const Valuevalue
 value of this PAG node More...
 
PAGEdge::PAGKindToEdgeSetMapTy InEdgeKindToSetMap
 
PAGEdge::PAGKindToEdgeSetMapTy OutEdgeKindToSetMap
 
bool isTLPointer
 
bool isATPointer
 top-level pointer More...
 

Detailed Description

Definition at line 453 of file PAGNode.h.

Constructor & Destructor Documentation

◆ GepObjPN()

SVF::GepObjPN::GepObjPN ( const MemObj mem,
NodeID  i,
const LocationSet l,
PNODEK  ty = GepObjNode 
)
inline

Constructor.

Definition at line 484 of file PAGNode.h.

484  :
485  ObjPN(mem->getRefVal(), i, mem, ty), ls(l)
486  {
487  base = mem->getSymId();
488  }
LocationSet ls
Definition: PAGNode.h:456
ObjPN(const Value *val, NodeID i, const MemObj *m, PNODEK ty=ObjNode)
Constructor.
Definition: PAGNode.h:325
const Value * getRefVal() const
Get the reference value to this object.
Definition: MemModel.h:325
const MemObj * mem
Definition: PAGNode.h:323
NodeID base
Definition: PAGNode.h:457

Member Function Documentation

◆ classof() [1/4]

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

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

Definition at line 462 of file PAGNode.h.

463  {
464  return true;
465  }

◆ classof() [2/4]

static bool SVF::GepObjPN::classof ( const ObjPN node)
inlinestatic

Definition at line 466 of file PAGNode.h.

467  {
468  return node->getNodeKind() == PAGNode::GepObjNode
469  || node->getNodeKind() == PAGNode::CloneGepObjNode;
470  }

◆ classof() [3/4]

static bool SVF::GepObjPN::classof ( const PAGNode node)
inlinestatic

Definition at line 471 of file PAGNode.h.

472  {
473  return node->getNodeKind() == PAGNode::GepObjNode
474  || node->getNodeKind() == PAGNode::CloneGepObjNode;
475  }

◆ classof() [4/4]

static bool SVF::GepObjPN::classof ( const GenericPAGNodeTy node)
inlinestatic

Definition at line 476 of file PAGNode.h.

477  {
478  return node->getNodeKind() == PAGNode::GepObjNode
479  || node->getNodeKind() == PAGNode::CloneGepObjNode;
480  }

◆ getBaseNode()

NodeID SVF::GepObjPN::getBaseNode ( void  ) const
inline

Return the base object from which this GEP node came from.

Definition at line 503 of file PAGNode.h.

504  {
505  return base;
506  }
NodeID base
Definition: PAGNode.h:457

◆ getLocationSet()

const LocationSet& SVF::GepObjPN::getLocationSet ( ) const
inline

offset of the mem object

Definition at line 491 of file PAGNode.h.

492  {
493  return ls;
494  }
LocationSet ls
Definition: PAGNode.h:456

◆ getType()

virtual const llvm::Type* SVF::GepObjPN::getType ( ) const
inlinevirtual

Return the type of this gep object.

Reimplemented from SVF::ObjPN.

Definition at line 509 of file PAGNode.h.

510  {
512  }
LocationSet ls
Definition: PAGNode.h:456
Size_t getByteOffset() const
Definition: LocationSet.h:198
const llvm::Type * getType() const
Get obj type.
Definition: MemModel.cpp:278
static SymbolTableInfo * SymbolInfo()
Singleton design here to make sure we only have one instance during any analysis. ...
const Type * getOrigSubTypeWithByteOffset(const Type *baseType, u32_t byteOffset)
const MemObj * mem
Definition: PAGNode.h:323

◆ getValueName()

const std::string SVF::GepObjPN::getValueName ( ) const
inlinevirtual

Return name of a LLVM value.

Reimplemented from SVF::ObjPN.

Reimplemented in SVF::CloneGepObjPN.

Definition at line 515 of file PAGNode.h.

516  {
517  if (value && value->hasName())
518  return value->getName().str() + "_" + llvm::itostr(ls.getOffset());
519  return "offset_" + llvm::itostr(ls.getOffset());
520  }
LocationSet ls
Definition: PAGNode.h:456
const Value * value
value of this PAG node
Definition: PAGNode.h:77
Size_t getOffset() const
Get methods.
Definition: LocationSet.h:194

◆ setBaseNode()

void SVF::GepObjPN::setBaseNode ( NodeID  base)
inline

Set the base object from which this GEP node came from.

Definition at line 497 of file PAGNode.h.

498  {
499  this->base = base;
500  }
NodeID base
Definition: PAGNode.h:457

◆ toString()

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

Reimplemented from SVF::ObjPN.

Reimplemented in SVF::CloneGepObjPN.

Definition at line 129 of file PAG.cpp.

129  {
130  std::string str;
131  raw_string_ostream rawstr(str);
132  rawstr << "GepObjPN ID: " << getId() << " with offset_" + llvm::itostr(ls.getOffset());
134  rawstr << "\n";
135  }
136  rawstr << value2String(value);
137  return rawstr.str();
138 }
LocationSet ls
Definition: PAGNode.h:456
const Value * value
value of this PAG node
Definition: PAGNode.h:77
static const llvm::cl::opt< bool > PAGDotGraphShorter
Definition: Options.h:88
llvm::raw_string_ostream raw_string_ostream
Definition: BasicTypes.h:100
const std::string value2String(const Value *value)
Definition: SVFUtil.cpp:359
Size_t getOffset() const
Get methods.
Definition: LocationSet.h:194
NodeID getId() const
Get ID.
Definition: GenericGraph.h:164

Member Data Documentation

◆ base

NodeID SVF::GepObjPN::base = 0
private

Definition at line 457 of file PAGNode.h.

◆ ls

LocationSet SVF::GepObjPN::ls
private

Definition at line 456 of file PAGNode.h.


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