[llvm] 88988c5 - [Utils] Use std::optional in LoopPeel.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 17:53:22 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T17:53:17-08:00
New Revision: 88988c50f838cb53dc9a0f055045f2625dc6a302
URL: https://github.com/llvm/llvm-project/commit/88988c50f838cb53dc9a0f055045f2625dc6a302
DIFF: https://github.com/llvm/llvm-project/commit/88988c50f838cb53dc9a0f055045f2625dc6a302.diff
LOG: [Utils] Use std::optional in LoopPeel.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
Added:
Modified:
llvm/lib/Transforms/Utils/LoopPeel.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp
index 4fa2fe24a88a..e8704091b6a0 100644
--- a/llvm/lib/Transforms/Utils/LoopPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp
@@ -42,6 +42,7 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
+#include <optional>
using namespace llvm;
using namespace llvm::PatternMatch;
@@ -163,7 +164,7 @@ class PhiAnalyzer {
Optional<unsigned> calculateIterationsToPeel();
protected:
- using PeelCounter = Optional<unsigned>;
+ using PeelCounter = std::optional<unsigned>;
const PeelCounter Unknown = None;
// Add 1 respecting Unknown and return Unknown if result over MaxIterations
More information about the llvm-commits
mailing list