[Utils] Use std::optional in LoopPeel.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 01:53:17 +0000 (17:53 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 01:53:17 +0000 (17:53 -0800)
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

llvm/lib/Transforms/Utils/LoopPeel.cpp

index 4fa2fe2..e870409 100644 (file)
@@ -42,6 +42,7 @@
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
+#include <optional>
 
 using namespace llvm;
 using namespace llvm::PatternMatch;
@@ -163,7 +164,7 @@ public:
   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