LLVM API Documentation
#include <SlotTable.h>
Collaboration diagram for llvm::SlotTable:
Public Types | |
Types | |
typedef unsigned | SlotNum |
Type slot number identification type. | |
typedef unsigned | PlaneNum |
The type of a plane number (corresponds to Type::TypeID). | |
typedef std::vector< const Value * > | ValuePlane |
A single plane of Values. Intended index is slot number. | |
typedef std::vector< ValuePlane > | ValueTable |
A table of Values. Intended index is Type::TypeID. | |
typedef std::map< const Value *, SlotNum > | ValueMap |
A map of values to slot numbers. | |
typedef std::vector< const Type * > | TypePlane |
A single plane of Types. Intended index is slot number. | |
typedef std::map< const Type *, SlotNum > | TypeMap |
A map of types to slot numbers. | |
enum | Constants { MAX_SLOT = 4294967294U, BAD_SLOT = 4294967295U } |
Some constants used as flags instead of actual slot numbers. More... | |
Public Member Functions | |
Constructors | |
SlotTable (bool dont_insert_primitives=false) | |
Default Constructor. | |
Accessors | |
size_t | value_size () const |
Get the number of planes of values. | |
size_t | type_size () const |
Get the number of types. | |
bool | plane_exists (PlaneNum plane) const |
Determine if a specific type plane in the value table exists. | |
bool | plane_empty (PlaneNum plane) const |
Determine if a specific type plane in the value table is empty. | |
size_t | plane_size (PlaneNum plane) const |
Get the number of entries in a specific plane of the value table. | |
bool | empty () const |
Determine if the SlotTable is empty. | |
SlotNum | getSlot (const Value *Val) const |
Get a slot number for a Value. | |
SlotNum | getSlot (const Type *Typ) const |
Get a slot number for a Type. | |
bool | hasSlot (const Value *Val) |
Determine if a Value has a slot number. | |
bool | hasSlot (const Type *Typ) |
Determine if a Type has a slot number. | |
Mutators | |
void | clear () |
Completely clear the SlotTable;. | |
void | resize (size_t new_size) |
Resize the table to incorporate at least new_size planes. | |
SlotNum | insert (const Value *Val, PlaneNum plane) |
Add a Value to the SlotTable. | |
SlotNum | insert (const Type *Typ) |
Add a Type to the SlotTable. | |
SlotNum | remove (const Value *Val, PlaneNum plane) |
Remove a Value from the SlotTable. | |
SlotNum | remove (const Type *Typ) |
Remove a Type from the SlotTable. |
This class is the common abstract data type for both the SlotMachine and the SlotCalculator. It provides the two-way mapping between Values and Slots as well as the two-way mapping between Types and Slots. For Values, the slot number can be extracted by simply using the getSlot() method and passing in the Value. For Types, it is the same.
Definition at line 36 of file SlotTable.h.
|
The type of a plane number (corresponds to Type::TypeID). This type is used throughout the code to make it clear that an unsigned value refers to a type plane number and not something else. Definition at line 50 of file SlotTable.h. |
|
Type slot number identification type. This type is used throughout the code to make it clear that an unsigned value refers to a Slot number and not something else. Definition at line 45 of file SlotTable.h. |
|
A map of types to slot numbers.
Definition at line 71 of file SlotTable.h. |
|
A single plane of Types. Intended index is slot number.
Definition at line 68 of file SlotTable.h. |
|
A map of values to slot numbers.
Definition at line 65 of file SlotTable.h. |
|
A single plane of Values. Intended index is slot number.
Definition at line 59 of file SlotTable.h. |
|
A table of Values. Intended index is Type::TypeID.
Definition at line 62 of file SlotTable.h. |
|
Some constants used as flags instead of actual slot numbers.
Definition at line 53 of file SlotTable.h. |
|
Default Constructor. This constructor initializes all the containers in the SlotTable to empty and then inserts all the primitive types into the type plane by default. This is done as a convenience since most uses of the SlotTable will need the primitive types. If you don't need them, pass in true.
|
|
Completely clear the SlotTable;.
|
|
Determine if the SlotTable is empty.
Referenced by plane_empty(). |
|
Get a slot number for a Type.
|
|
Get a slot number for a Value.
Referenced by hasSlot(). |
|
Determine if a Type has a slot number.
Definition at line 130 of file SlotTable.h. |
|
Determine if a Value has a slot number.
Definition at line 126 of file SlotTable.h. |
|
|
|
|
|
Determine if a specific type plane in the value table is empty.
Definition at line 103 of file SlotTable.h. References empty(), and plane_exists(). |
|
Determine if a specific type plane in the value table exists.
Definition at line 98 of file SlotTable.h. Referenced by plane_empty(), and plane_size(). |
|
Get the number of entries in a specific plane of the value table.
Definition at line 108 of file SlotTable.h. References plane_exists(). |
|
Remove a Type from the SlotTable.
|
|
Remove a Value from the SlotTable.
|
|
Resize the table to incorporate at least
|
|
Get the number of types.
Definition at line 95 of file SlotTable.h. |
|
Get the number of planes of values.
Definition at line 92 of file SlotTable.h. |