From 1515490c80fab3d60da58efcfc91155228f7a156 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 21 Jul 2022 10:20:00 +0200 Subject: [PATCH] [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 --- clang-tools-extra/clangd/tool/Check.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/tool/Check.cpp b/clang-tools-extra/clangd/tool/Check.cpp index 54c7e91..1fc44fd 100644 --- a/clang-tools-extra/clangd/tool/Check.cpp +++ b/clang-tools-extra/clangd/tool/Check.cpp @@ -111,7 +111,9 @@ public: 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)); -- 2.7.4