[PATCH] D130228: [clangd] Mention whether compile flags were inferred in check mode

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 01:27:51 PDT 2022


kadircet created this revision.
kadircet added a reviewer: ilya-biryukov.
Herald added subscribers: usaxena95, arphaman.
Herald added a project: All.
kadircet requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang-tools-extra.

That way when looking at logs it's clear whether diagnostics are a
result of compile flags mismatch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130228

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


Index: clang-tools-extra/clangd/tool/Check.cpp
===================================================================
--- clang-tools-extra/clangd/tool/Check.cpp
+++ clang-tools-extra/clangd/tool/Check.cpp
@@ -111,7 +111,8 @@
 
     if (auto TrueCmd = CDB->getCompileCommand(File)) {
       Cmd = std::move(*TrueCmd);
-      log("Compile command from CDB is: {0}", printArgv(Cmd.CommandLine));
+      log("Compile command {1} is: {0}", printArgv(Cmd.CommandLine),
+          Cmd.Heuristic.empty() ? "from CDB" : Cmd.Heuristic);
     } else {
       Cmd = CDB->getFallbackCommand(File);
       log("Generic fallback command is: {0}", printArgv(Cmd.CommandLine));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130228.446383.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220721/8f67c4cd/attachment-0001.bin>


More information about the cfe-commits mailing list