ROSE 0.11.145.147
|
Base class for pool of locations.
A storage pool contains an ordered sequence of locations and a predicate to determine whether the locations are able to hold a value of the specified type.
Definition at line 80 of file StoragePool.h.
#include <Rose/BinaryAnalysis/CallingConvention/StoragePool.h>
Public Types | |
using | Ptr = StoragePoolBasePtr |
Shared-ownership pointer. | |
using | ConstPtr = StoragePoolBaseConstPtr |
Shared-ownership pointer. | |
Public Member Functions | |
virtual Ptr | copy () const =0 |
Copy constructor. | |
virtual bool | canStore (SgAsmType *) const |
Test whether locations can store type. | |
virtual void | reset ()=0 |
Reset allocation. | |
virtual std::vector< ConcreteLocation > | consume (SgAsmType *)=0 |
Consume a storage location. | |
virtual std::vector< ConcreteLocation > | constantLocations () const |
List of constant storage locations. | |
Protected Member Functions | |
StoragePoolBase (const std::string &name, const TypePredicateConstPtr &) | |
Shared-ownership pointer.
Definition at line 85 of file StoragePool.h.
Shared-ownership pointer.
Definition at line 86 of file StoragePool.h.
|
pure virtual |
Copy constructor.
Makes a new copy of this pool.
Implemented in Rose::BinaryAnalysis::CallingConvention::StoragePoolEnumerated, and Rose::BinaryAnalysis::CallingConvention::StoragePoolStack.
|
virtual |
Test whether locations can store type.
If this pool contains locations that are capable of storing an instance of the specified type, then this predicate returns true, else false.
|
pure virtual |
Reset allocation.
Resets this storage pool back to its initial state. For instance, if the storage pool contains a list of three explicit locations and some or all of them have been taken by consume, then calling this function will make all three available again.
Implemented in Rose::BinaryAnalysis::CallingConvention::StoragePoolEnumerated, and Rose::BinaryAnalysis::CallingConvention::StoragePoolStack.
|
pure virtual |
Consume a storage location.
Given an argument type, return a location(s) if possible and remove that location from this pool.
Implemented in Rose::BinaryAnalysis::CallingConvention::StoragePoolEnumerated, and Rose::BinaryAnalysis::CallingConvention::StoragePoolStack.
|
virtual |
List of constant storage locations.
A constant location is any location whose address is known and is a constant. For example, a ConcreteLocation describing a particular register or memory location is a constant location, but a ConcreteLocation that describes a memory address which is stored in a register or a memory address that is the sum of a register value and an offset is not constant.
The constant values are used by the calling convention Analysis to check whether the callee reads from any of these locations without first writing to them.
The base implementation returns an empty vector.
Reimplemented in Rose::BinaryAnalysis::CallingConvention::StoragePoolEnumerated.