[Orc] Use std::optional in ELFNixPlatform.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 26 Nov 2022 23:19:50 +0000 (15:19 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 26 Nov 2022 23:19:50 +0000 (15:19 -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/ExecutionEngine/Orc/ELFNixPlatform.cpp

index 0a90847..eb24221 100644 (file)
@@ -16,6 +16,7 @@
 #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/Debug.h"
+#include <optional>
 
 #define DEBUG_TYPE "orc"
 
@@ -850,7 +851,7 @@ Error ELFNixPlatform::ELFNixPlatformPlugin::fixTLVSectionsAndEdges(
   auto *TLSInfoEntrySection = G.findSectionByName("$__TLSINFO");
 
   if (TLSInfoEntrySection) {
-    Optional<uint64_t> Key;
+    std::optional<uint64_t> Key;
     {
       std::lock_guard<std::mutex> Lock(MP.PlatformMutex);
       auto I = MP.JITDylibToPThreadKey.find(&JD);