Commit 28628ea6 by Diego Novillo Committed by Diego Novillo

lto.c (uniquify_nodes): Move code to register decls to the loop that computes canonical types.

	* lto.c (uniquify_nodes): Move code to register decls to
	the loop that computes canonical types.

From-SVN: r174745
parent 1dcad079
2011-06-07 Diego Novillo <dnovillo@google.com>
* lto.c (uniquify_nodes): Move code to register decls to
the loop that computes canonical types.
2011-06-07 Richard Guenther <rguenther@suse.de> 2011-06-07 Richard Guenther <rguenther@suse.de>
* lto-lang.c (lto_init): Do not set * lto-lang.c (lto_init): Do not set
......
...@@ -651,21 +651,13 @@ uniquify_nodes (struct data_in *data_in, unsigned from) ...@@ -651,21 +651,13 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
/* Go backwards because children streamed for the first time come /* Go backwards because children streamed for the first time come
as part of their parents, and hence are created after them. */ as part of their parents, and hence are created after them. */
/* First register all declarations and types in the cache. /* First register all the types in the cache. This makes sure to
This makes sure to have the original structure in the type cycles have the original structure in the type cycles when registering
when registering them and computing hashes. */ them and computing hashes. */
for (i = len; i-- > from;) for (i = len; i-- > from;)
{ {
tree t = VEC_index (tree, cache->nodes, i); tree t = VEC_index (tree, cache->nodes, i);
if (t && TYPE_P (t))
if (t == NULL_TREE)
continue;
if (TREE_CODE (t) == VAR_DECL)
lto_register_var_decl_in_symtab (data_in, t);
else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t))
lto_register_function_decl_in_symtab (data_in, t);
else if (TYPE_P (t))
gimple_register_type (t); gimple_register_type (t);
} }
...@@ -788,19 +780,23 @@ uniquify_nodes (struct data_in *data_in, unsigned from) ...@@ -788,19 +780,23 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
} }
} }
/* Finally compute the canonical type of t. From this point /* Finally compute the canonical type of all TREE_TYPEs and register
there are no longer any types with TYPE_STRUCTURAL_EQUALITY_P VAR_DECL and FUNCTION_DECL nodes in the symbol table.
and its type-based alias problems. This step requires the From this point there are no longer any types with
TYPE_POINTER_TO lists being present, so make sure it is done TYPE_STRUCTURAL_EQUALITY_P and its type-based alias problems.
last. */ This step requires the TYPE_POINTER_TO lists being present, so
make sure it is done last. */
for (i = len; i-- > from;) for (i = len; i-- > from;)
{ {
tree t = VEC_index (tree, cache->nodes, i); tree t = VEC_index (tree, cache->nodes, i);
if (!t if (t == NULL_TREE)
|| !TYPE_P (t))
continue; continue;
if (!TYPE_CANONICAL (t)) if (TREE_CODE (t) == VAR_DECL)
lto_register_var_decl_in_symtab (data_in, t);
else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t))
lto_register_function_decl_in_symtab (data_in, t);
else if (TYPE_P (t) && !TYPE_CANONICAL (t))
TYPE_CANONICAL (t) = gimple_register_canonical_type (t); TYPE_CANONICAL (t) = gimple_register_canonical_type (t);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment