Skip to content

Commit 4c14638

Browse files
[llvm] Use range-based for loops (NFC)
1 parent 4577860 commit 4c14638

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/lib/ProfileData/SampleProfWriter.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,9 @@ void DefaultFunctionPruningStrategy::Erase(size_t CurrentOutputSize) {
8383
NumToRemove = 1;
8484

8585
assert(NumToRemove <= SortedFunctions.size());
86-
llvm::for_each(
87-
llvm::make_range(SortedFunctions.begin() + SortedFunctions.size() -
88-
NumToRemove,
89-
SortedFunctions.end()),
90-
[&](const NameFunctionSamples &E) { ProfileMap.erase(E.first); });
86+
for (const NameFunctionSamples &E :
87+
llvm::drop_begin(SortedFunctions, SortedFunctions.size() - NumToRemove))
88+
ProfileMap.erase(E.first);
9189
SortedFunctions.resize(SortedFunctions.size() - NumToRemove);
9290
}
9391

llvm/lib/Transforms/Scalar/GuardWidening.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ class GuardWideningImpl {
209209

210210
void makeAvailableAt(const SmallVectorImpl<Value *> &Checks,
211211
Instruction *InsertPos) const {
212-
for_each(Checks, [&](Value *V) { makeAvailableAt(V, InsertPos); });
212+
for (Value *V : Checks)
213+
makeAvailableAt(V, InsertPos);
213214
}
214215

215216
/// Common helper used by \c widenGuard and \c isWideningCondProfitable. Try

0 commit comments

Comments
 (0)