/// The only purpose of this operator is to serve as a sequence point so that
/// the evaluation of `fun` (which build IR snippets in a scoped fashion) is
/// scoped within a LoopBuilder.
- ValueHandle operator()(std::function<void(void)> fun = nullptr);
+ ValueHandle operator()(llvm::function_ref<void(void)> fun = nullptr);
};
/// Explicit nested LoopBuilder. Offers a compressed multi-loop builder to avoid
LoopNestBuilder(ArrayRef<ValueHandle *> ivs, ArrayRef<ValueHandle> lbs,
ArrayRef<ValueHandle> ubs, ArrayRef<int64_t> steps);
- ValueHandle operator()(std::function<void(void)> fun = nullptr);
+ ValueHandle operator()(llvm::function_ref<void(void)> fun = nullptr);
private:
SmallVector<LoopBuilder, 4> loops;
/// The only purpose of this operator is to serve as a sequence point so that
/// the evaluation of `fun` (which build IR snippets in a scoped fashion) is
/// scoped within a BlockBuilder.
- void operator()(std::function<void(void)> fun = nullptr);
+ void operator()(llvm::function_ref<void(void)> fun = nullptr);
private:
BlockBuilder(BlockBuilder &) = delete;
enter(body, /*prev=*/1);
}
-ValueHandle mlir::edsc::LoopBuilder::operator()(std::function<void(void)> fun) {
+ValueHandle
+mlir::edsc::LoopBuilder::operator()(llvm::function_ref<void(void)> fun) {
// Call to `exit` must be explicit and asymmetric (cannot happen in the
// destructor) because of ordering wrt comma operator.
/// The particular use case concerns nested blocks:
}
ValueHandle
-mlir::edsc::LoopNestBuilder::operator()(std::function<void(void)> fun) {
+mlir::edsc::LoopNestBuilder::operator()(llvm::function_ref<void(void)> fun) {
if (fun)
fun();
// Iterate on the calling operator() on all the loops in the nest.
/// Only serves as an ordering point between entering nested block and creating
/// stmts.
-void mlir::edsc::BlockBuilder::operator()(std::function<void(void)> fun) {
+void mlir::edsc::BlockBuilder::operator()(llvm::function_ref<void(void)> fun) {
// Call to `exit` must be explicit and asymmetric (cannot happen in the
// destructor) because of ordering wrt comma operator.
if (fun)