From: Chris Lattner Date: Fri, 7 Sep 2001 16:43:50 +0000 (+0000) Subject: Types and constants are wierd things in symbol tables now X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=13b1f0cb4b7bfa84602b99d1d315e400f3dbd8c1;p=oota-llvm.git Types and constants are wierd things in symbol tables now git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@457 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp index bafcee6be7c..2f40f585d0c 100644 --- a/lib/Transforms/Scalar/SymbolStripping.cpp +++ b/lib/Transforms/Scalar/SymbolStripping.cpp @@ -26,11 +26,15 @@ static bool StripSymbolTable(SymbolTable *SymTab) { for (SymbolTable::iterator I = SymTab->begin(); I != SymTab->end(); ++I) { map &Plane = I->second; - map::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!"); } }