Static Value-Flow Analysis
|
#include <IRGraph.h>
Public Types | |
typedef Set< const SVFStmt * > | SVFStmtSet |
typedef Map< const SVFValue *, SVFStmtSet > | ValueToEdgeMap |
Public Types inherited from SVF::GenericGraph< SVFVar, SVFStmt > | |
typedef SVFVar | NodeType |
typedef SVFStmt | EdgeType |
typedef OrderedMap< NodeID, NodeType * > | IDToNodeMapTy |
NodeID to GenericNode map. More... | |
typedef IDToNodeMapTy::iterator | iterator |
Node Iterators. More... | |
typedef IDToNodeMapTy::const_iterator | const_iterator |
Public Member Functions | |
IRGraph (bool buildFromFile) | |
virtual | ~IRGraph () |
SymbolTableInfo * | getSymbolInfo () const |
bool | isBuiltFromFile () |
Whether this SVFIR built from a txt file. More... | |
const SVFStmtSet & | getValueEdges (const SVFValue *V) |
Get all SVFIR Edges that corresponds to an LLVM value. More... | |
NodeID | getValueNode (const SVFValue *V) |
bool | hasValueNode (const SVFValue *V) |
NodeID | getObjectNode (const SVFValue *V) |
NodeID | getReturnNode (const SVFFunction *func) const |
GetReturnNode - Return the unique node representing the return value of a function. More... | |
NodeID | getVarargNode (const SVFFunction *func) const |
getVarargNode - Return the unique node representing the variadic argument of a variadic function. More... | |
NodeID | getBlackHoleNode () const |
NodeID | getConstantNode () const |
NodeID | getBlkPtr () const |
NodeID | getNullPtr () const |
const MemObj * | getBlackHoleObj () const |
const MemObj * | getConstantObj () const |
u32_t | getValueNodeNum () const |
u32_t | getObjectNodeNum () const |
u32_t | getNodeNumAfterPAGBuild () const |
void | setNodeNumAfterPAGBuild (u32_t num) |
u32_t | getPAGNodeNum () const |
u32_t | getPAGEdgeNum () const |
u32_t | getPTAPAGEdgeNum () const |
std::string | getGraphName () const |
Return graph name. More... | |
void | dump (std::string name) |
Dump SVFIR. More... | |
void | view () |
View graph from the debugger. More... | |
Public Member Functions inherited from SVF::GenericGraph< SVFVar, SVFStmt > | |
GenericGraph () | |
Constructor. More... | |
virtual | ~GenericGraph () |
Destructor. More... | |
void | destroy () |
Release memory. More... | |
iterator | begin () |
Iterators. More... | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | addGNode (NodeID id, NodeType *node) |
Add a Node. More... | |
NodeType * | getGNode (NodeID id) const |
Get a node. More... | |
bool | hasGNode (NodeID id) const |
Has a node. More... | |
void | removeGNode (NodeType *node) |
Delete a node. More... | |
u32_t | getTotalNodeNum () const |
Get total number of node/edge. More... | |
u32_t | getTotalEdgeNum () const |
void | incNodeNum () |
Increase number of node/edge. More... | |
void | incEdgeNum () |
Protected Member Functions | |
NodeID | addNode (SVFVar *node, NodeID i) |
Add a node into the graph. More... | |
bool | addEdge (SVFVar *src, SVFVar *dst, SVFStmt *edge) |
Add an edge into the graph. More... | |
SVFStmt * | hasNonlabeledEdge (SVFVar *src, SVFVar *dst, SVFStmt::PEDGEK kind) |
SVFStmt * | hasLabeledEdge (SVFVar *src, SVFVar *dst, SVFStmt::PEDGEK kind, const ICFGNode *cs) |
SVFStmt * | hasLabeledEdge (SVFVar *src, SVFVar *op1, SVFStmt::PEDGEK kind, const SVFVar *op2) |
void | mapValueToEdge (const SVFValue *V, SVFStmt *edge) |
Map a value to a set of edges. More... | |
const MemObj * | getMemObj (const SVFValue *val) const |
get MemObj according to LLVM value More... | |
Protected Attributes | |
SVFStmt::KindToSVFStmtMapTy | KindToSVFStmtSetMap |
SVFIR edge map containing all PAGEdges. More... | |
SVFStmt::KindToSVFStmtMapTy | KindToPTASVFStmtSetMap |
SVFIR edge map containing only pointer-related edges, i.e., both LHS and RHS are of pointer type. More... | |
bool | fromFile |
Whether the SVFIR is built according to user specified data from a txt file. More... | |
NodeID | nodeNumAfterPAGBuild |
initial node number after building SVFIR, excluding later added nodes, e.g., gepobj nodes More... | |
u32_t | totalPTAPAGEdge |
ValueToEdgeMap | valueToEdgeMap |
Map SVFValues (e.g., ICFGNodes) to all corresponding PAGEdges. More... | |
SymbolTableInfo * | symInfo |
Protected Attributes inherited from SVF::GenericGraph< SVFVar, SVFStmt > | |
IDToNodeMapTy | IDToNodeMap |
node map More... | |
Friends | |
class | SVFIRWriter |
class | SVFIRReader |
Additional Inherited Members | |
Public Attributes inherited from SVF::GenericGraph< SVFVar, SVFStmt > | |
u32_t | edgeNum |
total num of node More... | |
u32_t | nodeNum |
total num of edge More... | |
typedef Set<const SVFStmt*> SVF::IRGraph::SVFStmtSet |
typedef Map<const SVFValue*,SVFStmtSet> SVF::IRGraph::ValueToEdgeMap |
|
inline |
Definition at line 104 of file IRGraph.h.
|
virtual |
Definition at line 36 of file IRGraph.cpp.
Add an edge into the graph.
Add a SVFIR edge into edge map
Definition at line 45 of file IRGraph.cpp.
Add a node into the graph.
Definition at line 68 of file IRGraph.h.
void IRGraph::dump | ( | std::string | name | ) |
Dump SVFIR.
Dump this IRGraph
Definition at line 102 of file IRGraph.cpp.
|
inline |
|
inline |
Definition at line 181 of file IRGraph.h.
|
inline |
get MemObj according to LLVM value
Definition at line 98 of file IRGraph.h.
|
inline |
|
inline |
Definition at line 207 of file IRGraph.h.
|
inline |
Definition at line 203 of file IRGraph.h.
|
inline |
|
inline |
GetReturnNode - Return the unique node representing the return value of a function.
Definition at line 152 of file IRGraph.h.
|
inline |
|
inline |
Get SVFIR Node according to LLVM value getNode - Return the node corresponding to the specified pointer.
Definition at line 137 of file IRGraph.h.
|
inline |
Definition at line 186 of file IRGraph.h.
|
inline |
getVarargNode - Return the unique node representing the variadic argument of a variadic function.
Definition at line 157 of file IRGraph.h.
|
protected |
Return true if this labeled edge exits, including store, call and load two store edge can have same dst and src but located in different basic blocks, thus flags are needed to distinguish them
Return an inter-procedural edge if found
Definition at line 88 of file IRGraph.cpp.
|
protected |
Return MultiOpndStmt since it has more than one operands (we use operand 2 here to make the flag)
Return an MultiOpndStmt if found
Definition at line 74 of file IRGraph.cpp.
|
protected |
|
inline |
Definition at line 141 of file IRGraph.h.
|
inline |
|
inline |
void IRGraph::view | ( | ) |
View graph from the debugger.
View IRGraph
Definition at line 110 of file IRGraph.cpp.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |