Skip to content

Commit c7b25fa

Browse files
[llvm-exegesis] Use range-based for loops (NFC)
1 parent 8a2d68f commit c7b25fa

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

llvm/tools/llvm-exegesis/lib/Clustering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,8 @@ void BenchmarkClustering::stabilize(unsigned NumOpcodes) {
307307
assert(std::distance(it, OldCluster.PointIndices.end()) > 0 &&
308308
"Should have found at least one bad point");
309309
// Mark to-be-moved points as belonging to the new cluster.
310-
std::for_each(it, OldCluster.PointIndices.end(),
311-
[this, &UnstableCluster](size_t P) {
312-
ClusterIdForPoint_[P] = UnstableCluster.Id;
313-
});
310+
for (size_t P : llvm::make_range(it, OldCluster.PointIndices.end()))
311+
ClusterIdForPoint_[P] = UnstableCluster.Id;
314312
// Actually append to-be-moved points to the new cluster.
315313
UnstableCluster.PointIndices.insert(UnstableCluster.PointIndices.end(),
316314
it, OldCluster.PointIndices.end());

llvm/tools/llvm-exegesis/llvm-exegesis.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,8 @@ void benchmarkMain() {
503503
}
504504

505505
BitVector AllReservedRegs;
506-
llvm::for_each(Repetitors,
507-
[&AllReservedRegs](
508-
const std::unique_ptr<const SnippetRepetitor> &Repetitor) {
509-
AllReservedRegs |= Repetitor->getReservedRegs();
510-
});
506+
for (const std::unique_ptr<const SnippetRepetitor> &Repetitor : Repetitors)
507+
AllReservedRegs |= Repetitor->getReservedRegs();
511508

512509
std::vector<BenchmarkCode> Configurations;
513510
if (!Opcodes.empty()) {

0 commit comments

Comments
 (0)