Make this MUCH faster by avoiding a linear search in the symbol table code.
authorChris Lattner <sabre@nondot.org>
Sun, 6 Mar 2005 05:42:36 +0000 (05:42 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Mar 2005 05:42:36 +0000 (05:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20479 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/DeadTypeElimination.cpp

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