class ValueSymbolTable

Declaration

class ValueSymbolTable { /* full declaration omitted */ };

Description

This class provides a symbol table of name/value pairs. It is essentially a std::map <std ::string,Value*> but has a controlled interface provided by LLVM as well as ensuring uniqueness of names.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:37

Member Variables

private llvm::ValueSymbolTable::ValueMap vmap
The map that holds the symbol table.
private int MaxNameSize
The maximum size for each name. If the limit is exceeded, the name is capped.
private uint32_t LastUnique = 0
Counter for tracking unique names

Method Overview

  • public ValueSymbolTable(int MaxNameSize = -1)
  • public inline llvm::ValueSymbolTable::iterator begin()
  • public inline llvm::ValueSymbolTable::const_iterator begin() const
  • private llvm::ValueName * createValueName(llvm::StringRef Name, llvm::Value * V)
  • public void dump() const
  • public inline bool empty() const
  • public inline llvm::ValueSymbolTable::iterator end()
  • public inline llvm::ValueSymbolTable::const_iterator end() const
  • public llvm::Value * lookup(llvm::StringRef Name) const
  • private llvm::ValueName * makeUniqueName(llvm::Value * V, SmallString<256> & UniqueName)
  • private void reinsertValue(llvm::Value * V)
  • private void removeValueName(llvm::ValueName * V)
  • public inline unsigned int size() const
  • public ~ValueSymbolTable()

Methods

ValueSymbolTable(int MaxNameSize = -1)

Description

@ } @ {

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:63

Parameters

int MaxNameSize = -1

inline llvm::ValueSymbolTable::iterator begin()

Description

Get an iterator that from the beginning of the symbol table.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:98

inline llvm::ValueSymbolTable::const_iterator
begin() const

Description

Get a const_iterator that from the beginning of the symbol table.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:101

llvm::ValueName* createValueName(
    llvm::StringRef Name,
    llvm::Value* V)

Description

createValueName - This method attempts to create a value name and insert it into the symbol table with the specified name. If it conflicts, it auto-renames the name and returns that instead.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:124

Parameters

llvm::StringRef Name
llvm::Value* V

void dump() const

Description

This function can be used from the debugger to display the content of the symbol table while debugging. Print out symbol table on stderr

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:91

inline bool empty() const

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:83

Returns

true iff the symbol table is empty Determine if the symbol table is empty

inline llvm::ValueSymbolTable::iterator end()

Description

Get an iterator to the end of the symbol table.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:104

inline llvm::ValueSymbolTable::const_iterator
end() const

Description

Get a const_iterator to the end of the symbol table.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:107

llvm::Value* lookup(llvm::StringRef Name) const

Description

This method finds the value with the given \p Name in the the symbol table.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:74

Parameters

llvm::StringRef Name

Returns

the value associated with the \p Name Lookup a named Value.

llvm::ValueName* makeUniqueName(
    llvm::Value* V,
    SmallString<256>& UniqueName)

Description

@ } @ {

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:113

Parameters

llvm::Value* V
SmallString<256>& UniqueName

void reinsertValue(llvm::Value* V)

Description

This method adds the provided value \p N to the symbol table. The Value must have a name which is used to place the value in the symbol table. If the inserted name conflicts, this renames the value. Add a named value to the symbol table

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:119

Parameters

llvm::Value* V

void removeValueName(llvm::ValueName* V)

Description

This method removes a value from the symbol table. It leaves the ValueName attached to the value, but it is no longer inserted in the symtab.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:129

Parameters

llvm::ValueName* V

inline unsigned int size() const

Description

The number of name/type pairs is returned.

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:86

~ValueSymbolTable()

Declared at: llvm/include/llvm/IR/ValueSymbolTable.h:64