[lld] Use std::optional in lld.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 05:03:34 +0000 (21:03 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 05:03:34 +0000 (21:03 -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

lld/tools/lld/lld.cpp

index 700c0b7..9b56089 100644 (file)
@@ -41,6 +41,7 @@
 #include "llvm/Support/PluginLoader.h"
 #include "llvm/Support/Process.h"
 #include <cstdlib>
+#include <optional>
 
 using namespace lld;
 using namespace llvm;
@@ -228,7 +229,7 @@ int lld_main(int argc, char **argv) {
     return lldMain(argc, const_cast<const char **>(argv), llvm::outs(),
                    llvm::errs());
 
-  Optional<int> mainRet;
+  std::optional<int> mainRet;
   CrashRecoveryContext::Enable();
 
   for (unsigned i = inTestVerbosity(); i > 0; --i) {