1#ifndef ROSE_BinaryAnalysis_CallingConvention_StoragePool_H
2#define ROSE_BinaryAnalysis_CallingConvention_StoragePool_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/CallingConvention/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Address.h>
8#include <Rose/BinaryAnalysis/Alignment.h>
9#include <Rose/BinaryAnalysis/ByteOrder.h>
10#include <Rose/BinaryAnalysis/ConcreteLocation.h>
18namespace BinaryAnalysis {
19namespace CallingConvention {
152 std::vector<ConcreteLocation> locations_;
198 size_t minimumValueSize_ = 1;
208 int64_t initialOffset_ = 0;
318 std::vector<StoragePoolBaseConstPtr> initialPools_;
322 std::vector<StoragePoolBasePtr> activePools_;
Information about alignments.
Allocates storage for an argument or return value.
AllocatorConstPtr ConstPtr
Shared-ownership pointer.
void reset()
Reset the allocation algorithm.
void append(const StoragePoolBaseConstPtr &)
Add a storage pool to the allocator.
static Ptr instance()
Constructor.
AllocatorPtr Ptr
Shared-ownership pointer.
std::vector< ConcreteLocation > allocate(SgAsmType *)
Allocate storage for a value.
Base class for pool of locations.
virtual bool canStore(SgAsmType *) const
Test whether locations can store type.
virtual Ptr copy() const =0
Copy constructor.
StoragePoolBaseConstPtr ConstPtr
Shared-ownership pointer.
virtual void reset()=0
Reset allocation.
virtual std::vector< ConcreteLocation > constantLocations() const
List of constant storage locations.
StoragePoolBasePtr Ptr
Shared-ownership pointer.
virtual std::vector< ConcreteLocation > consume(SgAsmType *)=0
Consume a storage location.
A storage pool for explicit locations.
std::vector< ConcreteLocation > constantLocations() const override
List of constant storage locations.
void append(const ConcreteLocation &)
Append an additional location.
void reset() override
Reset allocation.
StoragePoolBasePtr copy() const override
Copy constructor.
static Ptr instance(const std::string &name, const TypePredicateConstPtr &)
Constructor.
StoragePoolEnumeratedPtr Ptr
Shared-ownership pointer.
std::vector< ConcreteLocation > consume(SgAsmType *) override
Consume a storage location.
StoragePoolEnumeratedConstPtr ConstPtr
Shared-ownership pointer.
A storage pool for stack-based argument locations.
void alignment(const Alignment &)
Property: Alignment of stack offsets.
int64_t initialOffset() const
Property: Initial stack offset.
const Alignment & valuePadding() const
Property: Aligned value size.
static Ptr instance(const std::string &name, const TypePredicateConstPtr &, const Architecture::BaseConstPtr &)
Constructor.
StackDirection stackDirection() const
Property: Stack direction.
const Alignment & alignment() const
Property: Alignment of stack offsets.
void minimumValueSize(size_t m)
Property: Minimum value size.
void reset() override
Reset allocation.
void valueJustification(ByteOrder::Endianness)
Property: Value justification within allocated storage.
void initialOffset(int64_t)
Property: Initial stack offset.
void stackDirection(StackDirection)
Property: Stack direction.
RegisterDescriptor baseRegister() const
Property: Base register.
ByteOrder::Endianness valueJustification() const
Property: Value justification within allocated storage.
StoragePoolStackPtr Ptr
Shared-ownership pointer.
StoragePoolStackConstPtr ConstPtr
Shared-ownership pointer.
void valuePadding(const Alignment &)
Property: Aligned value size.
StoragePoolBasePtr copy() const override
Copy constructor.
size_t minimumValueSize() const
Property: Minimum value size.
void baseRegister(RegisterDescriptor)
Property: Base register.
std::vector< ConcreteLocation > consume(SgAsmType *) override
Consume a storage location.
bool test(SgAsmType *type) const override
Evaluate this predicate on a type.
Base class for type predicates.
TypePredicateConstPtr ConstPtr
Shared-ownership pointer.
virtual bool test(SgAsmType *) const =0
Evaluate this predicate on a type.
bool operator()(SgAsmType *) const
Evaluate this predicate on a type.
TypePredicatePtr Ptr
Shared-ownership pointer.
Concrete location of data.
Describes (part of) a physical CPU register.
Base class for binary types.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
@ ORDER_LSB
Least significant byte first, i.e., little-endian.
std::shared_ptr< TypePredicate > TypePredicatePtr
Shared-ownership pointer to TypePredicate.
std::shared_ptr< const StoragePoolEnumerated > StoragePoolEnumeratedConstPtr
Shared-ownership pointer to StoragePoolEnumerated.
std::shared_ptr< const Allocator > AllocatorConstPtr
Shared-ownership pointer to Allocator.
TypePredicate::Ptr isFpNotWiderThan(size_t nBits)
Functor returning true for floating-point types not wider than specified.
TypePredicate::Ptr isNonFpNotWiderThan(size_t nBits)
Functor returning true for non-floating-point types not wider than specified.
std::shared_ptr< Allocator > AllocatorPtr
Shared-ownership pointer to Allocator.
TypePredicate::Ptr isPointerNotWiderThan(size_t nBits)
Functor returning true for pointers not wider than specified.
std::shared_ptr< StoragePoolStack > StoragePoolStackPtr
Shared-ownership pointer to StoragePoolStack.
std::shared_ptr< const StoragePoolBase > StoragePoolBaseConstPtr
Shared-ownership pointer to StoragePoolBase.
std::shared_ptr< const TypePredicate > TypePredicateConstPtr
Shared-ownership pointer to TypePredicate.
TypePredicate::Ptr isIntegerNotWiderThan(size_t nBits)
Functor returning true for integer types not wider than specified.
std::shared_ptr< StoragePoolEnumerated > StoragePoolEnumeratedPtr
Shared-ownership pointer to StoragePoolEnumerated.
StackDirection
The direction in which the stack grows.
@ GROWS_DOWN
A push decrements the stack pointer.
std::shared_ptr< StoragePoolBase > StoragePoolBasePtr
Shared-ownership pointer to StoragePoolBase.
std::shared_ptr< const StoragePoolStack > StoragePoolStackConstPtr
Shared-ownership pointer to StoragePoolStack.
TypePredicate::Ptr isAnyType()
Functor returning true for any non-null type.