aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-07 16:43:50 +0000
committerChris Lattner <sabre@nondot.org>2001-09-07 16:43:50 +0000
commit13b1f0cb4b7bfa84602b99d1d315e400f3dbd8c1 (patch)
treeb325b91ca4c61eb54e7c7fb0f1632bda512cfc68 /lib
parentb70d82fb396b83f54d75540bdb41f236d4c001cd (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SymbolStripping.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp
index bafcee6be7..2f40f585d0 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<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!");
}
}