How to print a list of used LLVM APIs in a given open source project?

Hi,

     Assume there's an open source compiler implementation based on LLVM/Clang. What is the neatest way to print a list of LLVM APIs used in that open source project? Thanks.

Best,
Jiading

As a first approximation, you can scan #includes in the project or look for llvm::[a-zA-Z0-9_]+. If you need something precise, you could try using Clang’s ASTMatcher’s to query for all referenced declarations in namespace ::llvm.

– Sean Silva

I have not tried that tool (yet) so this is speculative.

But from the docs it appears to me that Google’s include-what-you-use could help.
See the output described here: You could do a temporary run. Not to “fix” your includes, but just to get a list of all the #include + reference statements printed. Cheers, Jonas