File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,12 @@ class PassManager : public PassInfoMixin<
222
222
// / For internal use only!
223
223
void eraseIf (function_ref<bool (StringRef)> Pred) {
224
224
for (auto I = Passes.begin (); I != Passes.end ();) {
225
- (*I)->eraseIf (Pred);
226
- bool IsSpecial = (*I)->name ().ends_with (" PassAdaptor" ) ||
227
- (*I)->name ().contains (" PassManager" );
228
- bool PredResult = Pred ((*I)->name ());
229
- if ((!IsSpecial && PredResult) || (IsSpecial && (*I)->isEmpty ()))
225
+ auto &P = *I;
226
+ P->eraseIf (Pred);
227
+ bool IsSpecial = P->name ().ends_with (" PassAdaptor" ) ||
228
+ P->name ().contains (" PassManager" );
229
+ bool PredResult = Pred (P->name ());
230
+ if ((!IsSpecial && PredResult) || (IsSpecial && P->isEmpty ()))
230
231
I = Passes.erase (I);
231
232
else
232
233
++I;
You can’t perform that action at this time.
0 commit comments