This is a part one of two part patch that flattens gimple-streamer.h, lto-streamer.h and tree-streamer.h. This work is part of the GCC Re-Architecture effort being led by Andrew MacLeod.

In gimple-streamer.h I moved all exports for gimple-streamer-in.c to a new file gimple-streamer-in.h. I also moved all exports for gimple-streamer-out.c to a new file gimple-streamer-out.h. Finally because gimple-streamer.h only contained exports for gimple-streamer-in.c and gimple-streamer-out.c I removed the file.

In lto-streamer.h I moved all exports for lto-streamer-in.c to a new file lto-streamer-in.h. I also moved all exports for lto-streamer-out.c to a new file gimple-streamer-out.h.

In tree-streamer.h I moved all exports for tree-streamer-in.c to a new file tree-streamer-in.h. I also moved all exports for tree-streamer-out.c to a new file tree-streamer-out.h.

As a result of the flattening I had to add new include files to gengtype.c.

I performed a full bootstrap with all languages on x86-linux. I also bootstrapped on all targets listed in contrib/config-list.mk with c and c++ enabled.

Is this okay for trunk?

2014-11-19  Michael Collison  <michael.colli...@linaro.org>

    * gengtype.c (open_base_files): Include gcov-io.h, plugin-api.h,
    diagnostic.h when generating gengytpe.c.
    * gimple-streamer.h : Remove file and move prototypes to new files
    gimple-streamer-in.h and gimple-streamer-out.h.
    * gimple-streamer-in.h: New file to contain prototypes for functions
    exported from gimple-streamer-in.c.
    * gimple-streamer-out.h: New file to contain prototypes for functions
    exported from gimple-streamer-out.c.
    * lto-streamer.h: Flatten by removing all include files.
    Move prototype for lto-streamer-in.c to new file lto-streamer-in.h.
    Move prototypes for lto-streamer-out.c to new file lto-streamer-out.h.
* lto-streamer-in.h: New file to contain exports from file lto-streamer-in.c. * lto-streamer-out.h: New file to contain exports from file lto-streamer-out.c.
    * tree-streamer.h: Flatten by removing all include files.
    Move prototypes for tree-streamer-in.c tp new file tree-streamer-in.h.
    Move prototypes for tree-streamer-out.c tp new file tree-streamer-out.h
* tree-streamer-in.h: New file to contain exports from file tree-streamer-in.c. * tree-streamer-out.h: New file to contain exports from file tree-streamer-out.c.

--
Michael Collison
Linaro Toolchain Working Group
michael.colli...@linaro.org

diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/gengtype.c 
gcc-trunk-streamer/gcc/gengtype.c
*** gcc-trunk/gcc/gengtype.c    2014-11-05 01:50:41.201568692 -0700
--- gcc-trunk-streamer/gcc/gengtype.c   2014-11-11 15:29:34.434699522 -0700
***************
*** 1841,1849 ****
        "tree-ssa-loop.h", "tree-ssa-loop-ivopts.h", "tree-ssa-loop-manip.h",
        "tree-ssa-loop-niter.h", "tree-into-ssa.h", "tree-dfa.h", 
        "tree-ssa.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
!       "except.h", "output.h",  "cfgloop.h", "target.h", "lto-streamer.h",
        "target-globals.h", "ipa-ref.h", "cgraph.h", "ipa-prop.h", 
!       "ipa-inline.h", "dwarf2out.h", NULL
      };
      const char *const *ifp;
      outf_p gtype_desc_c;
--- 1841,1850 ----
        "tree-ssa-loop.h", "tree-ssa-loop-ivopts.h", "tree-ssa-loop-manip.h",
        "tree-ssa-loop-niter.h", "tree-into-ssa.h", "tree-dfa.h", 
        "tree-ssa.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
!       "except.h", "output.h",  "cfgloop.h", "target.h",
!       "gcov-io.h", "plugin-api.h", "diagnostic.h",
        "target-globals.h", "ipa-ref.h", "cgraph.h", "ipa-prop.h", 
