[PATCH] D70222: [clangd] Add support for .rsp files in compile_commands.json

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 18 05:27:24 PST 2019


kadircet added a comment.

Thanks, layering seems better now. But as Sam mentioned in the issue it would be better to have something like `expandRSPFiles` similar to `inferMissingCompileCommands`.
As the problem is not in the `JSONCompilationDatabase` itself, it can also occur in `FixedCompilationDatabase` or any other models clang might've in the future.

The CompilationDatabase returned by `expandRSPFiles` could wrap any other `CDB` and upon querying of commands, it can expand any RSP files returned by the underlying CDB.

This will also ensure minimum changes to the existing code, reducing any chances of breakage. As for unittests, please see `clang/unittests/Tooling/CompilationDatabaseTest.cpp`

and a small nit, when modifying existing files, please only run formatting on the lines you touched to preserve history.


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

https://reviews.llvm.org/D70222





More information about the cfe-commits mailing list