[flang-commits] [flang] 7001089 - [flang] Use std::nullopt instead of llvm::None (NFC)
Kazu Hirata via flang-commits
flang-commits at lists.llvm.org
Fri Dec 9 18:32:46 PST 2022
Author: Kazu Hirata
Date: 2022-12-09T18:32:33-08:00
New Revision: 70010893f93c46183c820f845fd7db14be737cae
URL: https://github.com/llvm/llvm-project/commit/70010893f93c46183c820f845fd7db14be737cae
DIFF: https://github.com/llvm/llvm-project/commit/70010893f93c46183c820f845fd7db14be737cae.diff
LOG: [flang] Use std::nullopt instead of llvm::None (NFC)
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/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp b/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
index c8a3536cf802d..5fcd086d90498 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
@@ -28,6 +28,7 @@
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/DialectConversion.h"
+#include <optional>
namespace hlfir {
#define GEN_PASS_DEF_BUFFERIZEHLFIR
@@ -104,7 +105,7 @@ createTempFromMold(mlir::Location loc, fir::FirOpBuilder &builder,
llvm::StringRef tmpName{".tmp"};
mlir::Value alloca =
builder.createTemporary(loc, mold.getFortranElementType(), tmpName,
- /*shape*/ llvm::None, lenParams);
+ /*shape*/ std::nullopt, lenParams);
auto declareOp = builder.create<hlfir::DeclareOp>(
loc, alloca, tmpName, /*shapeOrShift*/ mlir::Value{}, lenParams,
fir::FortranVariableFlagsAttr{});
More information about the flang-commits
mailing list