[mlir] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. 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:
@@ -122,7 +122,7 @@ static Optional<Value> sizeFromTensorAtDim(OpBuilder &builder, Location loc,
|
||||
Value adaptedValue, unsigned dim) {
|
||||
auto enc = getSparseTensorEncoding(tensorTp);
|
||||
if (!enc)
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
|
||||
// Access into static dimension can query original type directly.
|
||||
// Note that this is typically already done by DimOp's folding.
|
||||
@@ -200,7 +200,7 @@ static Optional<LogicalResult>
|
||||
convertSparseTensorType(Type type, SmallVectorImpl<Type> &fields) {
|
||||
auto enc = getSparseTensorEncoding(type);
|
||||
if (!enc)
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
// Construct the basic types.
|
||||
auto *context = type.getContext();
|
||||
RankedTensorType rType = type.cast<RankedTensorType>();
|
||||
@@ -1105,7 +1105,7 @@ mlir::SparseTensorTypeToBufferConverter::SparseTensorTypeToBufferConverter() {
|
||||
Location loc) -> Optional<Value> {
|
||||
if (!getSparseTensorEncoding(tp))
|
||||
// Not a sparse tensor.
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
// Sparse compiler knows how to cancel out these casts.
|
||||
return genTuple(builder, loc, tp, inputs);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user