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

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 5 21:13:59 PST 2005



Changes in directory llvm/lib/VMCore:

SymbolTable.cpp updated: 1.53 -> 1.54
---
Log message:

Simplify some code.


---
Diffs of the changes:  (+5 -7)

 SymbolTable.cpp |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)


Index: llvm/lib/VMCore/SymbolTable.cpp
diff -u llvm/lib/VMCore/SymbolTable.cpp:1.53 llvm/lib/VMCore/SymbolTable.cpp:1.54
--- llvm/lib/VMCore/SymbolTable.cpp:1.53	Sat Mar  5 20:37:47 2005
+++ llvm/lib/VMCore/SymbolTable.cpp	Sat Mar  5 23:13:42 2005
@@ -252,9 +252,8 @@
       std::string UniqueName = getUniqueName(VTy, Name);
       assert(InternallyInconsistent == false &&
              "Infinite loop inserting value!");
-      InternallyInconsistent = true;
-      V->setName(UniqueName);
-      InternallyInconsistent = false;
+      V->Name = UniqueName;
+      VM->insert(VI, make_pair(UniqueName, V));
       return;
     }
   }
@@ -382,11 +381,10 @@
           //
           assert(InternallyInconsistent == false &&
                  "Symbol table already inconsistent!");
-          InternallyInconsistent = true;
 
-          // Remove newM from the symtab
-          NewGV->setName("");
-          InternallyInconsistent = false;
+          // Update NewGV's name, we're about the remove it from the symbol
+          // table.
+          NewGV->Name = "";
 
           // Now we can remove this global from the module entirely...
           Module *M = NewGV->getParent();






More information about the llvm-commits mailing list