LLVM API Documentation
#include <ValueSymbolTable.h>
Collaboration diagram for llvm::ValueSymbolTable:
Public Types | |
Types | |
typedef std::map< const std::string, Value * > | ValueMap |
A mapping of names to values. | |
typedef ValueMap::iterator | iterator |
An iterator over a ValueMap. | |
typedef ValueMap::const_iterator | const_iterator |
A const_iterator over a ValueMap. | |
Public Member Functions | |
Accessors | |
Value * | lookup (const std::string &name) const |
Lookup a named Value. | |
bool | empty () const |
Determine if the symbol table is empty. | |
unsigned | size () const |
The number of name/type pairs is returned. | |
std::string | getUniqueName (const std::string &BaseName) const |
Get a name unique to this symbol table. | |
void | dump () const |
Print out symbol table on stderr. | |
Iteration | |
iterator | begin () |
Get an iterator that from the beginning of the symbol table. | |
const_iterator | begin () const |
Get a const_iterator that from the beginning 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 | |
bool | strip () |
Strip the symbol table. | |
void | insert (Value *Val) |
Add a named value to the symbol table. | |
bool | erase (Value *Val) |
Remove a value from the symbol table. | |
bool | rename (Value *V, const std::string &Name) |
Rename a value in the symbol table. |
Definition at line 28 of file ValueSymbolTable.h.
typedef std::map<const std::string, Value *> llvm::ValueSymbolTable::ValueMap |
typedef ValueMap::iterator llvm::ValueSymbolTable::iterator |
typedef ValueMap::const_iterator llvm::ValueSymbolTable::const_iterator |
llvm::ValueSymbolTable::ValueSymbolTable | ( | ) | [inline] |
Definition at line 48 of file ValueSymbolTable.h.
ValueSymbolTable::~ValueSymbolTable | ( | ) |
Definition at line 27 of file ValueSymbolTable.cpp.
llvm::ValueSymbolTable::ValueSymbolTable | ( | ) | [inline] |
Definition at line 48 of file ValueSymbolTable.h.
ValueSymbolTable::~ValueSymbolTable | ( | ) |
Definition at line 27 of file ValueSymbolTable.cpp.
Value * ValueSymbolTable::lookup | ( | const std::string & | name | ) | const |
Lookup a named Value.
This method finds the value with the given name
in the the symbol table.
name
Definition at line 58 of file ValueSymbolTable.cpp.
bool llvm::ValueSymbolTable::empty | ( | ) | const [inline] |
Determine if the symbol table is empty.
Definition at line 64 of file ValueSymbolTable.h.
unsigned llvm::ValueSymbolTable::size | ( | ) | const [inline] |
std::string ValueSymbolTable::getUniqueName | ( | const std::string & | BaseName | ) | const |
Get a name unique to this symbol table.
Given a base name, return a string that is either equal to it or derived from it that does not already occur in the symbol table for the specified type.
Definition at line 45 of file ValueSymbolTable.cpp.
References llvm::utostr().
void ValueSymbolTable::dump | ( | ) | const |
Print out symbol table on stderr.
This function can be used from the debugger to display the content of the symbol table while debugging.
Definition at line 163 of file ValueSymbolTable.cpp.
References DumpVal().
iterator llvm::ValueSymbolTable::begin | ( | ) | [inline] |
Get an iterator that from the beginning of the symbol table.
Definition at line 86 of file ValueSymbolTable.h.
const_iterator llvm::ValueSymbolTable::begin | ( | ) | const [inline] |
Get a const_iterator that from the beginning of the symbol table.
Definition at line 89 of file ValueSymbolTable.h.
iterator llvm::ValueSymbolTable::end | ( | ) | [inline] |
const_iterator llvm::ValueSymbolTable::end | ( | ) | const [inline] |
Get a const_iterator to the end of the symbol table.
Definition at line 95 of file ValueSymbolTable.h.
bool ValueSymbolTable::strip | ( | ) |
Strip the symbol table.
This method will strip the symbol table of its names.
Definition at line 67 of file ValueSymbolTable.cpp.
References V.
void ValueSymbolTable::insert | ( | Value * | Val | ) |
Add a named value to the symbol table.
This method adds the provided value N
to the symbol table. The Value must have a name which is used to place the value in the symbol table.
Definition at line 83 of file ValueSymbolTable.cpp.
References dump(), getUniqueName(), and V.
bool ValueSymbolTable::erase | ( | Value * | Val | ) |
Remove a value from the symbol table.
This method removes a value from the symbol table. The name of the Value is extracted from Val
and used to lookup the Value in the symbol table. If the Value is not in the symbol table, this method returns false.
Val
was successfully erased, false otherwise Definition at line 100 of file ValueSymbolTable.cpp.
bool ValueSymbolTable::rename | ( | Value * | V, | |
const std::string & | Name | |||
) |
Rename a value in the symbol table.
Given a value with a non-empty name, remove its existing entry from the symbol table and insert a new one for Name. This is equivalent to doing "remove(V), V->Name = Name, insert(V)".
Definition at line 121 of file ValueSymbolTable.cpp.
References getUniqueName(), and V.