Hi,
I am working on implementing static analyzing into our product with CTU analysis. To do this properly we first have to dump ASTs of the sources with -emit-ast
and then run clang-extdef-mapping
on the source files before we can start the analysis. Both these processes can be pretty slow - so I am looking into any way to eliminate or reduce one of the steps.
I have two thoughts:
- Maybe clang-extdef-mapping could process the AST files directly - I think that would lead to less processing since the front-end already have done most of the heavy parsing. This would also be a natural way to handle the file name in the mapping file (i.e. not have to replace .cpp with .ast).
- Maybe we could output the mapping file from clang when creating the ast file, all parsing should already be done and we don’t have to do it again in this case.
Any thoughts on these changes? I’ll also appriciate any pointers to the API’s for opening the .ast files and getting the AST loaded?
Btw - I know about CodeChecker, and I’ll use the reporting tool of that, but I can’t integrate that into our build setup.