aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 05cc68e..cf0a596 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -97,6 +97,7 @@
#include <cstdlib> // ::getenv
#include <map>
#include <memory>
+#include <optional>
#include <utility>
#if LLVM_ON_UNIX
#include <unistd.h> // getpid
@@ -575,7 +576,7 @@ static llvm::Triple computeTargetTriple(const Driver &D,
// On AIX, the env OBJECT_MODE may affect the resulting arch variant.
if (Target.isOSAIX()) {
- if (Optional<std::string> ObjectModeValue =
+ if (std::optional<std::string> ObjectModeValue =
llvm::sys::Process::GetEnv("OBJECT_MODE")) {
StringRef ObjectMode = *ObjectModeValue;
llvm::Triple::ArchType AT = llvm::Triple::UnknownArch;
@@ -1277,7 +1278,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
A->claim();
PrefixDirs.push_back(A->getValue(0));
}
- if (Optional<std::string> CompilerPathValue =
+ if (std::optional<std::string> CompilerPathValue =
llvm::sys::Process::GetEnv("COMPILER_PATH")) {
StringRef CompilerPath = *CompilerPathValue;
while (!CompilerPath.empty()) {
@@ -5460,7 +5461,7 @@ const char *Driver::CreateTempFile(Compilation &C, StringRef Prefix,
StringRef BoundArch) const {
SmallString<128> TmpName;
Arg *A = C.getArgs().getLastArg(options::OPT_fcrash_diagnostics_dir);
- Optional<std::string> CrashDirectory =
+ std::optional<std::string> CrashDirectory =
CCGenDiagnostics && A
? std::string(A->getValue())
: llvm::sys::Process::GetEnv("CLANG_CRASH_DIAGNOSTICS_DIR");