summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commitd707ec62b613d8dc5cc17c495eff8038418008ff (patch)
tree30aa6a4305ce1d4a748ee7a6de217ab3d0f1e8c6 /llvm/lib/Transforms
parentdae05dc9374b302917535db7600134a136ff7a2f (diff)
downloadbcm5719-llvm-d707ec62b613d8dc5cc17c495eff8038418008ff.tar.gz
bcm5719-llvm-d707ec62b613d8dc5cc17c495eff8038418008ff.zip
Types and constants are wierd things in symbol tables now
llvm-svn: 457
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SymbolStripping.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/SymbolStripping.cpp b/llvm/lib/Transforms/Scalar/SymbolStripping.cpp
index bafcee6be7c..2f40f585d0c 100644
--- a/llvm/lib/Transforms/Scalar/SymbolStripping.cpp
+++ b/llvm/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!");
}
}
OpenPOWER on IntegriCloud