We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eeaf7f1 commit 6809c00Copy full SHA for 6809c00
llvm/include/llvm/IR/PassManager.h
@@ -222,11 +222,12 @@ class PassManager : public PassInfoMixin<
222
/// For internal use only!
223
void eraseIf(function_ref<bool(StringRef)> Pred) {
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()))
+ auto &P = *I;
+ P->eraseIf(Pred);
+ bool IsSpecial = P->name().ends_with("PassAdaptor") ||
+ P->name().contains("PassManager");
+ bool PredResult = Pred(P->name());
230
+ if ((!IsSpecial && PredResult) || (IsSpecial && P->isEmpty()))
231
I = Passes.erase(I);
232
else
233
++I;
0 commit comments