This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gengtype plugin improvement last4round -patch 6 [wstate]
On Thu, 25 Nov 2010 15:13:25 +0200
Laurynas Biveinis <laurynas.biveinis@gmail.com> wrote:
BTW, since you ok-ed with changes, I did commit to trunk.
>
> However I am looking at main() and have difficulty understanding: what
> was, as you say, the more intuitive place for write_state call that
> was wrong?
I forgot the details. Jeremie & me wrote this code in august 2010, and
we did not use any private version control system. But I remember we
had a bug related to the placement of the call to write_state (). Maybe
at that time our understanding of gengtype was worse than today. IIRC
the possible issue was calling set_gc_used (variables) before or after
write_state().
> For me the current one looks like the most intuitive: after
> all reading is done and before writing any output.
> Second, can you
> explain bit more this scenario of plugin depending on another plugin?
So, let's dream that 4.6 is released and that a plugin foo.so is
commonly used, up to the point that other plugins like foobar.so and
foogee.so are provided to run above it. Assume that all foo.so,
foobar.so & googee.so uses GTY and that foobar.c's GTY-ed types are
referencing a GTY-ed type provided by foo.c or its foo.h
To build foo.so, you need gt-foo.h generated by gengtype with
gengtype -r .../gtype.state -P gt-foo.h foo.h foo.c
But you may also want to provide for the use of sub-plugins
like foobar.so & foogee.so the derived state file gtype-foo.state
You will then run also
gengtype -r .../gtype.state -P gt-foo.h foo.h foo.c -w gtype-foo.state
[I don't know if that works today, since I never tested]
so that for gt-foobar.h you would run
gengtype -r gtype-foo.state -P gt-foobar.h foobar.c
Is my explanation clear enough?
Ok, to be clear, I did not test that use case. Maybe it don't work yet. But that would be a bug.
Cheers.
--
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 mine, sont seulement les miennes} ***