Hello Romain, Romain Geissler <romain.geiss...@st.com> a écrit:
> This patch solves some lacks with the PLUGIN_FINISH_TYPE event > triggering. For now, both C and C++ parser won't trigger it for enums or > for typedef. AFAICT, typedef declarations are reported by the PLUGIN_FINISH_DECL event. The predicate is_typedef_decl then returns TRUE when passed the decl carried by the event. Maybe the plugin's documentation could use an addendum for this. [...] > gcc/cp/ > 2011-09-12 Romain Geissler <romain.geiss...@gmail.com> > > * decl.c (grokdeclarator): Trigger PLUGIN_FINISH_TYPE for typedefs. [...] > Index: gcc/cp/decl.c > =================================================================== > --- gcc/cp/decl.c (revision 178252) > +++ gcc/cp/decl.c (working copy) > @@ -9682,6 +9682,9 @@ grokdeclarator (const cp_declarator *dec > memfn_quals != TYPE_UNQUALIFIED, > inlinep, friendp, raises != NULL_TREE); > > + if (TREE_TYPE (decl) != error_mark_node && !DECL_ARTIFICIAL (decl)) > + invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, decl); > + > return decl; > } > So I think this change is not necessary. [...] > Index: gcc/testsuite/gcc.dg/plugin/dumb-plugin-test-1.c > =================================================================== > --- gcc/testsuite/gcc.dg/plugin/dumb-plugin-test-1.c (revision 0) > +++ gcc/testsuite/gcc.dg/plugin/dumb-plugin-test-1.c (revision 0) > @@ -0,0 +1,56 @@ > +// Test case for the dumb plugin. > +// { dg-do compile } > +// { dg-options "-O -fplugin-arg-dumb_plugin-ref-pass-name=ccp > -fplugin-arg-dumb_plugin-ref-pass-instance-num=1" } > + Here, it would be nice to add a comment saying which plugin acts on this plugin's test and what the plugin does (what the output is supposed to be). That redundant information eases the review, at very least. Thanks. -- Dodji