Patchwork Use coretypes types in headers

login
register
mail settings
Submitter Steven Bosscher
Date July 11, 2012, 7:31 a.m.
Message ID <CABu31nNtsKGNACiBbN8MuQ+=5BY329QV7UdqbraCeoQs6YMw+A@mail.gmail.com>
Download mbox | patch
Permalink /patch/170383/
State New
Headers show

Comments

Steven Bosscher - July 11, 2012, 7:31 a.m.
Hello,

With coretypes included everywhere, there's no need to use the
underlying "struct blah *" method anymore in almost all places.

Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK?

Ciao!
Steven

	* basic-block.h (struct edge_def): Use basic_block instead of
	basic_block_def *.
	* cfgloop.h (struct loop_exit, struct loop): Likewise.
	* gengenrtl.c (type_from_format): Likewise.  Also for 'tree'
	instead of union tree_node *.
	* rtl.h (union rtunion_def, emit_insn_before_noloc,
	emit_insn_after_noloc, add_insn_before, add_insn_after,
	debug_bb_slim): Likewise.
	* tree-inline.h (struct copy_body_data): Likewise.
	* sched-rgn.c (dump_region_dot): Likewise.
	* gimple.h (struct gimple_statement_base, gimple_set_bb,
	gsi_move_to_bb_end): Likewise.
	* sched-vis.c (debug_bb_slim): Likewise.
	(debug_bb_n_slim): Likewise.
	* config/mn10300/mn10300.c (mn10300_insert_setlb_lcc): Likewise.
	(mn10300_block_contains_call):
Richard Guenther - July 11, 2012, 7:46 a.m.
On Wed, Jul 11, 2012 at 9:31 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> With coretypes included everywhere, there's no need to use the
> underlying "struct blah *" method anymore in almost all places.
>
> Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK?

Ok!

Thanks,
Richard.

