[lld] 1117d91 - [lld] Use std::optional in lld.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 21:03:39 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T21:03:34-08:00
New Revision: 1117d91bb27fedd1e8cbb7a57c1e0d1e197d98af
URL: https://github.com/llvm/llvm-project/commit/1117d91bb27fedd1e8cbb7a57c1e0d1e197d98af
DIFF: https://github.com/llvm/llvm-project/commit/1117d91bb27fedd1e8cbb7a57c1e0d1e197d98af.diff
LOG: [lld] Use std::optional in lld.cpp (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:
lld/tools/lld/lld.cpp
Removed:
################################################################################
diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp
index 700c0b770e20..9b560896970b 100644
--- a/lld/tools/lld/lld.cpp
+++ b/lld/tools/lld/lld.cpp
@@ -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) {
More information about the llvm-commits
mailing list