It seems to be simpler and more convenient to reuse the compilation database generated for ClangTool when using clang-check to run the analyzer.
In this patch, when the invocation list file is failed to be loaded, the ASTLoader will try to find a compilation database from the ctu-dir and convert the detected database to an invocation list.
For each compile command objects in the database:
- the "directory" entry is converted to option -working-directory appended to the invocation commands;
- the "file" entry is updated to an absolute path based on the "directory" entry as the index;
- and the "command" entry is converted to the invocation commands.
clang-format: please reformat the code