> Ciao!
> Steven
>
>         * basic-block.h (struct edge_def): Use basic_block instead of
>         basic_block_def *.
>         * cfgloop.h (struct loop_exit, struct loop): Likewise.
>         * gengenrtl.c (type_from_format): Likewise.  Also for 'tree'
>         instead of union tree_node *.
>         * rtl.h (union rtunion_def, emit_insn_before_noloc,
>         emit_insn_after_noloc, add_insn_before, add_insn_after,
>         debug_bb_slim): Likewise.
>         * tree-inline.h (struct copy_body_data): Likewise.
>         * sched-rgn.c (dump_region_dot): Likewise.
>         * gimple.h (struct gimple_statement_base, gimple_set_bb,
>         gsi_move_to_bb_end): Likewise.
>         * sched-vis.c (debug_bb_slim): Likewise.
>         (debug_bb_n_slim): Likewise.
>         * config/mn10300/mn10300.c (mn10300_insert_setlb_lcc): Likewise.
>         (mn10300_block_contains_call):
>
> Index: basic-block.h
> ===================================================================
> --- basic-block.h       (revision 189365)
> +++ basic-block.h       (working copy)
> @@ -35,8 +35,8 @@ typedef HOST_WIDEST_INT gcov_type;
>  /* Control flow edge information.  */
>  struct GTY(()) edge_def {
>    /* The two blocks at the ends of the edge.  */
> -  struct basic_block_def *src;
> -  struct basic_block_def *dest;
> +  basic_block src;
> +  basic_block dest;
>
>    /* Instructions queued on the edge.  */
>    union edge_def_insns {
> @@ -161,8 +161,8 @@ struct GTY((chain_next ("%h.next_bb"), c
>    struct et_node * GTY ((skip (""))) dom[2];
>
>    /* Previous and next blocks in the chain.  */
> -  struct basic_block_def *prev_bb;
> -  struct basic_block_def *next_bb;
> +  basic_block prev_bb;
> +  basic_block next_bb;
>
>    union basic_block_il_dependent {
>        struct gimple_bb_info GTY ((tag ("0"))) gimple;
> Index: cfgloop.h
> ===================================================================
> --- cfgloop.h   (revision 189365)
> +++ cfgloop.h   (working copy)
> @@ -80,7 +80,7 @@ struct GTY ((chain_next ("%h.next"))) nb
>
>  struct GTY (()) loop_exit {
>    /* The exit edge.  */
> -  struct edge_def *e;
> +  edge e;
>
>    /* Previous and next exit in the list of the exits of the loop.  */
>    struct loop_exit *prev;
> @@ -114,10 +114,10 @@ struct GTY ((chain_next ("%h.next"))) lo
>    unsigned ninsns;
>
>    /* Basic block of loop header.  */
> -  struct basic_block_def *header;
> +  basic_block header;
>
>    /* Basic block of loop latch.  */
> -  struct basic_block_def *latch;
> +  basic_block latch;
>
>    /* For loop unrolling/peeling decision.  */
>    struct lpt_decision lpt_decision;
> Index: gengenrtl.c
> ===================================================================
> --- gengenrtl.c (revision 189365)
> +++ gengenrtl.c (working copy)
> @@ -64,9 +64,9 @@ type_from_format (int c)
>      case 'E':
>        return "rtvec ";
>      case 't':
> -      return "union tree_node *";  /* tree - typedef not available */
> +      return "tree ";
>      case 'B':
> -      return "struct basic_block_def *";  /* basic block - typedef
> not available */
> +      return "basic_block ";
>      default:
>        gcc_unreachable ();
>      }
> Index: rtl.h
> ===================================================================
> --- rtl.h       (revision 189365)
> +++ rtl.h       (working copy)
> @@ -196,7 +196,7 @@ union rtunion_def
>    addr_diff_vec_flags rt_addr_diff_vec_flags;
>    struct cselib_val_struct *rt_cselib;
>    tree rt_tree;
> -  struct basic_block_def *rt_bb;
> +  basic_block rt_bb;
>    mem_attrs *rt_mem;
>    reg_attrs *rt_reg;
>    struct constant_descriptor_rtx *rt_constant;
> @@ -1735,7 +1735,7 @@ extern rtx assign_temp (tree, int, int);
>
>  /* In emit-rtl.c */
>  extern rtx emit_insn_before (rtx, rtx);
> -extern rtx emit_insn_before_noloc (rtx, rtx, struct basic_block_def *);
> +extern rtx emit_insn_before_noloc (rtx, rtx, basic_block);
>  extern rtx emit_insn_before_setloc (rtx, rtx, int);
>  extern rtx emit_jump_insn_before (rtx, rtx);
>  extern rtx emit_jump_insn_before_noloc (rtx, rtx);
> @@ -1750,7 +1750,7 @@ extern rtx emit_barrier_before (rtx);
>  extern rtx emit_label_before (rtx, rtx);
>  extern rtx emit_note_before (enum insn_note, rtx);
>  extern rtx emit_insn_after (rtx, rtx);
> -extern rtx emit_insn_after_noloc (rtx, rtx, struct basic_block_def *);
> +extern rtx emit_insn_after_noloc (rtx, rtx, basic_block);
>  extern rtx emit_insn_after_setloc (rtx, rtx, int);
>  extern rtx emit_jump_insn_after (rtx, rtx);
>  extern rtx emit_jump_insn_after_noloc (rtx, rtx);
> @@ -2435,8 +2435,8 @@ extern void unshare_all_rtl_in_chain (rt
>  extern void verify_rtl_sharing (void);
>  extern void link_cc0_insns (rtx);
>  extern void add_insn (rtx);
> -extern void add_insn_before (rtx, rtx, struct basic_block_def *);
> -extern void add_insn_after (rtx, rtx, struct basic_block_def *);
> +extern void add_insn_before (rtx, rtx, basic_block);
> +extern void add_insn_after (rtx, rtx, basic_block);
>  extern void remove_insn (rtx);
>  extern rtx emit (rtx);
>  extern void delete_insn (rtx);
> @@ -2463,7 +2463,7 @@ extern void delete_dead_jumptables (void
>
>  /* In sched-vis.c.  */
>  extern void debug_bb_n_slim (int);
> -extern void debug_bb_slim (struct basic_block_def *);
> +extern void debug_bb_slim (basic_block);
>  extern void print_rtl_slim (FILE *, rtx, rtx, int, int);
>  extern void print_rtl_slim_with_bb (FILE *, rtx, int);
>  extern void dump_insn_slim (FILE *f, rtx x);
> Index: tree-inline.h
> ===================================================================
> --- tree-inline.h       (revision 189365)
> +++ tree-inline.h       (working copy)
> @@ -116,7 +116,7 @@ typedef struct copy_body_data
>    struct pointer_set_t *statements_to_fold;
>
>    /* Entry basic block to currently copied body.  */
> -  struct basic_block_def *entry_bb;
> +  basic_block entry_bb;
>
>    /* Debug statements that need processing.  */
>    VEC(gimple,heap) *debug_stmts;
> Index: sched-rgn.c
> ===================================================================
> --- sched-rgn.c (revision 189365)
> +++ sched-rgn.c (working copy)
> @@ -435,7 +435,7 @@ dump_region_dot (FILE *f, int rgn)
>        edge e;
>        edge_iterator ei;
>        int src_bb_num = rgn_bb_table[current_blocks + i];
> -      struct basic_block_def *bb = BASIC_BLOCK (src_bb_num);
> +      basic_block bb = BASIC_BLOCK (src_bb_num);
>
>        FOR_EACH_EDGE (e, ei, bb->succs)
>          if (bb_in_region_p (e->dest->index, rgn))
> Index: gimple.h
> ===================================================================
> --- gimple.h    (revision 189365)
> +++ gimple.h    (working copy)
> @@ -200,7 +200,7 @@ struct GTY(()) gimple_statement_base {
>
>    /* [ WORD 3 ]
>       Basic block holding this statement.  */
> -  struct basic_block_def *bb;
> +  basic_block bb;
>
>    /* [ WORD 4-5 ]
>       Linked lists of gimple statements.  The next pointers form
> @@ -818,7 +818,7 @@ void gimple_call_reset_alias_info (gimpl
>  bool gimple_assign_copy_p (gimple);
>  bool gimple_assign_ssa_name_copy_p (gimple);
>  bool gimple_assign_unary_nop_p (gimple);
> -void gimple_set_bb (gimple, struct basic_block_def *);
> +void gimple_set_bb (gimple, basic_block);
>  void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
>  void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code,
>                                        tree, tree, tree);
> @@ -1186,7 +1186,7 @@ gimple_has_substatements (gimple g)
>
>  /* Return the basic block holding statement G.  */
>
> -static inline struct basic_block_def *
> +static inline basic_block
>  gimple_bb (const_gimple g)
>  {
>    return g->gsbase.bb;
> @@ -5190,7 +5190,7 @@ bool gsi_remove (gimple_stmt_iterator *,
>  gimple_stmt_iterator gsi_for_stmt (gimple);
>  void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
>  void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
> -void gsi_move_to_bb_end (gimple_stmt_iterator *, struct basic_block_def *);
> +void gsi_move_to_bb_end (gimple_stmt_iterator *, basic_block);
>  void gsi_insert_on_edge (edge, gimple);
>  void gsi_insert_seq_on_edge (edge, gimple_seq);
>  basic_block gsi_insert_on_edge_immediate (edge, gimple);
> Index: sched-vis.c
> ===================================================================
> --- sched-vis.c (revision 189365)
> +++ sched-vis.c (working copy)
> @@ -833,7 +833,7 @@ print_rtl_slim (FILE *f, rtx first, rtx
>  }
>
>  DEBUG_FUNCTION void
> -debug_bb_slim (struct basic_block_def *bb)
> +debug_bb_slim (basic_block bb)
>  {
>    print_rtl_slim (stderr, BB_HEAD (bb), BB_END (bb), -1, 32);
>  }
> @@ -841,7 +841,7 @@ debug_bb_slim (struct basic_block_def *b
>  DEBUG_FUNCTION void
>  debug_bb_n_slim (int n)
>  {
> -  struct basic_block_def *bb = BASIC_BLOCK (n);
> +  basic_block bb = BASIC_BLOCK (n);
>    debug_bb_slim (bb);
>  }
>
> Index: config/mn10300/mn10300.c
> ===================================================================
> --- config/mn10300/mn10300.c    (revision 189365)
> +++ config/mn10300/mn10300.c    (working copy)
> @@ -3178,7 +3178,7 @@ mn10300_insert_setlb_lcc (rtx label, rtx
>  }
>
>  static bool
> -mn10300_block_contains_call (struct basic_block_def * block)
> +mn10300_block_contains_call (basic_block block)
>  {
>    rtx insn;

Patch

Index: basic-block.h
===================================================================
--- basic-block.h	(revision 189365)
+++ basic-block.h	(working copy)
@@ -35,8 +35,8 @@  typedef HOST_WIDEST_INT gcov_type;
 /* Control flow edge information.  */
 struct GTY(()) edge_def {
   /* The two blocks at the ends of the edge.  */
-  struct basic_block_def *src;
-  struct basic_block_def *dest;
+  basic_block src;
+  basic_block dest;

   /* Instructions queued on the edge.  */
   union edge_def_insns {
@@ -161,8 +161,8 @@  struct GTY((chain_next ("%h.next_bb"), c
   struct et_node * GTY ((skip (""))) dom[2];

   /* Previous and next blocks in the chain.  */
-  struct basic_block_def *prev_bb;
-  struct basic_block_def *next_bb;
+  basic_block prev_bb;
+  basic_block next_bb;

   union basic_block_il_dependent {
       struct gimple_bb_info GTY ((tag ("0"))) gimple;
Index: cfgloop.h
===================================================================
--- cfgloop.h	(revision 189365)
+++ cfgloop.h	(working copy)
@@ -80,7 +80,7 @@  struct GTY ((chain_next ("%h.next"))) nb

 struct GTY (()) loop_exit {
   /* The exit edge.  */
-  struct edge_def *e;
+  edge e;

   /* Previous and next exit in the list of the exits of the loop.  */
   struct loop_exit *prev;
@@ -114,10 +114,10 @@  struct GTY ((chain_next ("%h.next"))) lo
   unsigned ninsns;

   /* Basic block of loop header.  */
-  struct basic_block_def *header;
+  basic_block header;

   /* Basic block of loop latch.  */
-  struct basic_block_def *latch;
+  basic_block latch;

   /* For loop unrolling/peeling decision.  */
   struct lpt_decision lpt_decision;
Index: gengenrtl.c
===================================================================
--- gengenrtl.c	(revision 189365)
+++ gengenrtl.c	(working copy)
@@ -64,9 +64,9 @@  type_from_format (int c)
     case 'E':
       return "rtvec ";
     case 't':
-      return "union tree_node *";  /* tree - typedef not available */
+      return "tree ";
     case 'B':
-      return "struct basic_block_def *";  /* basic block - typedef
not available */
+      return "basic_block ";
     default:
       gcc_unreachable ();
     }
Index: rtl.h
===================================================================
--- rtl.h	(revision 189365)
+++ rtl.h	(working copy)
@@ -196,7 +196,7 @@  union rtunion_def
   addr_diff_vec_flags rt_addr_diff_vec_flags;
   struct cselib_val_struct *rt_cselib;
   tree rt_tree;
-  struct basic_block_def *rt_bb;
+  basic_block rt_bb;
   mem_attrs *rt_mem;
   reg_attrs *rt_reg;
   struct constant_descriptor_rtx *rt_constant;
@@ -1735,7 +1735,7 @@  extern rtx assign_temp (tree, int, int);

 /* In emit-rtl.c */
 extern rtx emit_insn_before (rtx, rtx);
-extern rtx emit_insn_before_noloc (rtx, rtx, struct basic_block_def *);
+extern rtx emit_insn_before_noloc (rtx, rtx, basic_block);
 extern rtx emit_insn_before_setloc (rtx, rtx, int);
 extern rtx emit_jump_insn_before (rtx, rtx);
 extern rtx emit_jump_insn_before_noloc (rtx, rtx);
@@ -1750,7 +1750,7 @@  extern rtx emit_barrier_before (rtx);
 extern rtx emit_label_before (rtx, rtx);
 extern rtx emit_note_before (enum insn_note, rtx);
 extern rtx emit_insn_after (rtx, rtx);
-extern rtx emit_insn_after_noloc (rtx, rtx, struct basic_block_def *);
+extern rtx emit_insn_after_noloc (rtx, rtx, basic_block);
 extern rtx emit_insn_after_setloc (rtx, rtx, int);
 extern rtx emit_jump_insn_after (rtx, rtx);
 extern rtx emit_jump_insn_after_noloc (rtx, rtx);
@@ -2435,8 +2435,8 @@  extern void unshare_all_rtl_in_chain (rt
 extern void verify_rtl_sharing (void);
 extern void link_cc0_insns (rtx);
 extern void add_insn (rtx);
-extern void add_insn_before (rtx, rtx, struct basic_block_def *);
-extern void add_insn_after (rtx, rtx, struct basic_block_def *);
+extern void add_insn_before (rtx, rtx, basic_block);
+extern void add_insn_after (rtx, rtx, basic_block);
 extern void remove_insn (rtx);
 extern rtx emit (rtx);
 extern void delete_insn (rtx);
@@ -2463,7 +2463,7 @@  extern void delete_dead_jumptables (void

 /* In sched-vis.c.  */
 extern void debug_bb_n_slim (int);
-extern void debug_bb_slim (struct basic_block_def *);
+extern void debug_bb_slim (basic_block);
 extern void print_rtl_slim (FILE *, rtx, rtx, int, int);
 extern void print_rtl_slim_with_bb (FILE *, rtx, int);
 extern void dump_insn_slim (FILE *f, rtx x);
Index: tree-inline.h
===================================================================
--- tree-inline.h	(revision 189365)
+++ tree-inline.h	(working copy)
@@ -116,7 +116,7 @@  typedef struct copy_body_data
   struct pointer_set_t *statements_to_fold;

   /* Entry basic block to currently copied body.  */
-  struct basic_block_def *entry_bb;
+  basic_block entry_bb;

   /* Debug statements that need processing.  */
   VEC(gimple,heap) *debug_stmts;
Index: sched-rgn.c
===================================================================
--- sched-rgn.c	(revision 189365)
+++ sched-rgn.c	(working copy)
@@ -435,7 +435,7 @@  dump_region_dot (FILE *f, int rgn)
       edge e;
       edge_iterator ei;
       int src_bb_num = rgn_bb_table[current_blocks + i];
-      struct basic_block_def *bb = BASIC_BLOCK (src_bb_num);
+      basic_block bb = BASIC_BLOCK (src_bb_num);

       FOR_EACH_EDGE (e, ei, bb->succs)
         if (bb_in_region_p (e->dest->index, rgn))
Index: gimple.h
===================================================================
--- gimple.h	(revision 189365)
+++ gimple.h	(working copy)
@@ -200,7 +200,7 @@  struct GTY(()) gimple_statement_base {

   /* [ WORD 3 ]
      Basic block holding this statement.  */
-  struct basic_block_def *bb;
+  basic_block bb;

   /* [ WORD 4-5 ]
      Linked lists of gimple statements.  The next pointers form
@@ -818,7 +818,7 @@  void gimple_call_reset_alias_info (gimpl
 bool gimple_assign_copy_p (gimple);
 bool gimple_assign_ssa_name_copy_p (gimple);
 bool gimple_assign_unary_nop_p (gimple);
-void gimple_set_bb (gimple, struct basic_block_def *);
+void gimple_set_bb (gimple, basic_block);
 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code,
 				       tree, tree, tree);
@@ -1186,7 +1186,7 @@  gimple_has_substatements (gimple g)

 /* Return the basic block holding statement G.  */

-static inline struct basic_block_def *
+static inline basic_block
 gimple_bb (const_gimple g)
 {
   return g->gsbase.bb;
@@ -5190,7 +5190,7 @@  bool gsi_remove (gimple_stmt_iterator *,
 gimple_stmt_iterator gsi_for_stmt (gimple);
 void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
 void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
-void gsi_move_to_bb_end (gimple_stmt_iterator *, struct basic_block_def *);
+void gsi_move_to_bb_end (gimple_stmt_iterator *, basic_block);
 void gsi_insert_on_edge (edge, gimple);
 void gsi_insert_seq_on_edge (edge, gimple_seq);
 basic_block gsi_insert_on_edge_immediate (edge, gimple);
Index: sched-vis.c
===================================================================
--- sched-vis.c	(revision 189365)
+++ sched-vis.c	(working copy)
@@ -833,7 +833,7 @@  print_rtl_slim (FILE *f, rtx first, rtx
 }

 DEBUG_FUNCTION void
-debug_bb_slim (struct basic_block_def *bb)
+debug_bb_slim (basic_block bb)
 {
   print_rtl_slim (stderr, BB_HEAD (bb), BB_END (bb), -1, 32);
 }
@@ -841,7 +841,7 @@  debug_bb_slim (struct basic_block_def *b
 DEBUG_FUNCTION void
 debug_bb_n_slim (int n)
 {
-  struct basic_block_def *bb = BASIC_BLOCK (n);
+  basic_block bb = BASIC_BLOCK (n);
   debug_bb_slim (bb);
 }

Index: config/mn10300/mn10300.c
===================================================================
--- config/mn10300/mn10300.c	(revision 189365)
+++ config/mn10300/mn10300.c	(working copy)
@@ -3178,7 +3178,7 @@  mn10300_insert_setlb_lcc (rtx label, rtx
 }

 static bool
-mn10300_block_contains_call (struct basic_block_def * block)
+mn10300_block_contains_call (basic_block block)
 {
   rtx insn;