[PATCH] D64297: [JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 00:15:56 PDT 2019


phosek added a comment.

In D64297#1572872 <https://reviews.llvm.org/D64297#1572872>, @MaskRay wrote:

> Is `distcc gcc.exe` or `gomacc gcc.exe` possible?
>
> > The design of the compilation database/plugin model makes it pretty hard to add options.
>
> Yes. It also lacks user settings. Downstream `compile_commands.json` consumers may provide their own command line option filtering mechanism that users can customize and add more compiler schedulers. For some tools, they probably don't want to see filtering applying on multiple layers, especially if the filtering mechanism done at the JSONCompilationDatabase layer may have false positives.
>
> > but a messy aspect of the nature of the ecosystem around compile_commands.json.
>
> I'll appreciate it if you propose something to make `cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On` `ninja -t comdb` etc more precise:)


We have recently implemented `command_launcher` property in GN which is prepended to generated command in Ninja but omitted from the compilation database generated by GN. CMake has `CMAKE_{C,CXX}_COMPILER_LAUNCHER` which works exactly the same way. That addresses this problem in GN and CMake. Furthermore, bear automatically strips compiler wrappers <https://github.com/rizsotto/Bear/blob/master/bear/main.py.in#L96> from the generated compilation database. However, there are other ways to generate compilation database, e.g. `ninja -t compdb`, and those suffer from the described problem so I think we still need this.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64297





More information about the llvm-commits mailing list