[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp

Reid Spencer reid at x10sys.com
Fri Jan 26 00:01:48 PST 2007



Changes in directory llvm/lib/VMCore:

Function.cpp updated: 1.109 -> 1.110
---
Log message:

For PR645: http://llvm.org/PR645 :
Remove the Function::renameLocalSymbols function as it is no longer
needed.


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

 Function.cpp |   39 ---------------------------------------
 1 files changed, 39 deletions(-)


Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.109 llvm/lib/VMCore/Function.cpp:1.110
--- llvm/lib/VMCore/Function.cpp:1.109	Sat Jan  6 01:24:44 2007
+++ llvm/lib/VMCore/Function.cpp	Fri Jan 26 02:01:30 2007
@@ -139,45 +139,6 @@
 }
 
 
-/// renameLocalSymbols - This method goes through the Function's symbol table
-/// and renames any symbols that conflict with symbols at global scope.  This is
-/// required before printing out to a textual form, to ensure that there is no
-/// ambiguity when parsing.
-void Function::renameLocalSymbols() {
-  SymbolTable &LST = getValueSymbolTable();                 // Local Symtab
-  SymbolTable &GST = getParent()->getValueSymbolTable();    // Global Symtab
-
-  for (SymbolTable::plane_iterator LPI = LST.plane_begin(), E = LST.plane_end();
-       LPI != E; ++LPI)
-    // All global symbols are of pointer type, ignore any non-pointer planes.
-    if (isa<PointerType>(LPI->first)) {
-      // Only check if the global plane has any symbols of this type.
-      SymbolTable::plane_iterator GPI = GST.find(LPI->first);
-      if (GPI != GST.plane_end()) {
-        SymbolTable::ValueMap &LVM       = LPI->second;
-        const SymbolTable::ValueMap &GVM = GPI->second;
-
-        // Loop over all local symbols, renaming those that are in the global
-        // symbol table already.
-        for (SymbolTable::value_iterator VI = LVM.begin(), E = LVM.end();
-             VI != E;) {
-          Value *V                = VI->second;
-          const std::string &Name = VI->first;
-          ++VI;
-          if (GVM.count(Name)) {
-            static unsigned UniqueNum = 0;
-            // Find a name that does not conflict!
-            while (GVM.count(Name + "_" + utostr(++UniqueNum)) ||
-                   LVM.count(Name + "_" + utostr(UniqueNum)))
-              /* scan for UniqueNum that works */;
-            V->setName(Name + "_" + utostr(UniqueNum));
-          }
-        }
-      }
-    }
-}
-
-
 // dropAllReferences() - This function causes all the subinstructions to "let
 // go" of all references that they are maintaining.  This allows one to
 // 'delete' a whole class at a time, even though there may be circular






More information about the llvm-commits mailing list