Commit 811232fe by Jan Hubicka Committed by Jan Hubicka

(patch by Richard Guenther)


	(patch by Richard Guenther)
	* lto-streamer-out.c (output_function): Output head of argument list
	earlier.
	* lto-streamer-in.c (input_function): Re-map arguments into merged
	declaration.

From-SVN: r154105
parent 5fae76b1
2009-11-11 Jan Hubicka <jh@suse.cz> 2009-11-11 Jan Hubicka <jh@suse.cz>
(patch by Richard Guenther)
* lto-streamer-out.c (output_function): Output head of argument list
earlier.
* lto-streamer-in.c (input_function): Re-map arguments into merged
declaration.
2009-11-11 Jan Hubicka <jh@suse.cz>
* lto-cgraph.c: Include gcov-io.h * lto-cgraph.c: Include gcov-io.h
(output_profile_summary): New function. (output_profile_summary): New function.
(output_cgraph): Use it. (output_cgraph): Use it.
...@@ -1262,6 +1262,7 @@ input_function (tree fn_decl, struct data_in *data_in, ...@@ -1262,6 +1262,7 @@ input_function (tree fn_decl, struct data_in *data_in,
basic_block bb; basic_block bb;
struct bitpack_d *bp; struct bitpack_d *bp;
struct cgraph_node *node; struct cgraph_node *node;
tree args, narg, oarg;
fn = DECL_STRUCT_FUNCTION (fn_decl); fn = DECL_STRUCT_FUNCTION (fn_decl);
tag = input_record_start (ib); tag = input_record_start (ib);
...@@ -1296,6 +1297,22 @@ input_function (tree fn_decl, struct data_in *data_in, ...@@ -1296,6 +1297,22 @@ input_function (tree fn_decl, struct data_in *data_in,
/* Read all the local symbols. */ /* Read all the local symbols. */
fn->local_decls = lto_input_tree (ib, data_in); fn->local_decls = lto_input_tree (ib, data_in);
/* Read all function arguments. We need to re-map them here to the
arguments of the merged function declaration. */
args = lto_input_tree (ib, data_in);
for (oarg = args, narg = DECL_ARGUMENTS (fn_decl);
oarg && narg;
oarg = TREE_CHAIN (oarg), narg = TREE_CHAIN (narg))
{
int ix;
bool res;
res = lto_streamer_cache_lookup (data_in->reader_cache, oarg, &ix);
gcc_assert (res);
/* Replace the argument in the streamer cache. */
lto_streamer_cache_insert_at (data_in->reader_cache, narg, ix);
}
gcc_assert (!oarg && !narg);
/* Read all the SSA names. */ /* Read all the SSA names. */
input_ssa_names (ib, data_in, fn); input_ssa_names (ib, data_in, fn);
...@@ -1307,9 +1324,6 @@ input_function (tree fn_decl, struct data_in *data_in, ...@@ -1307,9 +1324,6 @@ input_function (tree fn_decl, struct data_in *data_in,
gcc_assert (DECL_INITIAL (fn_decl)); gcc_assert (DECL_INITIAL (fn_decl));
DECL_SAVED_TREE (fn_decl) = NULL_TREE; DECL_SAVED_TREE (fn_decl) = NULL_TREE;
/* Read all function arguments. */
DECL_ARGUMENTS (fn_decl) = lto_input_tree (ib, data_in);
/* Read all the basic blocks. */ /* Read all the basic blocks. */
tag = input_record_start (ib); tag = input_record_start (ib);
while (tag) while (tag)
......
...@@ -1870,6 +1870,9 @@ output_function (struct cgraph_node *node) ...@@ -1870,6 +1870,9 @@ output_function (struct cgraph_node *node)
/* Output all the local variables in the function. */ /* Output all the local variables in the function. */
lto_output_tree_ref (ob, fn->local_decls); lto_output_tree_ref (ob, fn->local_decls);
/* Output the head of the arguments list. */
lto_output_tree_ref (ob, DECL_ARGUMENTS (function));
/* Output all the SSA names used in the function. */ /* Output all the SSA names used in the function. */
output_ssa_names (ob, fn); output_ssa_names (ob, fn);
...@@ -1880,9 +1883,6 @@ output_function (struct cgraph_node *node) ...@@ -1880,9 +1883,6 @@ output_function (struct cgraph_node *node)
lexical scopes. */ lexical scopes. */
lto_output_tree (ob, DECL_INITIAL (function), true); lto_output_tree (ob, DECL_INITIAL (function), true);
/* Output the head of the arguments list. */
lto_output_tree_ref (ob, DECL_ARGUMENTS (function));
/* We will renumber the statements. The code that does this uses /* We will renumber the statements. The code that does this uses
the same ordering that we use for serializing them so we can use the same ordering that we use for serializing them so we can use
the same code on the other end and not have to write out the the same code on the other end and not have to write out the
......
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