Simplify some code.
authorChris Lattner <sabre@nondot.org>
Sun, 6 Mar 2005 05:13:42 +0000 (05:13 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Mar 2005 05:13:42 +0000 (05:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20476 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/SymbolTable.cpp

index db46607718f02909e960317d93e024941bf7c919..a4a0134f8978281c2cdea76704a9dd5521e6d427 100644 (file)
@@ -252,9 +252,8 @@ void SymbolTable::insertEntry(const std::string &Name, const Type *VTy,
       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 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
           //
           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();