Static Value-Flow Analysis
|
#include <NodeIDAllocator.h>
Classes | |
class | Clusterer |
Public Types | |
enum | Strategy { DENSE , REVERSE_DENSE , SEQ , DBUG } |
Allocation strategy to use. More... | |
Public Member Functions | |
NodeID | allocateObjectId (void) |
Allocate an object ID as determined by the strategy. | |
NodeID | allocateGepObjectId (NodeID base, u32_t offset, u32_t maxFieldLimit) |
NodeID | allocateValueId (void) |
Allocate a value ID as determined by the strategy. | |
NodeID | endSymbolAllocation (void) |
Notify the allocator that all symbols have had IDs allocated. | |
NodeID | getNumObjects (void) const |
Returns the total number of memory objects. | |
void | increaseNumOfObjAndNodes () |
Static Public Member Functions | |
static NodeIDAllocator * | get (void) |
Return (singleton) allocator. | |
static void | unset (void) |
Deletes the (singleton) allocator. | |
Static Public Attributes | |
static const NodeID | blackHoleObjectId = 0 |
static const NodeID | constantObjectId = 1 |
static const NodeID | blackHolePointerId = 2 |
static const NodeID | nullPointerId = 3 |
Private Member Functions | |
NodeIDAllocator (void) | |
Builds a node ID allocator with the strategy specified on the command line. | |
Private Attributes | |
enum Strategy | strategy |
Strategy to allocate with. | |
NodeID | numObjects |
NodeID | numValues |
Number of values allocated, including specials. | |
NodeID | numSymbols |
Number of explicit symbols allocated (e.g., llvm::Values), including specials. | |
NodeID | numNodes |
Total number of objects and values allocated. | |
Static Private Attributes | |
static NodeIDAllocator * | allocator = nullptr |
Single allocator. | |
Friends | |
class | SVFIRWriter |
class | SVFIRReader |
Allocates node IDs for objects and values, upon request, according to some strategy which can be user-defined. It is the job of SymbolTableInfo to tell the NodeIDAllocator when all symbols have been allocated through endSymbolAllocation.
Definition at line 20 of file NodeIDAllocator.h.
Allocation strategy to use.
Definition at line 27 of file NodeIDAllocator.h.
|
private |
Builds a node ID allocator with the strategy specified on the command line.
Definition at line 46 of file NodeIDAllocator.cpp.
Allocate a GEP object ID as determined by the strategy. allocateObjectId is still fine for GEP objects, but for some strategies (DBUG, namely), GEP objects can be allocated differently (more readable, for DBUG). Regardless, numObjects is shared; there is no special numGepObjects.
Definition at line 86 of file NodeIDAllocator.cpp.
NodeID SVF::NodeIDAllocator::allocateObjectId | ( | void | ) |
Allocate an object ID as determined by the strategy.
Definition at line 50 of file NodeIDAllocator.cpp.
NodeID SVF::NodeIDAllocator::allocateValueId | ( | void | ) |
Allocate a value ID as determined by the strategy.
Definition at line 128 of file NodeIDAllocator.cpp.
NodeID SVF::NodeIDAllocator::endSymbolAllocation | ( | void | ) |
Notify the allocator that all symbols have had IDs allocated.
Definition at line 163 of file NodeIDAllocator.cpp.
|
static |
Return (singleton) allocator.
Definition at line 26 of file NodeIDAllocator.cpp.
|
inline |
Returns the total number of memory objects.
Definition at line 80 of file NodeIDAllocator.h.
|
inline |
Definition at line 85 of file NodeIDAllocator.h.
|
static |
Deletes the (singleton) allocator.
Definition at line 36 of file NodeIDAllocator.cpp.
|
friend |
Definition at line 23 of file NodeIDAllocator.h.
|
friend |
Definition at line 22 of file NodeIDAllocator.h.
|
staticprivate |
Single allocator.
Definition at line 112 of file NodeIDAllocator.h.
These nodes, and any nodes before them are assumed allocated as objects and values. For simplicity's sake, numObjects and numVals thus start at 4 (and the other counters are set appropriately).
Definition at line 50 of file NodeIDAllocator.h.
Definition at line 52 of file NodeIDAllocator.h.
Definition at line 51 of file NodeIDAllocator.h.
Definition at line 53 of file NodeIDAllocator.h.
|
private |
Total number of objects and values allocated.
Definition at line 105 of file NodeIDAllocator.h.
|
private |
These are moreso counters than amounts.
Number of memory objects allocated, including specials.
Definition at line 99 of file NodeIDAllocator.h.
|
private |
Number of explicit symbols allocated (e.g., llvm::Values), including specials.
Definition at line 103 of file NodeIDAllocator.h.
|
private |
Number of values allocated, including specials.
Definition at line 101 of file NodeIDAllocator.h.
Strategy to allocate with.
Definition at line 109 of file NodeIDAllocator.h.