diff --git a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp index bf4c099fe05d..96925bebf07b 100644 --- a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp @@ -120,7 +120,7 @@ private: // Arguments type are uniformly unranked tensors. llvm::SmallVector argTypes(proto.getArgs().size(), getType(VarType{})); - auto funcType = builder.getFunctionType(argTypes, std::nullopt); + auto funcType = builder.getFunctionType(argTypes, {}); return builder.create(location, proto.getName(), funcType); } diff --git a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp index bf4c099fe05d..c8cba82cb63a 100644 --- a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp @@ -120,7 +120,7 @@ private: // Arguments type are uniformly unranked tensors. llvm::SmallVector argTypes(proto.getArgs().size(), getType(VarType{})); - auto funcType = builder.getFunctionType(argTypes, std::nullopt); + auto funcType = builder.getFunctionType(argTypes, /*results=*/{}); return builder.create(location, proto.getName(), funcType); } diff --git a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp index b56e2f7c9008..9371815577b1 100644 --- a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp @@ -120,7 +120,7 @@ private: // Arguments type are uniformly unranked tensors. llvm::SmallVector argTypes(proto.getArgs().size(), getType(VarType{})); - auto funcType = builder.getFunctionType(argTypes, std::nullopt); + auto funcType = builder.getFunctionType(argTypes, /*results=*/{}); return builder.create(location, proto.getName(), funcType); } diff --git a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp index b56e2f7c9008..9371815577b1 100644 --- a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp @@ -120,7 +120,7 @@ private: // Arguments type are uniformly unranked tensors. llvm::SmallVector argTypes(proto.getArgs().size(), getType(VarType{})); - auto funcType = builder.getFunctionType(argTypes, std::nullopt); + auto funcType = builder.getFunctionType(argTypes, /*results=*/{}); return builder.create(location, proto.getName(), funcType); } diff --git a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp index b56e2f7c9008..9371815577b1 100644 --- a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp @@ -120,7 +120,7 @@ private: // Arguments type are uniformly unranked tensors. llvm::SmallVector argTypes(proto.getArgs().size(), getType(VarType{})); - auto funcType = builder.getFunctionType(argTypes, std::nullopt); + auto funcType = builder.getFunctionType(argTypes, /*results=*/{}); return builder.create(location, proto.getName(), funcType); } diff --git a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp index e554e375209f..2490f17163b8 100644 --- a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp @@ -182,7 +182,7 @@ private: return nullptr; argTypes.push_back(type); } - auto funcType = builder.getFunctionType(argTypes, std::nullopt); + auto funcType = builder.getFunctionType(argTypes, /*results=*/{}); return builder.create(location, proto.getName(), funcType); } @@ -441,10 +441,10 @@ private: for (auto &var : lit.getValues()) { if (auto *number = llvm::dyn_cast(var.get())) { attrElements.push_back(getConstantAttr(*number)); - typeElements.push_back(getType(std::nullopt)); + typeElements.push_back(getType(/*shape=*/{})); } else if (auto *lit = llvm::dyn_cast(var.get())) { attrElements.push_back(getConstantAttr(*lit)); - typeElements.push_back(getType(std::nullopt)); + typeElements.push_back(getType(/*shape=*/{})); } else { auto *structLit = llvm::cast(var.get()); auto attrTypePair = getConstantAttr(*structLit);