[PATCH] D34440: [Clang] Expand response files before loading compilation database

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 08:19:51 PDT 2017

alexfh added a comment.

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

> @alexfh
>  Thanks for the response!
>  Yes, we re-implemented logic and now use JSON compilation database to pass compiler options to Clang-Tidy.
>  Anyway, i think in general it's useful to support @response_files, see my comment: https://reviews.llvm.org/D34440#813411

If you see value in supporting response files and are willing to invest more time in the implementation, I'll expand a bit on https://reviews.llvm.org/D34440#809529. Since the primary use case for @response_files is to work around the command line length limit, and, as Anton pointed out, they can be generated by build systems on the fly (both only relevant on Windows, I guess), they may be valuable for passing compiler arguments (they can grow really large) and less so for other arguments of Clang tools. So it seems like the right place to expand response files is where the compiler arguments are retrieved from the compilation database. However, a bit of extra attention may be needed to properly handle the use case of Clang tooling as a library with in-memory files system (where we probably don't want to read random response files that compiler arguments in the compilation database refer to).



More information about the cfe-commits mailing list