From patchwork Wed Jul 11 07:31:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 170383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E95A12C01FF for ; Wed, 11 Jul 2012 17:31:57 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1342596718; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:From:Date:Message-ID:Subject:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=6KGwFKN xCyQhNcQ9O0RiEuJV6OY=; b=D1+cJj37/2f+mT0f6FxssTu5/q5aVVBh5yjQQd2 WhZ2o2ewSimL4Ipp1MfDgNClm8FmNbOacTyQsjXoAYrvIyJibXJAtDptzMafnQXT 2CV3NA9fsqdh20WMUl5SvaJqY8c5yfkIRjS0DIbpC1WKXs/x1aPC6pQYdV2cFgpK vJaI= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:MIME-Version:Received:From:Date:Message-ID:Subject:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=JimvY+IRp3kBX9yBR6sEj/VniX0F7CjVNKP5YQXxJDuAA9fThxKqf6W10hUxdu HdH4cKlytxsJNkCWUYNjepdamGraGON1QYiGzxzqDb9cIh4uOexonts/KUQXekOC j/rP+baSMvpm05OkoFcaGkHSlrZ/2jYL0+6fW6OFSLla0=; Received: (qmail 2779 invoked by alias); 11 Jul 2012 07:31:48 -0000 Received: (qmail 2532 invoked by uid 22791); 11 Jul 2012 07:31:45 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_TM X-Spam-Check-By: sourceware.org Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Jul 2012 07:31:29 +0000 Received: by lbol5 with SMTP id l5so1485025lbo.20 for ; Wed, 11 Jul 2012 00:31:28 -0700 (PDT) Received: by 10.112.43.67 with SMTP id u3mr21402342lbl.16.1341991888002; Wed, 11 Jul 2012 00:31:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.4.229 with HTTP; Wed, 11 Jul 2012 00:31:06 -0700 (PDT) From: Steven Bosscher Date: Wed, 11 Jul 2012 09:31:06 +0200 Message-ID: Subject: [patch] Use coretypes types in headers To: GCC Patches X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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): 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;