This adds an experimental C API for clang-scan-deps. It provides both
the full module dependency graph along with a flattened list of
dependencies.
See clang/include/clang-c/Dependencies.h for the API and documentation.
You can test it out using:
c-index-test core --scan-deps <working-directory> -- clang --cc1 <args>
This will output a list of modules and then the direct dependencies of
the main translation unit.
This is based on a patch by Alex Lorenz.
It would be simpler if the clients didn't have to worry about the worker?
As far as a user of this lib is concerned, they need to create a shared cache, then call scanDeps() in some form with the shared cache and other inputs.
Can we hide the worker inside the implementation? So essentially we create a new worker for every invocation (that's assuming worker setup is cheap).