SVF
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SVF::ObjPN Class Reference

#include <PAGNode.h>

Inheritance diagram for SVF::ObjPN:
SVF::PAGNode SVF::GenericNode< NodeTy, EdgeTy > SVF::DummyObjPN SVF::FIObjPN SVF::GepObjPN SVF::CloneDummyObjPN SVF::CloneFIObjPN SVF::CloneGepObjPN

Public Member Functions

const MemObjgetMemObj () const
 Return memory object. More...
 
virtual const std::string getValueName () const
 Return name of a LLVM value. More...
 
virtual const llvm::Type * getType () const
 Return type of the value. More...
 
virtual const std::string toString () const
 
- 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 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)
 

Protected Member Functions

 ObjPN (const Value *val, NodeID i, const MemObj *m, PNODEK ty=ObjNode)
 Constructor. More...
 

Protected Attributes

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

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
 

Detailed Description

Definition at line 319 of file PAGNode.h.

Constructor & Destructor Documentation

◆ ObjPN()

SVF::ObjPN::ObjPN ( const Value val,
NodeID  i,
const MemObj m,
PNODEK  ty = ObjNode 
)
inlineprotected

Constructor.

Definition at line 325 of file PAGNode.h.

325  :
326  PAGNode(val, i, ty), mem(m)
327  {
328  }
const MemObj * mem
Definition: PAGNode.h:323
PAGNode(const Value *val, NodeID i, PNODEK k)
address-taken pointer
Definition: PAG.cpp:1018

Member Function Documentation

◆ classof() [1/3]

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

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

Definition at line 332 of file PAGNode.h.

333  {
334  return true;
335  }

◆ classof() [2/3]

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

Definition at line 336 of file PAGNode.h.

337  {
338  return node->getNodeKind() == PAGNode::ObjNode ||
339  node->getNodeKind() == PAGNode::GepObjNode ||
340  node->getNodeKind() == PAGNode::FIObjNode ||
341  node->getNodeKind() == PAGNode::DummyObjNode ||
342  node->getNodeKind() == PAGNode::CloneGepObjNode ||
343  node->getNodeKind() == PAGNode::CloneFIObjNode ||
344  node->getNodeKind() == PAGNode::CloneDummyObjNode;
345  }

◆ classof() [3/3]

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

Definition at line 346 of file PAGNode.h.

347  {
348  return node->getNodeKind() == PAGNode::ObjNode ||
349  node->getNodeKind() == PAGNode::GepObjNode ||
350  node->getNodeKind() == PAGNode::FIObjNode ||
351  node->getNodeKind() == PAGNode::DummyObjNode ||
352  node->getNodeKind() == PAGNode::CloneGepObjNode ||
353  node->getNodeKind() == PAGNode::CloneFIObjNode ||
354  node->getNodeKind() == PAGNode::CloneDummyObjNode;
355  }

◆ getMemObj()

const MemObj* SVF::ObjPN::getMemObj ( ) const
inline

Return memory object.

Definition at line 359 of file PAGNode.h.

360  {
361  return mem;
362  }
const MemObj * mem
Definition: PAGNode.h:323

◆ getType()

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

Return type of the value.

Reimplemented from SVF::PAGNode.

Reimplemented in SVF::GepObjPN.

Definition at line 372 of file PAGNode.h.

373  {
374  return mem->getType();
375  }
const llvm::Type * getType() const
Get obj type.
Definition: MemModel.cpp:278
const MemObj * mem
Definition: PAGNode.h:323

◆ getValueName()

virtual const std::string SVF::ObjPN::getValueName ( ) const
inlinevirtual

Return name of a LLVM value.

Implements SVF::PAGNode.

Reimplemented in SVF::CloneFIObjPN, SVF::CloneGepObjPN, SVF::CloneDummyObjPN, SVF::DummyObjPN, SVF::FIObjPN, and SVF::GepObjPN.

Definition at line 365 of file PAGNode.h.

366  {
367  if (value && value->hasName())
368  return value->getName().str();
369  return "";
370  }
const Value * value
value of this PAG node
Definition: PAGNode.h:77

◆ toString()

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

Reimplemented from SVF::PAGNode.

Reimplemented in SVF::CloneFIObjPN, SVF::CloneGepObjPN, SVF::CloneDummyObjPN, SVF::DummyObjPN, SVF::FIObjPN, and SVF::GepObjPN.

Definition at line 107 of file PAG.cpp.

107  {
108  std::string str;
109  raw_string_ostream rawstr(str);
110  rawstr << "ObjPN ID: " << getId();
112  rawstr << "\n";
113  }
114  rawstr << value2String(value);
115  return rawstr.str();
116 }
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
NodeID getId() const
Get ID.
Definition: GenericGraph.h:164

Member Data Documentation

◆ mem

const MemObj* SVF::ObjPN::mem
protected

memory object

Definition at line 323 of file PAGNode.h.


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