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

#include <PAGNode.h>

Inheritance diagram for SVF::GepValPN:
SVF::ValPN SVF::PAGNode SVF::GenericNode< NodeTy, EdgeTy >

Public Member Functions

 GepValPN (const Value *val, NodeID i, const LocationSet &l, const Type *ty, u32_t idx)
 Constructor. More...
 
u32_t getOffset () const
 offset of the base value node More...
 
const std::string getValueName () const
 Return name of a LLVM value. More...
 
const TypegetType () const
 Return type of the value. More...
 
u32_t getFieldIdx () const
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::ValPN
 ValPN (const Value *val, NodeID i, PNODEK ty=ValNode)
 Constructor. 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 GepValPN *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const ValPN *node)
 
static bool classof (const PAGNode *node)
 
static bool classof (const GenericPAGNodeTy *node)
 
- Static Public Member Functions inherited from SVF::ValPN
static bool classof (const ValPN *)
 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
 
const TypegepValType
 
u32_t fieldIdx
 

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 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 386 of file PAGNode.h.

Constructor & Destructor Documentation

◆ GepValPN()

SVF::GepValPN::GepValPN ( const Value val,
NodeID  i,
const LocationSet l,
const Type ty,
u32_t  idx 
)
inline

Constructor.

Definition at line 416 of file PAGNode.h.

416  :
417  ValPN(val, i, GepValNode), ls(l), gepValType(ty), fieldIdx(idx)
418  {
419  }
ValPN(const Value *val, NodeID i, PNODEK ty=ValNode)
Constructor.
Definition: PAGNode.h:300
const Type * gepValType
Definition: PAGNode.h:391
u32_t fieldIdx
Definition: PAGNode.h:392
LocationSet ls
Definition: PAGNode.h:390

Member Function Documentation

◆ classof() [1/4]

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

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

Definition at line 397 of file PAGNode.h.

398  {
399  return true;
400  }

◆ classof() [2/4]

static bool SVF::GepValPN::classof ( const ValPN node)
inlinestatic

Definition at line 401 of file PAGNode.h.

402  {
403  return node->getNodeKind() == PAGNode::GepValNode;
404  }

◆ classof() [3/4]

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

Definition at line 405 of file PAGNode.h.

406  {
407  return node->getNodeKind() == PAGNode::GepValNode;
408  }

◆ classof() [4/4]

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

Definition at line 409 of file PAGNode.h.

410  {
411  return node->getNodeKind() == PAGNode::GepValNode;
412  }

◆ getFieldIdx()

u32_t SVF::GepValPN::getFieldIdx ( ) const
inline

Definition at line 440 of file PAGNode.h.

441  {
442  return fieldIdx;
443  }
u32_t fieldIdx
Definition: PAGNode.h:392

◆ getOffset()

u32_t SVF::GepValPN::getOffset ( ) const
inline

offset of the base value node

Definition at line 422 of file PAGNode.h.

423  {
424  return ls.getOffset();
425  }
Size_t getOffset() const
Get methods.
Definition: LocationSet.h:194
LocationSet ls
Definition: PAGNode.h:390

◆ getType()

const Type* SVF::GepValPN::getType ( ) const
inlinevirtual

Return type of the value.

Reimplemented from SVF::PAGNode.

Definition at line 435 of file PAGNode.h.

436  {
437  return gepValType;
438  }
const Type * gepValType
Definition: PAGNode.h:391

◆ getValueName()

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

Return name of a LLVM value.

Reimplemented from SVF::ValPN.

Definition at line 428 of file PAGNode.h.

429  {
430  if (value && value->hasName())
431  return value->getName().str() + "_" + llvm::utostr(getOffset());
432  return "offset_" + llvm::utostr(getOffset());
433  }
const Value * value
value of this PAG node
Definition: PAGNode.h:77
u32_t getOffset() const
offset of the base value node
Definition: PAGNode.h:422

◆ toString()

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

Reimplemented from SVF::ValPN.

Definition at line 118 of file PAG.cpp.

118  {
119  std::string str;
120  raw_string_ostream rawstr(str);
121  rawstr << "GepValPN ID: " << getId() << " with offset_" + llvm::utostr(getOffset());
123  rawstr << "\n";
124  }
125  rawstr << value2String(value);
126  return rawstr.str();
127 }
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
u32_t getOffset() const
offset of the base value node
Definition: PAGNode.h:422
const std::string value2String(const Value *value)
Definition: SVFUtil.cpp:359
NodeID getId() const
Get ID.
Definition: GenericGraph.h:164

Member Data Documentation

◆ fieldIdx

u32_t SVF::GepValPN::fieldIdx
private

Definition at line 392 of file PAGNode.h.

◆ gepValType

const Type* SVF::GepValPN::gepValType
private

Definition at line 391 of file PAGNode.h.

◆ ls

LocationSet SVF::GepValPN::ls
private

Definition at line 390 of file PAGNode.h.


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