LLVM API Documentation

llvm::SlotCalculator Class Reference

#include <SlotCalculator.h>

Collaboration diagram for llvm::SlotCalculator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< const
ConstantArray * >::const_iterator 
string_iterator

Public Member Functions

 SlotCalculator (const Module *M)
 SlotCalculator (const Function *F)
int getSlot (const Value *V) const
int getSlot (const Type *T) const
unsigned getGlobalSlot (const Value *V) const
unsigned getGlobalSlot (const Type *V) const
unsigned getNumPlanes () const
unsigned getNumTypes () const
unsigned getModuleLevel (unsigned Plane) const
unsigned getModuleTypeLevel () const
 Returns the number of types in the type list that are at module level.
TypePlane & getPlane (unsigned Plane)
TypeList & getTypes ()
void incorporateFunction (const Function *F)
void purgeFunction ()
string_iterator string_begin () const
string_iterator string_end () const
const std::vector< TypePlane > & getCompactionTable () const
const TypeList & getCompactionTypes () const
bool CompactionTableIsEmpty () const
 Determine if the compaction table (not types) is empty.

Detailed Description

Definition at line 35 of file SlotCalculator.h.


Member Typedef Documentation

typedef std::vector<const ConstantArray*>::const_iterator llvm::SlotCalculator::string_iterator

string_iterator/string_begin/end - Access the list of module-level constant strings that have been incorporated. This is only applicable to bytecode files.

Definition at line 131 of file SlotCalculator.h.


Constructor & Destructor Documentation

SlotCalculator::SlotCalculator ( const Module M  ) 

Definition at line 40 of file SlotCalculator.cpp.

References llvm::Type::FirstDerivedTyID, llvm::Type::getPrimitiveType(), M, and SC_DEBUG.

SlotCalculator::SlotCalculator ( const Function F  ) 

Definition at line 58 of file SlotCalculator.cpp.

References llvm::Type::FirstDerivedTyID, llvm::Type::getPrimitiveType(), incorporateFunction(), M, and SC_DEBUG.


Member Function Documentation

bool SlotCalculator::CompactionTableIsEmpty (  )  const

Determine if the compaction table (not types) is empty.

Determine if the compaction table is actually empty. Because the compaction table always includes the primitive type planes, we can't just check getCompactionTable().size() because it will never be zero. Furthermore, the ModuleLevel factors into whether a given plane is empty or not. This function does the necessary computation to determine if its actually empty.

Definition at line 626 of file SlotCalculator.cpp.

References getModuleLevel().

const std::vector<TypePlane>& llvm::SlotCalculator::getCompactionTable (  )  const [inline]

Definition at line 135 of file SlotCalculator.h.

const TypeList& llvm::SlotCalculator::getCompactionTypes (  )  const [inline]

Definition at line 139 of file SlotCalculator.h.

unsigned SlotCalculator::getGlobalSlot ( const Type V  )  const

Definition at line 85 of file SlotCalculator.cpp.

References I, and T.

unsigned SlotCalculator::getGlobalSlot ( const Value V  )  const

getGlobalSlot - Return a slot number from the global table. This can only be used when a compaction table is active.

Definition at line 77 of file SlotCalculator.cpp.

References I, and V.

unsigned llvm::SlotCalculator::getModuleLevel ( unsigned  Plane  )  const [inline]

Definition at line 106 of file SlotCalculator.h.

Referenced by CompactionTableIsEmpty(), and purgeFunction().

unsigned llvm::SlotCalculator::getModuleTypeLevel (  )  const [inline]

Returns the number of types in the type list that are at module level.

Definition at line 111 of file SlotCalculator.h.

unsigned llvm::SlotCalculator::getNumPlanes (  )  const [inline]

Definition at line 92 of file SlotCalculator.h.

Referenced by incorporateFunction().

unsigned llvm::SlotCalculator::getNumTypes (  )  const [inline]

Definition at line 99 of file SlotCalculator.h.

SlotCalculator::TypePlane & SlotCalculator::getPlane ( unsigned  Plane  ) 

Definition at line 91 of file SlotCalculator.cpp.

References llvm::Module::begin(), E, llvm::Module::end(), F, llvm::Module::getSymbolTable(), llvm::Module::global_begin(), llvm::Module::global_end(), I, llvm::inst_begin(), llvm::inst_end(), OI, PI, llvm::SymbolTable::plane_begin(), llvm::SymbolTable::plane_end(), llvm::Type::SByteTy, SC_DEBUG, Ty, llvm::SymbolTable::type_begin(), llvm::SymbolTable::type_end(), and llvm::Type::UByteTy.

Referenced by incorporateFunction(), and purgeFunction().

int SlotCalculator::getSlot ( const Type T  )  const

Definition at line 664 of file SlotCalculator.cpp.

References T.

int SlotCalculator::getSlot ( const Value V  )  const

getSlot - Return the slot number of the specified value in it's type plane. This returns < 0 on error!

Definition at line 646 of file SlotCalculator.cpp.

References V.

TypeList& llvm::SlotCalculator::getTypes (  )  [inline]

Definition at line 116 of file SlotCalculator.h.

void SlotCalculator::incorporateFunction ( const Function F  ) 

incorporateFunction/purgeFunction - If you'd like to deal with a function, use these two methods to get its data into the SlotCalculator!

Definition at line 271 of file SlotCalculator.cpp.

References BB, llvm::BasicBlock::begin(), llvm::constant_begin(), llvm::constant_end(), E, llvm::BasicBlock::end(), F, getNumPlanes(), getPlane(), I, SC_DEBUG, and size.

Referenced by SlotCalculator().

void SlotCalculator::purgeFunction (  ) 

Definition at line 331 of file SlotCalculator.cpp.

References getModuleLevel(), getPlane(), and SC_DEBUG.

string_iterator llvm::SlotCalculator::string_begin (  )  const [inline]

Definition at line 132 of file SlotCalculator.h.

string_iterator llvm::SlotCalculator::string_end (  )  const [inline]

Definition at line 133 of file SlotCalculator.h.


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