LLVM API Documentation
#include <TypeSymbolTable.h>
Public Types | |
Types | |
| typedef std::map< const std::string, const Type * > | TypeMap |
| A mapping of names to types. | |
| typedef TypeMap::iterator | iterator |
| An iterator over the TypeMap. | |
| typedef TypeMap::const_iterator | const_iterator |
| A const_iterator over the TypeMap. | |
Public Member Functions | |
Constructors | |
| TypeSymbolTable () | |
| ~TypeSymbolTable () | |
Accessors | |
| std::string | getUniqueName (const StringRef &BaseName) const |
| Get a unique name for a type. | |
| Type * | lookup (const StringRef &name) const |
| Lookup a type by name. | |
| iterator | find (const StringRef &name) |
| const_iterator | find (const StringRef &name) const |
| bool | empty () const |
| Determine if the symbol table is empty. | |
| unsigned | size () const |
| The number of name/type pairs is returned. | |
| void | dump () const |
| Print out symbol table on stderr. | |
Iteration | |
| iterator | begin () |
| Get an iterator to the start of the symbol table. | |
| const_iterator | begin () const |
| Get a const_iterator to the start of the symbol table. | |
| iterator | end () |
| Get an iterator to the end of the symbol table. | |
| const_iterator | end () const |
| Get a const_iterator to the end of the symbol table. | |
Mutators | |
| void | insert (const StringRef &Name, const Type *Typ) |
| Insert a type under a new name. | |
| Type * | remove (iterator TI) |
Definition at line 28 of file TypeSymbolTable.h.
| typedef std::map<const std::string, const Type*> llvm::TypeSymbolTable::TypeMap |
| typedef TypeMap::const_iterator llvm::TypeSymbolTable::const_iterator |
| llvm::TypeSymbolTable::TypeSymbolTable | ( | ) | [inline] |
Definition at line 48 of file TypeSymbolTable.h.
| TypeSymbolTable::~TypeSymbolTable | ( | ) |
Definition at line 30 of file TypeSymbolTable.cpp.
| std::string TypeSymbolTable::getUniqueName | ( | const StringRef & | BaseName | ) | const |
Get a unique name for a type.
Generates a unique name for a type based on the BaseName by incrementing an integer and appending it to the name, if necessary
Definition at line 38 of file TypeSymbolTable.cpp.
References End, llvm::StringRef::str(), and llvm::utostr().
Referenced by insert().
Lookup a type by name.
This method finds the type with the given name in the type map and returns it.
name. Definition at line 52 of file TypeSymbolTable.cpp.
Referenced by llvm::Module::addTypeName(), llvm::Module::getTypeByName(), insert(), and LinkTypes().
| TypeSymbolTable::iterator TypeSymbolTable::find | ( | const StringRef & | name | ) |
Lookup the type associated with name.
Definition at line 62 of file TypeSymbolTable.cpp.
Referenced by LLVMDeleteTypeName().
| TypeSymbolTable::const_iterator TypeSymbolTable::find | ( | const StringRef & | name | ) | const |
Lookup the type associated with name.
Definition at line 68 of file TypeSymbolTable.cpp.
| bool llvm::TypeSymbolTable::empty | ( | ) | const [inline] |
Determine if the symbol table is empty.
Definition at line 81 of file TypeSymbolTable.h.
Referenced by WriteTypeSymbolTable().
| unsigned llvm::TypeSymbolTable::size | ( | ) | const [inline] |
The number of name/type pairs is returned.
Definition at line 85 of file TypeSymbolTable.h.
| void TypeSymbolTable::dump | ( | ) | const [virtual] |
Print out symbol table on stderr.
This function can be used from the debugger to display the content of the symbol table while debugging.
Implements llvm::AbstractTypeUser.
Definition at line 192 of file TypeSymbolTable.cpp.
References llvm::cerr(), and DumpTypes().
| iterator llvm::TypeSymbolTable::begin | ( | ) | [inline] |
Get an iterator to the start of the symbol table.
Definition at line 97 of file TypeSymbolTable.h.
Referenced by AddModuleTypesToPrinter(), llvm::CloneModule(), findTypeName(), llvm::Module::getTypeName(), LinkTypes(), llvm::MSILModule::runOnModule(), StripDebugInfo(), StripTypeSymtab(), and WriteTypeSymbolTable().
| const_iterator llvm::TypeSymbolTable::begin | ( | ) | const [inline] |
Get a const_iterator to the start of the symbol table.
Definition at line 100 of file TypeSymbolTable.h.
| iterator llvm::TypeSymbolTable::end | ( | ) | [inline] |
Get an iterator to the end of the symbol table.
Definition at line 103 of file TypeSymbolTable.h.
Referenced by AddModuleTypesToPrinter(), llvm::CloneModule(), findTypeName(), llvm::Module::getTypeName(), LinkTypes(), LLVMDeleteTypeName(), llvm::MSILModule::runOnModule(), StripDebugInfo(), StripTypeSymtab(), and WriteTypeSymbolTable().
| const_iterator llvm::TypeSymbolTable::end | ( | ) | const [inline] |
Get a const_iterator to the end of the symbol table.
Definition at line 106 of file TypeSymbolTable.h.
Insert a type under a new name.
Inserts a type into the symbol table with the specified name. There can be a many-to-one mapping between names and types. This method allows a type with an existing entry in the symbol table to get a new name.
Definition at line 105 of file TypeSymbolTable.cpp.
References llvm::cerr(), dump(), llvm::Type::getDescription(), getUniqueName(), llvm::Type::isAbstract(), and lookup().
Referenced by llvm::Module::addTypeName(), and LinkTypes().
Remove a type at the specified position in the symbol table.
Definition at line 74 of file TypeSymbolTable.cpp.
References llvm::cerr(), and dump().
Referenced by LLVMDeleteTypeName(), llvm::MSILModule::runOnModule(), StripDebugInfo(), and StripTypeSymtab().