ROSE 0.11.145.147
|
Allocates storage for an argument or return value.
This class is an ordered container of storage pools, and any allocation requests are satisfied by dispatching to the storage pools. The first storage pool that can handle the request wins. Storage pools can be things like explicit lists of storage locations (e.g., an ordered list of registers used for integer function arguments), or they can generate storage locations on the fly (e.g., pushing function arguments onto a stack).
Definition at line 308 of file StoragePool.h.
#include <Rose/BinaryAnalysis/CallingConvention/StoragePool.h>
Public Types | |
using | Ptr = AllocatorPtr |
Shared-ownership pointer. | |
using | ConstPtr = AllocatorConstPtr |
Shared-ownership pointer. | |
Public Member Functions | |
void | append (const StoragePoolBaseConstPtr &) |
Add a storage pool to the allocator. | |
void | reset () |
Reset the allocation algorithm. | |
std::vector< ConcreteLocation > | allocate (SgAsmType *) |
Allocate storage for a value. | |
Static Public Member Functions | |
static Ptr | instance () |
Constructor. | |
Shared-ownership pointer.
Definition at line 313 of file StoragePool.h.
Shared-ownership pointer.
Definition at line 314 of file StoragePool.h.
|
static |
Constructor.
Construct an allocator with empty storage pools. Such an allocator cannot allocate anything.
void Rose::BinaryAnalysis::CallingConvention::Allocator::reset | ( | ) |
Reset the allocation algorithm.
This should be called before allocating arguments and return values for a new function declaration.
std::vector< ConcreteLocation > Rose::BinaryAnalysis::CallingConvention::Allocator::allocate | ( | SgAsmType * | ) |
Allocate storage for a value.
Returns the location where this value would be stored. It's possible that some values are stored at more than one location. An empty result means the value cannot be allocated.