alexfh added a comment.

In https://reviews.llvm.org/D34440#808156, @vladimir.plyashkun wrote:

> **To discuss:**
>  ...
>  By this moment, we unable to use //CompilationDatabase.json// from //CLion 
> //side which is widely used in //Clang-Tidy// and in other common tools.


It would be interesting to learn more about the reasons why you can't use JSON 
compilation database. In case you don't want to clutter the project's 
directory, you can place the compile_commands.json file elsewhere (in a 
temporary directory, for example) and point clang tools to this directory using 
the `-p` command line flag.

> Anyway, there are possibility to pass compiler options directly through 
> command line.
>  But we cannot pass compiler options directly through command-line, due to 
> command-line-length restrictions.
>  So, we decided to pass compiler options through //@ResponseFile //mechanism.
>  But there are some problems with this approach.
>  Before this patch, ///clang/lib/Tooling/CommonOptionsParser.cpp// worked in 
> this way:
> 
> 1. Load compilation database from command-line
> 2. Expand response files
> 3. Parse all other command line arguments I think it's strange behavior?

I don't think anyone has tried using response files for clang tools before. So 
the behavior here is almost certainly not intended. The other question is what 
would be a good way to handle response files in clang tools and whether we want 
it at all. IIUC, the only use case for response files is to workaround the 
limits on the size of a command line. If so, clang tools have an alternative 
solution - JSON compilation database. Are there any concerns using the 
alternative?


Repository:
  rL LLVM

https://reviews.llvm.org/D34440



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to