[llvm] 6b82441 - [NFC][llvm-reduce] Purify for_each usage in Operand Bundles into range-based for loop
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 13:11:17 PDT 2020
Author: Roman Lebedev
Date: 2020-07-09T23:10:43+03:00
New Revision: 6b824415a21c188adfcabbb61ac8cf5d44b8e236
URL: https://github.com/llvm/llvm-project/commit/6b824415a21c188adfcabbb61ac8cf5d44b8e236
DIFF: https://github.com/llvm/llvm-project/commit/6b824415a21c188adfcabbb61ac8cf5d44b8e236.diff
LOG: [NFC][llvm-reduce] Purify for_each usage in Operand Bundles into range-based for loop
Summary:
As per lengthy/heated disscussion in D83351,
and CodingStandards D83431.
Reviewers: dblaikie, nickdesaulniers
Reviewed By: nickdesaulniers
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83434
Added:
Modified:
llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp b/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp
index cc2aebf46df1..77cb73837c82 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp
@@ -56,10 +56,9 @@ class OperandBundleRemapper : public InstVisitor<OperandBundleRemapper> {
OperandBundlesToKeepIndexes.reserve(Call.getNumOperandBundles());
// Enumerate every operand bundle on this call.
- for_each(seq(0U, Call.getNumOperandBundles()), [&](unsigned BundleIndex) {
+ for (unsigned BundleIndex : seq(0U, Call.getNumOperandBundles()))
if (O.shouldKeep()) // Should we keep this one?
OperandBundlesToKeepIndexes.emplace_back(BundleIndex);
- });
}
};
@@ -102,9 +101,8 @@ static void extractOperandBundesFromModule(std::vector<Chunk> ChunksToKeep,
OperandBundleRemapper R(ChunksToKeep);
R.visit(Program);
- for_each(R.CallsToRefine, [](const auto &P) {
- return maybeRewriteCallWithDifferentBundles(P.first, P.second);
- });
+ for (const auto &I : R.CallsToRefine)
+ maybeRewriteCallWithDifferentBundles(I.first, I.second);
}
/// Counts the amount of operand bundles.
More information about the llvm-commits
mailing list