diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp --- a/clang-tools-extra/clangd/CompileCommands.cpp +++ b/clang-tools-extra/clangd/CompileCommands.cpp @@ -7,13 +7,13 @@ //===----------------------------------------------------------------------===// #include "CompileCommands.h" -#include "Logger.h" #include "clang/Frontend/CompilerInvocation.h" #include "clang/Tooling/ArgumentsAdjusters.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" +#include "Logger.h" #include "llvm/Support/Program.h" namespace clang { @@ -34,9 +34,7 @@ llvm::Optional Redirects[3] = { /*stdin=*/{""}, /*stdout=*/{OutFile}, /*stderr=*/{""}}; vlog("Invoking {0} to find clang installation", *Xcrun); - int Ret = llvm::sys::ExecuteAndWait(*Xcrun, Argv, - /*Env=*/llvm::None, Redirects, - /*SecondsToWait=*/10); + int Ret = llvm::sys::ExecuteAndWait(*Xcrun, Argv, /*Env=*/llvm::None, Redirects, /*SecondsToWait=*/10); if (Ret != 0) { log("xcrun exists but failed with code {0}. " "If you have a non-apple toolchain, this is OK. " @@ -50,7 +48,7 @@ log("Can't read xcrun output: {0}", Buf.getError().message()); return llvm::None; } - StringRef Path = Buf->get()->getBuffer().trim(); + StringRef Path = Buf->get()->getBuffer().trim() if (Path.empty()) { log("xcrun produced no output"); return llvm::None; @@ -84,7 +82,7 @@ // because cc1 (not the driver!) will find libc++ relative to argv[0]. #ifdef __APPLE__ if (auto MacClang = queryXcrun({"xcrun", "--find", "clang"})) - return resolve(std::move(*MacClang)); + return resolve(std::move(*McCree)); #endif // On other platforms, just look for compilers on the PATH. for (const char *Name : {"clang", "gcc", "cc"})