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

Vladimir Plyashkun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 12:51:59 PDT 2017

vladimir.plyashkun added a comment.

Thanks for the response @klimek !
Sorry for possible confusions.

> Yes. I'm still confused why in this case clang-tidy @file --  would be expected to expand the response file? Am I missing something?

I think that we discussed use-case when @response files can appear in the compiler options (right after `--` symbol).

> I don't understand this. Can you elaborate?

As IDE developers we can't control how users pass options to compiler.
For example, user can set compiler options directly in the CMake, like this:

  set(CMAKE_CXX_FLAGS "@response.rsp")

and our goal is to pass this options to Clang-Tidy as is. 
It doesn't matter how will we pass them to Clang-Tidy through // compile_command.json//:

    "directory" : "",
     "command": "clang++ ... @response.rsp",
     "file": "..."

or through command line (we choosed this method):

  clang-tidy ... -- @response.rsp

If compiler options will contain response files, all contents will be discarded, because Clang based tools don't expand response files.
By this fact we can loose important compiler information (header paths, definitions,  etc.) which will lead us to inaccurate analysis result.



More information about the cfe-commits mailing list