diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-26 17:41:52 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-26 17:41:52 -0800 |
commit | d90a14f87d24119bde7b0cd18f2afa089c78b27e (patch) | |
tree | 6f226247d48e040dab01d7904d7d701d81b13641 /llvm/lib/Transforms | |
parent | 6288a09c94b267edd532c284b797f80ebfa8a948 (diff) | |
download | llvm-d90a14f87d24119bde7b0cd18f2afa089c78b27e.zip llvm-d90a14f87d24119bde7b0cd18f2afa089c78b27e.tar.gz llvm-d90a14f87d24119bde7b0cd18f2afa089c78b27e.tar.bz2 |
[Scalar] Use std::optional in SimpleLoopUnswitch.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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index 74e6adf..35494e8 100644 --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -63,6 +63,7 @@ #include <cassert> #include <iterator> #include <numeric> +#include <optional> #include <utility> #define DEBUG_TYPE "simple-loop-unswitch" @@ -2988,7 +2989,7 @@ static NonTrivialUnswitchCandidate findBestNonTrivialUnswitchCandidate( return (LoopCost - Cost) * (SuccessorsCount - 1); }; - Optional<NonTrivialUnswitchCandidate> Best; + std::optional<NonTrivialUnswitchCandidate> Best; for (auto &Candidate : UnswitchCandidates) { Instruction &TI = *Candidate.TI; ArrayRef<Value *> Invariants = Candidate.Invariants; @@ -3210,7 +3211,7 @@ PreservedAnalyses SimpleLoopUnswitchPass::run(Loop &L, LoopAnalysisManager &AM, U.markLoopAsDeleted(L, Name); }; - Optional<MemorySSAUpdater> MSSAU; + std::optional<MemorySSAUpdater> MSSAU; if (AR.MSSA) { MSSAU = MemorySSAUpdater(AR.MSSA); if (VerifyMemorySSA) |