[llvm-commits] CVS: llvm/include/llvm/SymbolTable.h Value.h

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 5 18:11:10 PST 2005



Changes in directory llvm/include/llvm:

SymbolTable.h updated: 1.40 -> 1.41
Value.h updated: 1.73 -> 1.74
---
Log message:

Add a new method, allow symtab to poke name.


---
Diffs of the changes:  (+10 -0)

 SymbolTable.h |    8 ++++++++
 Value.h       |    2 ++
 2 files changed, 10 insertions(+)


Index: llvm/include/llvm/SymbolTable.h
diff -u llvm/include/llvm/SymbolTable.h:1.40 llvm/include/llvm/SymbolTable.h:1.41
--- llvm/include/llvm/SymbolTable.h:1.40	Sat Mar  5 13:58:40 2005
+++ llvm/include/llvm/SymbolTable.h	Sat Mar  5 20:10:40 2005
@@ -217,6 +217,14 @@
     return this->removeEntry(pmap.find(It->second->getType()), It);
   }
 
+  /// changeName - 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)", but is faster,
+  /// and will not temporarily remove the symbol table plane if V is the last
+  /// value in the symtab with that name (which could invalidate iterators to
+  /// that plane).
+  void changeName(Value *V, const std::string &Name);
+
   /// This method will strip the symbol table of its names leaving
   /// the type and values. 
   /// @brief Strip the symbol table. 


Index: llvm/include/llvm/Value.h
diff -u llvm/include/llvm/Value.h:1.73 llvm/include/llvm/Value.h:1.74
--- llvm/include/llvm/Value.h:1.73	Sat Mar  5 13:51:20 2005
+++ llvm/include/llvm/Value.h	Sat Mar  5 20:10:40 2005
@@ -50,6 +50,8 @@
 private:
   PATypeHolder Ty;
   Use *UseList;
+
+  friend class SymbolTable;    // Allow SymbolTable to directly poke Name.
   std::string Name;
 
   void operator=(const Value &);     // Do not implement






More information about the llvm-commits mailing list