On Mon, 2015-07-06 at 21:02 +0000, Justin Tai wrote:
Hi everyone,
I'm trying to add support for a new pragma to gcc. This requires
support for the PLUGIN_PRAGMAS event, which I'm currently trying to
add support for.
1) Any tips?
2) I've added support for registering a callback for the
PLUGIN_PRAGMAS event. The next step is to add support for the GCC API
c_register_pragma() by adding an entry to GccMethods in gcc-python.c
and adding and populating gcc-python-pragmas.c/h. Does this sound
about right?
Yes, this sounds sane.
I have a vague feeling I looked at doing this, and that I could see a
usable void * user_data place for pragmas for storing the associated
Python callable. But looking at
c-family/c-pragma.c:c_register_pragma_with_data I see that the C
frontend somehow manages to stash a void *, so presumably it's possible.
Hope this is helpful
Dave