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
(output_profile_summary): New function.
(output_cgraph): Use it.
basic_block bb;
struct bitpack_d *bp;
struct cgraph_node *node;
+ tree args, narg, oarg;
fn = DECL_STRUCT_FUNCTION (fn_decl);
tag = input_record_start (ib);
/* Read all the local symbols. */
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. */
input_ssa_names (ib, data_in, fn);
gcc_assert (DECL_INITIAL (fn_decl));
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. */
tag = input_record_start (ib);
while (tag)
/* Output all the local variables in the function. */
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_ssa_names (ob, fn);
lexical scopes. */
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
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