[PLUGIN] Fix PLUGIN_FINISH_TYPE
Romain Geissler
romain.geissler@st.com
Mon Sep 12 11:41:00 GMT 2011
Hi,
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. In C++, when a struct, class or union declaration is parsed
(without definition), the given event data is an error mark instead of
the parsed type node.
Bootstrapped and tested on x86_64.
Romain Geissler
gcc/
2011-09-12 Romain Geissler <romain.geissler@gmail.com>
* c-decl.c (grokdeclarator): Trigger PLUGIN_FINISH_TYPE for typedefs.
* c-parser.c (cp_parser_type_specifier: Trigger PLUGIN_FINISH_TYPE for
enums.
gcc/cp/
2011-09-12 Romain Geissler <romain.geissler@gmail.com>
* decl.c (grokdeclarator): Trigger PLUGIN_FINISH_TYPE for typedefs.
* parser.c (cp_parser_type_specifier: Trigger PLUGIN_FINISH_TYPE for
enums.
Correctly trigger PLUGIN_FINISH_TYPE for unions, structs or classes.
gcc/testsuite/
2011-09-12 Romain Geissler <romain.geissler@gmail.com>
* gcc.dg/plugin/dumb-plugin-test-1.c: New File.
* gcc.dg/plugin/dumb_plugin.c: Likewise.
* gcc.dg/plugin/plugin.exp: Add above testcase.
* g++.dg/plugin/dumb-plugin-test-1.C: New tests.
* g++.dg/plugin/dumb_plugin.c (handle_type): Renamed from handle_struct.
Add warnings for all kind of types.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: finish_type.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110912/a69a77f1/attachment.ksh>
More information about the Gcc-patches
mailing list