LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::SlotMachine Class Reference

LLVM Assembly Writing Slot Computation. More...

Collaboration diagram for llvm::SlotMachine:

Collaboration graph
[legend]
List of all members.

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

Constructors
 SlotMachine (const Module *M)
 Construct from a module.
 SlotMachine (const Function *F)
 Construct from a function, starting out in incorp state.
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 ModuleTheModule
 The module for which we are holding slot numbers.
const FunctionTheFunction
 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...

Detailed Description

LLVM Assembly Writing Slot Computation.

This class provides computation of slot numbers for LLVM Assembly writing.

Definition at line 38 of file AsmWriter.cpp.


Member Typedef Documentation

typedef std::map<const Type*, ValuePlane> llvm::SlotMachine::TypedPlanes
 

The map of planes by Type.

Definition at line 63 of file AsmWriter.cpp.

typedef std::map<const Type*, unsigned> llvm::SlotMachine::TypeMap
 

Definition at line 46 of file AsmWriter.cpp.

typedef std::map<const Value*, unsigned> llvm::SlotMachine::ValueMap
 

A mapping of Values to slot numbers.

Definition at line 45 of file AsmWriter.cpp.


Constructor & Destructor Documentation

SlotMachine::SlotMachine const Module M  ) 
 

Construct from a module.

Definition at line 1307 of file AsmWriter.cpp.

SlotMachine::SlotMachine const Function F  ) 
 

Construct from a function, starting out in incorp state.

Definition at line 1320 of file AsmWriter.cpp.


Member Function Documentation

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 1462 of file AsmWriter.cpp.

References fTypes, llvm::SlotMachine::TypePlane::map, mTypes, llvm::SlotMachine::TypePlane::next_slot, and TheFunction.

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 1401 of file AsmWriter.cpp.

References fMap, mMap, and TheFunction.

Referenced by WriteAsOperandInternal().

bool llvm::SlotMachine::hasSlot const Type Ty  ) 
 

bool llvm::SlotMachine::hasSlot const Value V  ) 
 

Determine if a Value has a slot or not.

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 95 of file AsmWriter.cpp.

References 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 1389 of file AsmWriter.cpp.

References llvm::SlotMachine::TypePlane::clear(), fMap, fTypes, FunctionProcessed, SC_DEBUG, and TheFunction.


Member Data Documentation

TypedPlanes llvm::SlotMachine::fMap
 

The TypePlanes map for the function level data.

Definition at line 151 of file AsmWriter.cpp.

Referenced by getSlot(), and purgeFunction().

TypePlane llvm::SlotMachine::fTypes
 

Definition at line 152 of file AsmWriter.cpp.

Referenced by getSlot(), and purgeFunction().

bool llvm::SlotMachine::FunctionProcessed
 

Definition at line 144 of file AsmWriter.cpp.

Referenced by incorporateFunction(), and purgeFunction().

TypedPlanes llvm::SlotMachine::mMap
 

The TypePlanes map for the module level data.

Definition at line 147 of file AsmWriter.cpp.

Referenced by getSlot().

TypePlane llvm::SlotMachine::mTypes
 

Definition at line 148 of file AsmWriter.cpp.

Referenced by getSlot().

const Function* llvm::SlotMachine::TheFunction
 

The function for which we are holding slot numbers.

Definition at line 143 of file AsmWriter.cpp.

Referenced by getSlot(), incorporateFunction(), and purgeFunction().

const Module* llvm::SlotMachine::TheModule
 

The module for which we are holding slot numbers.

Definition at line 140 of file AsmWriter.cpp.


The documentation for this class was generated from the following file: