for (SymbolTable::VarMap::iterator PI = Plane.begin(); PI != Plane.end();)
// If this entry should be unconditionally removed, or if we detect that
// the type is not used, remove it.
- //
if (ShouldNukeSymtabEntry(*PI) ||
!UsedTypes.count(cast<Type>(PI->second))) {
-#if MAP_IS_NOT_BRAINDEAD
- PI = Plane.erase(PI); // STD C++ Map should support this!
-#else
- Plane.erase(PI); // Alas, GCC 2.95.3 doesn't *SIGH*
- PI = Plane.begin();
-#endif
+ SymbolTable::VarMap::iterator PJ = PI++;
+ Plane.erase(PJ);
++NumKilled;
Changed = true;
} else {
++I; // This analysis is preserved, leave it in the available set...
else {
if (!dynamic_cast<ImmutablePass*>(I->second)) {
-#if MAP_DOESNT_HAVE_BROKEN_ERASE_MEMBER
- I = CurrentAnalyses.erase(I); // Analysis not preserved!
-#else
- // GCC 2.95.3 STL doesn't have correct erase member!
- CurrentAnalyses.erase(I);
- I = CurrentAnalyses.begin();
-#endif
+ std::map<AnalysisID, Pass*>::iterator J = I++;
+ CurrentAnalyses.erase(J); // Analysis not preserved!
} else {
++I;
}