This patch introduces an outline for the clang-scan-deps tool that will be used to implement fast dependency discovery phase using implicit modules for explicit module builds.
The initial version of the tool works by computing non-modular header dependencies for files in the compilation database without any optimizations (i.e. without source minimization from https://reviews.llvm.org/D55463). The tool spawns a number of worker threads to run the clang compiler workers in parallel.
The immediate goal for clang-scan-deps is to create a ClangScanDeps library which will be used to build up this tool to use the source minimization and caching multi-threaded filesystem to implement the optimized non-incremental dependency scanning phase for a non-modular build. This will allow us to do benchmarks and comparisons for performance that the minimization and caching give us, and maybe setup CI to track that performance. @Bigcheese will then extend the tool to have the support for computing modular dependencies for Clang modules. The tool could possibly interact with build systems in the future if desired, but it's not our immediate goal.
This tool is based on code that was included in the original WIP patch I posted before the dev meeting last October: https://reviews.llvm.org/D53354 .
Is -MD -MF required for clang-scan-deps to work? Can't we append those arguments automatically, so that only include paths are needed in the CDB?
Would it possible for the tool to produce a collated file? A real-world usage would otherwise produce tens of thousands of files. Which then would be opened/parsed by the calling application.