Gai, Jiading
2014-Jan-13 22:39 UTC
[LLVMdev] 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
Sean Silva
2014-Jan-13 23:10 UTC
[LLVMdev] How to print a list of used LLVM APIs in a given open source project?
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 On Mon, Jan 13, 2014 at 5:39 PM, Gai, Jiading <jgai at illinois.edu> wrote:> 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 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140113/47f98834/attachment.html>
Jonas Gefele
2014-Jan-14 05:35 UTC
[LLVMdev] How to print a list of used LLVM APIs in a given open source project?
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: http://sylvestre.ledru.info/blog/2013/09/08/include-what-you-use-yet 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 On 14.01.2014 00:10, Sean Silva wrote:> 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 > > > On Mon, Jan 13, 2014 at 5:39 PM, Gai, Jiading <jgai at illinois.edu > <mailto:jgai at illinois.edu>> wrote: > > 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 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> > http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140114/5185c8c9/attachment.html>