when implementing some static code analysis tool based on clang, you often
want to introspect the complete code base of a project. With the current API,
you have to specify the list of files explicitly by passing them as second
parameter to the constructor of tooling::ClangTool and
the common approach seems to be to pass in this list as command line
parameters to your application.
Now I wonder whether the CompilationDatabase class (which has loaded all the
compilation information from compile_commands.json already) could provide a
getter method to retrieve the list of files and passing it to
tooling::ClangTool directly.
Attached is a patch for that. No idea how to handle the usage of
FixedCompilationDatabase in this case though.
when implementing some static code analysis tool based on clang, you often
want to introspect the complete code base of a project. With the current API,
you have to specify the list of files explicitly by passing them as second
parameter to the constructor of tooling::ClangTool and
the common approach seems to be to pass in this list as command line
parameters to your application.
Now I wonder whether the CompilationDatabase class (which has loaded all the
compilation information from compile_commands.json already) could provide a
getter method to retrieve the list of files and passing it to
tooling::ClangTool directly.
Attached is a patch for that. No idea how to handle the usage of
FixedCompilationDatabase in this case though.
Any suggestions, objections, comments?
LGTM
apart from "." missing at the end of the \brief comments