Skip to content

Commit bba5581

Browse files
[Scalar] Use std::optional in LoopFlatten.cpp (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
1 parent 7fc772b commit bba5581

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Scalar/LoopFlatten.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#include "llvm/Transforms/Utils/LoopUtils.h"
7676
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
7777
#include "llvm/Transforms/Utils/SimplifyIndVar.h"
78+
#include <optional>
7879

7980
using namespace llvm;
8081
using namespace llvm::PatternMatch;
@@ -913,7 +914,7 @@ PreservedAnalyses LoopFlattenPass::run(LoopNest &LN, LoopAnalysisManager &LAM,
913914

914915
bool Changed = false;
915916

916-
Optional<MemorySSAUpdater> MSSAU;
917+
std::optional<MemorySSAUpdater> MSSAU;
917918
if (AR.MSSA) {
918919
MSSAU = MemorySSAUpdater(AR.MSSA);
919920
if (VerifyMemorySSA)
@@ -983,7 +984,7 @@ bool LoopFlattenLegacyPass::runOnFunction(Function &F) {
983984
auto *AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
984985
auto *MSSA = getAnalysisIfAvailable<MemorySSAWrapperPass>();
985986

986-
Optional<MemorySSAUpdater> MSSAU;
987+
std::optional<MemorySSAUpdater> MSSAU;
987988
if (MSSA)
988989
MSSAU = MemorySSAUpdater(&MSSA->getMSSA());
989990

0 commit comments

Comments
 (0)