!       "ipa-inline.h", "lto-streamer.h","dwarf2out.h", NULL
      };
      const char *const *ifp;
      outf_p gtype_desc_c;
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/gimple-streamer.h 
gcc-trunk-streamer/gcc/gimple-streamer.h
*** gcc-trunk/gcc/gimple-streamer.h     2014-11-05 01:50:41.209568692 -0700
--- gcc-trunk-streamer/gcc/gimple-streamer.h    1969-12-31 17:00:00.000000000 
-0700
***************
*** 1,42 ****
- /* Data structures and functions for streaming GIMPLE.
- 
-    Copyright (C) 2011-2014 Free Software Foundation, Inc.
-    Contributed by Diego Novillo <dnovi...@google.com>
- 
- This file is part of GCC.
- 
- GCC is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 3, or (at your option) any later
- version.
- 
- GCC is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- for more details.
- 
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
- #ifndef GCC_GIMPLE_STREAMER_H
- #define GCC_GIMPLE_STREAMER_H
- 
- #include "hashtab.h"
- #include "hash-set.h"
- #include "vec.h"
- #include "machmode.h"
- #include "tm.h"
- #include "hard-reg-set.h"
- #include "input.h"
- #include "function.h"
- #include "lto-streamer.h"
- 
- /* In gimple-streamer-in.c  */
- void input_bb (struct lto_input_block *, enum LTO_tags, struct data_in *,
-              struct function *, int);
- 
- /* In gimple-streamer-out.c  */
- void output_bb (struct output_block *, basic_block, struct function *);
- 
- #endif  /* GCC_GIMPLE_STREAMER_H  */
--- 0 ----
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/gimple-streamer-in.h 
gcc-trunk-streamer/gcc/gimple-streamer-in.h
*** gcc-trunk/gcc/gimple-streamer-in.h  1969-12-31 17:00:00.000000000 -0700
--- gcc-trunk-streamer/gcc/gimple-streamer-in.h 2014-11-10 20:41:43.799424454 
-0700
***************
*** 0 ****
--- 1,29 ----
+ /* Data structures and functions for streaming GIMPLE in.
+ 
+    Copyright (C) 2011-2014 Free Software Foundation, Inc.
+    Contributed by Michael Collison <colli...@linaro.org>
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_GIMPLE_STREAMER_IN_H
+ #define GCC_GIMPLE_STREAMER_IN_H
+ 
+ /* In gimple-streamer-in.c  */
+ void input_bb (struct lto_input_block *, enum LTO_tags, struct data_in *,
+              struct function *, int);
+ 
+ #endif  /* GCC_GIMPLE_STREAMER_IN_H  */
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/gimple-streamer-out.h 
gcc-trunk-streamer/gcc/gimple-streamer-out.h
*** gcc-trunk/gcc/gimple-streamer-out.h 1969-12-31 17:00:00.000000000 -0700
--- gcc-trunk-streamer/gcc/gimple-streamer-out.h        2014-11-10 
20:41:28.127423695 -0700
***************
*** 0 ****
--- 1,28 ----
+ /* Data structures and functions for streaming GIMPLE out.
+ 
+    Copyright (C) 2011-2014 Free Software Foundation, Inc.
+    Contributed by Michael Collison <colli...@linaro.org>
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_GIMPLE_STREAMER_OUT_H
+ #define GCC_GIMPLE_STREAMER_OUT_H
+ 
+ /* In gimple-streamer-out.c  */
+ void output_bb (struct output_block *, basic_block, struct function *);
+ 
+ #endif  /* GCC_GIMPLE_STREAMER_OUT_H  */
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/lto-streamer.h 
gcc-trunk-streamer/gcc/lto-streamer.h
*** gcc-trunk/gcc/lto-streamer.h        2014-11-05 01:50:41.365568700 -0700
--- gcc-trunk-streamer/gcc/lto-streamer.h       2014-11-11 13:20:13.146323897 
-0700
***************
*** 23,37 ****
  #ifndef GCC_LTO_STREAMER_H
  #define GCC_LTO_STREAMER_H
  
