diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-02 21:11:37 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-02 21:11:37 -0800 |
commit | 343de6856e16b58bcbd16d479fc633f54e22fadc (patch) | |
tree | 31e3fbef03aa0e4c5ea9582d0eacc650aba3073d /llvm/lib/Transforms/Utils/LoopPeel.cpp | |
parent | 998960ee1f2c8bc3830df4849ab89ec9d6217f26 (diff) | |
download | llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.zip llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.tar.gz llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.tar.bz2 |
[Transforms] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
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/Utils/LoopPeel.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopPeel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp index e870409..bfb865a 100644 --- a/llvm/lib/Transforms/Utils/LoopPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp @@ -165,7 +165,7 @@ public: protected: using PeelCounter = std::optional<unsigned>; - const PeelCounter Unknown = None; + const PeelCounter Unknown = std::nullopt; // Add 1 respecting Unknown and return Unknown if result over MaxIterations PeelCounter addOne(PeelCounter PC) const { @@ -250,7 +250,7 @@ Optional<unsigned> PhiAnalyzer::calculateIterationsToPeel() { } } assert((Iterations <= MaxIterations) && "bad result in phi analysis"); - return Iterations ? Optional<unsigned>(Iterations) : None; + return Iterations ? Optional<unsigned>(Iterations) : std::nullopt; } } // unnamed namespace |