[cfe-dev] Code reorganization using Clang

thomasp thomas.pleyber at alyotech.fr
Fri Feb 10 06:07:19 PST 2012

I heard of LLVM/Clang several times in the past, and now I want to use it
because it seems just very powerful.
But as it appears a bit hairy for the beginner I am, I'd like to know if I
can achieve what I want before digging in more seriously (note I didn't say
: "how to do it", just "can I do it with Clang")

The goal is to parse OpenCL source code in input, find all global variables
and pack them into a C-struct passed in as argument of all kernels.

for example, an input file would be :

And after custom Clang classes processed the code structure (AST ?), I
obtain the following :

So the question is : does Clang allow to do such processing (adding types
based on existing ones, modifying function signature and function body
contents) ?

View this message in context: http://clang-developers.42468.n3.nabble.com/Code-reorganization-using-Clang-tp3732618p3732618.html
Sent from the Clang Developers mailing list archive at Nabble.com.

More information about the cfe-dev mailing list