- #include "plugin-api.h"
- #include "hash-table.h"
- #include "hash-map.h"
- #include "target.h"
- #include "vec.h"
- #include "alloc-pool.h"
- #include "gcov-io.h"
- #include "diagnostic.h"
- 
  /* Define when debugging the LTO streamer.  This causes the writer
     to output the numeric value for the memory address of the tree node
     being emitted.  When debugging a problem in the reader, check the
--- 23,28 ----
***************
*** 759,810 ****
  extern void lto_check_version (int, int);
  extern void lto_streamer_hooks_init (void);
  
- /* In lto-streamer-in.c */
- extern void lto_input_cgraph (struct lto_file_decl_data *, const char *);
- extern void lto_reader_init (void);
- extern void lto_input_function_body (struct lto_file_decl_data *,
-                                    struct cgraph_node *,
-                                    const char *);
- extern void lto_input_variable_constructor (struct lto_file_decl_data *,
-                                           struct varpool_node *,
-                                           const char *);
- extern void lto_input_constructors_and_inits (struct lto_file_decl_data *,
-                                             const char *);
- extern void lto_input_toplevel_asms (struct lto_file_decl_data *, int);
- extern struct data_in *lto_data_in_create (struct lto_file_decl_data *,
-                                   const char *, unsigned,
-                                   vec<ld_plugin_symbol_resolution_t> );
- extern void lto_data_in_delete (struct data_in *);
- extern void lto_input_data_block (struct lto_input_block *, void *, size_t);
- location_t lto_input_location (struct bitpack_d *, struct data_in *);
- tree lto_input_tree_ref (struct lto_input_block *, struct data_in *,
-                        struct function *, enum LTO_tags);
- void lto_tag_check_set (enum LTO_tags, int, ...);
- void lto_init_eh (void);
- hashval_t lto_input_scc (struct lto_input_block *, struct data_in *,
-                        unsigned *, unsigned *);
- tree lto_input_tree_1 (struct lto_input_block *, struct data_in *,
-                      enum LTO_tags, hashval_t hash);
- tree lto_input_tree (struct lto_input_block *, struct data_in *);
- 
- 
- /* In lto-streamer-out.c  */
- extern void lto_register_decl_definition (tree, struct lto_file_decl_data *);
- extern struct output_block *create_output_block (enum lto_section_type);
- extern void destroy_output_block (struct output_block *);
- extern void lto_output_tree (struct output_block *, tree, bool, bool);
- extern void lto_output_toplevel_asms (void);
- extern void produce_asm (struct output_block *ob, tree fn);
- extern void lto_output ();
- extern void produce_asm_for_decls ();
- void lto_output_decl_state_streams (struct output_block *,
-                                   struct lto_out_decl_state *);
- void lto_output_decl_state_refs (struct output_block *,
-                                struct lto_output_stream *,
-                                struct lto_out_decl_state *);
- void lto_output_location (struct output_block *, struct bitpack_d *, 
location_t);
- 
- 
  /* In lto-cgraph.c  */
  extern bool asm_nodes_output;
  lto_symtab_encoder_t lto_symtab_encoder_new (bool);
