LLVM API Documentation
Collaboration diagram for llvm::SlotMachine:
Public Types | |
Types | |
typedef std::map< const Value *, unsigned > | ValueMap |
A mapping of Values to slot numbers. | |
typedef std::map< const Type *, unsigned > | TypeMap |
typedef std::map< const Type *, ValuePlane > | TypedPlanes |
The map of planes by Type. | |
Public Member Functions | |
Accessors | |
int | getSlot (const Value *V) |
int | getSlot (const Type *Ty) |
bool | hasSlot (const Value *V) |
Determine if a Value has a slot or not. | |
bool | hasSlot (const Type *Ty) |
Mutators | |
void | incorporateFunction (const Function *F) |
void | purgeFunction () |
Public Attributes | |
Data | |
const Module * | TheModule |
The module for which we are holding slot numbers. | |
const Function * | TheFunction |
The function for which we are holding slot numbers. | |
bool | FunctionProcessed |
TypedPlanes | mMap |
The TypePlanes map for the module level data. | |
TypePlane | mTypes |
TypedPlanes | fMap |
The TypePlanes map for the function level data. | |
TypePlane | fTypes |
Classes | |
struct | TypePlane |
struct | ValuePlane |
A plane with next slot number and ValueMap. More... |
This class provides computation of slot numbers for LLVM Assembly writing.
Definition at line 43 of file AsmWriter.cpp.
typedef std::map<const Value*, unsigned> llvm::SlotMachine::ValueMap |
typedef std::map<const Type*, unsigned> llvm::SlotMachine::TypeMap |
Definition at line 51 of file AsmWriter.cpp.
typedef std::map<const Type*, ValuePlane> llvm::SlotMachine::TypedPlanes |
SlotMachine::SlotMachine | ( | const Module * | M | ) |
SlotMachine::SlotMachine | ( | const Function * | F | ) |
Construct from a function, starting out in incorp state.
Definition at line 1412 of file AsmWriter.cpp.
SlotMachine::SlotMachine | ( | const Module * | M | ) |
SlotMachine::SlotMachine | ( | const Function * | F | ) |
Construct from a function, starting out in incorp state.
Definition at line 1412 of file AsmWriter.cpp.
int SlotMachine::getSlot | ( | const Value * | V | ) |
Return the slot number of the specified value in it's type plane. Its an error to ask for something not in the SlotMachine. Its an error to ask for a Type*
Definition at line 1493 of file AsmWriter.cpp.
References fMap, MI, mMap, TheFunction, and V.
Referenced by WriteAsOperandInternal().
int SlotMachine::getSlot | ( | const Type * | Ty | ) |
Get the slot number for a value. This function will assert if you ask for a Value that hasn't previously been inserted with createSlot. Types are forbidden because Type does not inherit from Value (any more).
Definition at line 1554 of file AsmWriter.cpp.
References fTypes, llvm::SlotMachine::TypePlane::map, mTypes, llvm::SlotMachine::TypePlane::next_slot, TheFunction, and Ty.
bool llvm::SlotMachine::hasSlot | ( | const Type * | Ty | ) |
void llvm::SlotMachine::incorporateFunction | ( | const Function * | F | ) | [inline] |
If you'd like to deal with a function instead of just a module, use this method to get its data into the SlotMachine.
Definition at line 100 of file AsmWriter.cpp.
References F, FunctionProcessed, and TheFunction.
void SlotMachine::purgeFunction | ( | ) |
After calling incorporateFunction, use this method to remove the most recently incorporated function from the SlotMachine. This will reset the state of the machine back to just the module contents.
Definition at line 1481 of file AsmWriter.cpp.
References llvm::SlotMachine::TypePlane::clear(), fMap, fTypes, FunctionProcessed, SC_DEBUG, and TheFunction.
The function for which we are holding slot numbers.
Definition at line 148 of file AsmWriter.cpp.
Referenced by getSlot(), incorporateFunction(), and purgeFunction().
Definition at line 149 of file AsmWriter.cpp.
Referenced by incorporateFunction(), and purgeFunction().
The TypePlanes map for the module level data.
Definition at line 152 of file AsmWriter.cpp.
Referenced by getSlot().
The TypePlanes map for the function level data.
Definition at line 156 of file AsmWriter.cpp.
Referenced by getSlot(), and purgeFunction().