This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Added PLUGIN_FINISH_TYPE callback on enum type processing
- From: Bruno Loff <bruno dot loff at gmail dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 Feb 2015 20:07:45 +0100
- Subject: Re: [PATCH] Added PLUGIN_FINISH_TYPE callback on enum type processing
- Authentication-results: sourceware.org; auth=none
- References: <CAGOfsMiNLbWaQP6yyx+vFVOAM7xPM0koDn8HRJO_sUTeb3SP3A at mail dot gmail dot com> <CAD_=9DTeDuO-57jGuEZOiQ9z3yGXvdFfv9o4baDb+bgpO0+WaA at mail dot gmail dot com>
Something like:
The PLUGIN_FINISH_TYPE callback for gcc plugins is now triggered for
enum declarations.
?
On 2 February 2015 at 20:03, Diego Novillo <dnovillo@google.com> wrote:
> On Thu, Jan 29, 2015 at 4:32 PM, Bruno Loff <bruno.loff@gmail.com> wrote:
>>
>> The issue was first reported by Joachim Wieland to the list
>> gcc@gcc.gnu.org, on Wed,
>> Jan 19, 2011 (Subject: PLUGIN_FINISH_TYPE not executed for enums).
>>
>>
>> A description of the problem/bug and how my patch addresses it.
>> -------------------------------------------------------------------------------------------
>> The problem was that when gcc plugins registered callbacks on the
>> PLUGIN_FINISH_TYPE event, this event would not be triggered after an
>> enum had finished processing.
>>
>> The function call that does this was not there; it seems to me that it
>> has simply been forgotten.
>>
>> Bootstrapping and testing
>> ------------------------------------
>>
>> make bootstrap
>> make -k check
>>
>> === gcc Summary ===
>>
>> # of expected passes 106729
>> # of expected failures 256
>> # of unsupported tests 1409
>>
>> on x86_64 ubuntu linux 14.04
>>
>> Furthermore, I tested the plugin functionality (with a gcc-with-python
>> script), and it now works properly. (However, changes to
>> gcc-with-python also had to be made so that enum type info is properly
>> converted to python types; see my github fork for these changes
>> https://github.com/bloff/gcc-python-plugin)
>>
>> The Patch
>> ---------------
>>
>> From: bloff <bloff.sites@gmail.com>
>> Date: Sun, 19 Oct 2014 14:54:01 +0100
>> Subject: [PATCH] Added PLUGIN_FINISH_TYPE callback on enum type processing
>>
>> First reported by Joachim Wieland to the list gcc@gcc.gnu.org, on Wed,
>> Jan 19, 2011 (Subject: PLUGIN_FINISH_TYPE not executed for enums).
>> ---
>> gcc/c/c-parser.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
>> index 264c170..cb515aa 100644
>> --- a/gcc/c/c-parser.c
>> +++ b/gcc/c/c-parser.c
>> @@ -2324,6 +2324,7 @@ c_parser_declspecs (c_parser *parser, struct
>> c_declspecs *specs,
>> attrs_ok = true;
>> seen_type = true;
>> t = c_parser_enum_specifier (parser);
>> + invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, t.spec);
>> declspecs_add_type (loc, specs, t);
>> break;
>> case RID_STRUCT:
>>
> This is OK with a ChangeLog entry.
>
> Thanks. Diego.