@@ -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 ();
0 commit comments