[flang] Use std::nullopt instead of None (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 4 Dec 2022 22:40:10 +0000 (14:40 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 4 Dec 2022 22:40:10 +0000 (14:40 -0800)
I've verified that every single instance of std::nullopt in this patch
affects generated files and would reduce the number of warnings if
None were deprecated.

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

flang/include/flang/Optimizer/Dialect/FIROps.td

index c0ea063..a6b84ee 100644 (file)
@@ -1903,8 +1903,8 @@ def fir_SliceOp : fir_Op<"slice", [NoMemoryEffect, AttrSizedOperandSegments]> {
 
   let builders = [
     OpBuilder<(ins "mlir::ValueRange":$triples,
-      CArg<"mlir::ValueRange", "llvm::None">:$fields,
-      CArg<"mlir::ValueRange", "llvm::None">:$substr)>
+      CArg<"mlir::ValueRange", "std::nullopt">:$fields,
+      CArg<"mlir::ValueRange", "std::nullopt">:$substr)>
   ];
 
   let hasVerifier = 1;