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

index 6e7fde6..54c1732 100644 (file)
@@ -57,6 +57,7 @@
 #include "llvm/Transforms/Utils/FunctionImportUtils.h"
 #include "llvm/Transforms/Utils/SplitModule.h"
 
+#include <optional>
 #include <set>
 
 using namespace llvm;
@@ -1254,7 +1255,7 @@ class InProcessThinBackend : public ThinBackendProc {
   std::set<GlobalValue::GUID> CfiFunctionDefs;
   std::set<GlobalValue::GUID> CfiFunctionDecls;
 
-  Optional<Error> Err;
+  std::optional<Error> Err;
   std::mutex ErrMu;
 
   bool ShouldEmitIndexFiles;