Author: Fangrui Song Date: 2022-12-01T22:18:34Z New Revision: f4fb2b3048c7e775df7b12a94cc41d490ca3b58e
URL: https://github.com/llvm/llvm-project/commit/f4fb2b3048c7e775df7b12a94cc41d490ca3b58e DIFF: https://github.com/llvm/llvm-project/commit/f4fb2b3048c7e775df7b12a94cc41d490ca3b58e.diff LOG: [clangd] Fix build after e748db0f7f0971dc258c6631ae1fb0a38cfdf9dd Added: Modified: clang-tools-extra/clangd/CompileCommands.cpp clang-tools-extra/clangd/SystemIncludeExtractor.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp index e84eb0aa30328..3876cfce83165 100644 --- a/clang-tools-extra/clangd/CompileCommands.cpp +++ b/clang-tools-extra/clangd/CompileCommands.cpp @@ -46,11 +46,11 @@ llvm::Optional<std::string> queryXcrun(llvm::ArrayRef<llvm::StringRef> Argv) { llvm::SmallString<64> OutFile; llvm::sys::fs::createTemporaryFile("clangd-xcrun", "", OutFile); llvm::FileRemover OutRemover(OutFile); - llvm::Optional<llvm::StringRef> Redirects[3] = { + std::optional<llvm::StringRef> Redirects[3] = { /*stdin=*/{""}, /*stdout=*/{OutFile.str()}, /*stderr=*/{""}}; vlog("Invoking {0} to find clang installation", *Xcrun); int Ret = llvm::sys::ExecuteAndWait(*Xcrun, Argv, - /*Env=*/llvm::None, Redirects, + /*Env=*/std::nullopt, Redirects, /*SecondsToWait=*/10); if (Ret != 0) { log("xcrun exists but failed with code {0}. " diff --git a/clang-tools-extra/clangd/SystemIncludeExtractor.cpp b/clang-tools-extra/clangd/SystemIncludeExtractor.cpp index 7cfbd3dbf7318..2624b8fafcfc6 100644 --- a/clang-tools-extra/clangd/SystemIncludeExtractor.cpp +++ b/clang-tools-extra/clangd/SystemIncludeExtractor.cpp @@ -175,7 +175,7 @@ extractSystemIncludesAndTarget(llvm::SmallString<128> Driver, auto CleanUp = llvm::make_scope_exit( [&StdErrPath]() { llvm::sys::fs::remove(StdErrPath); }); - llvm::Optional<llvm::StringRef> Redirects[] = {{""}, {""}, StdErrPath.str()}; + std::optional<llvm::StringRef> Redirects[] = {{""}, {""}, StdErrPath.str()}; llvm::SmallVector<llvm::StringRef> Args = {Driver, "-E", "-x", Lang, "-", "-v"}; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits