LLVM API Documentation

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

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


Member Typedef Documentation

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

A mapping of Values to slot numbers.

Definition at line 50 of file AsmWriter.cpp.

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

The map of planes by Type.

Definition at line 68 of file AsmWriter.cpp.


Constructor & Destructor Documentation

SlotMachine::SlotMachine ( const Module M  ) 

Construct from a module.

Definition at line 1399 of file AsmWriter.cpp.

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  ) 

Construct from a module.

Definition at line 1399 of file AsmWriter.cpp.

SlotMachine::SlotMachine ( const Function F  ) 

Construct from a function, starting out in incorp state.

Definition at line 1412 of file AsmWriter.cpp.


Member Function Documentation

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 Value V  ) 

Determine if a Value has a slot or not.

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.


Member Data Documentation

const Module* llvm::SlotMachine::TheModule

The module for which we are holding slot numbers.

Definition at line 145 of file AsmWriter.cpp.

const Function* llvm::SlotMachine::TheFunction

The function for which we are holding slot numbers.

Definition at line 148 of file AsmWriter.cpp.

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

bool llvm::SlotMachine::FunctionProcessed

Definition at line 149 of file AsmWriter.cpp.

Referenced by incorporateFunction(), and purgeFunction().

TypedPlanes llvm::SlotMachine::mMap

The TypePlanes map for the module level data.

Definition at line 152 of file AsmWriter.cpp.

Referenced by getSlot().

TypePlane llvm::SlotMachine::mTypes

Definition at line 153 of file AsmWriter.cpp.

Referenced by getSlot().

TypedPlanes llvm::SlotMachine::fMap

The TypePlanes map for the function level data.

Definition at line 156 of file AsmWriter.cpp.

Referenced by getSlot(), and purgeFunction().

TypePlane llvm::SlotMachine::fTypes

Definition at line 157 of file AsmWriter.cpp.

Referenced by getSlot(), and purgeFunction().


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