<font color="#330099"><font size="2"><font face="georgia,serif">You can print or dump the AST that is generated by clang command. It is not clear what kind of your own program you are going to use. By the way do you know which function of clang is generating AST? <br>

</font></font></font><br><div class="gmail_quote">2011/11/17 Jorge Fernández Fabeiro <span dir="ltr"><<a href="mailto:fabeirojorge@gmail.com">fabeirojorge@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi,<div><br></div><div>I need to generate the AST in order to visit its nodes and do some source-to-source transformations in some of them. But I need to do this using the Clang libraries in a program of my own, not using the clang command-line tool. Or is there some way to pass an AST generated like you are telling me into a program?</div>



<div><br></div><div>Thanks,</div><div><br></div><div>Jorge.<div><div class="h5"><br><br><div class="gmail_quote">2011/11/17 eya <span dir="ltr"><<a href="mailto:eya.get@gmail.com" target="_blank">eya.get@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
Actually -x cl option can't really make it compatible to clang, rather it<br>
informs for the compiler as the source is cl file. What you want to do by<br>
using clang? If you want to generate llvm IR or AST, it really works.<br>
clang -S -emit-llvm -o file  -x cl <a href="http://file.cl" target="_blank">file.cl</a> this can generate LLVM IR for any<br>
.cl file.<br>
<span><font color="#888888"><br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/How-to-visit-an-OpenCL-kernel-source-code-using-Clang-library-tp3512146p3514858.html" target="_blank">http://clang-developers.42468.n3.nabble.com/How-to-visit-an-OpenCL-kernel-source-code-using-Clang-library-tp3512146p3514858.html</a><br>




Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><b>With Best Regards,<br><br>===========================================<br>Eyasu Getahun</b><br><br>1 Fusionopolis way, #08-10 Connexis North Tower<br>Singapore 138632, Singapore<br>

Mobile: +393279239907<br><b>===========================================<br></b><br>