Fix a bug in the -deadtypeelim pass. The SymbolTable re-write changed it
authorJohn Criswell <criswell@uiuc.edu>
Thu, 27 May 2004 21:16:46 +0000 (21:16 +0000)
committerJohn Criswell <criswell@uiuc.edu>
Thu, 27 May 2004 21:16:46 +0000 (21:16 +0000)
to eliminate the wrong type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13855 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/DeadTypeElimination.cpp

index 28e5dca9f0b4253b5c962dcdeddbcbfbcd6e8728..cad90f56729e13a424f75d1ee920a90a6a62b3a8 100644 (file)
@@ -81,7 +81,7 @@ bool DTE::run(Module &M) {
     const Type *RHS = TI->second;
     if (ShouldNukeSymtabEntry(RHS) || !UsedTypes.count(RHS)) {
       SymbolTable::type_iterator ToRemove = TI++;
-      ST.remove(TI->second);
+      ST.remove(ToRemove->second);
       ++NumKilled;
       Changed = true;
     } else {