+
+ /// Get an iterator to the start of the name/Type map.
+ inline type_iterator type_begin() { return tmap.begin(); }
+
+ /// @brief Get a const_iterator to the start of the name/Type map.
+ inline type_const_iterator type_begin() const { return tmap.begin(); }
+
+ /// Get an iterator to the end of the name/Type map. This serves as the
+ /// marker for end of iteration of the types.
+ inline type_iterator type_end() { return tmap.end(); }
+
+ /// Get a const-iterator to the end of the name/Type map. This serves
+ /// as the marker for end of iteration of the types.
+ inline type_const_iterator type_end() const { return tmap.end(); }
+
+ /// This method returns a plane_const_iterator for iteration over
+ /// the type planes starting at a specific plane, given by \p Ty.
+ /// @brief Find a type plane.
+ inline plane_const_iterator find(const Type* Typ) const {
+ assert(Typ && "Can't find type plane with null type!");
+ return pmap.find(Typ);
+ }
+
+ /// This method returns a plane_iterator for iteration over the
+ /// type planes starting at a specific plane, given by \p Ty.
+ /// @brief Find a type plane.
+ inline plane_iterator find(const Type* Typ) {
+ assert(Typ && "Can't find type plane with null type!");
+ return pmap.find(Typ);
+ }
+
+
+/// @}
+/// @name Mutators
+/// @{
+public:
+
+ /// This method will strip the symbol table of its names leaving the type and
+ /// values.
+ /// @brief Strip the symbol table.
+ bool strip();
+
+ /// 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.
+ /// @brief Insert a type under a new name.
+ void insert(const std::string &Name, const Type *Typ);
+
+ /// Remove a type at the specified position in the symbol table.
+ /// @returns the removed Type.
+ Type* remove(type_iterator TI);
+
+/// @}
+/// @name Mutators used by Value::setName and other LLVM internals.
+/// @{
+public:
+
+ /// This method adds the provided value \p N to the symbol table. The Value
+ /// must have both a name and a type which are extracted and used to place the
+ /// value in the correct type plane under the value's name.
+ /// @brief Add a named value to the symbol table
+ inline void insert(Value *Val) {
+ assert(Val && "Can't insert null type into symbol table!");
+ assert(Val->hasName() && "Value must be named to go into symbol table!");
+ insertEntry(Val->getName(), Val->getType(), Val);