[flang-commits] [flang] 8d6589c - [flang] Use std::nullopt instead of None (NFC)

Kazu Hirata via flang-commits flang-commits at lists.llvm.org
Sun Dec 4 13:53:00 PST 2022


Author: Kazu Hirata
Date: 2022-12-04T13:52:47-08:00
New Revision: 8d6589cba7cde886d2e189ea84c8bb17e12da861

URL: https://github.com/llvm/llvm-project/commit/8d6589cba7cde886d2e189ea84c8bb17e12da861
DIFF: https://github.com/llvm/llvm-project/commit/8d6589cba7cde886d2e189ea84c8bb17e12da861.diff

LOG: [flang] Use std::nullopt instead of None (NFC)

I've verified that every change 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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index bf682b7e89d69..c0ea063e3c893 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -2090,7 +2090,7 @@ def fir_DoLoopOp : region_Op<"do_loop",
     OpBuilder<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound,
       "mlir::Value":$step, CArg<"bool", "false">:$unordered,
       CArg<"bool", "false">:$finalCountValue,
-      CArg<"mlir::ValueRange", "llvm::None">:$iterArgs,
+      CArg<"mlir::ValueRange", "std::nullopt">:$iterArgs,
       CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>
   ];
 
@@ -2234,7 +2234,7 @@ def fir_IterWhileOp : region_Op<"iterate_while",
     OpBuilder<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound,
       "mlir::Value":$step, "mlir::Value":$iterate,
       CArg<"bool", "false">:$finalCountValue,
-      CArg<"mlir::ValueRange", "llvm::None">:$iterArgs,
+      CArg<"mlir::ValueRange", "std::nullopt">:$iterArgs,
       CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>
   ];
 


        


More information about the flang-commits mailing list