PLUGIN_PRAGMAS event

Rafael Espindola espindola@google.com
Fri Nov 6 15:36:00 GMT 2009


>>
>> The patch still has PLUGIN_START_UNIT in plugin.c
>
> PLUGIN_START_UNIT seems to already be in the trunk rev 153950. I believe it
> was added by somebody else, and I strongly believe it should not be removed
> (that is, all plugin events should be kept).
> And the string "PLUGIN_ATTRIBUTES" seems to be missing in its plugin.c; I am
> correcting that also in the submitted patch here.

That is correct. I misread the first patch. Thanks.

> I tend to believe that we should have a plugin-events.def file containing
> the list of events like
>
>  PLUGIN_EVENT(PLUGIN_PASS_MANAGER_SETUP)
>  PLUGIN_EVENT(PLUGIN_FINISH_TYPE)
>  PLUGIN_EVENT(PLUGIN_FINISH_UNIT)
>
> and include it with various #define of PLUGIN_EVENT both in gcc-plugin.h &
> plugin.c. We could even generate some part of plugins.texi but I won't
> propose such a patch if people are not interested.
> Perhaps we should sort alphabetically the list of events there.

Should be good to have. Maybe in the next stage1?

> There is also a typo in the error message when the callback event is
> unknown.

Thanks for fixing.

> Back to PLUGIN_PRAGMAS.
>
>>
>> The test fails with:
>>  error: 'abort' was not declared in this scope
>
> I removed the use of abort.  I tried to reproduce the dg comments from other
> tests, but which the plugin_pragma.c does work as expected, the comments in
> gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C
> are not making dejagnu happy. Unfortunately I never understood dejagnu. But
> when the pragma_plugin.so is loaded, it works as I expect:
>
> /usr/src/Lang/gcc-trunk-bstarynk/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C:5:28:
> warning: 'pragma GCCPLUGIN sayhello' outside of function: here
> /usr/src/Lang/gcc-trunk-bstarynk/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C:
> In function 'int some_func(const char*)':
> /usr/src/Lang/gcc-trunk-bstarynk/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C:11:28:
> warning: 'pragma GCCPLUGIN sayhello' from function 'some_func': at start
> /usr/src/Lang/gcc-trunk-bstarynk/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C:16:20:
> warning: 'pragma GCCPLUGIN sayhello' from function 'some_func': in block
>
> What are the comments needed in pragma_plugin-test-1.C to make dejagnu
> happy?

Looks like the problem is that the comments have to be in the same
line as the pragmas and that some single quotes were missing. I have
attached a fix.

I think the patch is OK. Richard, Diego, the impact is probably low,
OK during stage3?

> Respectful regards.
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>

Cheers,
-- 
Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pragmas.patch
Type: text/x-diff
Size: 8492 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091106/8db92891/attachment.bin>


More information about the Gcc-patches mailing list