aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-06 09:53:37 -0800
committerKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-06 09:56:14 -0800
commit3c255f679c90e332fe0b38b09d5811a64db3f0f6 (patch)
tree824a5b686ddb65c32accffd5e60b394700d61947 /llvm/lib/Support/CommandLine.cpp
parentaa6ea6009fc50b02dbf3788ee9fe605081b154f6 (diff)
downloadllvm-3c255f679c90e332fe0b38b09d5811a64db3f0f6.zip
llvm-3c255f679c90e332fe0b38b09d5811a64db3f0f6.tar.gz
llvm-3c255f679c90e332fe0b38b09d5811a64db3f0f6.tar.bz2
Process: convert Optional to std::optional
This applies to GetEnv and FindInEnvPath.
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index abcfa7c..20a2e85 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -45,6 +45,7 @@
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
+#include <optional>
#include <string>
using namespace llvm;
using namespace cl;
@@ -1363,7 +1364,7 @@ bool cl::expandResponseFiles(int Argc, const char *const *Argv,
: cl::TokenizeGNUCommandLine;
// The environment variable specifies initial options.
if (EnvVar)
- if (llvm::Optional<std::string> EnvValue = sys::Process::GetEnv(EnvVar))
+ if (std::optional<std::string> EnvValue = sys::Process::GetEnv(EnvVar))
Tokenize(*EnvValue, Saver, NewArgv, /*MarkEOLs=*/false);
// Command line options can override the environment variable.
@@ -1456,7 +1457,7 @@ bool cl::ParseCommandLineOptions(int argc, const char *const *argv,
// Parse options from environment variable.
if (EnvVar) {
- if (llvm::Optional<std::string> EnvValue =
+ if (std::optional<std::string> EnvValue =
sys::Process::GetEnv(StringRef(EnvVar)))
TokenizeGNUCommandLine(*EnvValue, Saver, NewArgv);
}