Skip to content

Commit 6809c00

Browse files
committed
avoid (*I)
1 parent eeaf7f1 commit 6809c00

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/include/llvm/IR/PassManager.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ class PassManager : public PassInfoMixin<
222222
/// For internal use only!
223223
void eraseIf(function_ref<bool(StringRef)> Pred) {
224224
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()))
230231
I = Passes.erase(I);
231232
else
232233
++I;

0 commit comments

Comments
 (0)