[flang] Use std::nullopt instead of llvm::None (NFC)
authorKazu Hirata <kazu@google.com>
Thu, 8 Dec 2022 04:10:57 +0000 (20:10 -0800)
committerKazu Hirata <kazu@google.com>
Thu, 8 Dec 2022 04:10:57 +0000 (20:10 -0800)
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/lib/Optimizer/Builder/HLFIRTools.cpp

index 76fc053..f8db670 100644 (file)
@@ -76,7 +76,7 @@ hlfir::translateToExtendedValue(mlir::Location loc, fir::FirOpBuilder &builder,
   if (entity.isVariable()) {
     if (entity.isScalar() && !entity.hasLengthParameters() &&
         !hlfir::isBoxAddressOrValueType(entity.getType()))
-      return {fir::ExtendedValue{entity.getBase()}, llvm::None};
+      return {fir::ExtendedValue{entity.getBase()}, std::nullopt};
     TODO(loc, "HLFIR variable to fir::ExtendedValue without a "
               "FortranVariableOpInterface");
   }