ctcache works great for the case where compiler arguments are passed on the clang-tidy command line in the form clang-tidy file.cpp -- gcc -DBLAH=1 file.cpp, however it does not deal with the (relatively common, I expect) case where the -p argument is used, whereby clang-tidy sources the compiler arguments from a compile_commands.json file that was generated during compilation. This PR adds the functionality to detect when -p is used, and loads and reads from the compile commands DB as necessary.
ctcache works great for the case where compiler arguments are passed on the clang-tidy command line in the form
clang-tidy file.cpp -- gcc -DBLAH=1 file.cpp
, however it does not deal with the (relatively common, I expect) case where the-p
argument is used, whereby clang-tidy sources the compiler arguments from acompile_commands.json
file that was generated during compilation. This PR adds the functionality to detect when-p
is used, and loads and reads from the compile commands DB as necessary.