]> gcc.gnu.org Git - gcc.git/commitdiff
lto-cgraph.c: Include tree-pass.h.
authorMartin Jambor <mjambor@suse.cz>
Wed, 7 Nov 2012 09:28:50 +0000 (10:28 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 7 Nov 2012 09:28:50 +0000 (10:28 +0100)
2012-11-07  Martin Jambor  <mjambor@suse.cz>

* lto-cgraph.c: Include tree-pass.h.
(lto_output_node): Stream node->ipa_transforms_to_apply.
(input_node): Likewise.
* tree-pass.h (passes_by_id): Declare.
(passes_by_id_size): Likewise.
* Makefile.in (lto-cgraph.o): Add TREE_PASS_H to dependencies.

From-SVN: r193286

gcc/ChangeLog
gcc/Makefile.in
gcc/lto-cgraph.c
gcc/tree-pass.h

index e1b7657e7e00b6394d22ca965e6bf4ad53611156..0445594efc1a8bbcd18bb411d377a353969cb401 100644 (file)
@@ -1,3 +1,12 @@
+2012-11-07  Martin Jambor  <mjambor@suse.cz>
+
+       * lto-cgraph.c: Include tree-pass.h.
+       (lto_output_node): Stream node->ipa_transforms_to_apply.
+       (input_node): Likewise.
+       * tree-pass.h (passes_by_id): Declare.
+       (passes_by_id_size): Likewise.
+       * Makefile.in (lto-cgraph.o): Add TREE_PASS_H to dependencies.
+
 2012-11-07  Jan Hubicka  <jh@suse.cz>
 
        * ipa-inline-analysis.c (true_predicate, single_cond_predicate,
index 9aea03ddc469799cfc7d6a527470d86f3447f1a5..816d150d002d5f530ccaa7a7108a10447290def1 100644 (file)
@@ -2143,7 +2143,7 @@ lto-cgraph.o: lto-cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h   \
    $(HASHTAB_H) langhooks.h $(BASIC_BLOCK_H) \
    $(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_CORE_H) \
    $(EXCEPT_H) $(TIMEVAR_H) pointer-set.h $(LTO_STREAMER_H) \
-   $(GCOV_IO_H) $(DATA_STREAMER_H) $(TREE_STREAMER_H)
+   $(GCOV_IO_H) $(DATA_STREAMER_H) $(TREE_STREAMER_H) $(TREE_PASS_H)
 lto-streamer-in.o: lto-streamer-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(TM_H) toplev.h $(DIAGNOSTIC_CORE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) \
    input.h $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) \
index e8f171824a11610a717887921f56d55071ec2631..b52a8e3a55cdc124d55842b795f27c4a949181c0 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "data-streamer.h"
 #include "tree-streamer.h"
 #include "gcov-io.h"
+#include "tree-pass.h"
 
 static void output_cgraph_opt_summary (void);
 static void input_cgraph_opt_summary (VEC (symtab_node, heap) * nodes);
@@ -377,6 +378,8 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
   intptr_t ref;
   bool in_other_partition = false;
   struct cgraph_node *clone_of;
+  struct ipa_opt_pass_d *pass;
+  int i;
 
   boundary_p = !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)node);
 
@@ -432,6 +435,12 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
   streamer_write_hwi_stream (ob->main_stream, node->count);
   streamer_write_hwi_stream (ob->main_stream, node->count_materialization_scale);
 
+  streamer_write_hwi_stream (ob->main_stream,
+                            VEC_length (ipa_opt_pass,
+                                        node->ipa_transforms_to_apply));
+  FOR_EACH_VEC_ELT (ipa_opt_pass, node->ipa_transforms_to_apply, i, pass)
+    streamer_write_hwi_stream (ob->main_stream, pass->pass.static_pass_number);
+
   if (tag == LTO_symtab_analyzed_node)
     {
       if (node->global.inlined_to)
@@ -897,6 +906,7 @@ input_node (struct lto_file_decl_data *file_data,
   int ref = LCC_NOT_FOUND, ref2 = LCC_NOT_FOUND;
   int clone_ref;
   int order;
+  int i, count;
 
   order = streamer_read_hwi (ib) + order_base;
   clone_ref = streamer_read_hwi (ib);
@@ -919,6 +929,19 @@ input_node (struct lto_file_decl_data *file_data,
   node->count = streamer_read_hwi (ib);
   node->count_materialization_scale = streamer_read_hwi (ib);
 
+  count = streamer_read_hwi (ib);
+  node->ipa_transforms_to_apply = NULL;
+  for (i = 0; i < count; i++)
+    {
+      struct opt_pass *pass;
+      int pid = streamer_read_hwi (ib);
+
+      gcc_assert (pid < passes_by_id_size);
+      pass = passes_by_id[pid];
+      VEC_safe_push (ipa_opt_pass, heap, node->ipa_transforms_to_apply,
+                    (struct ipa_opt_pass_d *) pass);
+    }
+
   if (tag == LTO_symtab_analyzed_node)
     ref = streamer_read_hwi (ib);
 
index 8ed2d986ada70904b9110dac67350e02dc37871a..09ec531f27bf97a115461c17ca821aed36c11c3d 100644 (file)
@@ -544,6 +544,9 @@ extern void register_pass (struct register_pass_info *);
    directly in jump threading, and avoid peeling them next time.  */
 extern bool first_pass_instance;
 
+extern struct opt_pass **passes_by_id;
+extern int passes_by_id_size;
+
 /* Declare for plugins.  */
 extern void do_per_function_toporder (void (*) (void *), void *);
 
This page took 0.102357 seconds and 5 git commands to generate.