mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-01 20:06:06 +00:00
[llvm] Use range-based for loops (NFC)
This commit is contained in:
parent
45778602f4
commit
4c14638b55
@ -83,11 +83,9 @@ void DefaultFunctionPruningStrategy::Erase(size_t CurrentOutputSize) {
|
||||
NumToRemove = 1;
|
||||
|
||||
assert(NumToRemove <= SortedFunctions.size());
|
||||
llvm::for_each(
|
||||
llvm::make_range(SortedFunctions.begin() + SortedFunctions.size() -
|
||||
NumToRemove,
|
||||
SortedFunctions.end()),
|
||||
[&](const NameFunctionSamples &E) { ProfileMap.erase(E.first); });
|
||||
for (const NameFunctionSamples &E :
|
||||
llvm::drop_begin(SortedFunctions, SortedFunctions.size() - NumToRemove))
|
||||
ProfileMap.erase(E.first);
|
||||
SortedFunctions.resize(SortedFunctions.size() - NumToRemove);
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,8 @@ class GuardWideningImpl {
|
||||
|
||||
void makeAvailableAt(const SmallVectorImpl<Value *> &Checks,
|
||||
Instruction *InsertPos) const {
|
||||
for_each(Checks, [&](Value *V) { makeAvailableAt(V, InsertPos); });
|
||||
for (Value *V : Checks)
|
||||
makeAvailableAt(V, InsertPos);
|
||||
}
|
||||
|
||||
/// Common helper used by \c widenGuard and \c isWideningCondProfitable. Try
|
||||
|
Loading…
x
Reference in New Issue
Block a user