<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 24, 2015, at 6:30 PM, Q Z <<a href="mailto:zhaoqian301@gmail.com" class="">zhaoqian301@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Thank you for you nice answer. But I'am sorry, I find the question I was asked is not what I really want. my situation is that I want to write a LLVM pass to check a large progress. what is the simplest way for me to make the progress become checkable?</div></div></blockquote><div><br class=""></div><div>I think it depends the kind of check you want to perform. If it is something local enough that a function pass or module pass would work, you may not need the entire project as a whole in a single IR file. In this case you can add your pass to the pipeline and recompile clang or again depending on what you want to perform you can try a solution like this: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__homes.cs.washington.edu_-7Easampson_blog_clangpass.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=eek9o_cmSHm8dcEZi03MGTjJn0UzX60eVOLKUB7VkV4&s=f6f4JghghCEMgaft_lQ-3fUq6TMLw3Oizc5a-BoP7tA&e=" class="">https://homes.cs.washington.edu/~asampson/blog/clangpass.html</a></div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-06-25 1:54 GMT+08:00 Pete Cooper <span dir="ltr" class=""><<a href="mailto:peter_cooper@apple.com" target="_blank" class="">peter_cooper@apple.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jun 24, 2015, at 10:19 AM, Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank" class="">eliben@google.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 24, 2015 at 7:05 AM, Q Z <span dir="ltr" class=""><<a href="mailto:zhaoqian301@gmail.com" target="_blank" class="">zhaoqian301@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class="">Hello,I want to compile a large project(for example,Apache httpd) to one .bc file. How can I do this? Can you give me some examples?<div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">In general, if the codebase of a certain project is compilable by Clang/LLVM, this should be possible, but the devil is in the details (for example - how is the standard library going to get compiled into that .bc file?)</div></div></div></div></div></blockquote></span>If you only care about the project itself and not things like the standard library, then LTO is possible too.  Depends on the linker you are using, but Apple’s ld and I believe the gold linker both have -save-temps options which save the bit codes before/after optimization but certainly after linking.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Pete<br class=""><blockquote type="cite" class=""><div class=""><span class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">I suggest you take a look at the "NaCl ports" project (<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__code.google.com_p_naclports_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=RfjvEJWweAkWHLneLw1ksvf1RoobZbEIUUVtXtJgYv4&s=RvO9OeVGsfCkE0U5HJQV_pwo1s2U1qoZg2Wx-gK19cs&e=" target="_blank" class="">https://code.google.com/p/naclports/</a>). It has ready-made makefiles to compile a bunch of well known open source projects using the PNaCl toolchain, which is based on LLVM. Each file is compiled to IR and the LLVM linker is used to link them all together. This is a full solution, handling the standard libraries, and so on. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Eli</div><div class=""><br class=""></div></div></div></div></span>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank" class="">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" target="_blank" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></div></body></html>