From 11bbc448afb0cb5dcc0f8b77ae6cee693c2aedfb Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Mon, 30 Jun 2025 17:14:37 -0400 Subject: [PATCH] [mlir][examples] Fix deprecation warnings for `ArrayRef(std::nullopt)` --- mlir/examples/toy/Ch2/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch3/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch4/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch5/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch6/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch7/include/toy/Ops.td | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mlir/examples/toy/Ch2/include/toy/Ops.td b/mlir/examples/toy/Ch2/include/toy/Ops.td index 1a1b136af71fb..ef65c9c8d682b 100644 --- a/mlir/examples/toy/Ch2/include/toy/Ops.td +++ b/mlir/examples/toy/Ch2/include/toy/Ops.td @@ -297,7 +297,7 @@ def ReturnOp : Toy_Op<"return", [Pure, HasParent<"FuncOp">, // Allow building a ReturnOp with no return operand. let builders = [ - OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]> + OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; // Provide extra utility definitions on the c++ operation class definition. diff --git a/mlir/examples/toy/Ch3/include/toy/Ops.td b/mlir/examples/toy/Ch3/include/toy/Ops.td index 021802b5c4fcb..485980420a20b 100644 --- a/mlir/examples/toy/Ch3/include/toy/Ops.td +++ b/mlir/examples/toy/Ch3/include/toy/Ops.td @@ -298,7 +298,7 @@ def ReturnOp : Toy_Op<"return", [Pure, HasParent<"FuncOp">, // Allow building a ReturnOp with no return operand. let builders = [ - OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]> + OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; // Provide extra utility definitions on the c++ operation class definition. diff --git a/mlir/examples/toy/Ch4/include/toy/Ops.td b/mlir/examples/toy/Ch4/include/toy/Ops.td index 4441e48ca53c0..0b32b1b0c7726 100644 --- a/mlir/examples/toy/Ch4/include/toy/Ops.td +++ b/mlir/examples/toy/Ch4/include/toy/Ops.td @@ -335,7 +335,7 @@ def ReturnOp : Toy_Op<"return", [Pure, HasParent<"FuncOp">, // Allow building a ReturnOp with no return operand. let builders = [ - OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]> + OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; // Provide extra utility definitions on the c++ operation class definition. diff --git a/mlir/examples/toy/Ch5/include/toy/Ops.td b/mlir/examples/toy/Ch5/include/toy/Ops.td index 5b7c966de6f08..d11d18dc93cf1 100644 --- a/mlir/examples/toy/Ch5/include/toy/Ops.td +++ b/mlir/examples/toy/Ch5/include/toy/Ops.td @@ -335,7 +335,7 @@ def ReturnOp : Toy_Op<"return", [Pure, HasParent<"FuncOp">, // Allow building a ReturnOp with no return operand. let builders = [ - OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]> + OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; // Provide extra utility definitions on the c++ operation class definition. diff --git a/mlir/examples/toy/Ch6/include/toy/Ops.td b/mlir/examples/toy/Ch6/include/toy/Ops.td index fdbc239a171df..63950f467455c 100644 --- a/mlir/examples/toy/Ch6/include/toy/Ops.td +++ b/mlir/examples/toy/Ch6/include/toy/Ops.td @@ -335,7 +335,7 @@ def ReturnOp : Toy_Op<"return", [Pure, HasParent<"FuncOp">, // Allow building a ReturnOp with no return operand. let builders = [ - OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]> + OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; // Provide extra utility definitions on the c++ operation class definition. diff --git a/mlir/examples/toy/Ch7/include/toy/Ops.td b/mlir/examples/toy/Ch7/include/toy/Ops.td index 71ab7b0aeebb9..bdf8ad0bc21a1 100644 --- a/mlir/examples/toy/Ch7/include/toy/Ops.td +++ b/mlir/examples/toy/Ch7/include/toy/Ops.td @@ -360,7 +360,7 @@ def ReturnOp : Toy_Op<"return", [Pure, HasParent<"FuncOp">, // Allow building a ReturnOp with no return operand. let builders = [ - OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]> + OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; // Provide extra utility definitions on the c++ operation class definition.