This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch to add prototypes


Here's an updated version of a patch to add prototypes in a number of
random places. This one is against egcs-980328.

Bernd

	* c-lex.c (is_class_name): Delete declaration.
	(whitespace_cr): Make static and add prototype.
	* c-lex.h (make_pointer_declarator, reinit_parse_for_function,
	yylex, get_directive_line): Turn declarations into prototypes.
	(position_after_whitespace, check_newline, yyerror,
	forget_protocol_qualifiers, remember_protocol_qualifiers): Add
	prototypes.
	* genattr.c (extend_range, write_upcase, gen_attr, write_units): Add
	prototypes.
	* gencodes.c (gen_insn): Add prototype.
	* genconfig.c (walk_insn, gen_insn, gen_expand, gen_split,
	gen_peephole): Add prototypes.
	* genflags.c (num_operands, gen_proto, gen_nonproto, gen_insn): Add
	prototypes.
	* gengenrtl.c (type_from_format, accessor_from_format, special_rtx,
	special_format, find_formats, gendecl, genmacro, gendef, genlegend,
	genheader, gencode): Add prototypes.
	* genopinit.c (gen_insn): Add prototype.
	* genoutput.c (output_prologue, output_epilogue, scan_operands,
	process_template, validate_insn_alternatives, gen_insn, gen_peephole,
	gen_expand, gen_split, n_occurrences): Add prototypes.
	* genpeep.c (gen_peephole): Add prototype.
	* loop.c (find_and_verify_loops, mark_loop_jump, prescan_loop,
	reg_in_basic_block_p, consec_sets_invariant_p, libcall_other_reg,
	labels_in_range_p, count_loop_regs_set, note_addr_stored,
	loop_reg_used_before_p, scan_loop, replace_call_address,
	skip_consec_insns, libcall_benefit, ignore_some_movables,
	force_movables, combine_movables, rtx_equal_for_loop_p, move_movables,
	strength_reduce, valid_initial_value_p, find_mem_givs, record_biv,
	check_final_value, record_giv, update_giv_derive, basic_induction_var,
	simplify_giv_expr, general_induction_var, consec_sets_giv,
	check_dbra_loop, express_from, combine_givs_p, combine_givs,
	product_cheap_p, maybe_eliminate_biv, maybe_eliminate_biv_1,
	last_use_this_basic_block, record_initial, update_reg_last_use,
	iteration_info, analyze_loop_iterations, insert_bct,
	instrument_loop_bct, indirect_jump_in_function_p): Turn declarations
	into prototypes.

Index: c-lex.c
===================================================================
RCS file: /usr/local/cvs/gcs/gcc/c-lex.c,v
retrieving revision 1.1.1.7
diff -c -p -d -r1.1.1.7 c-lex.c
*** c-lex.c	1998/04/04 16:09:51	1.1.1.7
--- c-lex.c	1998/04/05 14:58:27
*************** tree lastiddecl;
*** 93,100 ****
  
  int doing_objc_thang;
  
- extern tree is_class_name ();
- 
  extern int yydebug;
  
  /* File used for outputting assembler code.  */
--- 93,98 ----
*************** static int nextchar = -1;
*** 129,134 ****
--- 127,133 ----
  #ifdef HANDLE_SYSV_PRAGMA
  static int handle_sysv_pragma		PROTO((int));
  #endif /* HANDLE_SYSV_PRAGMA */
+ static int whitespace_cr		PROTO((int));
  static int skip_white_space		PROTO((int));
  static char *extend_token_buffer	PROTO((char *));
  static int readescape			PROTO((int *));
*************** yyprint (file, yychar, yylval)
*** 334,340 ****
  
  /* Iff C is a carriage return, warn about it - if appropriate -
     and return nonzero.  */
