diff --git a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp index 9b1a919465c5..b3a439e14873 100644 --- a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -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 {