[IR] Use std::optional in Statepoint.h (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:40:10 +0000 (14:40 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:40:10 +0000 (14:40 -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/include/llvm/IR/Statepoint.h

index 559840a..8b6ffd2 100644 (file)
@@ -30,6 +30,7 @@
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
+#include <optional>
 #include <vector>
 
 namespace llvm {
@@ -233,8 +234,8 @@ std::vector<const GCRelocateInst *> GCStatepointInst::getGCRelocates() const {
 /// have attributes that describe properties of gc.statepoint call they will be
 /// eventually be wrapped in.  This struct is used represent such directives.
 struct StatepointDirectives {
-  Optional<uint32_t> NumPatchBytes;
-  Optional<uint64_t> StatepointID;
+  std::optional<uint32_t> NumPatchBytes;
+  std::optional<uint64_t> StatepointID;
 
   static const uint64_t DefaultStatepointID = 0xABCDEF00;
   static const uint64_t DeoptBundleStatepointID = 0xABCDEF0F;