Types and constants are wierd things in symbol tables now
authorChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:43:50 +0000 (16:43 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:43:50 +0000 (16:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@457 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SymbolStripping.cpp

index bafcee6be7c505d9617e9bc0537ab1f418acd63a..2f40f585d0c37fb5429bf4b35e11d698f7ec8eea 100644 (file)
@@ -26,11 +26,15 @@ static bool StripSymbolTable(SymbolTable *SymTab) {
   for (SymbolTable::iterator I = SymTab->begin(); I != SymTab->end(); ++I) {
     map<const string, Value *> &Plane = I->second;
     
-    map<const string, Value *>::iterator B;
+    SymbolTable::type_iterator B;
     while ((B = Plane.begin()) != Plane.end()) {   // Found nonempty type plane!
-      B->second->setName("");     // Set name to "", removing from symbol table!
+      Value *V = B->second;
+      if (V->isConstant() || V->isType())
+       SymTab->type_remove(B);
+      else 
+       V->setName("", SymTab);   // Set name to "", removing from symbol table!
       RemovedSymbol = true;
-      assert(Plane.begin() != B);
+      assert(Plane.begin() != B && "Symbol not removed from table!");
     }
   }