diff options
author | Krzysztof Parzyszek <kparzysz@quicinc.com> | 2022-12-06 09:53:37 -0800 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@quicinc.com> | 2022-12-06 09:56:14 -0800 |
commit | 3c255f679c90e332fe0b38b09d5811a64db3f0f6 (patch) | |
tree | 824a5b686ddb65c32accffd5e60b394700d61947 /llvm/lib/Support/CommandLine.cpp | |
parent | aa6ea6009fc50b02dbf3788ee9fe605081b154f6 (diff) | |
download | llvm-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.cpp | 5 |
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); } |