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

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 03:01:04 PDT 2019


sammccall marked an inline comment as done.
sammccall added a comment.

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

> These commands can be freely used as extensionless header files: `#include <distcc>`. That said, I don't have objection to this approach.


I think you're talking about a command like `ccache distcc -Xclang -emit-pch` where ccache is the name of a header file.

This seems implausible:

- JSON compilation databases almost never contain header commands
- if there's no extension on the file, clang requires `-x c-header` etc **before** the filename AFAICT
- such commands don't work with `distcc` or `gomacc` as the wrapper, because they do the same heuristic detection and will detect the filename is actually the compiler. (Though it may work with ccache)
- extensionless source files are almost only used in the standard library, which doesn't have these names *and* won't appear in compile_commands.json

It also doesn't seem to be related to looping: it's a false positive that could occur on any iteration including the first.

So it's a minor point, but I'm inclined to have the loop here


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