Hello!
For my research project, I want to gather statistics about specific C++ codebases (i.e., firefox). Things I want to know are (1) class definitions, (2) class constructor declaration, and (3) the use of class constructors in code (i.e., instantiation of an object).
I was told that clang lib tooling might help here, so I wrote a matcher that analyzes the source code. I can find the class and their constructor declarations. Still, my code threats object instantiation as a class declaration as well (for some reason, it appears as CXXConstructorDecl in the CXXRecordDecl node of the AST tree). In addition, I cannot figure out how to analyze all the source code, but not the standard libraries. Filtering by include does not work, as it will filter all the header files. I tried the Amalgamate tool, but it still requires to analyze the code base on a file-by-file basis.
I guess my questions are:
- Is clang lib tooling with AST Matching the right tool for the task?
- If so, what APIs should I use to resolve my issues?
- If not, what other tool should I use?
Thank you!