LLVM 19.0.0git
Friends | List of all members
llvm::ValueSymbolTable Class Reference

This class provides a symbol table of name/value pairs. More...

#include "llvm/IR/ValueSymbolTable.h"

Public Types

Types
using ValueMap = StringMap< Value * >
 A mapping of names to values.
 
using iterator = ValueMap::iterator
 An iterator over a ValueMap.
 
using const_iterator = ValueMap::const_iterator
 A const_iterator over a ValueMap.
 

Public Member Functions

Constructors
 ValueSymbolTable (int MaxNameSize=-1)
 
 ~ValueSymbolTable ()
 
Accessors
Valuelookup (StringRef Name) const
 This method finds the value with the given Name in the the symbol table.
 
bool empty () const
 
unsigned size () const
 The number of name/type pairs is returned.
 
void dump () const
 This function can be used from the debugger to display the content of the symbol table while debugging.
 
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.
 

Friends

class SymbolTableListTraits< Argument >
 
class SymbolTableListTraits< BasicBlock >
 
class SymbolTableListTraits< Function >
 
class SymbolTableListTraits< GlobalAlias >
 
class SymbolTableListTraits< GlobalIFunc >
 
class SymbolTableListTraits< GlobalVariable >
 
class SymbolTableListTraits< Instruction, ilist_iterator_bits< true > >
 
class Value
 

Detailed 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.

Definition at line 38 of file ValueSymbolTable.h.

Member Typedef Documentation

◆ const_iterator

A const_iterator over a ValueMap.

Definition at line 58 of file ValueSymbolTable.h.

◆ iterator

An iterator over a ValueMap.

Definition at line 55 of file ValueSymbolTable.h.

◆ ValueMap

A mapping of names to values.

Definition at line 52 of file ValueSymbolTable.h.

Constructor & Destructor Documentation

◆ ValueSymbolTable()

llvm::ValueSymbolTable::ValueSymbolTable ( int  MaxNameSize = -1)
inline

Definition at line 64 of file ValueSymbolTable.h.

◆ ~ValueSymbolTable()

ValueSymbolTable::~ValueSymbolTable ( )

Definition at line 33 of file ValueSymbolTable.cpp.

References assert(), and llvm::dbgs().

Member Function Documentation

◆ begin() [1/2]

iterator llvm::ValueSymbolTable::begin ( )
inline

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

Definition at line 99 of file ValueSymbolTable.h.

References llvm::StringMap< ValueTy, AllocatorTy >::begin().

◆ begin() [2/2]

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

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

Definition at line 102 of file ValueSymbolTable.h.

References llvm::StringMap< ValueTy, AllocatorTy >::begin().

◆ dump()

LLVM_DUMP_METHOD void ValueSymbolTable::dump ( ) const

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

Print out symbol table on stderr

Definition at line 122 of file ValueSymbolTable.cpp.

References I.

◆ empty()

bool llvm::ValueSymbolTable::empty ( ) const
inline
Returns
true iff the symbol table is empty Determine if the symbol table is empty

Definition at line 84 of file ValueSymbolTable.h.

References llvm::StringMapImpl::empty().

◆ end() [1/2]

iterator llvm::ValueSymbolTable::end ( )
inline

Get an iterator to the end of the symbol table.

Definition at line 105 of file ValueSymbolTable.h.

References llvm::StringMap< ValueTy, AllocatorTy >::end().

◆ end() [2/2]

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

Get a const_iterator to the end of the symbol table.

Definition at line 108 of file ValueSymbolTable.h.

References llvm::StringMap< ValueTy, AllocatorTy >::end().

◆ lookup()

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

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

Returns
the value associated with the Name Lookup a named Value.

Definition at line 75 of file ValueSymbolTable.h.

References llvm::StringMap< ValueTy, AllocatorTy >::lookup(), and Name.

Referenced by parseIRValue().

◆ size()

unsigned llvm::ValueSymbolTable::size ( ) const
inline

The number of name/type pairs is returned.

Definition at line 87 of file ValueSymbolTable.h.

References llvm::StringMapImpl::size().

Referenced by llvm::Module::getNumNamedValues().

Friends And Related Function Documentation

◆ SymbolTableListTraits< Argument >

friend class SymbolTableListTraits< Argument >
friend

Definition at line 1 of file ValueSymbolTable.h.

◆ SymbolTableListTraits< BasicBlock >

friend class SymbolTableListTraits< BasicBlock >
friend

Definition at line 1 of file ValueSymbolTable.h.

◆ SymbolTableListTraits< Function >

friend class SymbolTableListTraits< Function >
friend

Definition at line 1 of file ValueSymbolTable.h.

◆ SymbolTableListTraits< GlobalAlias >

friend class SymbolTableListTraits< GlobalAlias >
friend

Definition at line 1 of file ValueSymbolTable.h.

◆ SymbolTableListTraits< GlobalIFunc >

friend class SymbolTableListTraits< GlobalIFunc >
friend

Definition at line 1 of file ValueSymbolTable.h.

◆ SymbolTableListTraits< GlobalVariable >

friend class SymbolTableListTraits< GlobalVariable >
friend

Definition at line 1 of file ValueSymbolTable.h.

◆ SymbolTableListTraits< Instruction, ilist_iterator_bits< true > >

Definition at line 1 of file ValueSymbolTable.h.

◆ Value

friend class Value
friend

Definition at line 46 of file ValueSymbolTable.h.


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