[clang-tools-extra] ece76dc - [clangd][check] Print directory with compile flags

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Tue May 16 10:01:53 PDT 2023


Author: Kadir Cetinkaya
Date: 2023-05-16T19:01:23+02:00
New Revision: ece76dce55f79efc733a0b42718700a5c42c602e

URL: https://github.com/llvm/llvm-project/commit/ece76dce55f79efc733a0b42718700a5c42c602e
DIFF: https://github.com/llvm/llvm-project/commit/ece76dce55f79efc733a0b42718700a5c42c602e.diff

LOG: [clangd][check] Print directory with compile flags

Added: 
    

Modified: 
    clang-tools-extra/clangd/tool/Check.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/tool/Check.cpp b/clang-tools-extra/clangd/tool/Check.cpp
index 4a6f6f8857aa0..d1ece69e3ba08 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -24,12 +24,17 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "../clang-tidy/ClangTidyModule.h"
 #include "../clang-tidy/ClangTidyModuleRegistry.h"
+#include "../clang-tidy/ClangTidyOptions.h"
 #include "../clang-tidy/GlobList.h"
 #include "ClangdLSPServer.h"
+#include "ClangdServer.h"
 #include "CodeComplete.h"
 #include "CompileCommands.h"
+#include "Compiler.h"
 #include "Config.h"
+#include "Diagnostics.h"
 #include "Feature.h"
 #include "GlobalCompilationDatabase.h"
 #include "Hover.h"
@@ -37,23 +42,39 @@
 #include "ParsedAST.h"
 #include "Preamble.h"
 #include "Protocol.h"
+#include "Selection.h"
 #include "SemanticHighlighting.h"
 #include "SourceCode.h"
+#include "TidyProvider.h"
 #include "XRefs.h"
 #include "index/CanonicalIncludes.h"
 #include "index/FileIndex.h"
 #include "refactor/Tweak.h"
+#include "support/Context.h"
+#include "support/Logger.h"
 #include "support/ThreadsafeFS.h"
 #include "support/Trace.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/LLVM.h"
 #include "clang/Format/Format.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Chrono.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
+#include <array>
+#include <chrono>
+#include <cstdint>
+#include <limits>
+#include <memory>
 #include <optional>
+#include <utility>
+#include <vector>
 
 namespace clang {
 namespace clangd {
@@ -153,12 +174,13 @@ class Checker {
 
     if (auto TrueCmd = CDB->getCompileCommand(File)) {
       Cmd = std::move(*TrueCmd);
-      log("Compile command {0} is: {1}",
-          Cmd.Heuristic.empty() ? "from CDB" : Cmd.Heuristic,
+      log("Compile command {0} is: [{1}] {2}",
+          Cmd.Heuristic.empty() ? "from CDB" : Cmd.Heuristic, Cmd.Directory,
           printArgv(Cmd.CommandLine));
     } else {
       Cmd = CDB->getFallbackCommand(File);
-      log("Generic fallback command is: {0}", printArgv(Cmd.CommandLine));
+      log("Generic fallback command is: [{0}] {1}", Cmd.Directory,
+          printArgv(Cmd.CommandLine));
     }
 
     return true;


        


More information about the cfe-commits mailing list