<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 4, 2015, at 10:18 AM, Phil Tomson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Dec 2, 2015 at 11:06 AM, David Chisnall <span dir="ltr" class=""><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank" class="">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2 Dec 2015, at 19:00, Phil Tomson <<a href="mailto:phil.a.tomson@gmail.com" class="">phil.a.tomson@gmail.com</a>> wrote:<br class="">
><br class="">
> I have a feeling this would get rather tricky given that there are several libraries linked in to the final executable as well. It would have to look something like:<br class="">
><br class="">
> clang -c file.c -emit-llvm > opt -... > llc ... > as > ld (libs to link in)<br class="">
<br class="">
</span>You don’t need as (llc can emit .o files). </blockquote><div class=""><br class=""></div><div class="">How do you get llc to emit a .o file (I seem to only be able to get it to output a .s file)?<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>$ llc --help | grep filetype -A 3<br class="">  -filetype                         - Choose a file type (not all types are supported by all targets):<br class="">    =asm                            -   Emit an assembly ('.s') file<br class="">    =obj                            -   Emit a native object ('.o') file<br class="">    =null                           -   Emit nothing, for performance testing<br class=""><br class=""></div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hopefully, your build system has different CC / CXX / LD values, so the final link is separate too.<br class=""></blockquote><div class=""><br class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br class="">
> Someone above mentioned modifying PassManagerBuilder and rebuilding clang - I'd guess there's a list of optimization passes performed somewhere that PassManagerBuilder references, but I haven't been in the optimization pass area of LLVM much yet. Any pointers on that approach?<br class="">
<br class="">
</span>You can take a look in BackendUtil.cpp for how the passes are constructed for clang.  Note that it is quite complex and depends a lot on your language options...<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
David<br class="">
<br class="">
</font></span></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>