--- 750,755 ----
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/lto-streamer-in.h 
gcc-trunk-streamer/gcc/lto-streamer-in.h
*** gcc-trunk/gcc/lto-streamer-in.h     1969-12-31 17:00:00.000000000 -0700
--- gcc-trunk-streamer/gcc/lto-streamer-in.h    2014-11-18 18:03:46.796414175 
-0700
***************
*** 0 ****
--- 1,47 ----
+ /* Data structures and declarations used for reading
+    GIMPLE from a file stream.
+ 
+    Copyright (C) 2009-2014 Free Software Foundation, Inc.
+    Contributed by Michael Collison <colli...@linaro.org>
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_LTO_STREAMER_IN_H
+ #define GCC_LTO_STREAMER_IN_H
+ 
+ extern void lto_reader_init (void);
+ extern void lto_input_function_body (struct lto_file_decl_data *,
+                                    struct cgraph_node *,
+                                    const char *);
+ extern void lto_input_variable_constructor (struct lto_file_decl_data *,
+                                           struct varpool_node *,
+                                           const char *);
+ extern void lto_input_toplevel_asms (struct lto_file_decl_data *, int);
+ extern struct data_in *lto_data_in_create (struct lto_file_decl_data *,
+                                   const char *, unsigned,
+                                   vec<ld_plugin_symbol_resolution_t> );
+ extern void lto_data_in_delete (struct data_in *);
+ extern location_t lto_input_location (struct bitpack_d *, struct data_in *);
+ extern void lto_tag_check_set (enum LTO_tags, int, ...);
+ extern void lto_init_eh (void);
+ extern hashval_t lto_input_scc (struct lto_input_block *, struct data_in *,
+                        unsigned *, unsigned *);
+ extern tree lto_input_tree_1 (struct lto_input_block *, struct data_in *,
+                      enum LTO_tags, hashval_t hash);
+ extern tree lto_input_tree (struct lto_input_block *, struct data_in *);
+ 
+ #endif /* GCC_LTO_STREAMER_IN_H  */
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/lto-streamer-out.h 
gcc-trunk-streamer/gcc/lto-streamer-out.h
*** gcc-trunk/gcc/lto-streamer-out.h    1969-12-31 17:00:00.000000000 -0700
--- gcc-trunk-streamer/gcc/lto-streamer-out.h   2014-11-18 17:36:09.180333951 
-0700
***************
*** 0 ****
--- 1,35 ----
+ /* Data structures and declarations used for writing
+    GIMPLE to a file stream.
+ 
+    Copyright (C) 2009-2014 Free Software Foundation, Inc.
+    Contributed by Michael Collison <colli...@linaro.org>
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_LTO_STREAMER_OUT_H
+ #define GCC_LTO_STREAMER_OUT_H
+ 
+ extern struct output_block *create_output_block (enum lto_section_type);
+ extern void destroy_output_block (struct output_block *);
+ extern void lto_output_tree (struct output_block *, tree, bool, bool);
+ extern void lto_output_toplevel_asms (void);
+ extern void produce_asm (struct output_block *ob, tree fn);
+ extern void lto_output ();
+ extern void produce_asm_for_decls ();
+ extern void lto_output_location (struct output_block *, struct bitpack_d *, 
location_t);
+ 
+ #endif /* GCC_LTO_STREAMER_OUT_H  */
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/tree-streamer.h 
gcc-trunk-streamer/gcc/tree-streamer.h
*** gcc-trunk/gcc/tree-streamer.h       2014-11-05 01:50:46.541568950 -0700
--- gcc-trunk-streamer/gcc/tree-streamer.h      2014-11-11 15:02:36.222621205 
-0700
***************
*** 22,31 ****
  #ifndef GCC_TREE_STREAMER_H
  #define GCC_TREE_STREAMER_H
  
