This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Generating gimple statements from pragma's
- From: Julien Peeters <jj dot peeters at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 26 Apr 2013 20:10:19 +0200
- Subject: Generating gimple statements from pragma's
Hi ML Readers,
I am looking for help to make a GCC plugin.
The plugin aims to add pragma's to GCC. These pragma's would have the
effect of inserting calls to runtime library functions a very specific
points in the code.
Here is an example:
If I write:
int a, b;
...
#pragma mypragma opt(a, b)
{
int c;
c = b;
a += c;
b = a;
}
the resulting gimple should be equivalent to this:
int a, b;
...
runtime_start ();
runtime_require ( a );
runtime_require ( b );
runtime_check ();
{
int c;
c = b;
a += c;
b = a;
}
runtime_finalize ();
I found in the examples how to add pragma's but I am not sure how can I
detect the block next to the pragma, check that all variable in the opt
option are accessible in the scope of the block and finally how can I
add calls to the runtime functions.
Thanks for helping,
Julien.