[clang-tools-extra] 1515490 - [clangd] Mention whether compile flags were inferred in check mode
Kadir Cetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 21 08:33:59 PDT 2022
Author: Kadir Cetinkaya
Date: 2022-07-21T17:33:44+02:00
New Revision: 1515490c80fab3d60da58efcfc91155228f7a156
URL: https://github.com/llvm/llvm-project/commit/1515490c80fab3d60da58efcfc91155228f7a156
DIFF: https://github.com/llvm/llvm-project/commit/1515490c80fab3d60da58efcfc91155228f7a156.diff
LOG: [clangd] Mention whether compile flags were inferred in check mode
That way when looking at logs it's clear whether diagnostics are a
result of compile flags mismatch.
Differential Revision: https://reviews.llvm.org/D130228
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 54c7e91ab9815..1fc44fd29ce98 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -111,7 +111,9 @@ class Checker {
if (auto TrueCmd = CDB->getCompileCommand(File)) {
Cmd = std::move(*TrueCmd);
- log("Compile command from CDB is: {0}", printArgv(Cmd.CommandLine));
+ log("Compile command {0} is: {1}",
+ Cmd.Heuristic.empty() ? "from CDB" : Cmd.Heuristic,
+ printArgv(Cmd.CommandLine));
} else {
Cmd = CDB->getFallbackCommand(File);
log("Generic fallback command is: {0}", printArgv(Cmd.CommandLine));
More information about the cfe-commits
mailing list