LLVM API Documentation
#include <SlotTable.h>
Collaboration diagram for llvm::SlotTable:
Public Types | |
Types | |
enum | Constants { MAX_SLOT = 4294967294U, BAD_SLOT = 4294967295U } |
Some constants used as flags instead of actual slot numbers. More... | |
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. | |
Public Member Functions | |
Accessors | |
size_t | value_size () const |
Get the number of planes of values. | |
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.
typedef unsigned llvm::SlotTable::SlotNum |
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.
typedef unsigned llvm::SlotTable::PlaneNum |
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.
typedef std::vector<const Value*> llvm::SlotTable::ValuePlane |
typedef std::vector<ValuePlane> llvm::SlotTable::ValueTable |
typedef std::map<const Value*,SlotNum> llvm::SlotTable::ValueMap |
typedef std::vector<const Type*> llvm::SlotTable::TypePlane |
typedef std::map<const Type*,SlotNum> llvm::SlotTable::TypeMap |
Some constants used as flags instead of actual slot numbers.
Definition at line 53 of file SlotTable.h.
llvm::SlotTable::SlotTable | ( | bool | dont_insert_primitives = false |
) | [explicit] |
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.
dont_insert_primitives | Control insertion of primitives. |
llvm::SlotTable::SlotTable | ( | bool | dont_insert_primitives = false |
) | [explicit] |
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.
dont_insert_primitives | Control insertion of primitives. |
size_t llvm::SlotTable::value_size | ( | ) | const [inline] |
bool llvm::SlotTable::plane_exists | ( | PlaneNum | plane | ) | const [inline] |
Determine if a specific type plane in the value table exists.
Definition at line 95 of file SlotTable.h.
Referenced by plane_empty(), and plane_size().
bool llvm::SlotTable::plane_empty | ( | PlaneNum | plane | ) | const [inline] |
Determine if a specific type plane in the value table is empty.
Definition at line 100 of file SlotTable.h.
References empty(), and plane_exists().
size_t llvm::SlotTable::plane_size | ( | PlaneNum | plane | ) | const [inline] |
Get the number of entries in a specific plane of the value table.
Definition at line 105 of file SlotTable.h.
References plane_exists(), and size.
bool llvm::SlotTable::empty | ( | ) | const |
Determine if the SlotTable is empty.
Referenced by plane_empty().
bool llvm::SlotTable::hasSlot | ( | const Value * | Val | ) | [inline] |
bool llvm::SlotTable::hasSlot | ( | const Type * | Typ | ) | [inline] |
void llvm::SlotTable::clear | ( | ) |
Completely clear the SlotTable;.
void llvm::SlotTable::resize | ( | size_t | new_size | ) |
Resize the table to incorporate at least new_size
planes.