[llvm] 0ea3386 - [IR] Use std::optional in Statepoint.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 14:40:22 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T14:40:10-08:00
New Revision: 0ea3386d7b6402ca8ad81abae70e3b1070e6d717

URL: https://github.com/llvm/llvm-project/commit/0ea3386d7b6402ca8ad81abae70e3b1070e6d717
DIFF: https://github.com/llvm/llvm-project/commit/0ea3386d7b6402ca8ad81abae70e3b1070e6d717.diff

LOG: [IR] Use std::optional in Statepoint.h (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/include/llvm/IR/Statepoint.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/Statepoint.h b/llvm/include/llvm/IR/Statepoint.h
index 559840a33cfd..8b6ffd2e0897 100644
--- a/llvm/include/llvm/IR/Statepoint.h
+++ b/llvm/include/llvm/IR/Statepoint.h
@@ -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;


        


More information about the llvm-commits mailing list