[llvm-exegesis] Use range-based for loops (NFC)

This commit is contained in:
Kazu Hirata 2023-09-09 00:27:23 -07:00
parent 8a2d68f6be
commit c7b25faaac
2 changed files with 4 additions and 9 deletions

View File

@ -307,10 +307,8 @@ void BenchmarkClustering::stabilize(unsigned NumOpcodes) {
assert(std::distance(it, OldCluster.PointIndices.end()) > 0 &&
"Should have found at least one bad point");
// Mark to-be-moved points as belonging to the new cluster.
std::for_each(it, OldCluster.PointIndices.end(),
[this, &UnstableCluster](size_t P) {
ClusterIdForPoint_[P] = UnstableCluster.Id;
});
for (size_t P : llvm::make_range(it, OldCluster.PointIndices.end()))
ClusterIdForPoint_[P] = UnstableCluster.Id;
// Actually append to-be-moved points to the new cluster.
UnstableCluster.PointIndices.insert(UnstableCluster.PointIndices.end(),
it, OldCluster.PointIndices.end());

View File

@ -503,11 +503,8 @@ void benchmarkMain() {
}
BitVector AllReservedRegs;
llvm::for_each(Repetitors,
[&AllReservedRegs](
const std::unique_ptr<const SnippetRepetitor> &Repetitor) {
AllReservedRegs |= Repetitor->getReservedRegs();
});
for (const std::unique_ptr<const SnippetRepetitor> &Repetitor : Repetitors)
AllReservedRegs |= Repetitor->getReservedRegs();
std::vector<BenchmarkCode> Configurations;
if (!Opcodes.empty()) {