<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 15, 2015 at 6:43 AM, James Courtier-Dutton <span dir="ltr"><<a href="mailto:james.dutton@gmail.com" target="_blank">james.dutton@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 14 May 2015 at 20:44, Aditya Avinash <<a href="mailto:adityaavinash1@gmail.com">adityaavinash1@gmail.com</a>> wrote:<br>
</span><div><div class="h5">> Hi,<br>
> I am trying to use LLVM to generate C (partly, Intel AVX) code to test some<br>
> abstractions. Apparently, most of the documentation is related to generating<br>
> LLVM-IR. Are there any tools to do this? (I have generated AST from these<br>
> abstractions. I want to generate C code from it).<br>
> Thank you! :)<br>
><br>
> PS: If this is a wrong mailinglist, help me with the right one.<br>
><br>
<br>
</div></div>If you have your code at the AST level, you might as well use CLANG to<br>
work at the AST level and create C code as output.<br>
CLANG is closely linked to LLVM.<br></blockquote><div><br></div><div>Cool. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There seems very little point in lowering the AST to LLVM-IR then<br>
output to C. You will loose useful structural information.<br></blockquote><div><br></div><div>I am trying to do AST->C. It's one way. You won't hit stages you already passed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
E.g. By using something like this with CLANG would be better:<br>
<a href="http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang" target="_blank">http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang</a><br>
<br>
Also, if you can create AST in a format CLANG understands, it can then<br>
automatically lower it to LLVM-IR, and you will have your completed<br>
compiler for your own language.<br></blockquote><div><br></div><div>Thank you! :)<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The mailing list for CLANG is<br>
mailto: <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<br>
Kind Regards<br>
<span class="HOEnZb"><font color="#888888"><br>
James<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><font style="font-family:trebuchet ms,sans-serif" size="2">Regards,<br></font></div><font style="font-family:trebuchet ms,sans-serif" size="2"><b style="background-color:rgb(255,255,255);color:rgb(0,0,153)">Aditya Atluri,<br></b></font></div><div><font style="font-family:trebuchet ms,sans-serif" size="2"><b style="background-color:rgb(255,255,255);color:rgb(0,0,153)">USA.<br></b></font></div><font style="font-family:trebuchet ms,sans-serif" size="2"><b style="background-color:rgb(255,255,255);color:rgb(0,0,153)"></b><span style="background-color:rgb(255,255,255);color:rgb(0,0,153)"></span></font><br></div></div>
</div></div>