Skip to content

Commit e854321

Browse files
[IR] Use llvm::for_each (NFC) (#146989)
We can pass a range to llvm::for_each.
1 parent 60fca53 commit e854321

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/IR/LegacyPassManager.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void PMDataManager::emitInstrCountChangedRemark(
120120
// If no function was passed in, then we're either a module pass or an
121121
// CGSCC pass.
122122
if (!CouldOnlyImpactOneFunction)
123-
std::for_each(M.begin(), M.end(), UpdateFunctionChanges);
123+
llvm::for_each(M, UpdateFunctionChanges);
124124
else
125125
UpdateFunctionChanges(*F);
126126

@@ -197,9 +197,7 @@ void PMDataManager::emitInstrCountChangedRemark(
197197
// Are we looking at more than one function? If so, emit remarks for all of
198198
// the functions in the module. Otherwise, only emit one remark.
199199
if (!CouldOnlyImpactOneFunction)
200-
std::for_each(FunctionToInstrCount.keys().begin(),
201-
FunctionToInstrCount.keys().end(),
202-
EmitFunctionSizeChangedRemark);
200+
llvm::for_each(FunctionToInstrCount.keys(), EmitFunctionSizeChangedRemark);
203201
else
204202
EmitFunctionSizeChangedRemark(F->getName().str());
205203
}

0 commit comments

Comments
 (0)