From a636224712ac122867042395ba2e2827cc6248ab Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 7 Jan 2007 00:41:39 +0000 Subject: [PATCH] Update the documentation for SymbolTable class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32970 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ProgrammersManual.html | 72 ++++++------------------------------- 1 file changed, 11 insertions(+), 61 deletions(-) diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index ae6f0e1bd76..fae99d6cd71 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -1426,14 +1426,14 @@ somewhere) can never be refined.

This class provides a symbol table that the Function and Module classes use for naming definitions. The symbol table can -provide a name for any Value or Type. SymbolTable is an abstract data -type. It hides the data it contains and provides access to it through a -controlled interface.

+provide a name for any Value. +SymbolTable is an abstract data type. It hides the data it contains +and provides access to it through a controlled interface.

-

Note that the symbol table class is should not be directly accessed by most -clients. It should only be used when iteration over the symbol table names -themselves are required, which is very special purpose. Note that not all LLVM +

Note that the SymbolTable class should not be directly accessed +by most clients. It should only be used when iteration over the symbol table +names themselves are required, which is very special purpose. Note that not +all LLVM Values have names, and those without names (i.e. they have an empty name) do not exist in the symbol table.

@@ -1442,9 +1442,8 @@ an empty name) do not exist in the symbol table. structure of the information it holds. The class contains two std::map objects. The first, pmap, is a map of Type* to maps of name (std::string) to Value*. -The second, tmap, is a map of names to Type*. Thus, Values -are stored in two-dimensions and accessed by Type and name. Types, -however, are stored in a single dimension and accessed only by name.

+Thus, Values are stored in two-dimensions and accessed by Type and +name.

The interface of this class provides three basic types of operations:

    @@ -1456,7 +1455,7 @@ however, are stored in a single dimension and accessed only by name.

    insert.
  1. Iterators. Iterators allow the user to traverse the content of the symbol table in well defined ways, such as the method - type_begin.
  2. + plane_begin.

Accessors

@@ -1467,15 +1466,6 @@ however, are stored in a single dimension and accessed only by name.

Ty parameter for a Value with the provided name. If a suitable Value is not found, null is returned. -
Type* lookupType( const std::string& name) const:
-
The lookupType method searches through the types for a - Type with the provided name. If a suitable Type - is not found, null is returned.
- -
bool hasTypes() const:
-
This function returns true if an entry has been made into the type - map.
-
bool isEmpty() const:
This function returns true if both the value and types maps are empty
@@ -1493,12 +1483,6 @@ however, are stored in a single dimension and accessed only by name.

name. There can be a many to one mapping between names and constants or types. -
void insert(const std::string& Name, Type *Typ):
-
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.
-
void remove(Value* Val):
This method removes a named value from the symbol table. The type and name of the Value are extracted from \p N and used to @@ -1506,21 +1490,11 @@ however, are stored in a single dimension and accessed only by name.

not in the symbol table, this method silently ignores the request.
-
void remove(Type* Typ):
-
This method removes a named type from the symbol table. The - name of the type is extracted from \P T and used to look up - the Type in the type map. If the Type is not in the symbol - table, this method silently ignores the request.
-
Value* remove(const std::string& Name, Value *Val):
Remove a constant or type with the specified name from the symbol table.
-
Type* remove(const std::string& Name, Type* T):
-
Remove a type with the specified name from the symbol table. - Returns the removed Type.
- -
Value *value_remove(const value_iterator& It):
+
Value *remove(const value_iterator& It):
Removes a specific value from the symbol table. Returns the removed value.
@@ -1547,16 +1521,6 @@ for (SymbolTable::plane_const_iterator PI = ST.plane_begin(), PE = ST.plane_end(); PI != PE; ++PI ) { PI->first // This is the Type* of the plane PI->second // This is the SymbolTable::ValueMap of name/Value pairs -} - - - - All name/Type PairsTI -

-for (SymbolTable::type_const_iterator TI = ST.type_begin(),
-     TE = ST.type_end(); TI != TE; ++TI ) {
-  TI->first  // This is the name of the type
-  TI->second // This is the Type* value associated with the name
 }
     
@@ -1618,20 +1582,6 @@ will loop infinitely.

marker for end of iteration of the type plane. Note: the type plane must already exist before using this. -
type_iterator type_begin():
-
Get an iterator to the start of the name/Type map.
- -
type_const_iterator type_begin() cons:
-
Get a const_iterator to the start of the name/Type map.
- -
type_iterator type_end():
-
Get an iterator to the end of the name/Type map. This serves as the - marker for end of iteration of the types.
- -
type_const_iterator type_end() const:
-
Get a const-iterator to the end of the name/Type map. This serves - as the marker for end of iteration of the types.
-
plane_const_iterator find(const Type* Typ ) const:
This method returns a plane_const_iterator for iteration over the type planes starting at a specific plane, given by \p Ty.