Skip to content

Commit c092158

Browse files
[flang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". 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
1 parent 4d4d478 commit c092158

34 files changed

+157
-159
lines changed

flang/include/flang/Lower/BoxAnalyzer.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct ScalarDynamicChar : ScalarSym {
7777
ScalarDynamicChar(const Fortran::semantics::Symbol &sym)
7878
: ScalarSym{sym}, len{FromBox{}} {}
7979

80-
llvm::Optional<Fortran::lower::SomeExpr> charLen() const {
80+
std::optional<Fortran::lower::SomeExpr> charLen() const {
8181
if (auto *l = std::get_if<Fortran::lower::SomeExpr>(&len))
8282
return {*l};
8383
return std::nullopt;
@@ -318,17 +318,17 @@ class BoxAnalyzer : public fir::details::matcher<BoxAnalyzer> {
318318
[](const auto &x) { return x.staticSize(); });
319319
}
320320

321-
llvm::Optional<int64_t> getCharLenConst() const {
322-
using A = llvm::Optional<int64_t>;
321+
std::optional<int64_t> getCharLenConst() const {
322+
using A = std::optional<int64_t>;
323323
return match(
324324
[](const ScalarStaticChar &x) -> A { return {x.charLen()}; },
325325
[](const StaticArrayStaticChar &x) -> A { return {x.charLen()}; },
326326
[](const DynamicArrayStaticChar &x) -> A { return {x.charLen()}; },
327327
[](const auto &) -> A { return std::nullopt; });
328328
}
329329

330-
llvm::Optional<Fortran::lower::SomeExpr> getCharLenExpr() const {
331-
using A = llvm::Optional<Fortran::lower::SomeExpr>;
330+
std::optional<Fortran::lower::SomeExpr> getCharLenExpr() const {
331+
using A = std::optional<Fortran::lower::SomeExpr>;
332332
return match([](const ScalarDynamicChar &x) { return x.charLen(); },
333333
[](const StaticArrayDynamicChar &x) { return x.charLen(); },
334334
[](const DynamicArrayDynamicChar &x) { return x.charLen(); },
@@ -472,9 +472,9 @@ class BoxAnalyzer : public fir::details::matcher<BoxAnalyzer> {
472472
}
473473

474474
// Get the constant LEN of a CHARACTER, if it exists.
475-
llvm::Optional<int64_t>
475+
std::optional<int64_t>
476476
charLenConstant(const Fortran::semantics::Symbol &sym) {
477-
if (llvm::Optional<Fortran::lower::SomeExpr> expr = charLenVariable(sym))
477+
if (std::optional<Fortran::lower::SomeExpr> expr = charLenVariable(sym))
478478
if (std::optional<int64_t> asInt = Fortran::evaluate::ToInt64(*expr)) {
479479
// Length is max(0, *asInt) (F2018 7.4.4.2 point 5.).
480480
if (*asInt < 0)
@@ -485,7 +485,7 @@ class BoxAnalyzer : public fir::details::matcher<BoxAnalyzer> {
485485
}
486486

487487
// Get the `SomeExpr` that describes the CHARACTER's LEN.
488-
llvm::Optional<Fortran::lower::SomeExpr>
488+
std::optional<Fortran::lower::SomeExpr>
489489
charLenVariable(const Fortran::semantics::Symbol &sym) {
490490
const Fortran::semantics::ParamValue &lenParam =
491491
sym.GetType()->characterTypeSpec().length();

flang/include/flang/Lower/ComponentPath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ComponentPath {
6969
/// This optional continuation allows the generation of those dereferences.
7070
/// These accesses are always on Fortran entities of record types, which are
7171
/// implicitly in-memory objects.
72-
llvm::Optional<ExtendRefFunc> extendCoorRef = std::nullopt;
72+
std::optional<ExtendRefFunc> extendCoorRef = std::nullopt;
7373

7474
private:
7575
void setPC(bool isImplicit);

flang/include/flang/Lower/ConvertCall.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fir::ExtendedValue genCallOpAndResult(
3232
mlir::Location loc, Fortran::lower::AbstractConverter &converter,
3333
Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx,
3434
Fortran::lower::CallerInterface &caller, mlir::FunctionType callSiteType,
35-
llvm::Optional<mlir::Type> resultType);
35+
std::optional<mlir::Type> resultType);
3636

3737
/// If \p arg is the address of a function with a denoted host-association tuple
3838
/// argument, then return the host-associations tuple value of the current
@@ -42,11 +42,10 @@ mlir::Value argumentHostAssocs(Fortran::lower::AbstractConverter &converter,
4242

4343
/// Lower a ProcedureRef to HLFIR. If this is a function call, return the
4444
/// lowered result value. Return nothing otherwise.
45-
llvm::Optional<hlfir::EntityWithAttributes> convertCallToHLFIR(
45+
std::optional<hlfir::EntityWithAttributes> convertCallToHLFIR(
4646
mlir::Location loc, Fortran::lower::AbstractConverter &converter,
47-
const evaluate::ProcedureRef &procRef,
48-
llvm::Optional<mlir::Type> resultType, Fortran::lower::SymMap &symMap,
49-
Fortran::lower::StatementContext &stmtCtx);
47+
const evaluate::ProcedureRef &procRef, std::optional<mlir::Type> resultType,
48+
Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx);
5049

5150
} // namespace Fortran::lower
5251
#endif // FORTRAN_LOWER_CONVERTCALL_H

flang/include/flang/Lower/ConvertExpr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void createArrayOfPointerAssignment(
176176
AbstractConverter &converter, const SomeExpr &lhs, const SomeExpr &rhs,
177177
ExplicitIterSpace &explicitIterSpace, ImplicitIterSpace &implicitIterSpace,
178178
const llvm::SmallVector<mlir::Value> &lbounds,
179-
llvm::Optional<llvm::SmallVector<mlir::Value>> ubounds, SymMap &symMap,
179+
std::optional<llvm::SmallVector<mlir::Value>> ubounds, SymMap &symMap,
180180
StatementContext &stmtCtx);
181181

182182
/// Lower an array expression with "parallel" semantics. Such a rhs expression

flang/include/flang/Lower/CustomIntrinsicCall.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ using OperandPrepare = std::function<void(const Fortran::lower::SomeExpr &)>;
5454
/// preparation was done. An absent optional means the argument is statically
5555
/// present. An mlir::Value means the presence must be checked at runtime, and
5656
/// that the value contains the "is present" boolean value.
57-
using OperandPresent = std::function<llvm::Optional<mlir::Value>(std::size_t)>;
57+
using OperandPresent = std::function<std::optional<mlir::Value>(std::size_t)>;
5858

5959
/// Type of the callback to generate an argument reference after the call
6060
/// preparation was done. For optional arguments, the utility guarantees
@@ -77,7 +77,7 @@ using OperandGetter = std::function<fir::ExtendedValue(std::size_t)>;
7777
void prepareCustomIntrinsicArgument(
7878
const Fortran::evaluate::ProcedureRef &procRef,
7979
const Fortran::evaluate::SpecificIntrinsic &intrinsic,
80-
llvm::Optional<mlir::Type> retTy,
80+
std::optional<mlir::Type> retTy,
8181
const OperandPrepare &prepareOptionalArgument,
8282
const OperandPrepare &prepareOtherArgument, AbstractConverter &converter);
8383

@@ -90,7 +90,7 @@ void prepareCustomIntrinsicArgument(
9090
/// not generate any implicit loop nest on its own).
9191
fir::ExtendedValue
9292
lowerCustomIntrinsic(fir::FirOpBuilder &builder, mlir::Location loc,
93-
llvm::StringRef name, llvm::Optional<mlir::Type> retTy,
93+
llvm::StringRef name, std::optional<mlir::Type> retTy,
9494
const OperandPresent &isPresentCheck,
9595
const OperandGetter &getOperand, std::size_t numOperands,
9696
Fortran::lower::StatementContext &stmtCtx);

flang/include/flang/Lower/IntrinsicCall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class StatementContext;
2929
/// Returned mlir::Value is the returned Fortran intrinsic value.
3030
fir::ExtendedValue genIntrinsicCall(fir::FirOpBuilder &, mlir::Location,
3131
llvm::StringRef name,
32-
llvm::Optional<mlir::Type> resultType,
32+
std::optional<mlir::Type> resultType,
3333
llvm::ArrayRef<fir::ExtendedValue> args,
3434
StatementContext &);
3535

flang/include/flang/Lower/IterationSpace.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ class ExplicitIterSpace {
445445
}
446446

447447
/// `load` must be a LHS array_load. Returns `std::nullopt` on error.
448-
llvm::Optional<size_t> findArgPosition(fir::ArrayLoadOp load);
448+
std::optional<size_t> findArgPosition(fir::ArrayLoadOp load);
449449

450450
bool isLHS(fir::ArrayLoadOp load) {
451451
return findArgPosition(load).has_value();
@@ -466,7 +466,7 @@ class ExplicitIterSpace {
466466
llvm_unreachable("inner argument value was not found");
467467
}
468468

469-
llvm::Optional<fir::ArrayLoadOp> getLhsLoad(size_t i) {
469+
std::optional<fir::ArrayLoadOp> getLhsLoad(size_t i) {
470470
assert(i < lhsBases.size());
471471
if (lhsBases[counter])
472472
return findBinding(*lhsBases[counter]);
@@ -542,7 +542,7 @@ class ExplicitIterSpace {
542542

543543
// A stack of lists of front-end symbols.
544544
llvm::SmallVector<llvm::SmallVector<FrontEndSymbol>> symbolStack;
545-
llvm::SmallVector<llvm::Optional<ArrayBases>> lhsBases;
545+
llvm::SmallVector<std::optional<ArrayBases>> lhsBases;
546546
llvm::SmallVector<llvm::SmallVector<ArrayBases>> rhsBases;
547547
llvm::DenseMap<ArrayBases, fir::ArrayLoadOp> loadBindings;
548548

@@ -553,9 +553,9 @@ class ExplicitIterSpace {
553553
StatementContext stmtCtx;
554554
llvm::SmallVector<mlir::Value> innerArgs;
555555
llvm::SmallVector<mlir::Value> initialArgs;
556-
llvm::Optional<fir::DoLoopOp> outerLoop;
556+
std::optional<fir::DoLoopOp> outerLoop;
557557
llvm::SmallVector<llvm::SmallVector<fir::DoLoopOp>> loopStack;
558-
llvm::Optional<std::function<void(fir::FirOpBuilder &)>> loopCleanup;
558+
std::optional<std::function<void(fir::FirOpBuilder &)>> loopCleanup;
559559
std::size_t forallContextOpen = 0;
560560
std::size_t counter = 0;
561561
};

flang/include/flang/Lower/Runtime.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ void genPointerAssociateRemapping(fir::FirOpBuilder &, mlir::Location,
7878

7979
mlir::Value genCpuTime(fir::FirOpBuilder &, mlir::Location);
8080
void genDateAndTime(fir::FirOpBuilder &, mlir::Location,
81-
llvm::Optional<fir::CharBoxValue> date,
82-
llvm::Optional<fir::CharBoxValue> time,
83-
llvm::Optional<fir::CharBoxValue> zone, mlir::Value values);
81+
std::optional<fir::CharBoxValue> date,
82+
std::optional<fir::CharBoxValue> time,
83+
std::optional<fir::CharBoxValue> zone, mlir::Value values);
8484

8585
void genRandomInit(fir::FirOpBuilder &, mlir::Location, mlir::Value repeatable,
8686
mlir::Value imageDistinct);

flang/include/flang/Lower/SymbolMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class SymMap {
349349
symbolMapStack.back().try_emplace(sym, definingOp);
350350
}
351351

352-
llvm::Optional<fir::FortranVariableOpInterface>
352+
std::optional<fir::FortranVariableOpInterface>
353353
lookupVariableDefinition(semantics::SymbolRef sym);
354354

355355
private:

flang/include/flang/Optimizer/Builder/FIRBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ mlir::Value createZeroValue(fir::FirOpBuilder &builder, mlir::Location loc,
596596
mlir::Type type);
597597

598598
/// Get the integer constants of triplet and compute the extent.
599-
llvm::Optional<std::int64_t>
600-
getExtentFromTriplet(mlir::Value lb, mlir::Value ub, mlir::Value stride);
599+
std::optional<std::int64_t> getExtentFromTriplet(mlir::Value lb, mlir::Value ub,
600+
mlir::Value stride);
601601

602602
/// Generate max(\p value, 0) where \p value is a scalar integer.
603603
mlir::Value genMaxWithZero(fir::FirOpBuilder &builder, mlir::Location loc,

flang/include/flang/Optimizer/Builder/HLFIRTools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class EntityWithAttributes : public Entity {
163163
/// In that case, a cleanup function is provided to generate the finalization
164164
/// code after the end of the fir::ExtendedValue use.
165165
using CleanupFunction = std::function<void()>;
166-
std::pair<fir::ExtendedValue, llvm::Optional<CleanupFunction>>
166+
std::pair<fir::ExtendedValue, std::optional<CleanupFunction>>
167167
translateToExtendedValue(mlir::Location loc, fir::FirOpBuilder &builder,
168168
Entity entity);
169169

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
133133
if (const llvm::opt::Arg *A =
134134
args.getLastArg(clang::driver::options::OPT_mrelocation_model)) {
135135
llvm::StringRef ModelName = A->getValue();
136-
auto RM = llvm::StringSwitch<llvm::Optional<llvm::Reloc::Model>>(ModelName)
136+
auto RM = llvm::StringSwitch<std::optional<llvm::Reloc::Model>>(ModelName)
137137
.Case("static", llvm::Reloc::Static)
138138
.Case("pic", llvm::Reloc::PIC_)
139139
.Case("dynamic-no-pic", llvm::Reloc::DynamicNoPIC)

flang/lib/Lower/Bridge.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
823823
Fortran::lower::SymbolBox
824824
lookupSymbol(const Fortran::semantics::Symbol &sym) {
825825
if (bridge.getLoweringOptions().getLowerToHighLevelFIR()) {
826-
if (llvm::Optional<fir::FortranVariableOpInterface> var =
826+
if (std::optional<fir::FortranVariableOpInterface> var =
827827
localSymbols.lookupVariableDefinition(sym)) {
828828
auto exv =
829829
hlfir::translateToExtendedValue(toLocation(), *builder, *var);
@@ -1098,7 +1098,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
10981098
assert(stmt.typedCall && "Call was not analyzed");
10991099
mlir::Value res{};
11001100
if (bridge.getLoweringOptions().getLowerToHighLevelFIR()) {
1101-
llvm::Optional<mlir::Type> resultType = std::nullopt;
1101+
std::optional<mlir::Type> resultType = std::nullopt;
11021102
if (stmt.typedCall->hasAlternateReturns())
11031103
resultType = builder->getIndexType();
11041104
auto hlfirRes = Fortran::lower::convertCallToHLFIR(
@@ -2544,8 +2544,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
25442544
void genArrayAssignment(
25452545
const Fortran::evaluate::Assignment &assign,
25462546
Fortran::lower::StatementContext &localStmtCtx,
2547-
llvm::Optional<llvm::SmallVector<mlir::Value>> lbounds = std::nullopt,
2548-
llvm::Optional<llvm::SmallVector<mlir::Value>> ubounds = std::nullopt) {
2547+
std::optional<llvm::SmallVector<mlir::Value>> lbounds = std::nullopt,
2548+
std::optional<llvm::SmallVector<mlir::Value>> ubounds = std::nullopt) {
25492549

25502550
Fortran::lower::StatementContext &stmtCtx =
25512551
explicitIterationSpace()
@@ -2697,8 +2697,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
26972697
: genExprAddr(assign.rhs, stmtCtx);
26982698
const bool lhsIsWholeAllocatable =
26992699
Fortran::lower::isWholeAllocatable(assign.lhs);
2700-
llvm::Optional<fir::factory::MutableBoxReallocation> lhsRealloc;
2701-
llvm::Optional<fir::MutableBoxValue> lhsMutableBox;
2700+
std::optional<fir::factory::MutableBoxReallocation> lhsRealloc;
2701+
std::optional<fir::MutableBoxValue> lhsMutableBox;
27022702
auto lhs = [&]() -> fir::ExtendedValue {
27032703
if (lhsIsWholeAllocatable) {
27042704
lhsMutableBox = genExprMutableBox(loc, assign.lhs);

flang/lib/Lower/CallInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ class Fortran::lower::CallInterfaceImpl {
686686
interface.side().getHostAssociatedTuple(), emptyValue()});
687687
}
688688

689-
static llvm::Optional<Fortran::evaluate::DynamicType> getResultDynamicType(
689+
static std::optional<Fortran::evaluate::DynamicType> getResultDynamicType(
690690
const Fortran::evaluate::characteristics::Procedure &procedure) {
691691
if (const std::optional<Fortran::evaluate::characteristics::FunctionResult>
692692
&result = procedure.functionResult)
@@ -714,7 +714,7 @@ class Fortran::lower::CallInterfaceImpl {
714714
// array function with assumed length (f18 forbides defining such
715715
// interfaces). Hence, passing the length is most likely useless, but stick
716716
// with ifort/nag/xlf interface here.
717-
if (llvm::Optional<Fortran::evaluate::DynamicType> type =
717+
if (std::optional<Fortran::evaluate::DynamicType> type =
718718
getResultDynamicType(procedure))
719719
return type->category() == Fortran::common::TypeCategory::Character;
720720
return false;
@@ -987,7 +987,7 @@ class Fortran::lower::CallInterfaceImpl {
987987
proc.procedure.value();
988988
mlir::Type funcType =
989989
getProcedureDesignatorType(&procedure, interface.converter);
990-
llvm::Optional<Fortran::evaluate::DynamicType> resultTy =
990+
std::optional<Fortran::evaluate::DynamicType> resultTy =
991991
getResultDynamicType(procedure);
992992
if (resultTy && mustPassLengthWithDummyProcedure(procedure)) {
993993
// The result length of dummy procedures that are character functions must

flang/lib/Lower/ConvertCall.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fir::ExtendedValue Fortran::lower::genCallOpAndResult(
103103
mlir::Location loc, Fortran::lower::AbstractConverter &converter,
104104
Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx,
105105
Fortran::lower::CallerInterface &caller, mlir::FunctionType callSiteType,
106-
llvm::Optional<mlir::Type> resultType) {
106+
std::optional<mlir::Type> resultType) {
107107
fir::FirOpBuilder &builder = converter.getFirOpBuilder();
108108
using PassBy = Fortran::lower::CallerInterface::PassEntityBy;
109109
// Handle cases where caller must allocate the result or a fir.box for it.
@@ -137,7 +137,7 @@ fir::ExtendedValue Fortran::lower::genCallOpAndResult(
137137
return fir::factory::genMaxWithZero(builder, loc, convertExpr);
138138
};
139139
llvm::SmallVector<mlir::Value> resultLengths;
140-
auto allocatedResult = [&]() -> llvm::Optional<fir::ExtendedValue> {
140+
auto allocatedResult = [&]() -> std::optional<fir::ExtendedValue> {
141141
llvm::SmallVector<mlir::Value> extents;
142142
llvm::SmallVector<mlir::Value> lengths;
143143
if (!caller.callerAllocateResult())
@@ -514,7 +514,7 @@ class CallBuilder {
514514
bool handleDynamicOptional;
515515
};
516516
using PreparedActualArguments =
517-
llvm::SmallVector<llvm::Optional<PreparedActualArgument>>;
517+
llvm::SmallVector<std::optional<PreparedActualArgument>>;
518518
using PassBy = Fortran::lower::CallerInterface::PassEntityBy;
519519

520520
public:
@@ -523,9 +523,9 @@ class CallBuilder {
523523
Fortran::lower::StatementContext &stmtCtx)
524524
: converter{converter}, symMap{symMap}, stmtCtx{stmtCtx}, loc{loc} {}
525525

526-
llvm::Optional<hlfir::EntityWithAttributes>
526+
std::optional<hlfir::EntityWithAttributes>
527527
gen(const Fortran::evaluate::ProcedureRef &procRef,
528-
llvm::Optional<mlir::Type> resultType) {
528+
std::optional<mlir::Type> resultType) {
529529
mlir::Location loc = getLoc();
530530
if (auto *specific = procRef.proc().GetSpecificIntrinsic()) {
531531
if (isElementalProcWithArrayArgs(procRef))
@@ -571,10 +571,10 @@ class CallBuilder {
571571
}
572572

573573
private:
574-
llvm::Optional<hlfir::EntityWithAttributes>
574+
std::optional<hlfir::EntityWithAttributes>
575575
genUserCall(PreparedActualArguments &loweredActuals,
576576
Fortran::lower::CallerInterface &caller,
577-
llvm::Optional<mlir::Type> resultType,
577+
std::optional<mlir::Type> resultType,
578578
mlir::FunctionType callSiteType) {
579579
mlir::Location loc = getLoc();
580580
fir::FirOpBuilder &builder = getBuilder();
@@ -667,10 +667,10 @@ class CallBuilder {
667667
return extendedValueToHlfirEntity(result, ".tmp.func_result");
668668
}
669669

670-
llvm::Optional<hlfir::EntityWithAttributes>
670+
std::optional<hlfir::EntityWithAttributes>
671671
genElementalUserCall(PreparedActualArguments &loweredActuals,
672672
Fortran::lower::CallerInterface &caller,
673-
llvm::Optional<mlir::Type> resultType,
673+
std::optional<mlir::Type> resultType,
674674
mlir::FunctionType callSiteType, bool isImpure) {
675675
mlir::Location loc = getLoc();
676676
fir::FirOpBuilder &builder = getBuilder();
@@ -747,7 +747,7 @@ class CallBuilder {
747747

748748
hlfir::EntityWithAttributes
749749
genIntrinsicRef(const Fortran::evaluate::ProcedureRef &procRef,
750-
llvm::Optional<mlir::Type> resultType,
750+
std::optional<mlir::Type> resultType,
751751
const Fortran::evaluate::SpecificIntrinsic &intrinsic) {
752752
mlir::Location loc = getLoc();
753753
if (Fortran::lower::intrinsicRequiresCustomOptionalHandling(
@@ -822,10 +822,9 @@ class CallBuilder {
822822
};
823823
} // namespace
824824

825-
llvm::Optional<hlfir::EntityWithAttributes> Fortran::lower::convertCallToHLFIR(
825+
std::optional<hlfir::EntityWithAttributes> Fortran::lower::convertCallToHLFIR(
826826
mlir::Location loc, Fortran::lower::AbstractConverter &converter,
827-
const evaluate::ProcedureRef &procRef,
828-
llvm::Optional<mlir::Type> resultType, Fortran::lower::SymMap &symMap,
829-
Fortran::lower::StatementContext &stmtCtx) {
827+
const evaluate::ProcedureRef &procRef, std::optional<mlir::Type> resultType,
828+
Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) {
830829
return CallBuilder(loc, converter, symMap, stmtCtx).gen(procRef, resultType);
831830
}

0 commit comments

Comments
 (0)