This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PLUGIN] Fix PLUGIN_FINISH_TYPE


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.

Attachment: finish_type.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]