Fix an iterator invalidation problem in code used by the -strip pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-10-31 18:42:37 +00:00
parent 76ff2c7504
commit 306f6fefc9

View File

@ -269,12 +269,12 @@ bool SymbolTable::strip() {
value_iterator B = Plane.begin(), Bend = Plane.end();
while (B != Bend) { // Found nonempty type plane!
Value *V = B->second;
++B;
if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()) {
// Set name to "", removing from symbol table!
V->setName("");
RemovedSymbol = true;
}
++B;
}
}