<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear Yuxi,<br>
<br>
There are three general ways to do this (two of which have already
been mentioned).<br>
<br>
First, you can change the Makefiles to emit bitcode and then use
llvm-link to link all the bitcode files together into a big
bitcode file. You can then run the opt program on this large
bitcode file.<br>
<br>
Second, you can use some third-party tools (for lack of a better
term) that will get you a single bitcode file with fewer changes
to the Makefiles. I'm not very familiar with these, but I think
others have commented on them.<br>
<br>
Third, you can add your analysis pass to the libLTO library and
use LLVM's link-time optimization framework to run your analysis.
Documentation libLTO can be found at
<a class="moz-txt-link-freetext" href="http://llvm.org/docs/LinkTimeOptimization.html">http://llvm.org/docs/LinkTimeOptimization.html</a> and
<a class="moz-txt-link-freetext" href="http://llvm.org/docs/GoldPlugin.html">http://llvm.org/docs/GoldPlugin.html</a>. LLVM's LTO infrastructure
is designed to be transparent (i.e., you shouldn't have to modify
Makefiles to use it), though some programs' Makefiles are
more...complaint than others.<br>
<br>
I've used the libLTO approach for large programs with reasonable
success. However, some of the other third-party approaches have
been reported to work well, so you might try looking at those.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
On 3/10/16 9:54 PM, Yuxi Chen via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:83E2887150EB424E8D7877B912AE1FF167BDEBA3@xm-mbx-07-prod"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">Hi All,<br>
<br>
I am using clang to compile Mysql source code. Because I want to
do some inter-procedural analysis, hopefully, I want to get a
.o(bitcode) file(a module) containing all possible function
declarations and definitions. Is it possible to do that ? Or you
guys have some suggestions?<br>
<br>
To be clear, like Mysql, there is a mysqld routine, which is a
major routine. I want to mysqld.o(which is generated by clang)
to contain all possible function declarations and definitions.
So when I do some analysis, I just need load one module, which
is mysqld.o, instead of all .o files. <br>
<br>
<br>
Best,<br>
Yuxi<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>