rohit bhatia
2015-May-29 02:41 UTC
[LLVMdev] Whole Program Analysis with dynamically loaded libraries
Hi I was wondering if there is any way we can run whole program analysis on more than just one compilation unit. I would like to include the dynamically loaded libraries into the call graph too. Is there a way to do that? Thanks and Regards Rohit -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150528/4f2db071/attachment.html>
John Criswell
2015-May-31 15:31 UTC
[LLVMdev] Whole Program Analysis with dynamically loaded libraries
On 5/28/15 9:41 PM, rohit bhatia wrote:> Hi > > I was wondering if there is any way we can run whole program analysis > on more than just one compilation unit. I would like to include the > dynamically loaded libraries into the call graph too. > Is there a way to do that?Yes, you can do whole program analysis with LLVM. You can either a) link the bitcode files of each compilation unit together with llvm-link and then use opt to run your pass(es) on the whole-program bitcode file; or b) Modify the LLVM Gold plugin to run your pass. The former is easier to do; the latter will make it easier to use your pass(es) on large open-source projects. For dynamically loaded libraries, you will need to compile their source code to LLVM bitcode and link their bitcode files statically into the program. Alternatively (though this is unlikely to work), you could use a tool like RevGen to translate their the library native code into LLVM IR. Regards, John Criswell> > Thanks and Regards > Rohit > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150531/c17b07e0/attachment.html>