This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: LTO/WHOPR streaming of varpool
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 May 2010 17:49:22 +0200
- Subject: Re: LTO/WHOPR streaming of varpool
- References: <20100428180912.GF9094@kam.mff.cuni.cz>
Hi,
On Wed, Apr 28, 2010 at 08:09:12PM +0200, Jan Hubicka wrote:
>
...
>
> Index: lto-symtab.c
> ===================================================================
> --- lto-symtab.c (revision 158825)
> +++ lto-symtab.c (working copy)
> @@ -44,6 +44,9 @@ struct GTY(()) lto_symtab_entry_def
> /* The cgraph node if decl is a function decl. Filled in during the
> merging process. */
> struct cgraph_node *node;
> + /* The varpool node if decl is a variable decl. Filled in during the
> + merging process. */
> + struct varpool_node *vnode;
> /* LTO file-data and symbol resolution for this decl. */
> struct lto_file_decl_data * GTY((skip (""))) file_data;
> enum ld_plugin_symbol_resolution resolution;
> @@ -244,6 +247,23 @@ lto_cgraph_replace_node (struct cgraph_n
> cgraph_remove_node (node);
> }
>
> +/* Replace the cgraph node NODE with PREVAILING_NODE in the cgraph, merging
> + all edges and removing the old node. */
> +
> +static void
> +lto_varpool_replace_node (struct varpool_node *node,
> + struct varpool_node *prevailing_node)
> +{
> + /* Merge node flags. */
> + if (node->needed)
> + varpool_mark_needed_node (prevailing_node);
> + gcc_assert (!node->finalized || prevailing_node->finalized);
> + gcc_assert (!node->analyzed || prevailing_node->analyzed);
> +
> + /* Finally remove the replaced node. */
> + varpool_remove_node (node);
> +}
The comment does not reflect what the function does and is a bit
confusing, especially since nowadays the function is a bit more
complex. Can you update it when you have a chance, please?
Thanks,
Martin