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

Jorge Fernández Fabeiro fabeirojorge at gmail.com
Thu Nov 17 00:14:50 PST 2011


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111117/546682ba/attachment.html>


More information about the cfe-dev mailing list