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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 04:54:12 PDT 2022


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM.
Please note the NIT that arguably improves readability.



================
Comment at: clang-tools-extra/clangd/tool/Check.cpp:114
       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);
----------------
NIT: maybe change the order of arguments and the format string placeholders?
it's a bit hard to swap arguments inside one's head when reading the code.

```
log("{1}, {0}!", "world", "Hello");
// vs
log("{0}, {1}!", "Hello", "world");
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130228/new/

https://reviews.llvm.org/D130228



More information about the cfe-commits mailing list