UniqueAttributeValues.insert(KV.second);
}
}
- llvm::for_each(UniqueNonterminals, [&T](llvm::StringRef Name) {
+ for (llvm::StringRef Name : UniqueNonterminals) {
T->Nonterminals.emplace_back();
T->Nonterminals.back().Name = Name.str();
- });
+ }
assert(T->Nonterminals.size() < (1 << (SymbolBits - 1)) &&
"Too many nonterminals to fit in SymbolID bits!");
llvm::sort(T->Nonterminals, [](const GrammarTable::Nonterminal &L,
// Add an empty string for the corresponding sentinel unset attribute.
T->AttributeValues.push_back("");
UniqueAttributeValues.erase("");
- llvm::for_each(UniqueAttributeValues, [&T](llvm::StringRef Name) {
+ for (llvm::StringRef Name : UniqueAttributeValues) {
T->AttributeValues.emplace_back();
T->AttributeValues.back() = Name.str();
- });
+ }
llvm::sort(T->AttributeValues);
assert(T->AttributeValues.front() == "");
llvm::SmallVector<mlir::Value> elidedLenParams =
elideLengthsAlreadyInType(ty, lenParams);
auto idxTy = getIndexType();
- llvm::for_each(elidedShape, [&](mlir::Value sh) {
+ for (mlir::Value sh : elidedShape)
indices.push_back(createConvert(loc, idxTy, sh));
- });
// Add a target attribute, if needed.
llvm::SmallVector<mlir::NamedAttribute> attrs;
if (asTarget)
ArrayRef<size_t> Pts) const {
// First, get the centroid of this group of points. This is O(N).
SchedClassClusterCentroid G;
- for_each(Pts, [this, &G](size_t P) {
+ for (size_t P : Pts) {
assert(P < Points_.size());
ArrayRef<BenchmarkMeasure> Measurements = Points_[P].Measurements;
if (Measurements.empty()) // Error point.
- return;
+ continue;
G.addPoint(Measurements);
- });
+ }
const std::vector<BenchmarkMeasure> Centroid = G.getAsPoint();
// Since we will be comparing with the centroid, we need to halve the epsilon.
/*IsUnstable=*/!areAllNeighbours(PointsOfSchedClass)));
Cluster &CurrentCluster = Clusters_.back();
// Mark points as belonging to the new cluster.
- for_each(PointsOfSchedClass, [this, &CurrentCluster](size_t P) {
+ for (size_t P : PointsOfSchedClass)
ClusterIdForPoint_[P] = CurrentCluster.Id;
- });
// And add all the points of this opcode's sched class to the new cluster.
CurrentCluster.PointIndices.reserve(PointsOfSchedClass.size());
CurrentCluster.PointIndices.assign(PointsOfSchedClass.begin(),
(*fptr)(args);
// Run all dynamic library destroy callbacks to prepare for the shutdown.
- llvm::for_each(destroyFns, [](MlirRunnerDestroyFn destroy) { destroy(); });
+ for (MlirRunnerDestroyFn destroy : destroyFns)
+ destroy();
return Error::success();
}