gengtype & plugins [#define emitted in wrong order]

Basile STARYNKEVITCH basile@starynkevitch.net
Thu Oct 1 20:33:00 GMT 2009


Rafael Espindola wrote, citing first me (Basile)
>> Correcting the problem is actually simple, as the attached patch (against
>> trunk r152356) demonstrates. I just moved the write_func_for_structure calls
>> inside write_types into their own loops.
>>
>> I am also attaching the gcc/ChangeLog entry
>>
>> Ok for trunk if it bootstraps?
> 
> The patch looks reasonable, what I don't understand is why this is a
> problem only for plugins. Do you know what makes the old order work
> for the non-plugin case?

I don't claim to have a complete & detailed theory of gengtype's 
behavior (in other words I don't think I understand every detail of it; 
actually I would dare to believe that nobody understand entirely 
gengtype!). However, with the MELT branch, I observe that every macro is 
defined inside the common generated file gtype-desc.h which is included 
by a lot of files, before any code. And the generated gtype-desc.c 
obviously #include gtype-desc.h (and all the include files listed in 
array ifiles in function open_base_file of gengtype.c) before any code. 
A similar observation holds for the trunk itself, so I would believe 
that the macros are probably always generated in gtype-desc.h, and that 
does explain that we did not met that "bug" before.

> 
> Some comments:
> 
> * The } on line 2773 in unaligned.
> * There is a trailing space on the "emit the functions" comment on line 2793.
> * There is a dummy ; on line 2818
> 

Thanks. I am attaching a slightly enhanced patch to trunk rev 152380 
(and the gcc/ChangeLog which has not changed); the only differences are 
the typos above and a few words in comments.

Ok if it bootstraps? (on Debian Sid Amd64 ie gnu linux x86-64)


Regards.

BTW, I produce the patch diff file with
svn diff -x -p -x -b gcc/gengtype.c > \ 
~/tmp/patch-gengtype-plugin-r152380.diff
Is that command the right way to produce such a patch?
-- 
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} ***
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-gengtype-plugin-r152380.diff
Type: text/x-patch
Size: 3470 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091001/6aef6ee2/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ChangeLog
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091001/6aef6ee2/attachment.ksh>


More information about the Gcc-patches mailing list