This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Merge C++ conversion into trunk (3/6 - gengtype C++ support)
- From: Dodji Seketeli <dodji at seketeli dot org>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Laurynas Biveinis <laurynas dot biveinis at gmail dot com>, tromey at redhat dot com
- Date: Tue, 14 Aug 2012 04:38:35 -0400
- Subject: Re: Merge C++ conversion into trunk (3/6 - gengtype C++ support)
- References: <20120812201300.GA14743@google.com>
Hello Diego,
Just some minor comments.
Diego Novillo <dnovillo@google.com> a Ãcrit:
[...]
> +@section User-provided marking routines for template types
> +When a template type @code{TP} is marked with @code{GTY}, all
> +instances of that type are considered user-provided types. This means
> +that the individual instances of @code{TP} do not need to marked with
s/to marked/to be marked/
> +@code{GTY}. The user needs to provide template functions to mark all
> +the fields of the type.
> +
> +The following code snippets represent all the functions that need to
> +be provided. Note that type @code{TP} may reference to more than one
> +type. In these snippets, there is only one type @code{T}, but there
> +could be more.
> +
> +@smallexample
> +template<typename T>
> +void gt_ggc_mx (TP<T> *tp)
> +@{
Just for my education, for the marking routines in general why having
the parameter tp be a pointer, rather than TP<T> &tp ?
> + extern void gt_ggc_mx (T&);
> +
> + /* This marks field 'fld' of type 'T'. */
> + gt_ggc_mx (tp->fld);
> +@}
[...]
--
Dodji