- #include "streamer-hooks.h"
- #include "lto-streamer.h"
- #include "hash-map.h"
- 
  /* Cache of pickled nodes.  Used to avoid writing the same node more
     than once.  The first time a tree node is streamed out, it is
     entered in this cache.  Subsequent references to the same node are
--- 22,27 ----
***************
*** 69,96 ****
              || DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD));
  }
  
- /* In tree-streamer-in.c.  */
- tree streamer_read_string_cst (struct data_in *, struct lto_input_block *);
- tree streamer_read_chain (struct lto_input_block *, struct data_in *);
- tree streamer_alloc_tree (struct lto_input_block *, struct data_in *,
-                         enum LTO_tags);
- void streamer_read_tree_body (struct lto_input_block *, struct data_in *, 
tree);
- tree streamer_get_pickled_tree (struct lto_input_block *, struct data_in *);
- tree streamer_get_builtin_tree (struct lto_input_block *, struct data_in *);
- struct bitpack_d streamer_read_tree_bitfields (struct lto_input_block *,
-                                              struct data_in *, tree);
- 
- /* In tree-streamer-out.c.  */
- void streamer_write_string_cst (struct output_block *,
-                               struct lto_output_stream *, tree);
- void streamer_write_chain (struct output_block *, tree, bool);
- void streamer_write_tree_header (struct output_block *, tree);
- void streamer_pack_tree_bitfields (struct output_block *, struct bitpack_d *,
-                                  tree);
- void streamer_write_tree_body (struct output_block *, tree, bool);
- void streamer_write_integer_cst (struct output_block *, tree, bool);
- void streamer_write_builtin (struct output_block *, tree);
- 
  /* In tree-streamer.c.  */
  void streamer_check_handled_ts_structures (void);
  bool streamer_tree_cache_insert (struct streamer_tree_cache_d *, tree,
--- 65,70 ----
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/tree-streamer-in.h 
gcc-trunk-streamer/gcc/tree-streamer-in.h
*** gcc-trunk/gcc/tree-streamer-in.h    1969-12-31 17:00:00.000000000 -0700
--- gcc-trunk-streamer/gcc/tree-streamer-in.h   2014-11-11 14:50:02.150584710 
-0700
***************
*** 0 ****
--- 1,35 ----
+ /* Data structures and functions for streaming trees.
+ 
+    Copyright (C) 2011-2014 Free Software Foundation, Inc.
+    Contributed by Michael Collison <colli...@linaro.org>
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_TREE_STREAMER_IN_H
+ #define GCC_TREE_STREAMER_IN_H
+ 
+ tree streamer_read_string_cst (struct data_in *, struct lto_input_block *);
+ tree streamer_read_chain (struct lto_input_block *, struct data_in *);
+ tree streamer_alloc_tree (struct lto_input_block *, struct data_in *,
+                         enum LTO_tags);
+ void streamer_read_tree_body (struct lto_input_block *, struct data_in *, 
tree);
+ tree streamer_get_pickled_tree (struct lto_input_block *, struct data_in *);
+ tree streamer_get_builtin_tree (struct lto_input_block *, struct data_in *);
+ struct bitpack_d streamer_read_tree_bitfields (struct lto_input_block *,
+                                              struct data_in *, tree);
+ 
+ #endif  /* GCC_TREE_STREAMER_IN_H  */
diff -cr --new-file '--exclude=.git' gcc-trunk/gcc/tree-streamer-out.h 
gcc-trunk-streamer/gcc/tree-streamer-out.h
*** gcc-trunk/gcc/tree-streamer-out.h   1969-12-31 17:00:00.000000000 -0700
--- gcc-trunk-streamer/gcc/tree-streamer-out.h  2014-11-11 15:05:10.390628666 
-0700
***************
*** 0 ****
--- 1,36 ----
+ /* Data structures and functions for streaming trees.
+ 
+    Copyright (C) 2011-2014 Free Software Foundation, Inc.
+    Contributed by Michael Collison <colli...@linaro.org>
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_TREE_STREAMER_OUT_H
+ #define GCC_TREE_STREAMER_OUT_H
+ 
+ /* In tree-streamer-out.c.  */
+ void streamer_write_string_cst (struct output_block *,
+                               struct lto_output_stream *, tree);
+ void streamer_write_chain (struct output_block *, tree, bool);
+ void streamer_write_tree_header (struct output_block *, tree);
+ void streamer_pack_tree_bitfields (struct output_block *, struct bitpack_d *,
+                                  tree);
+ void streamer_write_tree_body (struct output_block *, tree, bool);
+ void streamer_write_integer_cst (struct output_block *, tree, bool);
+ void streamer_write_builtin (struct output_block *, tree);
+ 
+ #endif  /* GCC_TREE_STREAMER_OUT_H  */

Reply via email to