Static Value-Flow Analysis
|
#include <PersistentPointsToCache.h>
Public Types | |
typedef Map< Data, PointsToID > | PTSToIDMap |
typedef std::function< Data(const Data &, const Data &)> | DataOp |
typedef Map< std::pair< PointsToID, PointsToID >, PointsToID > | OpCache |
Public Member Functions | |
PersistentPointsToCache (void) | |
void | clear () |
Clear the cache. | |
void | reset (void) |
Resets the cache removing everything except the emptyData it was initialised with. | |
void | remapAllPts (void) |
Remaps all points-to sets stored in the cache to the current mapping. | |
PointsToID | emplacePts (const Data &pts) |
const Data & | getActualPts (PointsToID id) const |
Returns the points-to set which id represents. id must be stored in the cache. | |
PointsToID | unionPts (PointsToID lhs, PointsToID rhs) |
Unions lhs and rhs and returns their union's ID. | |
PointsToID | complementPts (PointsToID lhs, PointsToID rhs) |
Relatively complements lhs and rhs (lhs \ rhs) and returns it's ID. | |
PointsToID | intersectPts (PointsToID lhs, PointsToID rhs) |
Intersects lhs and rhs (lhs AND rhs) and returns the intersection's ID. | |
void | printStats (const std::string subtitle) const |
Print statistics on operations and points-to set numbers. | |
Map< Data, unsigned > | getAllPts (void) |
Static Public Member Functions | |
static PointsToID | emptyPointsToId (void) |
Private Member Functions | |
PointsToID | newPointsToId (void) |
PointsToID | opPts (PointsToID lhs, PointsToID rhs, const DataOp &dataOp, OpCache &opCache, bool commutative, bool &opPerformed) |
void | initStats (void) |
Initialises statistics variables to 0. | |
Private Attributes | |
std::vector< std::unique_ptr< Data > > | idToPts |
PTSToIDMap | ptsToId |
Maps points-to sets to their corresponding ID. | |
OpCache | unionCache |
Maps two IDs to their union. Keys must be sorted. | |
OpCache | complementCache |
Maps two IDs to their relative complement. | |
OpCache | intersectionCache |
Maps two IDs to their intersection. Keys must be sorted. | |
PointsToID | idCounter |
Used to generate new PointsToIDs. Any non-zero is valid. | |
u64_t | totalUnions |
u64_t | uniqueUnions |
u64_t | propertyUnions |
u64_t | lookupUnions |
u64_t | preemptiveUnions |
u64_t | totalComplements |
u64_t | uniqueComplements |
u64_t | propertyComplements |
u64_t | lookupComplements |
u64_t | preemptiveComplements |
u64_t | totalIntersections |
u64_t | uniqueIntersections |
u64_t | propertyIntersections |
u64_t | lookupIntersections |
u64_t | preemptiveIntersections |
Persistent points-to set store. Can be used as a backing for points-to data structures like PointsToDS and PointsToDFDS. Hides points-to sets and union operations from users and hands out PointsToIDs. Points-to sets are interned, and union operations are lazy and hash-consed.
Definition at line 32 of file PersistentPointsToCache.h.
typedef std::function<Data(const Data &, const Data &)> SVF::PersistentPointsToCache< Data >::DataOp |
Definition at line 36 of file PersistentPointsToCache.h.
typedef Map<std::pair<PointsToID, PointsToID>, PointsToID> SVF::PersistentPointsToCache< Data >::OpCache |
Definition at line 38 of file PersistentPointsToCache.h.
typedef Map<Data, PointsToID> SVF::PersistentPointsToCache< Data >::PTSToIDMap |
Definition at line 35 of file PersistentPointsToCache.h.
|
inline |
Definition at line 46 of file PersistentPointsToCache.h.
|
inline |
Clear the cache.
Definition at line 55 of file PersistentPointsToCache.h.
|
inline |
Relatively complements lhs and rhs (lhs \ rhs) and returns it's ID.
Definition at line 173 of file PersistentPointsToCache.h.
|
inline |
If pts is not in the PersistentPointsToCache, inserts it, assigns an ID, and returns that ID. If it is, then the ID is returned.
Definition at line 91 of file PersistentPointsToCache.h.
|
inlinestatic |
Definition at line 40 of file PersistentPointsToCache.h.
|
inline |
Returns the points-to set which id represents. id must be stored in the cache.
Definition at line 106 of file PersistentPointsToCache.h.
|
inline |
Returns all points-to sets stored by this cache as keys to a map. Values are all 1. We use the map to be more compatible with getAllPts in the various PTDatas. Performance is a non-issue (for now) since this is just used for evaluation's sake.
Definition at line 345 of file PersistentPointsToCache.h.
|
inlineprivate |
Initialises statistics variables to 0.
Definition at line 403 of file PersistentPointsToCache.h.
|
inline |
Intersects lhs and rhs (lhs AND rhs) and returns the intersection's ID.
Definition at line 236 of file PersistentPointsToCache.h.
|
inlineprivate |
Definition at line 355 of file PersistentPointsToCache.h.
|
inlineprivate |
Performs dataOp on lhs and rhs, checking the opCache first and updating it afterwards. commutative indicates whether the operation in question is commutative or not. opPerformed is set to true if the operation was not cached and thus performed, false otherwise.
Definition at line 365 of file PersistentPointsToCache.h.
|
inline |
Print statistics on operations and points-to set numbers.
Definition at line 313 of file PersistentPointsToCache.h.
|
inline |
Remaps all points-to sets stored in the cache to the current mapping.
Definition at line 80 of file PersistentPointsToCache.h.
|
inline |
Resets the cache removing everything except the emptyData it was initialised with.
Definition at line 66 of file PersistentPointsToCache.h.
|
inline |
Unions lhs and rhs and returns their union's ID.
Definition at line 114 of file PersistentPointsToCache.h.
|
private |
Maps two IDs to their relative complement.
Definition at line 436 of file PersistentPointsToCache.h.
|
private |
Used to generate new PointsToIDs. Any non-zero is valid.
Definition at line 441 of file PersistentPointsToCache.h.
|
private |
Maps points-to IDs (indices) to their corresponding points-to set. Reverse of idToPts. Elements are only added through push_back, so the number of elements stored is the size of the vector. Not const so we can remap.
Definition at line 429 of file PersistentPointsToCache.h.
|
private |
Maps two IDs to their intersection. Keys must be sorted.
Definition at line 438 of file PersistentPointsToCache.h.
|
private |
Definition at line 452 of file PersistentPointsToCache.h.
|
private |
Definition at line 457 of file PersistentPointsToCache.h.
|
private |
Definition at line 447 of file PersistentPointsToCache.h.
|
private |
Definition at line 453 of file PersistentPointsToCache.h.
|
private |
Definition at line 458 of file PersistentPointsToCache.h.
|
private |
Definition at line 448 of file PersistentPointsToCache.h.
|
private |
Definition at line 451 of file PersistentPointsToCache.h.
|
private |
Definition at line 456 of file PersistentPointsToCache.h.
|
private |
Definition at line 446 of file PersistentPointsToCache.h.
|
private |
Maps points-to sets to their corresponding ID.
Definition at line 431 of file PersistentPointsToCache.h.
|
private |
Definition at line 449 of file PersistentPointsToCache.h.
|
private |
Definition at line 454 of file PersistentPointsToCache.h.
|
private |
Definition at line 444 of file PersistentPointsToCache.h.
|
private |
Maps two IDs to their union. Keys must be sorted.
Definition at line 434 of file PersistentPointsToCache.h.
|
private |
Definition at line 450 of file PersistentPointsToCache.h.
|
private |
Definition at line 455 of file PersistentPointsToCache.h.
|
private |
Definition at line 445 of file PersistentPointsToCache.h.