! int
  whitespace_cr (c)
       int c;
  {
--- 333,339 ----
  
  /* Iff C is a carriage return, warn about it - if appropriate -
     and return nonzero.  */
! static int
  whitespace_cr (c)
       int c;
  {
Index: c-lex.h
===================================================================
RCS file: /usr/local/cvs/gcs/gcc/c-lex.h,v
retrieving revision 1.1.1.1
diff -c -p -d -r1.1.1.1 c-lex.h
*** c-lex.h	1998/04/03 10:24:42	1.1.1.1
--- c-lex.h	1998/04/05 14:58:27
*************** extern tree lastiddecl;
*** 73,80 ****
  
  extern char *token_buffer;	/* Pointer to token buffer.  */
  
! extern tree make_pointer_declarator ();
! extern void reinit_parse_for_function ();
! extern int yylex ();
  
! extern char *get_directive_line ();
--- 73,87 ----
  
  extern char *token_buffer;	/* Pointer to token buffer.  */
  
! extern tree make_pointer_declarator PROTO((tree, tree));
! extern void reinit_parse_for_function PROTO((void));
! extern void position_after_whitespace PROTO((void));
! extern int check_newline PROTO((void));
  
! extern int yylex PROTO((void));
! extern void yyerror PROTO((char *));
! 
! extern char *get_directive_line PROTO((FILE *));
! 
! extern void forget_protocol_qualifiers PROTO((void));
! extern void remember_protocol_qualifiers PROTO((void));
Index: genattr.c
diff -c -p -d -r1.1.1.4 genattr.c
*** genattr.c	1998/04/04 16:27:54	1.1.1.4
--- genattr.c	1998/04/05 14:58:32
*************** struct function_unit
*** 57,62 ****
--- 57,68 ----
    struct range issue_delay;	/* Range of issue delay values.  */
  };
  
+ static void extend_range PROTO((struct range *, int, int));
+ static void write_upcase PROTO((char *));
+ static void gen_attr PROTO((rtx));
+ static void write_units PROTO((int, struct range *, struct range *,
+ 			       struct range *, struct range *,
+ 			       struct range *));
  static void
  extend_range (range, min, max)
       struct range *range;
Index: gencodes.c
diff -c -p -d -r1.1.1.2 gencodes.c
*** gencodes.c	1998/04/04 16:27:55	1.1.1.2
--- gencodes.c	1998/04/05 14:58:32
*************** void fancy_abort PROTO((void));
*** 39,44 ****
--- 39,46 ----
  
  static int insn_code_number;
  
+ static void gen_insn PROTO((rtx));
+ 
  static void
  gen_insn (insn)
       rtx insn;
Index: genconfig.c
diff -c -p -d -r1.1.1.5 genconfig.c
*** genconfig.c	1998/04/04 16:27:55	1.1.1.5
--- genconfig.c	1998/04/05 14:58:32
*************** char *xmalloc PROTO((unsigned));
*** 50,55 ****
--- 50,61 ----
  static void fatal ();
  void fancy_abort PROTO((void));
  
+ static void walk_insn_part PROTO((rtx, int, int));
+ static void gen_insn PROTO((rtx));
+ static void gen_expand PROTO((rtx));
+ static void gen_split PROTO((rtx));
+ static void gen_peephole PROTO((rtx));
+ 
  /* RECOG_P will be non-zero if this pattern was seen in a context where it will
     be used to recognize, rather than just generate an insn. 
  
Index: genflags.c
diff -c -p -d -r1.1.1.4 genflags.c
*** genflags.c	1998/04/04 16:27:55	1.1.1.4
--- genflags.c	1998/04/05 14:58:32
*************** static struct obstack call_obstack, norm
*** 46,51 ****
--- 46,57 ----
  /* Max size of names encountered.  */
  static int max_id_len;
  
+ static int num_operands PROTO((rtx));
+ static void gen_proto PROTO((rtx));
+ static void gen_nonproto PROTO((rtx));
+ static void gen_insn PROTO((rtx));
+ 
+ 
  /* Count the number of match_operand's found.  */
  
  static int
Index: gengenrtl.c
diff -c -p -d -r1.1.1.2 gengenrtl.c
*** gengenrtl.c	1998/04/04 14:44:50	1.1.1.2
--- gengenrtl.c	1998/04/05 14:58:32
*************** struct rtx_definition defs[] = 
*** 48,53 ****
--- 48,65 ----
  
  const char *formats[NUM_RTX_CODE];
  
+ static const char *type_from_format PROTO((char));
+ static const char *accessor_from_format PROTO((char));
+ static int special_format PROTO((const char *));
+ static int special_rtx PROTO((int));
+ static void find_formats PROTO((void));
+ static void gendecl PROTO((FILE *, const char *));
+ static void genmacro PROTO((FILE *, int));
+ static void gendef PROTO((FILE *, const char *));
+ static void genlegend PROTO((FILE *));
+ static void genheader PROTO((FILE *));
+ static void gencode PROTO((FILE *));
+ 
  static const char *
  type_from_format (c)
       char c;
Index: genopinit.c
diff -c -p -d -r1.1.1.6 genopinit.c
*** genopinit.c	1998/04/04 16:27:56	1.1.1.6
--- genopinit.c	1998/04/05 14:58:32
*************** char *optabs[] =
*** 124,129 ****
--- 124,131 ----
  /* Allow linking with print-rtl.c.  */
  char **insn_name_ptr;
  
+ static void gen_insn PROTO((rtx));
+ 
  static void
  gen_insn (insn)
       rtx insn;
Index: genoutput.c
diff -c -p -d -r1.1.1.7 genoutput.c
*** genoutput.c	1998/04/04 16:27:56	1.1.1.7
--- genoutput.c	1998/04/05 14:58:33
*************** int have_constraints;
*** 169,178 ****
  
  static int have_error;
  
  static void
  output_prologue ()
  {
- 
    printf ("/* Generated automatically by the program `genoutput'\n\
  from the machine description file `md'.  */\n\n");
  
--- 169,188 ----
  
  static int have_error;
  
+ static void output_prologue PROTO((void));
+ static void output_epilogue PROTO((void));
+ static void scan_operands PROTO((rtx, int, int));
+ static void process_template PROTO((struct data *, char *));
+ static void validate_insn_alternatives PROTO((struct data *));
+ static void gen_insn PROTO((rtx));
+ static void gen_peephole PROTO((rtx));
+ static void gen_expand PROTO((rtx));
+ static void gen_split PROTO((rtx));
+ static int n_occurrences PROTO((int, char *));
+ 
  static void
  output_prologue ()
  {
    printf ("/* Generated automatically by the program `genoutput'\n\
  from the machine description file `md'.  */\n\n");
  
Index: genpeep.c
diff -c -p -d -r1.1.1.8 genpeep.c
*** genpeep.c	1998/04/04 16:27:56	1.1.1.8
--- genpeep.c	1998/04/05 15:02:21
*************** struct link
*** 44,50 ****
  };
  
  char *xmalloc PROTO((unsigned));
- static void match_rtx PROTO((rtx, struct link *, int));
  static void fatal ();
  void fancy_abort PROTO((void));
  
--- 44,49 ----
*************** static int n_operands;
*** 59,64 ****
--- 58,65 ----
  
  static int insn_code_number = 0;
  
+ static void gen_peephole PROTO((rtx));
+ static void match_rtx PROTO((rtx, struct link *, int));
  static void print_path PROTO((struct link *));
  static void print_code PROTO((RTX_CODE));
  
Index: loop.c
diff -c -p -d -r1.1.1.23 loop.c
*** loop.c	1998/04/04 16:27:11	1.1.1.23
--- loop.c	1998/04/05 15:00:35
*************** FILE *loop_dump_stream;
*** 277,343 ****
  
  /* Forward declarations.  */
  
! static void find_and_verify_loops ();
! static void mark_loop_jump ();
! static void prescan_loop ();
! static int reg_in_basic_block_p ();
! static int consec_sets_invariant_p ();
! static rtx libcall_other_reg ();
! static int labels_in_range_p ();
! static void count_loop_regs_set ();
! static void note_addr_stored ();
! static int loop_reg_used_before_p ();
! static void scan_loop ();
  #if 0
! static void replace_call_address ();
  #endif
! static rtx skip_consec_insns ();
! static int libcall_benefit ();
! static void ignore_some_movables ();
! static void force_movables ();
! static void combine_movables ();
! static int rtx_equal_for_loop_p ();
! static void move_movables ();
! static void strength_reduce ();
! static int valid_initial_value_p ();
! static void find_mem_givs ();
! static void record_biv ();
! static void check_final_value ();
! static void record_giv ();
! static void update_giv_derive ();
! static int basic_induction_var ();
! static rtx simplify_giv_expr ();
! static int general_induction_var ();
! static int consec_sets_giv ();
! static int check_dbra_loop ();
! static rtx express_from ();
! static int combine_givs_p ();
! static void combine_givs ();
! static int product_cheap_p ();
! static int maybe_eliminate_biv ();
! static int maybe_eliminate_biv_1 ();
! static int last_use_this_basic_block ();
! static void record_initial ();
! static void update_reg_last_use ();
  
  #ifdef HAIFA
  /* This is extern from unroll.c */
! void iteration_info ();
  
  /* Two main functions for implementing bct:
     first - to be called before loop unrolling, and the second - after */
  #ifdef HAVE_decrement_and_branch_on_count
! static void analyze_loop_iterations ();
! static void insert_bct ();
  
  /* Auxiliary function that inserts the bct pattern into the loop */
! static void instrument_loop_bct ();
  #endif /* HAVE_decrement_and_branch_on_count */
  #endif  /* HAIFA */
  
  /* Indirect_jump_in_function is computed once per function.  */
  int indirect_jump_in_function = 0;
! static int indirect_jump_in_function_p ();
  
  
  /* Relative gain of eliminating various kinds of operations.  */
--- 277,343 ----
  
  /* Forward declarations.  */
  
! static void find_and_verify_loops PROTO((rtx));
! static void mark_loop_jump PROTO((rtx, int));
! static void prescan_loop PROTO((rtx, rtx));
! static int reg_in_basic_block_p PROTO((rtx, rtx));
! static int consec_sets_invariant_p PROTO((rtx, int, rtx));
! static rtx libcall_other_reg PROTO((rtx, rtx));
! static int labels_in_range_p PROTO((rtx, int));
! static void count_loop_regs_set PROTO((rtx, rtx, char *, rtx *, int *, int));
! static void note_addr_stored PROTO((rtx));
! static int loop_reg_used_before_p PROTO((rtx, rtx, rtx, rtx, rtx));
! static void scan_loop PROTO((rtx, rtx, int, int));
  #if 0
! static void replace_call_address PROTO(());
  #endif
! static rtx skip_consec_insns PROTO((rtx, int));
! static int libcall_benefit PROTO((rtx));
! static void ignore_some_movables PROTO((struct movable *));
! static void force_movables PROTO((struct movable *));
! static void combine_movables PROTO((struct movable *, int));
! static int rtx_equal_for_loop_p PROTO((rtx, rtx, struct movable *));
! static void move_movables PROTO((struct movable *, int, int, rtx, rtx, int));
! static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, int));
! static int valid_initial_value_p PROTO((rtx, rtx, int, rtx));
! static void find_mem_givs PROTO((rtx, rtx, int, rtx, rtx));
! static void record_biv PROTO((struct induction *, rtx, rtx, rtx, rtx, int, int));
! static void check_final_value PROTO((struct induction *, rtx, rtx));
! static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, int, enum g_types, int, rtx *, rtx, rtx));
! static void update_giv_derive PROTO((rtx));
! static int basic_induction_var PROTO((rtx, enum machine_mode, rtx, rtx, rtx *, rtx *));
! static rtx simplify_giv_expr PROTO((rtx, int *));
! static int general_induction_var PROTO((rtx, rtx *, rtx *, rtx *));
! static int consec_sets_giv PROTO((int, rtx, rtx, rtx, rtx *, rtx *));
! static int check_dbra_loop PROTO((rtx, int, rtx));
! static rtx express_from PROTO((struct induction *, struct induction *));
! static int combine_givs_p PROTO((struct induction *, struct induction *));
! static void combine_givs PROTO((struct iv_class *));
! static int product_cheap_p PROTO((rtx, rtx));
! static int maybe_eliminate_biv PROTO((struct iv_class *, rtx, rtx, int, int, int));
! static int maybe_eliminate_biv_1 PROTO((rtx, rtx, struct iv_class *, int, rtx));
! static int last_use_this_basic_block PROTO((rtx, rtx));
! static void record_initial PROTO((rtx, rtx));
! static void update_reg_last_use PROTO((rtx, rtx));
  
  #ifdef HAIFA
  /* This is extern from unroll.c */
! extern void iteration_info PROTO((rtx, rtx *, rtx *, rtx, rtx));
  
  /* Two main functions for implementing bct:
     first - to be called before loop unrolling, and the second - after */
  #ifdef HAVE_decrement_and_branch_on_count
! static void analyze_loop_iterations PROTO((rtx, rtx));
! static void insert_bct PROTO((rtx, rtx));
  
  /* Auxiliary function that inserts the bct pattern into the loop */
! static void instrument_loop_bct PROTO((rtx, rtx, rtx));
  #endif /* HAVE_decrement_and_branch_on_count */
  #endif  /* HAIFA */
  
  /* Indirect_jump_in_function is computed once per function.  */
  int indirect_jump_in_function = 0;
! static int indirect_jump_in_function_p PROTO((rtx));
  
  
  /* Relative gain of eliminating various kinds of operations.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]