[mlir] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<.  I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
This commit is contained in:
Kazu Hirata
2023-01-14 01:25:58 -08:00
parent bb83dc10f5
commit 0a81ace004
244 changed files with 1210 additions and 1121 deletions

View File

@@ -134,8 +134,9 @@ Value sizeAtStoredDim(OpBuilder &builder, Location loc,
static void createPushback(OpBuilder &builder, Location loc,
MutSparseTensorDescriptor desc,
SparseTensorFieldKind kind, Optional<unsigned> dim,
Value value, Value repeat = Value()) {
SparseTensorFieldKind kind,
std::optional<unsigned> dim, Value value,
Value repeat = Value()) {
Type etp = desc.getMemRefElementType(kind, dim);
Value field = desc.getMemRefField(kind, dim);
StorageSpecifierKind specFieldKind = toSpecifierKind(kind);