Make this MUCH faster by avoiding a linear search in the symbol table code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20479 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-03-06 05:42:36 +00:00
parent c9a33cefb8
commit 82aa566795

View File

@ -80,8 +80,7 @@ bool DTE::runOnModule(Module &M) {
// the type is not used, remove it. // the type is not used, remove it.
const Type *RHS = TI->second; const Type *RHS = TI->second;
if (ShouldNukeSymtabEntry(RHS) || !UsedTypes.count(RHS)) { if (ShouldNukeSymtabEntry(RHS) || !UsedTypes.count(RHS)) {
SymbolTable::type_iterator ToRemove = TI++; ST.remove(TI++);
ST.remove(ToRemove->second);
++NumKilled; ++NumKilled;
Changed = true; Changed = true;
} else { } else {