[cfe-dev] How to visit an OpenCL kernel source code using Clang library

eyasu getahun eya.get at gmail.com
Thu Nov 17 00:38:19 PST 2011


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?

2011/11/17 Jorge Fernández Fabeiro <fabeirojorge at gmail.com>

> Hi,
>
> 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?
>
> Thanks,
>
> Jorge.
>
>
> 2011/11/17 eya <eya.get at gmail.com>
>
>>
>> Actually -x cl option can't really make it compatible to clang, rather it
>> informs for the compiler as the source is cl file. What you want to do by
>> using clang? If you want to generate llvm IR or AST, it really works.
>> clang -S -emit-llvm -o file  -x cl file.cl this can generate LLVM IR for
>> any
>> .cl file.
>>
>> --
>> View this message in context:
>> http://clang-developers.42468.n3.nabble.com/How-to-visit-an-OpenCL-kernel-source-code-using-Clang-library-tp3512146p3514858.html
>> Sent from the Clang Developers mailing list archive at Nabble.com.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>


-- 
*With Best Regards,

===========================================
Eyasu Getahun*

1 Fusionopolis way, #08-10 Connexis North Tower
Singapore 138632, Singapore
Mobile: +393279239907
*===========================================
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111117/01bb9ae0/attachment.html>


More information about the cfe-dev mailing list