diff options
author | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-01 15:59:10 +0000 |
---|---|---|
committer | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-01 15:59:10 +0000 |
commit | 1a97be37b9acd218052a467f7b1a26d3be1154f9 (patch) | |
tree | 1ed2af1b719c9ea42b10268e89af837f6cc20554 /gcc | |
parent | 157ed81477280b70dd98c8ffdec26b827d15bdfa (diff) | |
download | gcc-1a97be37b9acd218052a467f7b1a26d3be1154f9.tar.gz |
* genrecog.c: Use ISO C90 prototypes.
(nodes_identical): Correct declaration to match prototype.
(maybe_both_true): Likewise.
(merge_trees): Likewise.
* genpeep.c (gen_peephole): Remove #if 0 code.
Use ISO C90 prototypes.
* genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.
Remove #if 0'ed function simplify_by_alternatives.
(optimize_attrs): Remove #if 0'ed code.
Remove ^L.
Use ISO C90 prototypes.
(make_canonical): Remove #if 0'ed code.
(convert_const_symbol_ref): Remove #if 0'ed function.
* gen-protos.c (main): Check for argument.
* rtl.h: Use ISO C90 prototypes for functions from lists.c.
* params.h: Use ISO C90 prototypes.
* params.c: Likewise.
* intl.c: Likewise.
* intl.h: Likewise.
* lists.c: Likewise.
* errors.c: Likewise.
* errors.h: Likewise.
* gencodes.c: Likewise.
* genpreds.c: Likewise.
* genattr.c: Likewise.
* gen-protos.c: Likewise.
* genflags.c: Likewise
* genconditions.c: Likewise.
* genautomata.c: Likewise.
* gencheck.c: Likewise.
* genconfig.c: Likewise.
* genconstants.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
* gengenrtl.c: Likewise.
* gengtype.c: Likewise.
* gengtype.h: Likewise.
* genopinit.c: Likewise.
* genoutput.c: Likewise.
* gensupport.c: Likewise.
* gensupport.h: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67296 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 47 | ||||
-rw-r--r-- | gcc/errors.c | 19 | ||||
-rw-r--r-- | gcc/errors.h | 15 | ||||
-rw-r--r-- | gcc/gen-protos.c | 26 | ||||
-rw-r--r-- | gcc/genattr.c | 125 | ||||
-rw-r--r-- | gcc/genautomata.c | 1705 | ||||
-rw-r--r-- | gcc/gencheck.c | 13 | ||||
-rw-r--r-- | gcc/gencodes.c | 17 | ||||
-rw-r--r-- | gcc/genconditions.c | 29 | ||||
-rw-r--r-- | gcc/genconfig.c | 45 | ||||
-rw-r--r-- | gcc/genconstants.c | 15 | ||||
-rw-r--r-- | gcc/genemit.c | 85 | ||||
-rw-r--r-- | gcc/genextract.c | 45 | ||||
-rw-r--r-- | gcc/genflags.c | 47 | ||||
-rw-r--r-- | gcc/gengenrtl.c | 68 | ||||
-rw-r--r-- | gcc/gengtype.c | 633 | ||||
-rw-r--r-- | gcc/gengtype.h | 52 | ||||
-rw-r--r-- | gcc/genopinit.c | 14 | ||||
-rw-r--r-- | gcc/genoutput.c | 121 | ||||
-rw-r--r-- | gcc/genpeep.c | 54 | ||||
-rw-r--r-- | gcc/genpreds.c | 10 | ||||
-rw-r--r-- | gcc/genrecog.c | 269 | ||||
-rw-r--r-- | gcc/gensupport.c | 141 | ||||
-rw-r--r-- | gcc/gensupport.h | 20 | ||||
-rw-r--r-- | gcc/intl.c | 10 | ||||
-rw-r--r-- | gcc/intl.h | 6 | ||||
-rw-r--r-- | gcc/lists.c | 26 | ||||
-rw-r--r-- | gcc/params.c | 10 | ||||
-rw-r--r-- | gcc/params.h | 8 | ||||
-rw-r--r-- | gcc/rtl.h | 78 |
30 files changed, 1564 insertions, 2189 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a100bbc359e..56ddb829786 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,52 @@ 2003-06-01 Andreas Jaeger <aj@suse.de> + * genrecog.c: Use ISO C90 prototypes. + (nodes_identical): Correct declaration to match prototype. + (maybe_both_true): Likewise. + (merge_trees): Likewise. + + * genpeep.c (gen_peephole): Remove #if 0 code. + Use ISO C90 prototypes. + + * genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code. + Remove #if 0'ed function simplify_by_alternatives. + (optimize_attrs): Remove #if 0'ed code. + Remove ^L. + Use ISO C90 prototypes. + (make_canonical): Remove #if 0'ed code. + (convert_const_symbol_ref): Remove #if 0'ed function. + + * gen-protos.c (main): Check for argument. + + * rtl.h: Use ISO C90 prototypes for functions from lists.c. + + * params.h: Use ISO C90 prototypes. + * params.c: Likewise. + * intl.c: Likewise. + * intl.h: Likewise. + * lists.c: Likewise. + * errors.c: Likewise. + * errors.h: Likewise. + * gencodes.c: Likewise. + * genpreds.c: Likewise. + * genattr.c: Likewise. + * gen-protos.c: Likewise. + * genflags.c: Likewise + * genconditions.c: Likewise. + * genautomata.c: Likewise. + * gencheck.c: Likewise. + * genconfig.c: Likewise. + * genconstants.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * gengenrtl.c: Likewise. + * gengtype.c: Likewise. + * gengtype.h: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * gensupport.c: Likewise. + * gensupport.h: Likewise. + * sdbout.h: Use ISO C90 prototypes. * sdbout.c (CONTIN): Removed empty macro. diff --git a/gcc/errors.c b/gcc/errors.c index 4147b3fcf0a..6cbc29c47e3 100644 --- a/gcc/errors.c +++ b/gcc/errors.c @@ -1,5 +1,6 @@ /* Basic error reporting routines. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -42,7 +43,7 @@ void warning (const char *format, ...) { va_list ap; - + va_start (ap, format); fprintf (stderr, "%s: warning: ", progname); vfprintf (stderr, format, ap); @@ -57,7 +58,7 @@ void error (const char *format, ...) { va_list ap; - + va_start (ap, format); fprintf (stderr, "%s: ", progname); vfprintf (stderr, format, ap); @@ -74,7 +75,7 @@ void fatal (const char *format, ...) { va_list ap; - + va_start (ap, format); fprintf (stderr, "%s: ", progname); vfprintf (stderr, format, ap); @@ -89,7 +90,7 @@ void internal_error (const char *format, ...) { va_list ap; - + va_start (ap, format); fprintf (stderr, "%s: Internal error: ", progname); vfprintf (stderr, format, ap); @@ -105,8 +106,7 @@ internal_error (const char *format, ...) version if for the gen* programs and so needn't handle subdirectories. */ const char * -trim_filename (name) - const char *name; +trim_filename (const char *name) { static const char this_file[] = __FILE__; const char *p = name, *q = this_file; @@ -130,10 +130,7 @@ trim_filename (name) This file is used only by build programs, so we're not as polite as the version in diagnostic.c. */ void -fancy_abort (file, line, func) - const char *file; - int line; - const char *func; +fancy_abort (const char *file, int line, const char *func) { internal_error ("abort in %s, at %s:%d", func, file, line); } diff --git a/gcc/errors.h b/gcc/errors.h index b48f855554f..9e0bf1e8e01 100644 --- a/gcc/errors.h +++ b/gcc/errors.h @@ -1,5 +1,6 @@ /* Basic error reporting routines. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -29,12 +30,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef GCC_ERRORS_H #define GCC_ERRORS_H -extern void warning PARAMS ((const char *, ...)); -extern void error PARAMS ((const char *, ...)); -extern void fatal PARAMS ((const char *, ...)) ATTRIBUTE_NORETURN; -extern void internal_error PARAMS ((const char *, ...)) ATTRIBUTE_NORETURN; -extern const char *trim_filename PARAMS ((const char *)); -extern void fancy_abort PARAMS ((const char *, int, const char *)) +extern void warning (const char *, ...); +extern void error (const char *, ...); +extern void fatal (const char *, ...) ATTRIBUTE_NORETURN; +extern void internal_error (const char *, ...) ATTRIBUTE_NORETURN; +extern const char *trim_filename (const char *); +extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; extern int have_error; diff --git a/gcc/gen-protos.c b/gcc/gen-protos.c index a7814429130..64ef406cf88 100644 --- a/gcc/gen-protos.c +++ b/gcc/gen-protos.c @@ -1,6 +1,6 @@ /* gen-protos.c - massages a list of prototypes, for use by fixproto. Copyright (C) 1993, 1994, 1995, 1996, 1998, - 1999 Free Software Foundation, Inc. + 1999, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -26,8 +26,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ int verbose = 0; const char *progname; -static void add_hash PARAMS ((const char *)); -static int parse_fn_proto PARAMS ((char *, char *, struct fn_decl *)); +static void add_hash (const char *); +static int parse_fn_proto (char *, char *, struct fn_decl *); #define HASH_SIZE 2503 /* a prime */ int hash_tab[HASH_SIZE]; @@ -35,8 +35,7 @@ int next_index; int collisions; static void -add_hash (fname) - const char *fname; +add_hash (const char *fname) { int i, i0; @@ -67,9 +66,7 @@ add_hash (fname) The fields of FN point to the input string. */ static int -parse_fn_proto (start, end, fn) - char *start, *end; - struct fn_decl *fn; +parse_fn_proto (char *start, char *end, struct fn_decl *fn) { char *ptr; int param_nesting = 1; @@ -131,12 +128,8 @@ parse_fn_proto (start, end, fn) return 1; } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv; +main (int argc, char **argv) { FILE *inf = stdin; FILE *outf = stdout; @@ -144,6 +137,9 @@ main (argc, argv) sstring linebuf; struct fn_decl fn_decl; + if (argc <= 1) + fatal ("no input file name"); + i = strlen (argv[0]); while (i > 0 && argv[0][i-1] != '/') --i; progname = &argv[0][i]; @@ -155,7 +151,7 @@ main (argc, argv) /* A hash table entry of 0 means "unused" so reserve it. */ fprintf (outf, " {\"\", \"\", \"\", 0},\n"); next_index = 1; - + for (;;) { int c = skip_spaces (inf, ' '); @@ -192,6 +188,6 @@ main (argc, argv) fprintf (stderr, "gen-protos: %d entries %d collisions\n", next_index, collisions); - + return 0; } diff --git a/gcc/genattr.c b/gcc/genattr.c index 9f512a7ce9f..9914384da38 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -1,5 +1,6 @@ /* Generate attribute information (insn-attr.h) from machine description. - Copyright (C) 1991, 1994, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1991, 1994, 1996, 1998, 1999, 2000, 2003 + Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. @@ -51,52 +52,46 @@ struct function_unit struct range issue_delay; /* Range of issue delay values. */ }; -static void extend_range PARAMS ((struct range *, int, int)); -static void init_range PARAMS ((struct range *)); -static void write_upcase PARAMS ((const char *)); -static void gen_attr PARAMS ((rtx)); -static void write_units PARAMS ((int, struct range *, struct range *, - struct range *, struct range *, - struct range *)); +static void extend_range (struct range *, int, int); +static void init_range (struct range *); +static void write_upcase (const char *); +static void gen_attr (rtx); +static void write_units (int, struct range *, struct range *, + struct range *, struct range *, + struct range *); static void -extend_range (range, min, max) - struct range *range; - int min; - int max; +extend_range (struct range *range, int min, int max) { if (range->min > min) range->min = min; if (range->max < max) range->max = max; } static void -init_range (range) - struct range *range; +init_range (struct range *range) { range->min = 100000; range->max = -1; } static void -write_upcase (str) - const char *str; +write_upcase (const char *str) { for (; *str; str++) putchar (TOUPPER(*str)); } static void -gen_attr (attr) - rtx attr; +gen_attr (rtx attr) { const char *p, *tag; - int is_const = GET_CODE (XEXP (attr, 2)) == CONST; + int is_const = GET_CODE (XEXP (attr, 2)) == CONST; printf ("#define HAVE_ATTR_%s\n", XSTR (attr, 0)); /* If numeric attribute, don't need to write an enum. */ p = XSTR (attr, 1); if (*p == '\0') - printf ("extern int get_attr_%s PARAMS ((%s));\n", XSTR (attr, 0), + printf ("extern int get_attr_%s (%s);\n", XSTR (attr, 0), (is_const ? "void" : "rtx")); else { @@ -113,7 +108,7 @@ gen_attr (attr) } fputs ("};\n", stdout); - printf ("extern enum attr_%s get_attr_%s PARAMS ((%s));\n\n", + printf ("extern enum attr_%s get_attr_%s (%s);\n\n", XSTR (attr, 0), XSTR (attr, 0), (is_const ? "void" : "rtx")); } @@ -122,29 +117,24 @@ gen_attr (attr) if (! strcmp (XSTR (attr, 0), "length")) { puts ("\ -extern void shorten_branches PARAMS ((rtx));\n\ -extern int insn_default_length PARAMS ((rtx));\n\ -extern int insn_variable_length_p PARAMS ((rtx));\n\ -extern int insn_current_length PARAMS ((rtx));\n\n\ +extern void shorten_branches (rtx);\n\ +extern int insn_default_length (rtx);\n\ +extern int insn_variable_length_p (rtx);\n\ +extern int insn_current_length (rtx);\n\n\ #include \"insn-addr.h\"\n"); } } static void -write_units (num_units, multiplicity, simultaneity, - ready_cost, issue_delay, blockage) - int num_units; - struct range *multiplicity; - struct range *simultaneity; - struct range *ready_cost; - struct range *issue_delay; - struct range *blockage; +write_units (int num_units, struct range *multiplicity, struct range *simultaneity, + struct range *ready_cost, struct range *issue_delay, + struct range *blockage) { int i, q_size; printf ("#define INSN_SCHEDULING\n\n"); - printf ("extern int result_ready_cost PARAMS ((rtx));\n"); - printf ("extern int function_units_used PARAMS ((rtx));\n\n"); + printf ("extern int result_ready_cost (rtx);\n"); + printf ("extern int function_units_used (rtx);\n\n"); printf ("extern const struct function_unit_desc\n"); printf ("{\n"); printf (" const char *const name;\n"); @@ -153,11 +143,11 @@ write_units (num_units, multiplicity, simultaneity, printf (" const int simultaneity;\n"); printf (" const int default_cost;\n"); printf (" const int max_issue_delay;\n"); - printf (" int (*const ready_cost_function) PARAMS ((rtx));\n"); - printf (" int (*const conflict_cost_function) PARAMS ((rtx, rtx));\n"); + printf (" int (*const ready_cost_function) (rtx);\n"); + printf (" int (*const conflict_cost_function) (rtx, rtx);\n"); printf (" const int max_blockage;\n"); - printf (" unsigned int (*const blockage_range_function) PARAMS ((rtx));\n"); - printf (" int (*const blockage_function) PARAMS ((rtx, rtx));\n"); + printf (" unsigned int (*const blockage_range_function) (rtx);\n"); + printf (" int (*const blockage_function) (rtx, rtx);\n"); printf ("} function_units[];\n\n"); printf ("#define FUNCTION_UNITS_SIZE %d\n", num_units); printf ("#define MIN_MULTIPLICITY %d\n", multiplicity->min); @@ -182,12 +172,8 @@ write_units (num_units, multiplicity, simultaneity, printf ("#define INSN_QUEUE_SIZE %d\n", q_size); } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; int have_delay = 0; @@ -224,7 +210,7 @@ main (argc, argv) puts ("#define HAVE_ATTR_alternative"); puts ("#define get_attr_alternative(insn) which_alternative"); - + /* Read the machine description. */ while (1) @@ -243,9 +229,9 @@ main (argc, argv) if (! have_delay) { printf ("#define DELAY_SLOTS\n"); - printf ("extern int num_delay_slots PARAMS ((rtx));\n"); - printf ("extern int eligible_for_delay PARAMS ((rtx, int, rtx, int));\n\n"); - printf ("extern int const_num_delay_slots PARAMS ((rtx));\n\n"); + printf ("extern int num_delay_slots (rtx);\n"); + printf ("extern int eligible_for_delay (rtx, int, rtx, int);\n\n"); + printf ("extern int const_num_delay_slots (rtx);\n\n"); have_delay = 1; } @@ -254,14 +240,14 @@ main (argc, argv) if (XVECEXP (desc, 1, i + 1) && ! have_annul_true) { printf ("#define ANNUL_IFTRUE_SLOTS\n"); - printf ("extern int eligible_for_annul_true PARAMS ((rtx, int, rtx, int));\n"); + printf ("extern int eligible_for_annul_true (rtx, int, rtx, int);\n"); have_annul_true = 1; } if (XVECEXP (desc, 1, i + 2) && ! have_annul_false) { printf ("#define ANNUL_IFFALSE_SLOTS\n"); - printf ("extern int eligible_for_annul_false PARAMS ((rtx, int, rtx, int));\n"); + printf ("extern int eligible_for_annul_false (rtx, int, rtx, int);\n"); have_annul_false = 1; } } @@ -379,19 +365,19 @@ main (argc, argv) printf (" same processor cycle. */\n"); printf ("#define MAX_DFA_ISSUE_RATE max_dfa_issue_rate\n\n"); printf ("/* Insn latency time defined in define_insn_reservation. */\n"); - printf ("extern int insn_default_latency PARAMS ((rtx));\n\n"); + printf ("extern int insn_default_latency (rtx);\n\n"); printf ("/* Return nonzero if there is a bypass for given insn\n"); printf (" which is a data producer. */\n"); - printf ("extern int bypass_p PARAMS ((rtx));\n\n"); + printf ("extern int bypass_p (rtx);\n\n"); printf ("/* Insn latency time on data consumed by the 2nd insn.\n"); printf (" Use the function if bypass_p returns nonzero for\n"); printf (" the 1st insn. */\n"); - printf ("extern int insn_latency PARAMS ((rtx, rtx));\n\n"); + printf ("extern int insn_latency (rtx, rtx);\n\n"); printf ("\n#if AUTOMATON_ALTS\n"); printf ("/* The following function returns number of alternative\n"); printf (" reservations of given insn. It may be used for better\n"); printf (" insns scheduling heuristics. */\n"); - printf ("extern int insn_alts PARAMS ((rtx));\n\n"); + printf ("extern int insn_alts (rtx);\n\n"); printf ("#endif\n\n"); printf ("/* Maximal possible number of insns waiting results being\n"); printf (" produced by insns whose execution is not finished. */\n"); @@ -399,10 +385,10 @@ main (argc, argv) printf ("/* Pointer to data describing current state of DFA. */\n"); printf ("typedef void *state_t;\n\n"); printf ("/* Size of the data in bytes. */\n"); - printf ("extern int state_size PARAMS ((void));\n\n"); + printf ("extern int state_size (void);\n\n"); printf ("/* Initiate given DFA state, i.e. Set up the state\n"); printf (" as all functional units were not reserved. */\n"); - printf ("extern void state_reset PARAMS ((state_t));\n"); + printf ("extern void state_reset (state_t);\n"); printf ("/* The following function returns negative value if given\n"); printf (" insn can be issued in processor state described by given\n"); printf (" DFA state. In this case, the DFA state is changed to\n"); @@ -412,7 +398,7 @@ main (argc, argv) printf (" for superscalar or VLIW processors. If the second\n"); printf (" parameter is NULL the function changes given DFA state\n"); printf (" as new processor cycle started. */\n"); - printf ("extern int state_transition PARAMS ((state_t, rtx));\n"); + printf ("extern int state_transition (state_t, rtx);\n"); printf ("\n#if AUTOMATON_STATE_ALTS\n"); printf ("/* The following function returns number of possible\n"); printf (" alternative reservations of given insn in given\n"); @@ -420,12 +406,12 @@ main (argc, argv) printf (" heuristics. By default the function is defined if\n"); printf (" macro AUTOMATON_STATE_ALTS is defined because its\n"); printf (" implementation may require much memory. */\n"); - printf ("extern int state_alts PARAMS ((state_t, rtx));\n"); + printf ("extern int state_alts (state_t, rtx);\n"); printf ("#endif\n\n"); - printf ("extern int min_issue_delay PARAMS ((state_t, rtx));\n"); + printf ("extern int min_issue_delay (state_t, rtx);\n"); printf ("/* The following function returns nonzero if no one insn\n"); printf (" can be issued in current DFA state. */\n"); - printf ("extern int state_dead_lock_p PARAMS ((state_t));\n"); + printf ("extern int state_dead_lock_p (state_t);\n"); printf ("/* The function returns minimal delay of issue of the 2nd\n"); printf (" insn after issuing the 1st insn in given DFA state.\n"); printf (" The 1st insn should be issued in given state (i.e.\n"); @@ -433,30 +419,30 @@ main (argc, argv) printf (" the insn and the state). Data dependencies between\n"); printf (" the insns are ignored by the function. */\n"); printf - ("extern int min_insn_conflict_delay PARAMS ((state_t, rtx, rtx));\n"); + ("extern int min_insn_conflict_delay (state_t, rtx, rtx);\n"); printf ("/* The following function outputs reservations for given\n"); printf (" insn as they are described in the corresponding\n"); printf (" define_insn_reservation. */\n"); - printf ("extern void print_reservation PARAMS ((FILE *, rtx));\n"); + printf ("extern void print_reservation (FILE *, rtx);\n"); printf ("\n#if CPU_UNITS_QUERY\n"); printf ("/* The following function returns code of functional unit\n"); printf (" with given name (see define_cpu_unit). */\n"); - printf ("extern int get_cpu_unit_code PARAMS ((const char *));\n"); + printf ("extern int get_cpu_unit_code (const char *);\n"); printf ("/* The following function returns nonzero if functional\n"); printf (" unit with given code is currently reserved in given\n"); printf (" DFA state. */\n"); - printf ("extern int cpu_unit_reservation_p PARAMS ((state_t, int));\n"); + printf ("extern int cpu_unit_reservation_p (state_t, int);\n"); printf ("#endif\n\n"); printf ("/* Clean insn code cache. It should be called if there\n"); printf (" is a chance that condition value in a\n"); printf (" define_insn_reservation will be changed after\n"); printf (" last call of dfa_start. */\n"); - printf ("extern void dfa_clean_insn_cache PARAMS ((void));\n\n"); + printf ("extern void dfa_clean_insn_cache (void);\n\n"); printf ("/* Initiate and finish work with DFA. They should be\n"); printf (" called as the first and the last interface\n"); printf (" functions. */\n"); - printf ("extern void dfa_start PARAMS ((void));\n"); - printf ("extern void dfa_finish PARAMS ((void));\n"); + printf ("extern void dfa_start (void);\n"); + printf ("extern void dfa_finish (void);\n"); } else { @@ -465,7 +451,7 @@ main (argc, argv) printf ("typedef void *state_t;\n\n"); } - /* Output flag masks for use by reorg. + /* Output flag masks for use by reorg. Flags are used to hold branch direction and prediction information for use by eligible_for_... */ @@ -486,8 +472,7 @@ main (argc, argv) /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/genautomata.c b/gcc/genautomata.c index e72b52c7f04..b9ad9dd7282 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -2,7 +2,7 @@ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Vladimir Makarov <vmakarov@redhat.com> - + This file is part of GCC. GCC is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* References: - + 1. Detecting pipeline structural hazards quickly. T. Proebsting, C. Fraser. Proceedings of ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 280--286, 1994. @@ -73,7 +73,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA `genattrtab.c'. They transform RTL constructions describing automata in .md file into internal representation convenient for further processing. - + The translator major function `expand_automata' processes the description internal representation into finite state automaton. It can be divided on: @@ -215,321 +215,321 @@ typedef struct state_ainsn_table *state_ainsn_table_t; described on the file top because the functions are called from function `main'. */ -static void *create_node PARAMS ((size_t)); -static void *copy_node PARAMS ((const void *, size_t)); -static char *check_name PARAMS ((char *, pos_t)); -static char *next_sep_el PARAMS ((char **, int, int)); -static int n_sep_els PARAMS ((char *, int, int)); -static char **get_str_vect PARAMS ((char *, int *, int, int)); -static void gen_presence_absence_set PARAMS ((rtx, int, int)); -static regexp_t gen_regexp_el PARAMS ((char *)); -static regexp_t gen_regexp_repeat PARAMS ((char *)); -static regexp_t gen_regexp_allof PARAMS ((char *)); -static regexp_t gen_regexp_oneof PARAMS ((char *)); -static regexp_t gen_regexp_sequence PARAMS ((char *)); -static regexp_t gen_regexp PARAMS ((char *)); - -static unsigned string_hash PARAMS ((const char *)); -static unsigned automaton_decl_hash PARAMS ((const void *)); -static int automaton_decl_eq_p PARAMS ((const void *, - const void *)); -static decl_t insert_automaton_decl PARAMS ((decl_t)); -static decl_t find_automaton_decl PARAMS ((char *)); -static void initiate_automaton_decl_table PARAMS ((void)); -static void finish_automaton_decl_table PARAMS ((void)); - -static hashval_t insn_decl_hash PARAMS ((const void *)); -static int insn_decl_eq_p PARAMS ((const void *, - const void *)); -static decl_t insert_insn_decl PARAMS ((decl_t)); -static decl_t find_insn_decl PARAMS ((char *)); -static void initiate_insn_decl_table PARAMS ((void)); -static void finish_insn_decl_table PARAMS ((void)); - -static hashval_t decl_hash PARAMS ((const void *)); -static int decl_eq_p PARAMS ((const void *, - const void *)); -static decl_t insert_decl PARAMS ((decl_t)); -static decl_t find_decl PARAMS ((char *)); -static void initiate_decl_table PARAMS ((void)); -static void finish_decl_table PARAMS ((void)); - -static unit_set_el_t process_excls PARAMS ((char **, int, pos_t)); -static void add_excls PARAMS ((unit_set_el_t, unit_set_el_t, - pos_t)); +static void *create_node (size_t); +static void *copy_node (const void *, size_t); +static char *check_name (char *, pos_t); +static char *next_sep_el (char **, int, int); +static int n_sep_els (char *, int, int); +static char **get_str_vect (char *, int *, int, int); +static void gen_presence_absence_set (rtx, int, int); +static regexp_t gen_regexp_el (char *); +static regexp_t gen_regexp_repeat (char *); +static regexp_t gen_regexp_allof (char *); +static regexp_t gen_regexp_oneof (char *); +static regexp_t gen_regexp_sequence (char *); +static regexp_t gen_regexp (char *); + +static unsigned string_hash (const char *); +static unsigned automaton_decl_hash (const void *); +static int automaton_decl_eq_p (const void *, + const void *); +static decl_t insert_automaton_decl (decl_t); +static decl_t find_automaton_decl (char *); +static void initiate_automaton_decl_table (void); +static void finish_automaton_decl_table (void); + +static hashval_t insn_decl_hash (const void *); +static int insn_decl_eq_p (const void *, + const void *); +static decl_t insert_insn_decl (decl_t); +static decl_t find_insn_decl (char *); +static void initiate_insn_decl_table (void); +static void finish_insn_decl_table (void); + +static hashval_t decl_hash (const void *); +static int decl_eq_p (const void *, + const void *); +static decl_t insert_decl (decl_t); +static decl_t find_decl (char *); +static void initiate_decl_table (void); +static void finish_decl_table (void); + +static unit_set_el_t process_excls (char **, int, pos_t); +static void add_excls (unit_set_el_t, unit_set_el_t, + pos_t); static unit_set_el_t process_presence_absence_names - PARAMS ((char **, int, pos_t, - int, int)); + (char **, int, pos_t, + int, int); static pattern_set_el_t process_presence_absence_patterns - PARAMS ((char ***, int, pos_t, - int, int)); -static void add_presence_absence PARAMS ((unit_set_el_t, - pattern_set_el_t, - pos_t, int, int)); -static void process_decls PARAMS ((void)); -static struct bypass_decl *find_bypass PARAMS ((struct bypass_decl *, - struct insn_reserv_decl *)); -static void check_automaton_usage PARAMS ((void)); -static regexp_t process_regexp PARAMS ((regexp_t)); -static void process_regexp_decls PARAMS ((void)); -static void check_usage PARAMS ((void)); -static int loop_in_regexp PARAMS ((regexp_t, decl_t)); -static void check_loops_in_regexps PARAMS ((void)); -static void process_regexp_cycles PARAMS ((regexp_t, int, int, - int *, int *)); -static void evaluate_max_reserv_cycles PARAMS ((void)); -static void check_all_description PARAMS ((void)); - -static ticker_t create_ticker PARAMS ((void)); -static void ticker_off PARAMS ((ticker_t *)); -static void ticker_on PARAMS ((ticker_t *)); -static int active_time PARAMS ((ticker_t)); -static void print_active_time PARAMS ((FILE *, ticker_t)); - -static void add_advance_cycle_insn_decl PARAMS ((void)); - -static alt_state_t get_free_alt_state PARAMS ((void)); -static void free_alt_state PARAMS ((alt_state_t)); -static void free_alt_states PARAMS ((alt_state_t)); -static int alt_state_cmp PARAMS ((const void *alt_state_ptr_1, - const void *alt_state_ptr_2)); -static alt_state_t uniq_sort_alt_states PARAMS ((alt_state_t)); -static int alt_states_eq PARAMS ((alt_state_t, alt_state_t)); -static void initiate_alt_states PARAMS ((void)); -static void finish_alt_states PARAMS ((void)); - -static reserv_sets_t alloc_empty_reserv_sets PARAMS ((void)); -static unsigned reserv_sets_hash_value PARAMS ((reserv_sets_t)); -static int reserv_sets_cmp PARAMS ((reserv_sets_t, reserv_sets_t)); -static int reserv_sets_eq PARAMS ((reserv_sets_t, reserv_sets_t)); -static void set_unit_reserv PARAMS ((reserv_sets_t, int, int)); -static int test_unit_reserv PARAMS ((reserv_sets_t, int, int)); -static int it_is_empty_reserv_sets PARAMS ((reserv_sets_t)) + (char ***, int, pos_t, + int, int); +static void add_presence_absence (unit_set_el_t, + pattern_set_el_t, + pos_t, int, int); +static void process_decls (void); +static struct bypass_decl *find_bypass (struct bypass_decl *, + struct insn_reserv_decl *); +static void check_automaton_usage (void); +static regexp_t process_regexp (regexp_t); +static void process_regexp_decls (void); +static void check_usage (void); +static int loop_in_regexp (regexp_t, decl_t); +static void check_loops_in_regexps (void); +static void process_regexp_cycles (regexp_t, int, int, + int *, int *); +static void evaluate_max_reserv_cycles (void); +static void check_all_description (void); + +static ticker_t create_ticker (void); +static void ticker_off (ticker_t *); +static void ticker_on (ticker_t *); +static int active_time (ticker_t); +static void print_active_time (FILE *, ticker_t); + +static void add_advance_cycle_insn_decl (void); + +static alt_state_t get_free_alt_state (void); +static void free_alt_state (alt_state_t); +static void free_alt_states (alt_state_t); +static int alt_state_cmp (const void *alt_state_ptr_1, + const void *alt_state_ptr_2); +static alt_state_t uniq_sort_alt_states (alt_state_t); +static int alt_states_eq (alt_state_t, alt_state_t); +static void initiate_alt_states (void); +static void finish_alt_states (void); + +static reserv_sets_t alloc_empty_reserv_sets (void); +static unsigned reserv_sets_hash_value (reserv_sets_t); +static int reserv_sets_cmp (reserv_sets_t, reserv_sets_t); +static int reserv_sets_eq (reserv_sets_t, reserv_sets_t); +static void set_unit_reserv (reserv_sets_t, int, int); +static int test_unit_reserv (reserv_sets_t, int, int); +static int it_is_empty_reserv_sets (reserv_sets_t) ATTRIBUTE_UNUSED; -static int reserv_sets_are_intersected PARAMS ((reserv_sets_t, reserv_sets_t)); -static void reserv_sets_shift PARAMS ((reserv_sets_t, reserv_sets_t)); -static void reserv_sets_or PARAMS ((reserv_sets_t, reserv_sets_t, - reserv_sets_t)); -static void reserv_sets_and PARAMS ((reserv_sets_t, reserv_sets_t, - reserv_sets_t)) +static int reserv_sets_are_intersected (reserv_sets_t, reserv_sets_t); +static void reserv_sets_shift (reserv_sets_t, reserv_sets_t); +static void reserv_sets_or (reserv_sets_t, reserv_sets_t, + reserv_sets_t); +static void reserv_sets_and (reserv_sets_t, reserv_sets_t, + reserv_sets_t) ATTRIBUTE_UNUSED; -static void output_cycle_reservs PARAMS ((FILE *, reserv_sets_t, - int, int)); -static void output_reserv_sets PARAMS ((FILE *, reserv_sets_t)); -static state_t get_free_state PARAMS ((int, automaton_t)); -static void free_state PARAMS ((state_t)); -static hashval_t state_hash PARAMS ((const void *)); -static int state_eq_p PARAMS ((const void *, const void *)); -static state_t insert_state PARAMS ((state_t)); -static void set_state_reserv PARAMS ((state_t, int, int)); -static int intersected_state_reservs_p PARAMS ((state_t, state_t)); -static state_t states_union PARAMS ((state_t, state_t, reserv_sets_t)); -static state_t state_shift PARAMS ((state_t, reserv_sets_t)); -static void initiate_states PARAMS ((void)); -static void finish_states PARAMS ((void)); - -static void free_arc PARAMS ((arc_t)); -static void remove_arc PARAMS ((state_t, arc_t)); -static arc_t find_arc PARAMS ((state_t, state_t, ainsn_t)); -static arc_t add_arc PARAMS ((state_t, state_t, ainsn_t, int)); -static arc_t first_out_arc PARAMS ((state_t)); -static arc_t next_out_arc PARAMS ((arc_t)); -static void initiate_arcs PARAMS ((void)); -static void finish_arcs PARAMS ((void)); - -static automata_list_el_t get_free_automata_list_el PARAMS ((void)); -static void free_automata_list_el PARAMS ((automata_list_el_t)); -static void free_automata_list PARAMS ((automata_list_el_t)); -static hashval_t automata_list_hash PARAMS ((const void *)); -static int automata_list_eq_p PARAMS ((const void *, const void *)); -static void initiate_automata_lists PARAMS ((void)); -static void automata_list_start PARAMS ((void)); -static void automata_list_add PARAMS ((automaton_t)); -static automata_list_el_t automata_list_finish PARAMS ((void)); -static void finish_automata_lists PARAMS ((void)); - -static void initiate_excl_sets PARAMS ((void)); -static reserv_sets_t get_excl_set PARAMS ((reserv_sets_t)); - -static pattern_reserv_t form_reserv_sets_list PARAMS ((pattern_set_el_t)); -static void initiate_presence_absence_pattern_sets PARAMS ((void)); -static int check_presence_pattern_sets PARAMS ((reserv_sets_t, - reserv_sets_t, int)); -static int check_absence_pattern_sets PARAMS ((reserv_sets_t, reserv_sets_t, - int)); - -static regexp_t copy_insn_regexp PARAMS ((regexp_t)); -static regexp_t transform_1 PARAMS ((regexp_t)); -static regexp_t transform_2 PARAMS ((regexp_t)); -static regexp_t transform_3 PARAMS ((regexp_t)); +static void output_cycle_reservs (FILE *, reserv_sets_t, + int, int); +static void output_reserv_sets (FILE *, reserv_sets_t); +static state_t get_free_state (int, automaton_t); +static void free_state (state_t); +static hashval_t state_hash (const void *); +static int state_eq_p (const void *, const void *); +static state_t insert_state (state_t); +static void set_state_reserv (state_t, int, int); +static int intersected_state_reservs_p (state_t, state_t); +static state_t states_union (state_t, state_t, reserv_sets_t); +static state_t state_shift (state_t, reserv_sets_t); +static void initiate_states (void); +static void finish_states (void); + +static void free_arc (arc_t); +static void remove_arc (state_t, arc_t); +static arc_t find_arc (state_t, state_t, ainsn_t); +static arc_t add_arc (state_t, state_t, ainsn_t, int); +static arc_t first_out_arc (state_t); +static arc_t next_out_arc (arc_t); +static void initiate_arcs (void); +static void finish_arcs (void); + +static automata_list_el_t get_free_automata_list_el (void); +static void free_automata_list_el (automata_list_el_t); +static void free_automata_list (automata_list_el_t); +static hashval_t automata_list_hash (const void *); +static int automata_list_eq_p (const void *, const void *); +static void initiate_automata_lists (void); +static void automata_list_start (void); +static void automata_list_add (automaton_t); +static automata_list_el_t automata_list_finish (void); +static void finish_automata_lists (void); + +static void initiate_excl_sets (void); +static reserv_sets_t get_excl_set (reserv_sets_t); + +static pattern_reserv_t form_reserv_sets_list (pattern_set_el_t); +static void initiate_presence_absence_pattern_sets (void); +static int check_presence_pattern_sets (reserv_sets_t, + reserv_sets_t, int); +static int check_absence_pattern_sets (reserv_sets_t, reserv_sets_t, + int); + +static regexp_t copy_insn_regexp (regexp_t); +static regexp_t transform_1 (regexp_t); +static regexp_t transform_2 (regexp_t); +static regexp_t transform_3 (regexp_t); static regexp_t regexp_transform_func - PARAMS ((regexp_t, regexp_t (*) (regexp_t))); -static regexp_t transform_regexp PARAMS ((regexp_t)); -static void transform_insn_regexps PARAMS ((void)); - -static void store_alt_unit_usage PARAMS ((regexp_t, regexp_t, int, int)); -static void check_regexp_units_distribution PARAMS ((const char *, regexp_t)); -static void check_unit_distributions_to_automata PARAMS ((void)); - -static int process_seq_for_forming_states PARAMS ((regexp_t, automaton_t, - int)); -static void finish_forming_alt_state PARAMS ((alt_state_t, - automaton_t)); -static void process_alts_for_forming_states PARAMS ((regexp_t, - automaton_t, int)); -static void create_alt_states PARAMS ((automaton_t)); - -static void form_ainsn_with_same_reservs PARAMS ((automaton_t)); - -static reserv_sets_t form_reservs_matter PARAMS ((automaton_t)); -static void make_automaton PARAMS ((automaton_t)); -static void form_arcs_marked_by_insn PARAMS ((state_t)); -static int create_composed_state PARAMS ((state_t, arc_t, vla_ptr_t *)); -static void NDFA_to_DFA PARAMS ((automaton_t)); -static void pass_state_graph PARAMS ((state_t, void (*) (state_t))); -static void pass_states PARAMS ((automaton_t, - void (*) (state_t))); -static void initiate_pass_states PARAMS ((void)); -static void add_achieved_state PARAMS ((state_t)); -static int set_out_arc_insns_equiv_num PARAMS ((state_t, int)); -static void clear_arc_insns_equiv_num PARAMS ((state_t)); -static void copy_equiv_class PARAMS ((vla_ptr_t *to, - const vla_ptr_t *from)); -static int first_cycle_unit_presence PARAMS ((state_t, int)); -static int state_is_differed PARAMS ((state_t, state_t, int, int)); -static state_t init_equiv_class PARAMS ((state_t *states, int)); -static int partition_equiv_class PARAMS ((state_t *, int, - vla_ptr_t *, int *)); -static void evaluate_equiv_classes PARAMS ((automaton_t, vla_ptr_t *)); -static void merge_states PARAMS ((automaton_t, vla_ptr_t *)); -static void set_new_cycle_flags PARAMS ((state_t)); -static void minimize_DFA PARAMS ((automaton_t)); -static void incr_states_and_arcs_nums PARAMS ((state_t)); -static void count_states_and_arcs PARAMS ((automaton_t, int *, int *)); -static void build_automaton PARAMS ((automaton_t)); - -static void set_order_state_num PARAMS ((state_t)); -static void enumerate_states PARAMS ((automaton_t)); - -static ainsn_t insert_ainsn_into_equiv_class PARAMS ((ainsn_t, ainsn_t)); -static void delete_ainsn_from_equiv_class PARAMS ((ainsn_t)); -static void process_insn_equiv_class PARAMS ((ainsn_t, arc_t *)); -static void process_state_for_insn_equiv_partition PARAMS ((state_t)); -static void set_insn_equiv_classes PARAMS ((automaton_t)); - -static double estimate_one_automaton_bound PARAMS ((void)); -static int compare_max_occ_cycle_nums PARAMS ((const void *, - const void *)); -static void units_to_automata_heuristic_distr PARAMS ((void)); -static ainsn_t create_ainsns PARAMS ((void)); -static void units_to_automata_distr PARAMS ((void)); -static void create_automata PARAMS ((void)); - -static void form_regexp PARAMS ((regexp_t)); -static const char *regexp_representation PARAMS ((regexp_t)); -static void finish_regexp_representation PARAMS ((void)); - -static void output_range_type PARAMS ((FILE *, long int, long int)); -static int longest_path_length PARAMS ((state_t)); -static void process_state_longest_path_length PARAMS ((state_t)); -static void output_dfa_max_issue_rate PARAMS ((void)); -static void output_vect PARAMS ((vect_el_t *, int)); -static void output_chip_member_name PARAMS ((FILE *, automaton_t)); -static void output_temp_chip_member_name PARAMS ((FILE *, automaton_t)); -static void output_translate_vect_name PARAMS ((FILE *, automaton_t)); -static void output_trans_full_vect_name PARAMS ((FILE *, automaton_t)); -static void output_trans_comb_vect_name PARAMS ((FILE *, automaton_t)); -static void output_trans_check_vect_name PARAMS ((FILE *, automaton_t)); -static void output_trans_base_vect_name PARAMS ((FILE *, automaton_t)); -static void output_state_alts_full_vect_name PARAMS ((FILE *, automaton_t)); -static void output_state_alts_comb_vect_name PARAMS ((FILE *, automaton_t)); -static void output_state_alts_check_vect_name PARAMS ((FILE *, automaton_t)); -static void output_state_alts_base_vect_name PARAMS ((FILE *, automaton_t)); -static void output_min_issue_delay_vect_name PARAMS ((FILE *, automaton_t)); -static void output_dead_lock_vect_name PARAMS ((FILE *, automaton_t)); -static void output_reserved_units_table_name PARAMS ((FILE *, automaton_t)); -static void output_state_member_type PARAMS ((FILE *, automaton_t)); -static void output_chip_definitions PARAMS ((void)); -static void output_translate_vect PARAMS ((automaton_t)); -static int comb_vect_p PARAMS ((state_ainsn_table_t)); -static state_ainsn_table_t create_state_ainsn_table PARAMS ((automaton_t)); + (regexp_t, regexp_t (*) (regexp_t)); +static regexp_t transform_regexp (regexp_t); +static void transform_insn_regexps (void); + +static void store_alt_unit_usage (regexp_t, regexp_t, int, int); +static void check_regexp_units_distribution (const char *, regexp_t); +static void check_unit_distributions_to_automata (void); + +static int process_seq_for_forming_states (regexp_t, automaton_t, + int); +static void finish_forming_alt_state (alt_state_t, + automaton_t); +static void process_alts_for_forming_states (regexp_t, + automaton_t, int); +static void create_alt_states (automaton_t); + +static void form_ainsn_with_same_reservs (automaton_t); + +static reserv_sets_t form_reservs_matter (automaton_t); +static void make_automaton (automaton_t); +static void form_arcs_marked_by_insn (state_t); +static int create_composed_state (state_t, arc_t, vla_ptr_t *); +static void NDFA_to_DFA (automaton_t); +static void pass_state_graph (state_t, void (*) (state_t)); +static void pass_states (automaton_t, + void (*) (state_t)); +static void initiate_pass_states (void); +static void add_achieved_state (state_t); +static int set_out_arc_insns_equiv_num (state_t, int); +static void clear_arc_insns_equiv_num (state_t); +static void copy_equiv_class (vla_ptr_t *to, + const vla_ptr_t *from); +static int first_cycle_unit_presence (state_t, int); +static int state_is_differed (state_t, state_t, int, int); +static state_t init_equiv_class (state_t *states, int); +static int partition_equiv_class (state_t *, int, + vla_ptr_t *, int *); +static void evaluate_equiv_classes (automaton_t, vla_ptr_t *); +static void merge_states (automaton_t, vla_ptr_t *); +static void set_new_cycle_flags (state_t); +static void minimize_DFA (automaton_t); +static void incr_states_and_arcs_nums (state_t); +static void count_states_and_arcs (automaton_t, int *, int *); +static void build_automaton (automaton_t); + +static void set_order_state_num (state_t); +static void enumerate_states (automaton_t); + +static ainsn_t insert_ainsn_into_equiv_class (ainsn_t, ainsn_t); +static void delete_ainsn_from_equiv_class (ainsn_t); +static void process_insn_equiv_class (ainsn_t, arc_t *); +static void process_state_for_insn_equiv_partition (state_t); +static void set_insn_equiv_classes (automaton_t); + +static double estimate_one_automaton_bound (void); +static int compare_max_occ_cycle_nums (const void *, + const void *); +static void units_to_automata_heuristic_distr (void); +static ainsn_t create_ainsns (void); +static void units_to_automata_distr (void); +static void create_automata (void); + +static void form_regexp (regexp_t); +static const char *regexp_representation (regexp_t); +static void finish_regexp_representation (void); + +static void output_range_type (FILE *, long int, long int); +static int longest_path_length (state_t); +static void process_state_longest_path_length (state_t); +static void output_dfa_max_issue_rate (void); +static void output_vect (vect_el_t *, int); +static void output_chip_member_name (FILE *, automaton_t); +static void output_temp_chip_member_name (FILE *, automaton_t); +static void output_translate_vect_name (FILE *, automaton_t); +static void output_trans_full_vect_name (FILE *, automaton_t); +static void output_trans_comb_vect_name (FILE *, automaton_t); +static void output_trans_check_vect_name (FILE *, automaton_t); +static void output_trans_base_vect_name (FILE *, automaton_t); +static void output_state_alts_full_vect_name (FILE *, automaton_t); +static void output_state_alts_comb_vect_name (FILE *, automaton_t); +static void output_state_alts_check_vect_name (FILE *, automaton_t); +static void output_state_alts_base_vect_name (FILE *, automaton_t); +static void output_min_issue_delay_vect_name (FILE *, automaton_t); +static void output_dead_lock_vect_name (FILE *, automaton_t); +static void output_reserved_units_table_name (FILE *, automaton_t); +static void output_state_member_type (FILE *, automaton_t); +static void output_chip_definitions (void); +static void output_translate_vect (automaton_t); +static int comb_vect_p (state_ainsn_table_t); +static state_ainsn_table_t create_state_ainsn_table (automaton_t); static void output_state_ainsn_table - PARAMS ((state_ainsn_table_t, char *, void (*) (FILE *, automaton_t), - void (*) (FILE *, automaton_t), void (*) (FILE *, automaton_t), - void (*) (FILE *, automaton_t))); -static void add_vect PARAMS ((state_ainsn_table_t, - int, vect_el_t *, int)); -static int out_state_arcs_num PARAMS ((state_t)); -static int compare_transition_els_num PARAMS ((const void *, const void *)); -static void add_vect_el PARAMS ((vla_hwint_t *, - ainsn_t, int)); -static void add_states_vect_el PARAMS ((state_t)); -static void output_trans_table PARAMS ((automaton_t)); -static void output_state_alts_table PARAMS ((automaton_t)); -static int min_issue_delay_pass_states PARAMS ((state_t, ainsn_t)); -static int min_issue_delay PARAMS ((state_t, ainsn_t)); -static void initiate_min_issue_delay_pass_states PARAMS ((void)); -static void output_min_issue_delay_table PARAMS ((automaton_t)); -static void output_dead_lock_vect PARAMS ((automaton_t)); -static void output_reserved_units_table PARAMS ((automaton_t)); -static void output_tables PARAMS ((void)); -static void output_max_insn_queue_index_def PARAMS ((void)); -static void output_insn_code_cases PARAMS ((void (*) (automata_list_el_t))); -static void output_automata_list_min_issue_delay_code PARAMS ((automata_list_el_t)); -static void output_internal_min_issue_delay_func PARAMS ((void)); -static void output_automata_list_transition_code PARAMS ((automata_list_el_t)); -static void output_internal_trans_func PARAMS ((void)); -static void output_internal_insn_code_evaluation PARAMS ((const char *, - const char *, int)); -static void output_dfa_insn_code_func PARAMS ((void)); -static void output_trans_func PARAMS ((void)); -static void output_automata_list_state_alts_code PARAMS ((automata_list_el_t)); -static void output_internal_state_alts_func PARAMS ((void)); -static void output_state_alts_func PARAMS ((void)); -static void output_min_issue_delay_func PARAMS ((void)); -static void output_internal_dead_lock_func PARAMS ((void)); -static void output_dead_lock_func PARAMS ((void)); -static void output_internal_reset_func PARAMS ((void)); -static void output_size_func PARAMS ((void)); -static void output_reset_func PARAMS ((void)); -static void output_min_insn_conflict_delay_func PARAMS ((void)); -static void output_internal_insn_latency_func PARAMS ((void)); -static void output_insn_latency_func PARAMS ((void)); -static void output_print_reservation_func PARAMS ((void)); -static int units_cmp PARAMS ((const void *, - const void *)); -static void output_get_cpu_unit_code_func PARAMS ((void)); -static void output_cpu_unit_reservation_p PARAMS ((void)); -static void output_dfa_clean_insn_cache_func PARAMS ((void)); -static void output_dfa_start_func PARAMS ((void)); -static void output_dfa_finish_func PARAMS ((void)); - -static void output_regexp PARAMS ((regexp_t )); -static void output_unit_set_el_list PARAMS ((unit_set_el_t)); -static void output_pattern_set_el_list PARAMS ((pattern_set_el_t)); -static void output_description PARAMS ((void)); -static void output_automaton_name PARAMS ((FILE *, automaton_t)); -static void output_automaton_units PARAMS ((automaton_t)); -static void add_state_reservs PARAMS ((state_t)); -static void output_state_arcs PARAMS ((state_t)); -static int state_reservs_cmp PARAMS ((const void *, - const void *)); -static void remove_state_duplicate_reservs PARAMS ((void)); -static void output_state PARAMS ((state_t)); -static void output_automaton_descriptions PARAMS ((void)); -static void output_statistics PARAMS ((FILE *)); -static void output_time_statistics PARAMS ((FILE *)); -static void generate PARAMS ((void)); - -static void make_insn_alts_attr PARAMS ((void)); -static void make_internal_dfa_insn_code_attr PARAMS ((void)); -static void make_default_insn_latency_attr PARAMS ((void)); -static void make_bypass_attr PARAMS ((void)); -static const char *file_name_suffix PARAMS ((const char *)); -static const char *base_file_name PARAMS ((const char *)); -static void check_automata_insn_issues PARAMS ((void)); -static void add_automaton_state PARAMS ((state_t)); -static void form_important_insn_automata_lists PARAMS ((void)); + (state_ainsn_table_t, char *, void (*) (FILE *, automaton_t), + void (*) (FILE *, automaton_t), void (*) (FILE *, automaton_t), + void (*) (FILE *, automaton_t)); +static void add_vect (state_ainsn_table_t, + int, vect_el_t *, int); +static int out_state_arcs_num (state_t); +static int compare_transition_els_num (const void *, const void *); +static void add_vect_el (vla_hwint_t *, + ainsn_t, int); +static void add_states_vect_el (state_t); +static void output_trans_table (automaton_t); +static void output_state_alts_table (automaton_t); +static int min_issue_delay_pass_states (state_t, ainsn_t); +static int min_issue_delay (state_t, ainsn_t); +static void initiate_min_issue_delay_pass_states (void); +static void output_min_issue_delay_table (automaton_t); +static void output_dead_lock_vect (automaton_t); +static void output_reserved_units_table (automaton_t); +static void output_tables (void); +static void output_max_insn_queue_index_def (void); +static void output_insn_code_cases (void (*) (automata_list_el_t)); +static void output_automata_list_min_issue_delay_code (automata_list_el_t); +static void output_internal_min_issue_delay_func (void); +static void output_automata_list_transition_code (automata_list_el_t); +static void output_internal_trans_func (void); +static void output_internal_insn_code_evaluation (const char *, + const char *, int); +static void output_dfa_insn_code_func (void); +static void output_trans_func (void); +static void output_automata_list_state_alts_code (automata_list_el_t); +static void output_internal_state_alts_func (void); +static void output_state_alts_func (void); +static void output_min_issue_delay_func (void); +static void output_internal_dead_lock_func (void); +static void output_dead_lock_func (void); +static void output_internal_reset_func (void); +static void output_size_func (void); +static void output_reset_func (void); +static void output_min_insn_conflict_delay_func (void); +static void output_internal_insn_latency_func (void); +static void output_insn_latency_func (void); +static void output_print_reservation_func (void); +static int units_cmp (const void *, + const void *); +static void output_get_cpu_unit_code_func (void); +static void output_cpu_unit_reservation_p (void); +static void output_dfa_clean_insn_cache_func (void); +static void output_dfa_start_func (void); +static void output_dfa_finish_func (void); + +static void output_regexp (regexp_t ); +static void output_unit_set_el_list (unit_set_el_t); +static void output_pattern_set_el_list (pattern_set_el_t); +static void output_description (void); +static void output_automaton_name (FILE *, automaton_t); +static void output_automaton_units (automaton_t); +static void add_state_reservs (state_t); +static void output_state_arcs (state_t); +static int state_reservs_cmp (const void *, + const void *); +static void remove_state_duplicate_reservs (void); +static void output_state (state_t); +static void output_automaton_descriptions (void); +static void output_statistics (FILE *); +static void output_time_statistics (FILE *); +static void generate (void); + +static void make_insn_alts_attr (void); +static void make_internal_dfa_insn_code_attr (void); +static void make_default_insn_latency_attr (void); +static void make_bypass_attr (void); +static const char *file_name_suffix (const char *); +static const char *base_file_name (const char *); +static void check_automata_insn_issues (void); +static void add_automaton_state (state_t); +static void form_important_insn_automata_lists (void); /* Undefined position. */ static pos_t no_pos = 0; @@ -545,11 +545,11 @@ static struct obstack irp; allocator when varray is used only. */ /* Start work with vla. */ -#define VLA_PTR_CREATE(vla, allocated_length, name) \ +#define VLA_PTR_CREATE(vla, allocated_length, name) \ do \ - { \ + { \ vla_ptr_t *const _vla_ptr = &(vla); \ - \ + \ VARRAY_GENERIC_PTR_INIT (_vla_ptr->varray, allocated_length, name);\ _vla_ptr->length = 0; \ } \ @@ -1307,14 +1307,14 @@ struct state_ainsn_table &(_decl)->decl.bypass; })) #define DECL_AUTOMATON(d) __extension__ \ -(({ struct decl *const _decl = (d); \ +(({ struct decl *const _decl = (d); \ if (_decl->mode != dm_automaton) \ decl_mode_check_failed (_decl->mode, "dm_automaton", \ __FILE__, __LINE__, __FUNCTION__); \ &(_decl)->decl.automaton; })) #define DECL_EXCL(d) __extension__ \ -(({ struct decl *const _decl = (d); \ +(({ struct decl *const _decl = (d); \ if (_decl->mode != dm_excl) \ decl_mode_check_failed (_decl->mode, "dm_excl", \ __FILE__, __LINE__, __FUNCTION__); \ @@ -1328,7 +1328,7 @@ struct state_ainsn_table &(_decl)->decl.presence; })) #define DECL_ABSENCE(d) __extension__ \ -(({ struct decl *const _decl = (d); \ +(({ struct decl *const _decl = (d); \ if (_decl->mode != dm_absence) \ decl_mode_check_failed (_decl->mode, "dm_absence", \ __FILE__, __LINE__, __FUNCTION__); \ @@ -1342,20 +1342,19 @@ struct state_ainsn_table &(_decl)->decl.reserv; })) #define DECL_INSN_RESERV(d) __extension__ \ -(({ struct decl *const _decl = (d); \ +(({ struct decl *const _decl = (d); \ if (_decl->mode != dm_insn_reserv) \ decl_mode_check_failed (_decl->mode, "dm_insn_reserv", \ __FILE__, __LINE__, __FUNCTION__); \ &(_decl)->decl.insn_reserv; })) -static const char *decl_name PARAMS ((enum decl_mode)); -static void decl_mode_check_failed PARAMS ((enum decl_mode, const char *, - const char *, int, const char *)); +static const char *decl_name (enum decl_mode); +static void decl_mode_check_failed (enum decl_mode, const char *, + const char *, int, const char *); /* Return string representation of declaration mode MODE. */ static const char * -decl_name (mode) - enum decl_mode mode; +decl_name (enum decl_mode mode) { static char str [100]; @@ -1383,12 +1382,8 @@ decl_name (mode) /* The function prints message about unexpected declaration and finish the program. */ static void -decl_mode_check_failed (mode, expected_mode_str, file, line, func) - enum decl_mode mode; - const char *expected_mode_str; - const char *file; - int line; - const char *func; +decl_mode_check_failed (enum decl_mode mode, const char *expected_mode_str, + const char *file, int line, const char *func) { fprintf (stderr, @@ -1440,16 +1435,15 @@ decl_mode_check_failed (mode, expected_mode_str, file, line, func) __FILE__, __LINE__, __FUNCTION__); \ &(_regexp)->regexp.oneof; })) -static const char *regexp_name PARAMS ((enum regexp_mode)); -static void regexp_mode_check_failed PARAMS ((enum regexp_mode, const char *, - const char *, int, - const char *)); +static const char *regexp_name (enum regexp_mode); +static void regexp_mode_check_failed (enum regexp_mode, const char *, + const char *, int, + const char *); /* Return string representation of regexp mode MODE. */ static const char * -regexp_name (mode) - enum regexp_mode mode; +regexp_name (enum regexp_mode mode) { static char str [100]; @@ -1475,12 +1469,9 @@ regexp_name (mode) /* The function prints message about unexpected regexp and finish the program. */ static void -regexp_mode_check_failed (mode, expected_mode_str, file, line, func) - enum regexp_mode mode; - const char *expected_mode_str; - const char *file; - int line; - const char *func; +regexp_mode_check_failed (enum regexp_mode mode, + const char *expected_mode_str, + const char *file, int line, const char *func) { fprintf (stderr, @@ -1511,8 +1502,7 @@ regexp_mode_check_failed (mode, expected_mode_str, file, line, func) /* Create IR structure (node). */ static void * -create_node (size) - size_t size; +create_node (size_t size) { void *result; @@ -1526,9 +1516,7 @@ create_node (size) /* Copy IR structure (node). */ static void * -copy_node (from, size) - const void *from; - size_t size; +copy_node (const void *from, size_t size) { void *const result = create_node (size); memcpy (result, from, size); @@ -1537,9 +1525,7 @@ copy_node (from, size) /* The function checks that NAME does not contain quotes (`"'). */ static char * -check_name (name, pos) - char * name; - pos_t pos ATTRIBUTE_UNUSED; +check_name (char * name, pos_t pos ATTRIBUTE_UNUSED) { const char *str; @@ -1559,10 +1545,7 @@ static vla_ptr_t decls; after the string scanned, or the end-of-string. Return NULL if at end of string. */ static char * -next_sep_el (pstr, sep, par_flag) - char **pstr; - int sep; - int par_flag; +next_sep_el (char **pstr, int sep, int par_flag) { char *out_str; char *p; @@ -1610,10 +1593,7 @@ next_sep_el (pstr, sep, par_flag) nonzero value. Return 0 for the null string, -1 if parentheses is not balanced. */ static int -n_sep_els (s, sep, par_flag) - char *s; - int sep; - int par_flag; +n_sep_els (char *s, int sep, int par_flag) { int n; int pars_num; @@ -1638,11 +1618,7 @@ n_sep_els (s, sep, par_flag) function also inserts the end marker NULL at the end of vector. Return 0 for the null string, -1 if parantheses are not balanced. */ static char ** -get_str_vect (str, els_num, sep, paren_p) - char *str; - int *els_num; - int sep; - int paren_p; +get_str_vect (char *str, int *els_num, int sep, int paren_p) { int i; char **vect; @@ -1663,13 +1639,12 @@ get_str_vect (str, els_num, sep, paren_p) return vect; } -/* Process a DEFINE_CPU_UNIT. +/* Process a DEFINE_CPU_UNIT. This gives information about a unit contained in CPU. We fill a struct unit_decl with information used later by `expand_automata'. */ void -gen_cpu_unit (def) - rtx def; +gen_cpu_unit (rtx def) { decl_t decl; char **str_cpu_units; @@ -1695,13 +1670,12 @@ gen_cpu_unit (def) } } -/* Process a DEFINE_QUERY_CPU_UNIT. +/* Process a DEFINE_QUERY_CPU_UNIT. This gives information about a unit contained in CPU. We fill a struct unit_decl with information used later by `expand_automata'. */ void -gen_query_cpu_unit (def) - rtx def; +gen_query_cpu_unit (rtx def) { decl_t decl; char **str_cpu_units; @@ -1725,14 +1699,13 @@ gen_query_cpu_unit (def) } } -/* Process a DEFINE_BYPASS. +/* Process a DEFINE_BYPASS. This gives information about a unit contained in the CPU. We fill in a struct bypass_decl with information used later by `expand_automata'. */ void -gen_bypass (def) - rtx def; +gen_bypass (rtx def) { decl_t decl; char **out_insns; @@ -1762,14 +1735,13 @@ gen_bypass (def) } } -/* Process an EXCLUSION_SET. +/* Process an EXCLUSION_SET. This gives information about a cpu unit conflicts. We fill a struct excl_rel_decl (excl) with information used later by `expand_automata'. */ void -gen_excl_set (def) - rtx def; +gen_excl_set (rtx def) { decl_t decl; char **first_str_cpu_units; @@ -1809,10 +1781,7 @@ gen_excl_set (def) We fill a struct unit_pattern_rel_decl with information used later by `expand_automata'. */ static void -gen_presence_absence_set (def, presence_p, final_p) - rtx def; - int presence_p; - int final_p; +gen_presence_absence_set (rtx def, int presence_p, int final_p) { decl_t decl; char **str_cpu_units; @@ -1874,62 +1843,57 @@ gen_presence_absence_set (def, presence_p, final_p) num_dfa_decls++; } -/* Process a PRESENCE_SET. - +/* Process a PRESENCE_SET. + This gives information about a cpu unit reservation requirements. We fill a struct unit_pattern_rel_decl (presence) with information used later by `expand_automata'. */ - void -gen_presence_set (def) - rtx def; +void +gen_presence_set (rtx def) { gen_presence_absence_set (def, TRUE, FALSE); } - -/* Process a FINAL_PRESENCE_SET. + +/* Process a FINAL_PRESENCE_SET. This gives information about a cpu unit reservation requirements. We fill a struct unit_pattern_rel_decl (presence) with information used later by `expand_automata'. */ void -gen_final_presence_set (def) - rtx def; +gen_final_presence_set (rtx def) { gen_presence_absence_set (def, TRUE, TRUE); } - + /* Process an ABSENCE_SET. This gives information about a cpu unit reservation requirements. We fill a struct unit_pattern_rel_decl (absence) with information used later by `expand_automata'. */ void -gen_absence_set (def) - rtx def; +gen_absence_set (rtx def) { gen_presence_absence_set (def, FALSE, FALSE); } - + /* Process a FINAL_ABSENCE_SET. This gives information about a cpu unit reservation requirements. We fill a struct unit_pattern_rel_decl (absence) with information used later by `expand_automata'. */ void -gen_final_absence_set (def) - rtx def; +gen_final_absence_set (rtx def) { gen_presence_absence_set (def, FALSE, TRUE); } - -/* Process a DEFINE_AUTOMATON. + +/* Process a DEFINE_AUTOMATON. This gives information about a finite state automaton used for recognizing pipeline hazards. We fill a struct automaton_decl with information used later by `expand_automata'. */ void -gen_automaton (def) - rtx def; +gen_automaton (rtx def) { decl_t decl; char **str_automata; @@ -1951,13 +1915,12 @@ gen_automaton (def) } } -/* Process an AUTOMATA_OPTION. +/* Process an AUTOMATA_OPTION. This gives information how to generate finite state automaton used for recognizing pipeline hazards. */ void -gen_automata_option (def) - rtx def; +gen_automata_option (rtx def) { if (strcmp ((char *) XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0) no_minimization_flag = 1; @@ -1982,8 +1945,7 @@ static char *reserv_str; /* Parse an element in STR. */ static regexp_t -gen_regexp_el (str) - char *str; +gen_regexp_el (char *str) { regexp_t regexp; int len; @@ -2012,8 +1974,7 @@ gen_regexp_el (str) /* Parse construction `repeat' in STR. */ static regexp_t -gen_regexp_repeat (str) - char *str; +gen_regexp_repeat (char *str) { regexp_t regexp; regexp_t repeat; @@ -2046,8 +2007,7 @@ gen_regexp_repeat (str) /* Parse reservation STR which possibly contains separator '+'. */ static regexp_t -gen_regexp_allof (str) - char *str; +gen_regexp_allof (char *str) { regexp_t allof; char **allof_vect; @@ -2073,8 +2033,7 @@ gen_regexp_allof (str) /* Parse reservation STR which possibly contains separator '|'. */ static regexp_t -gen_regexp_oneof (str) - char *str; +gen_regexp_oneof (char *str) { regexp_t oneof; char **oneof_vect; @@ -2100,8 +2059,7 @@ gen_regexp_oneof (str) /* Parse reservation STR which possibly contains separator ','. */ static regexp_t -gen_regexp_sequence (str) - char *str; +gen_regexp_sequence (char *str) { regexp_t sequence; char **sequence_vect; @@ -2126,8 +2084,7 @@ gen_regexp_sequence (str) /* Parse construction reservation STR. */ static regexp_t -gen_regexp (str) - char *str; +gen_regexp (char *str) { reserv_str = str; return gen_regexp_sequence (str);; @@ -2139,8 +2096,7 @@ gen_regexp (str) in a struct reserv_decl with information used later by `expand_automata'. */ void -gen_reserv (def) - rtx def; +gen_reserv (rtx def) { decl_t decl; @@ -2159,8 +2115,7 @@ gen_reserv (def) insn. We fill a struct insn_reserv_decl with information used later by `expand_automata'. */ void -gen_insn_reserv (def) - rtx def; +gen_insn_reserv (rtx def) { decl_t decl; @@ -2180,8 +2135,7 @@ gen_insn_reserv (def) /* The function evaluates hash value (0..UINT_MAX) of string. */ static unsigned -string_hash (string) - const char *string; +string_hash (const char *string) { unsigned result, i; @@ -2201,8 +2155,7 @@ string_hash (string) function is used by abstract data `hashtab'. The function returns hash value (0..UINT_MAX) of given automaton declaration. */ static hashval_t -automaton_decl_hash (automaton_decl) - const void *automaton_decl; +automaton_decl_hash (const void *automaton_decl) { const decl_t decl = (decl_t) automaton_decl; @@ -2216,9 +2169,8 @@ automaton_decl_hash (automaton_decl) function returns 1 if the declarations have the same key, 0 otherwise. */ static int -automaton_decl_eq_p (automaton_decl_1, automaton_decl_2) - const void* automaton_decl_1; - const void* automaton_decl_2; +automaton_decl_eq_p (const void* automaton_decl_1, + const void* automaton_decl_2) { const decl_t decl1 = (decl_t) automaton_decl_1; const decl_t decl2 = (decl_t) automaton_decl_2; @@ -2240,8 +2192,7 @@ static htab_t automaton_decl_table; declaration node in the table with the same key as given automaton declaration node. */ static decl_t -insert_automaton_decl (automaton_decl) - decl_t automaton_decl; +insert_automaton_decl (decl_t automaton_decl) { void **entry_ptr; @@ -2261,8 +2212,7 @@ static struct decl work_automaton_decl; declaration. The function returns node found in the table, NULL if such node does not exist in the table. */ static decl_t -find_automaton_decl (name) - char *name; +find_automaton_decl (char *name) { void *entry; @@ -2277,7 +2227,7 @@ find_automaton_decl (name) declaration with given name. The function must be called only once before any work with the automaton declaration table. */ static void -initiate_automaton_decl_table () +initiate_automaton_decl_table (void) { work_automaton_decl.mode = dm_automaton; automaton_decl_table = htab_create (10, automaton_decl_hash, @@ -2288,7 +2238,7 @@ initiate_automaton_decl_table () function `initiate_automaton_decl_table' is possible immediately after this function call. */ static void -finish_automaton_decl_table () +finish_automaton_decl_table (void) { htab_delete (automaton_decl_table); } @@ -2305,8 +2255,7 @@ finish_automaton_decl_table () function is used by abstract data `hashtab'. The function returns hash value (0..UINT_MAX) of given insn declaration. */ static hashval_t -insn_decl_hash (insn_decl) - const void *insn_decl; +insn_decl_hash (const void *insn_decl) { const decl_t decl = (decl_t) insn_decl; @@ -2319,9 +2268,7 @@ insn_decl_hash (insn_decl) The function is used by abstract data `hashtab'. The function returns 1 if declarations have the same key, 0 otherwise. */ static int -insn_decl_eq_p (insn_decl_1, insn_decl_2) - const void *insn_decl_1; - const void *insn_decl_2; +insn_decl_eq_p (const void *insn_decl_1, const void *insn_decl_2) { const decl_t decl1 = (decl_t) insn_decl_1; const decl_t decl2 = (decl_t) insn_decl_2; @@ -2344,8 +2291,7 @@ static htab_t insn_decl_table; already in the table. The function returns insn declaration node in the table with the same key as given insn declaration node. */ static decl_t -insert_insn_decl (insn_decl) - decl_t insn_decl; +insert_insn_decl (decl_t insn_decl) { void **entry_ptr; @@ -2365,8 +2311,7 @@ static struct decl work_insn_decl; declaration. The function returns node found in the table, NULL if such node does not exist in the table. */ static decl_t -find_insn_decl (name) - char *name; +find_insn_decl (char *name) { void *entry; @@ -2381,7 +2326,7 @@ find_insn_decl (name) declaration with given name. The function must be called only once before any work with the insn declaration table. */ static void -initiate_insn_decl_table () +initiate_insn_decl_table (void) { work_insn_decl.mode = dm_insn_reserv; insn_decl_table = htab_create (10, insn_decl_hash, insn_decl_eq_p, @@ -2392,7 +2337,7 @@ initiate_insn_decl_table () function `initiate_insn_decl_table' is possible immediately after this function call. */ static void -finish_insn_decl_table () +finish_insn_decl_table (void) { htab_delete (insn_decl_table); } @@ -2408,8 +2353,7 @@ finish_insn_decl_table () is used by abstract data `hashtab'. The function returns hash value (0..UINT_MAX) of given declaration. */ static hashval_t -decl_hash (decl) - const void *decl; +decl_hash (const void *decl) { const decl_t d = (const decl_t) decl; @@ -2424,9 +2368,7 @@ decl_hash (decl) function is used by abstract data `hashtab'. The function returns 1 if the declarations have the same key, 0 otherwise. */ static int -decl_eq_p (decl_1, decl_2) - const void *decl_1; - const void *decl_2; +decl_eq_p (const void *decl_1, const void *decl_2) { const decl_t d1 = (const decl_t) decl_1; const decl_t d2 = (const decl_t) decl_2; @@ -2452,8 +2394,7 @@ static htab_t decl_table; same key as given declaration node. */ static decl_t -insert_decl (decl) - decl_t decl; +insert_decl (decl_t decl) { void **entry_ptr; @@ -2472,8 +2413,7 @@ static struct decl work_decl; returns node found in the table, NULL if such node does not exist in the table. */ static decl_t -find_decl (name) - char *name; +find_decl (char *name) { void *entry; @@ -2488,7 +2428,7 @@ find_decl (name) The function must be called only once before any work with the declaration table. */ static void -initiate_decl_table () +initiate_decl_table (void) { work_decl.mode = dm_unit; decl_table = htab_create (10, decl_hash, decl_eq_p, (htab_del) 0); @@ -2498,7 +2438,7 @@ initiate_decl_table () `initiate_declaration_table' is possible immediately after this function call. */ static void -finish_decl_table () +finish_decl_table (void) { htab_delete (decl_table); } @@ -2510,10 +2450,7 @@ finish_decl_table () /* Checking NAMES in an exclusion clause vector and returning formed unit_set_el_list. */ static unit_set_el_t -process_excls (names, num, excl_pos) - char **names; - int num; - pos_t excl_pos ATTRIBUTE_UNUSED; +process_excls (char **names, int num, pos_t excl_pos ATTRIBUTE_UNUSED) { unit_set_el_t el_list; unit_set_el_t last_el; @@ -2551,10 +2488,8 @@ process_excls (names, num, excl_pos) list of the each element from DEST_LIST. Checking situation "unit excludes itself". */ static void -add_excls (dest_list, source_list, excl_pos) - unit_set_el_t dest_list; - unit_set_el_t source_list; - pos_t excl_pos ATTRIBUTE_UNUSED; +add_excls (unit_set_el_t dest_list, unit_set_el_t source_list, + pos_t excl_pos ATTRIBUTE_UNUSED) { unit_set_el_t dst; unit_set_el_t src; @@ -2601,12 +2536,9 @@ add_excls (dest_list, source_list, excl_pos) formed unit_set_el_list. The function is called only after processing all exclusion sets. */ static unit_set_el_t -process_presence_absence_names (names, num, req_pos, presence_p, final_p) - char **names; - int num; - pos_t req_pos ATTRIBUTE_UNUSED; - int presence_p; - int final_p; +process_presence_absence_names (char **names, int num, + pos_t req_pos ATTRIBUTE_UNUSED, + int presence_p, int final_p) { unit_set_el_t el_list; unit_set_el_t last_el; @@ -2656,12 +2588,9 @@ process_presence_absence_names (names, num, req_pos, presence_p, final_p) returning the formed pattern_set_el_list. The function is called only after processing all exclusion sets. */ static pattern_set_el_t -process_presence_absence_patterns (patterns, num, req_pos, presence_p, final_p) - char ***patterns; - int num; - pos_t req_pos ATTRIBUTE_UNUSED; - int presence_p; - int final_p; +process_presence_absence_patterns (char ***patterns, int num, + pos_t req_pos ATTRIBUTE_UNUSED, + int presence_p, int final_p) { pattern_set_el_t el_list; pattern_set_el_t last_el; @@ -2730,12 +2659,10 @@ process_presence_absence_patterns (patterns, num, req_pos, presence_p, final_p) automata". Remember that we process absence sets only after all presence sets. */ static void -add_presence_absence (dest_list, pattern_list, req_pos, presence_p, final_p) - unit_set_el_t dest_list; - pattern_set_el_t pattern_list; - pos_t req_pos ATTRIBUTE_UNUSED; - int presence_p; - int final_p; +add_presence_absence (unit_set_el_t dest_list, + pattern_set_el_t pattern_list, + pos_t req_pos ATTRIBUTE_UNUSED, + int presence_p, int final_p) { unit_set_el_t dst; pattern_set_el_t pat; @@ -2851,9 +2778,8 @@ add_presence_absence (dest_list, pattern_list, req_pos, presence_p, final_p) /* The function searches for bypass with given IN_INSN_RESERV in given BYPASS_LIST. */ static struct bypass_decl * -find_bypass (bypass_list, in_insn_reserv) - struct bypass_decl *bypass_list; - struct insn_reserv_decl *in_insn_reserv; +find_bypass (struct bypass_decl *bypass_list, + struct insn_reserv_decl *in_insn_reserv) { struct bypass_decl *bypass; @@ -2866,7 +2792,7 @@ find_bypass (bypass_list, in_insn_reserv) /* The function processes pipeline description declarations, checks their correctness, and forms exclusion/presence/absence sets. */ static void -process_decls () +process_decls (void) { decl_t decl; decl_t automaton_decl; @@ -3040,7 +2966,7 @@ process_decls () { unit_set_el_t unit_set_el_list; unit_set_el_t unit_set_el_list_2; - + unit_set_el_list = process_excls (DECL_EXCL (decl)->names, DECL_EXCL (decl)->first_list_length, decl->pos); @@ -3063,7 +2989,7 @@ process_decls () { unit_set_el_t unit_set_el_list; pattern_set_el_t pattern_set_el_list; - + unit_set_el_list = process_presence_absence_names (DECL_PRESENCE (decl)->names, DECL_PRESENCE (decl)->names_num, @@ -3087,7 +3013,7 @@ process_decls () { unit_set_el_t unit_set_el_list; pattern_set_el_t pattern_set_el_list; - + unit_set_el_list = process_presence_absence_names (DECL_ABSENCE (decl)->names, DECL_ABSENCE (decl)->names_num, @@ -3108,7 +3034,7 @@ process_decls () the automaton is not used, the function fixes error/warning. The following function must be called only after `process_decls'. */ static void -check_automaton_usage () +check_automaton_usage (void) { decl_t decl; int i; @@ -3134,13 +3060,12 @@ check_automaton_usage () Remember that reserv_regexp does not exist before the function call. */ static regexp_t -process_regexp (regexp) - regexp_t regexp; +process_regexp (regexp_t regexp) { decl_t decl_in_table; regexp_t new_regexp; int i; - + if (regexp->mode == rm_unit) { decl_in_table = find_decl (REGEXP_UNIT (regexp)->name); @@ -3190,7 +3115,7 @@ process_regexp (regexp) define_insn_reservation with the aid of function `process_regexp'. */ static void -process_regexp_decls () +process_regexp_decls (void) { decl_t decl; int i; @@ -3212,7 +3137,7 @@ process_regexp_decls () following function must be called only after `process_decls', `process_regexp_decls'. */ static void -check_usage () +check_usage (void) { decl_t decl; int i; @@ -3245,9 +3170,7 @@ static int curr_loop_pass_num; contains given decl or reservations in given regexp refers for given decl. */ static int -loop_in_regexp (regexp, start_decl) - regexp_t regexp; - decl_t start_decl; +loop_in_regexp (regexp_t regexp, decl_t start_decl) { int i; @@ -3306,7 +3229,7 @@ loop_in_regexp (regexp, start_decl) /* The following function fixes errors "cycle in definition ...". The function uses function `loop_in_regexp' for that. */ static void -check_loops_in_regexps () +check_loops_in_regexps (void) { decl_t decl; int i; @@ -3321,7 +3244,7 @@ check_loops_in_regexps () { decl = description->decls [i]; curr_loop_pass_num = i; - + if (decl->mode == dm_reserv) { DECL_RESERV (decl)->loop_pass_num = curr_loop_pass_num; @@ -3339,11 +3262,9 @@ check_loops_in_regexps () /* The function recursively processes IR of reservation and defines max and min cycle for reservation of unit. */ static void -process_regexp_cycles (regexp, max_start_cycle, min_start_cycle, - max_finish_cycle, min_finish_cycle) - regexp_t regexp; - int max_start_cycle, min_start_cycle; - int *max_finish_cycle, *min_finish_cycle; +process_regexp_cycles (regexp_t regexp, int max_start_cycle, + int min_start_cycle, int *max_finish_cycle, + int *min_finish_cycle) { int i; @@ -3431,7 +3352,7 @@ process_regexp_cycles (regexp, max_start_cycle, min_start_cycle, /* The following function is called only for correct program. The function defines max reservation of insns in cycles. */ static void -evaluate_max_reserv_cycles () +evaluate_max_reserv_cycles (void) { int max_insn_cycles_num; int min_insn_cycles_num; @@ -3456,7 +3377,7 @@ evaluate_max_reserv_cycles () /* The following function calls functions for checking all description. */ static void -check_all_description () +check_all_description (void) { process_decls (); check_automaton_usage (); @@ -3476,7 +3397,7 @@ check_all_description () /* The following function creates ticker and makes it active. */ static ticker_t -create_ticker () +create_ticker (void) { ticker_t ticker; @@ -3487,8 +3408,7 @@ create_ticker () /* The following function switches off given ticker. */ static void -ticker_off (ticker) - ticker_t *ticker; +ticker_off (ticker_t *ticker) { if (ticker->incremented_off_time == 0) ticker->incremented_off_time = get_run_time () + 1; @@ -3496,8 +3416,7 @@ ticker_off (ticker) /* The following function switches on given ticker. */ static void -ticker_on (ticker) - ticker_t *ticker; +ticker_on (ticker_t *ticker) { if (ticker->incremented_off_time != 0) { @@ -3510,8 +3429,7 @@ ticker_on (ticker) /* The following function returns current time in milliseconds since the moment when given ticker was created. */ static int -active_time (ticker) - ticker_t ticker; +active_time (ticker_t ticker) { if (ticker.incremented_off_time != 0) return ticker.incremented_off_time - 1 - ticker.modified_creation_time; @@ -3536,9 +3454,7 @@ active_time (ticker) */ static void -print_active_time (f, ticker) - FILE *f; - ticker_t ticker; +print_active_time (FILE *f, ticker_t ticker) { int msecs; @@ -3586,7 +3502,7 @@ static ticker_t all_time; /* Pseudo insn decl which denotes advancing cycle. */ static decl_t advance_cycle_insn_decl; static void -add_advance_cycle_insn_decl () +add_advance_cycle_insn_decl (void) { advance_cycle_insn_decl = create_node (sizeof (struct decl)); advance_cycle_insn_decl->mode = dm_insn_reserv; @@ -3617,8 +3533,8 @@ static int allocated_alt_states_num = 0; /* The following function returns free node alt_state. It may be new allocated node or node freed earlier. */ -static alt_state_t -get_free_alt_state () +static alt_state_t +get_free_alt_state (void) { alt_state_t result; @@ -3642,8 +3558,7 @@ get_free_alt_state () /* The function frees node ALT_STATE. */ static void -free_alt_state (alt_state) - alt_state_t alt_state; +free_alt_state (alt_state_t alt_state) { if (alt_state == NULL) return; @@ -3653,8 +3568,7 @@ free_alt_state (alt_state) /* The function frees list started with node ALT_STATE_LIST. */ static void -free_alt_states (alt_states_list) - alt_state_t alt_states_list; +free_alt_states (alt_state_t alt_states_list) { alt_state_t curr_alt_state; alt_state_t next_alt_state; @@ -3670,9 +3584,7 @@ free_alt_states (alt_states_list) /* The function compares unique numbers of alt states. */ static int -alt_state_cmp (alt_state_ptr_1, alt_state_ptr_2) - const void *alt_state_ptr_1; - const void *alt_state_ptr_2; +alt_state_cmp (const void *alt_state_ptr_1, const void *alt_state_ptr_2) { if ((*(alt_state_t *) alt_state_ptr_1)->state->unique_num == (*(alt_state_t *) alt_state_ptr_2)->state->unique_num) @@ -3687,9 +3599,8 @@ alt_state_cmp (alt_state_ptr_1, alt_state_ptr_2) /* The function sorts ALT_STATES_LIST and removes duplicated alt states from the list. The comparison key is alt state unique number. */ -static alt_state_t -uniq_sort_alt_states (alt_states_list) - alt_state_t alt_states_list; +static alt_state_t +uniq_sort_alt_states (alt_state_t alt_states_list) { alt_state_t curr_alt_state; vla_ptr_t alt_states; @@ -3735,9 +3646,7 @@ uniq_sort_alt_states (alt_states_list) /* The function checks equality of alt state lists. Remember that the lists must be already sorted by the previous function. */ static int -alt_states_eq (alt_states_1, alt_states_2) - alt_state_t alt_states_1; - alt_state_t alt_states_2; +alt_states_eq (alt_state_t alt_states_1, alt_state_t alt_states_2) { while (alt_states_1 != NULL && alt_states_2 != NULL && alt_state_cmp (&alt_states_1, &alt_states_2) == 0) @@ -3750,14 +3659,14 @@ alt_states_eq (alt_states_1, alt_states_2) /* Initialization of the abstract data. */ static void -initiate_alt_states () +initiate_alt_states (void) { first_free_alt_state = NULL; } /* Finishing work with the abstract data. */ static void -finish_alt_states () +finish_alt_states (void) { } @@ -3825,7 +3734,7 @@ static int allocated_states_num = 0; /* Allocate new reservation set. */ static reserv_sets_t -alloc_empty_reserv_sets () +alloc_empty_reserv_sets (void) { reserv_sets_t result; @@ -3838,8 +3747,7 @@ alloc_empty_reserv_sets () /* Hash value of reservation set. */ static unsigned -reserv_sets_hash_value (reservs) - reserv_sets_t reservs; +reserv_sets_hash_value (reserv_sets_t reservs) { set_el_t hash_value; unsigned result; @@ -3873,9 +3781,7 @@ reserv_sets_hash_value (reservs) /* Comparison of given reservation sets. */ static int -reserv_sets_cmp (reservs_1, reservs_2) - reserv_sets_t reservs_1; - reserv_sets_t reservs_2; +reserv_sets_cmp (reserv_sets_t reservs_1, reserv_sets_t reservs_2) { int reservs_num; set_el_t *reserv_ptr_1; @@ -3902,9 +3808,7 @@ reserv_sets_cmp (reservs_1, reservs_2) /* The function checks equality of the reservation sets. */ static int -reserv_sets_eq (reservs_1, reservs_2) - reserv_sets_t reservs_1; - reserv_sets_t reservs_2; +reserv_sets_eq (reserv_sets_t reservs_1, reserv_sets_t reservs_2) { return reserv_sets_cmp (reservs_1, reservs_2) == 0; } @@ -3912,10 +3816,7 @@ reserv_sets_eq (reservs_1, reservs_2) /* Set up in the reservation set that unit with UNIT_NUM is used on CYCLE_NUM. */ static void -set_unit_reserv (reservs, cycle_num, unit_num) - reserv_sets_t reservs; - int cycle_num; - int unit_num; +set_unit_reserv (reserv_sets_t reservs, int cycle_num, int unit_num) { if (cycle_num >= max_cycles_num) abort (); @@ -3926,10 +3827,7 @@ set_unit_reserv (reservs, cycle_num, unit_num) /* Set up in the reservation set RESERVS that unit with UNIT_NUM is used on CYCLE_NUM. */ static int -test_unit_reserv (reservs, cycle_num, unit_num) - reserv_sets_t reservs; - int cycle_num; - int unit_num; +test_unit_reserv (reserv_sets_t reservs, int cycle_num, int unit_num) { if (cycle_num >= max_cycles_num) abort (); @@ -3940,8 +3838,7 @@ test_unit_reserv (reservs, cycle_num, unit_num) /* The function checks that the reservation set represents no one unit reservation. */ static int -it_is_empty_reserv_sets (operand) - reserv_sets_t operand; +it_is_empty_reserv_sets (reserv_sets_t operand) { set_el_t *reserv_ptr; int reservs_num; @@ -3960,9 +3857,8 @@ it_is_empty_reserv_sets (operand) i.e. there is a unit reservation on a cycle in both reservation sets. */ static int -reserv_sets_are_intersected (operand_1, operand_2) - reserv_sets_t operand_1; - reserv_sets_t operand_2; +reserv_sets_are_intersected (reserv_sets_t operand_1, + reserv_sets_t operand_2) { set_el_t *el_ptr_1; set_el_t *el_ptr_2; @@ -4005,9 +3901,7 @@ reserv_sets_are_intersected (operand_1, operand_2) cpu cycle. The remaining bits of OPERAND (representing the last cycle unit reservations) are not changed. */ static void -reserv_sets_shift (result, operand) - reserv_sets_t result; - reserv_sets_t operand; +reserv_sets_shift (reserv_sets_t result, reserv_sets_t operand) { int i; @@ -4019,10 +3913,8 @@ reserv_sets_shift (result, operand) /* OR of the reservation sets. */ static void -reserv_sets_or (result, operand_1, operand_2) - reserv_sets_t result; - reserv_sets_t operand_1; - reserv_sets_t operand_2; +reserv_sets_or (reserv_sets_t result, reserv_sets_t operand_1, + reserv_sets_t operand_2) { set_el_t *el_ptr_1; set_el_t *el_ptr_2; @@ -4038,10 +3930,8 @@ reserv_sets_or (result, operand_1, operand_2) /* AND of the reservation sets. */ static void -reserv_sets_and (result, operand_1, operand_2) - reserv_sets_t result; - reserv_sets_t operand_1; - reserv_sets_t operand_2; +reserv_sets_and (reserv_sets_t result, reserv_sets_t operand_1, + reserv_sets_t operand_2) { set_el_t *el_ptr_1; set_el_t *el_ptr_2; @@ -4059,11 +3949,8 @@ reserv_sets_and (result, operand_1, operand_2) cycle START_CYCLE in the reservation set. The function uses repeat construction if REPETITION_NUM > 1. */ static void -output_cycle_reservs (f, reservs, start_cycle, repetition_num) - FILE *f; - reserv_sets_t reservs; - int start_cycle; - int repetition_num; +output_cycle_reservs (FILE *f, reserv_sets_t reservs, int start_cycle, + int repetition_num) { int unit_num; int reserved_units_num; @@ -4102,9 +3989,7 @@ output_cycle_reservs (f, reservs, start_cycle, repetition_num) /* The function outputs string representation of units reservation in the reservation set. */ static void -output_reserv_sets (f, reservs) - FILE *f; - reserv_sets_t reservs; +output_reserv_sets (FILE *f, reserv_sets_t reservs) { int start_cycle = 0; int cycle; @@ -4144,9 +4029,7 @@ output_reserv_sets (f, reservs) may be new allocated node or node freed earlier. The function also allocates reservation set if WITH_RESERVS has nonzero value. */ static state_t -get_free_state (with_reservs, automaton) - int with_reservs; - automaton_t automaton; +get_free_state (int with_reservs, automaton_t automaton) { state_t result; @@ -4187,8 +4070,7 @@ get_free_state (with_reservs, automaton) /* The function frees node STATE. */ static void -free_state (state) - state_t state; +free_state (state_t state) { free_alt_states (state->component_states); VLA_PTR_ADD (free_states, state); @@ -4199,8 +4081,7 @@ free_state (state) it is formed from hash values of the component deterministic states. One more key is order number of state automaton. */ static hashval_t -state_hash (state) - const void *state; +state_hash (const void *state) { unsigned int hash_value; alt_state_t alt_state; @@ -4225,9 +4106,7 @@ state_hash (state) /* Return nonzero value if the states are the same. */ static int -state_eq_p (state_1, state_2) - const void *state_1; - const void *state_2; +state_eq_p (const void *state_1, const void *state_2) { alt_state_t alt_state_1; alt_state_t alt_state_2; @@ -4258,8 +4137,7 @@ state_eq_p (state_1, state_2) /* Insert STATE into the state table. */ static state_t -insert_state (state) - state_t state; +insert_state (state_t state) { void **entry_ptr; @@ -4272,10 +4150,7 @@ insert_state (state) /* Add reservation of unit with UNIT_NUM on cycle CYCLE_NUM to deterministic STATE. */ static void -set_state_reserv (state, cycle_num, unit_num) - state_t state; - int cycle_num; - int unit_num; +set_state_reserv (state_t state, int cycle_num, int unit_num) { set_unit_reserv (state->reservs, cycle_num, unit_num); } @@ -4283,9 +4158,7 @@ set_state_reserv (state, cycle_num, unit_num) /* Return nonzero value if the deterministic states contains a reservation of the same cpu unit on the same cpu cycle. */ static int -intersected_state_reservs_p (state1, state2) - state_t state1; - state_t state2; +intersected_state_reservs_p (state_t state1, state_t state2) { if (state1->automaton != state2->automaton) abort (); @@ -4296,10 +4169,7 @@ intersected_state_reservs_p (state1, state2) representing the automaton state which is union of reservations of the deterministic states masked by RESERVS. */ static state_t -states_union (state1, state2, reservs) - state_t state1; - state_t state2; - reserv_sets_t reservs; +states_union (state_t state1, state_t state2, reserv_sets_t reservs) { state_t result; state_t state_in_table; @@ -4322,9 +4192,7 @@ states_union (state1, state2, reservs) represent the automaton state is obtained from deterministic STATE by advancing cpu cycle and masking by RESERVS. */ static state_t -state_shift (state, reservs) - state_t state; - reserv_sets_t reservs; +state_shift (state_t state, reserv_sets_t reservs) { state_t result; state_t state_in_table; @@ -4343,7 +4211,7 @@ state_shift (state, reservs) /* Initialization of the abstract data. */ static void -initiate_states () +initiate_states (void) { decl_t decl; int i; @@ -4372,7 +4240,7 @@ initiate_states () /* Finishing work with the abstract data. */ static void -finish_states () +finish_states (void) { VLA_PTR_DELETE (units_container); htab_delete (state_table); @@ -4395,8 +4263,7 @@ static int allocated_arcs_num = 0; /* The function frees node ARC. */ static void -free_arc (arc) - arc_t arc; +free_arc (arc_t arc) { arc->next_out_arc = first_free_arc; first_free_arc = arc; @@ -4404,9 +4271,7 @@ free_arc (arc) /* The function removes and frees ARC staring from FROM_STATE. */ static void -remove_arc (from_state, arc) - state_t from_state; - arc_t arc; +remove_arc (state_t from_state, arc_t arc) { arc_t prev_arc; arc_t curr_arc; @@ -4430,10 +4295,7 @@ remove_arc (from_state, arc) /* The functions returns arc with given characteristics (or NULL if the arc does not exist). */ static arc_t -find_arc (from_state, to_state, insn) - state_t from_state; - state_t to_state; - ainsn_t insn; +find_arc (state_t from_state, state_t to_state, ainsn_t insn) { arc_t arc; @@ -4447,11 +4309,8 @@ find_arc (from_state, to_state, insn) and with given STATE_ALTS. The function returns added arc (or already existing arc). */ static arc_t -add_arc (from_state, to_state, ainsn, state_alts) - state_t from_state; - state_t to_state; - ainsn_t ainsn; - int state_alts; +add_arc (state_t from_state, state_t to_state, ainsn_t ainsn, + int state_alts) { arc_t new_arc; @@ -4485,30 +4344,28 @@ add_arc (from_state, to_state, ainsn, state_alts) /* The function returns the first arc starting from STATE. */ static arc_t -first_out_arc (state) - state_t state; +first_out_arc (state_t state) { return state->first_out_arc; } /* The function returns next out arc after ARC. */ static arc_t -next_out_arc (arc) - arc_t arc; +next_out_arc (arc_t arc) { return arc->next_out_arc; } /* Initialization of the abstract data. */ static void -initiate_arcs () +initiate_arcs (void) { first_free_arc = NULL; } /* Finishing work with the abstract data. */ static void -finish_arcs () +finish_arcs (void) { } @@ -4527,8 +4384,8 @@ static htab_t automata_list_table; /* The following function returns free automata list el. It may be new allocated node or node freed earlier. */ -static automata_list_el_t -get_free_automata_list_el () +static automata_list_el_t +get_free_automata_list_el (void) { automata_list_el_t result; @@ -4547,8 +4404,7 @@ get_free_automata_list_el () /* The function frees node AUTOMATA_LIST_EL. */ static void -free_automata_list_el (automata_list_el) - automata_list_el_t automata_list_el; +free_automata_list_el (automata_list_el_t automata_list_el) { if (automata_list_el == NULL) return; @@ -4558,8 +4414,7 @@ free_automata_list_el (automata_list_el) /* The function frees list AUTOMATA_LIST. */ static void -free_automata_list (automata_list) - automata_list_el_t automata_list; +free_automata_list (automata_list_el_t automata_list) { automata_list_el_t curr_automata_list_el; automata_list_el_t next_automata_list_el; @@ -4575,8 +4430,7 @@ free_automata_list (automata_list) /* Hash value of AUTOMATA_LIST. */ static hashval_t -automata_list_hash (automata_list) - const void *automata_list; +automata_list_hash (const void *automata_list) { unsigned int hash_value; automata_list_el_t curr_automata_list_el; @@ -4593,9 +4447,7 @@ automata_list_hash (automata_list) /* Return nonzero value if the automata_lists are the same. */ static int -automata_list_eq_p (automata_list_1, automata_list_2) - const void *automata_list_1; - const void *automata_list_2; +automata_list_eq_p (const void *automata_list_1, const void *automata_list_2) { automata_list_el_t automata_list_el_1; automata_list_el_t automata_list_el_2; @@ -4612,7 +4464,7 @@ automata_list_eq_p (automata_list_1, automata_list_2) /* Initialization of the abstract data. */ static void -initiate_automata_lists () +initiate_automata_lists (void) { first_free_automata_list_el = NULL; automata_list_table = htab_create (1500, automata_list_hash, @@ -4622,15 +4474,14 @@ initiate_automata_lists () /* The following function starts new automata list and makes it the current one. */ static void -automata_list_start () +automata_list_start (void) { current_automata_list = NULL; } /* The following function adds AUTOMATON to the current list. */ static void -automata_list_add (automaton) - automaton_t automaton; +automata_list_add (automaton_t automaton) { automata_list_el_t el; @@ -4643,7 +4494,7 @@ automata_list_add (automaton) /* The following function finishes forming the current list, inserts it into the table and returns it. */ static automata_list_el_t -automata_list_finish () +automata_list_finish (void) { void **entry_ptr; @@ -4661,7 +4512,7 @@ automata_list_finish () /* Finishing work with the abstract data. */ static void -finish_automata_lists () +finish_automata_lists (void) { htab_delete (automata_list_table); } @@ -4683,7 +4534,7 @@ static reserv_sets_t *unit_excl_set_table; /* The following function forms the array containing exclusion sets for each unit. */ static void -initiate_excl_sets () +initiate_excl_sets (void) { decl_t decl; reserv_sets_t unit_excl_set; @@ -4721,8 +4572,7 @@ initiate_excl_sets () /* The function sets up and return EXCL_SET which is union of exclusion sets for each unit in IN_SET. */ static reserv_sets_t -get_excl_set (in_set) - reserv_sets_t in_set; +get_excl_set (reserv_sets_t in_set) { int excl_char_num; int chars_num; @@ -4764,8 +4614,7 @@ static pattern_reserv_t *unit_final_absence_set_table; /* The following function forms list of reservation sets for given PATTERN_LIST. */ static pattern_reserv_t -form_reserv_sets_list (pattern_list) - pattern_set_el_t pattern_list; +form_reserv_sets_list (pattern_set_el_t pattern_list) { pattern_set_el_t el; pattern_reserv_t first, curr, prev; @@ -4794,7 +4643,7 @@ form_reserv_sets_list (pattern_list) /* The following function forms the array containing presence and absence pattern sets for each unit. */ static void -initiate_presence_absence_pattern_sets () +initiate_presence_absence_pattern_sets (void) { decl_t decl; int i; @@ -4833,9 +4682,9 @@ initiate_presence_absence_pattern_sets () sets for units in ORIGIONAL_SET. The function returns TRUE if it is ok. */ static int -check_presence_pattern_sets (checked_set, origional_set, final_p) - reserv_sets_t checked_set, origional_set; - int final_p; +check_presence_pattern_sets (reserv_sets_t checked_set, + reserv_sets_t origional_set, + int final_p) { int char_num; int chars_num; @@ -4844,7 +4693,7 @@ check_presence_pattern_sets (checked_set, origional_set, final_p) int unit_num; int presence_p; pattern_reserv_t pat_reserv; - + chars_num = els_in_cycle_reserv * sizeof (set_el_t); for (char_num = 0; char_num < chars_num; char_num++) if (((unsigned char *) origional_set) [char_num]) @@ -4882,9 +4731,9 @@ check_presence_pattern_sets (checked_set, origional_set, final_p) sets for units in ORIGIONAL_SET. The function returns TRUE if it is ok. */ static int -check_absence_pattern_sets (checked_set, origional_set, final_p) - reserv_sets_t checked_set, origional_set; - int final_p; +check_absence_pattern_sets (reserv_sets_t checked_set, + reserv_sets_t origional_set, + int final_p) { int char_num; int chars_num; @@ -4892,7 +4741,7 @@ check_absence_pattern_sets (checked_set, origional_set, final_p) int start_unit_num; int unit_num; pattern_reserv_t pat_reserv; - + chars_num = els_in_cycle_reserv * sizeof (set_el_t); for (char_num = 0; char_num < chars_num; char_num++) if (((unsigned char *) origional_set) [char_num]) @@ -4933,8 +4782,7 @@ check_absence_pattern_sets (checked_set, origional_set, final_p) defined by define_reservation by corresponding value during making the copy. */ static regexp_t -copy_insn_regexp (regexp) - regexp_t regexp; +copy_insn_regexp (regexp_t regexp) { regexp_t result; int i; @@ -4992,8 +4840,7 @@ static int regexp_transformed_p; /* The function makes transformation A*N -> A, A, ... */ static regexp_t -transform_1 (regexp) - regexp_t regexp; +transform_1 (regexp_t regexp) { int i; int repeat_num; @@ -5024,8 +4871,7 @@ transform_1 (regexp) ...+(A+B+...)+C+... -> ...+A+B+...+C+... ...|(A|B|...)|C|... -> ...|A|B|...|C|... */ static regexp_t -transform_2 (regexp) - regexp_t regexp; +transform_2 (regexp_t regexp) { if (regexp->mode == rm_sequence) { @@ -5169,8 +5015,7 @@ transform_2 (regexp) ...+(A,B,...)+C+... -> (...+A+C+...),B,... ...+(A,B,...)+(C,D,...) -> (A+C),(B+D),... */ static regexp_t -transform_3 (regexp) - regexp_t regexp; +transform_3 (regexp_t regexp) { if (regexp->mode == rm_sequence) { @@ -5370,9 +5215,7 @@ transform_3 (regexp) /* The function traverses IR of reservation and applies transformations implemented by FUNC. */ static regexp_t -regexp_transform_func (regexp, func) - regexp_t regexp; - regexp_t (*func) PARAMS ((regexp_t regexp)); +regexp_transform_func (regexp_t regexp, regexp_t (*func) (regexp_t regexp)) { int i; @@ -5399,10 +5242,9 @@ regexp_transform_func (regexp, func) /* The function applies all transformations for IR representation of reservation REGEXP. */ static regexp_t -transform_regexp (regexp) - regexp_t regexp; +transform_regexp (regexp_t regexp) { - regexp = regexp_transform_func (regexp, transform_1); + regexp = regexp_transform_func (regexp, transform_1); do { regexp_transformed_p = 0; @@ -5416,7 +5258,7 @@ transform_regexp (regexp) /* The function applies all transformations for reservations of all insn declarations. */ static void -transform_insn_regexps () +transform_insn_regexps (void) { decl_t decl; int i; @@ -5468,11 +5310,8 @@ static vla_ptr_t cycle_alt_unit_usages; CYCLE in REGEXP alternative with ALT_NUM. The structure is made accessed through cycle_alt_unit_usages. */ static void -store_alt_unit_usage (regexp, unit, cycle, alt_num) - regexp_t regexp; - regexp_t unit; - int cycle; - int alt_num; +store_alt_unit_usage (regexp_t regexp, regexp_t unit, int cycle, + int alt_num) { size_t i, length, old_length; unit_decl_t unit_decl; @@ -5504,9 +5343,8 @@ store_alt_unit_usage (regexp, unit, cycle, alt_num) /* The function processes given REGEXP to find units with the wrong distribution. */ static void -check_regexp_units_distribution (insn_reserv_name, regexp) - const char *insn_reserv_name; - regexp_t regexp; +check_regexp_units_distribution (const char *insn_reserv_name, + regexp_t regexp) { int i, j, k, cycle; regexp_t seq, allof, unit; @@ -5600,7 +5438,7 @@ check_regexp_units_distribution (insn_reserv_name, regexp) /* The function finds units which violates units to automata distribution rule. If the units exist, report about them. */ static void -check_unit_distributions_to_automata () +check_unit_distributions_to_automata (void) { decl_t decl; int i; @@ -5629,15 +5467,13 @@ static state_t state_being_formed; /* Current alt_state being formed. */ static alt_state_t alt_state_being_formed; - + /* This recursive function processes `,' and units in reservation REGEXP for forming alt_states of AUTOMATON. It is believed that CURR_CYCLE is start cycle of all reservation REGEXP. */ static int -process_seq_for_forming_states (regexp, automaton, curr_cycle) - regexp_t regexp; - automaton_t automaton; - int curr_cycle; +process_seq_for_forming_states (regexp_t regexp, automaton_t automaton, + int curr_cycle) { int i; @@ -5685,9 +5521,8 @@ process_seq_for_forming_states (regexp, automaton, curr_cycle) /* This recursive function finishes forming ALT_STATE of AUTOMATON and inserts alt_state into the table. */ static void -finish_forming_alt_state (alt_state, automaton) - alt_state_t alt_state; - automaton_t automaton ATTRIBUTE_UNUSED; +finish_forming_alt_state (alt_state_t alt_state, + automaton_t automaton ATTRIBUTE_UNUSED) { state_t state_in_table; state_t corresponding_state; @@ -5709,10 +5544,8 @@ static ainsn_t curr_ainsn; forming alt_states of AUTOMATON. List of the alt states should have the same order as in the description. */ static void -process_alts_for_forming_states (regexp, automaton, inside_oneof_p) - regexp_t regexp; - automaton_t automaton; - int inside_oneof_p; +process_alts_for_forming_states (regexp_t regexp, automaton_t automaton, + int inside_oneof_p) { int i; @@ -5744,8 +5577,7 @@ process_alts_for_forming_states (regexp, automaton, inside_oneof_p) /* Create nodes alt_state for all AUTOMATON insns. */ static void -create_alt_states (automaton) - automaton_t automaton; +create_alt_states (automaton_t automaton) { struct insn_reserv_decl *reserv_decl; @@ -5773,8 +5605,7 @@ create_alt_states (automaton) /* The function forms list of ainsns of AUTOMATON with the same reservation. */ static void -form_ainsn_with_same_reservs (automaton) - automaton_t automaton; +form_ainsn_with_same_reservs (automaton_t automaton) { ainsn_t curr_ainsn; size_t i; @@ -5826,8 +5657,7 @@ form_ainsn_with_same_reservs (automaton) of reservs_matter means some minimization during building the automaton. */ static reserv_sets_t -form_reservs_matter (automaton) - automaton_t automaton; +form_reservs_matter (automaton_t automaton) { int cycle, unit; reserv_sets_t reservs_matter = alloc_empty_reserv_sets(); @@ -5851,8 +5681,7 @@ form_reservs_matter (automaton) /* The following function creates all states of nondeterministic (if NDFA_FLAG has nonzero value) or deterministic AUTOMATON. */ static void -make_automaton (automaton) - automaton_t automaton; +make_automaton (automaton_t automaton) { ainsn_t ainsn; struct insn_reserv_decl *insn_reserv_decl; @@ -5946,8 +5775,7 @@ make_automaton (automaton) /* Foms lists of all arcs of STATE marked by the same ainsn. */ static void -form_arcs_marked_by_insn (state) - state_t state; +form_arcs_marked_by_insn (state_t state) { decl_t decl; arc_t arc; @@ -5974,10 +5802,8 @@ form_arcs_marked_by_insn (state) same insn. If the composed state is not in STATE_STACK yet, it is pushed into STATE_STACK. */ static int -create_composed_state (original_state, arcs_marked_by_insn, state_stack) - state_t original_state; - arc_t arcs_marked_by_insn; - vla_ptr_t *state_stack; +create_composed_state (state_t original_state, arc_t arcs_marked_by_insn, + vla_ptr_t *state_stack) { state_t state; alt_state_t alt_state, curr_alt_state; @@ -6079,8 +5905,7 @@ create_composed_state (original_state, arcs_marked_by_insn, state_stack) /* The function transforms nondeterministic AUTOMATON into deterministic. */ static void -NDFA_to_DFA (automaton) - automaton_t automaton; +NDFA_to_DFA (automaton_t automaton) { state_t start_state; state_t state; @@ -6124,9 +5949,7 @@ static int curr_state_graph_pass_num; /* This recursive function passes all states achieved from START_STATE and applies APPLIED_FUNC to them. */ static void -pass_state_graph (start_state, applied_func) - state_t start_state; - void (*applied_func) PARAMS ((state_t state)); +pass_state_graph (state_t start_state, void (*applied_func) (state_t state)) { arc_t arc; @@ -6143,9 +5966,7 @@ pass_state_graph (start_state, applied_func) /* This recursive function passes all states of AUTOMATON and applies APPLIED_FUNC to them. */ static void -pass_states (automaton, applied_func) - automaton_t automaton; - void (*applied_func) PARAMS ((state_t state)); +pass_states (automaton_t automaton, void (*applied_func) (state_t state)) { curr_state_graph_pass_num++; pass_state_graph (automaton->start_state, applied_func); @@ -6153,7 +5974,7 @@ pass_states (automaton, applied_func) /* The function initializes code for passing of all states. */ static void -initiate_pass_states () +initiate_pass_states (void) { curr_state_graph_pass_num = 0; } @@ -6165,8 +5986,7 @@ static vla_ptr_t all_achieved_states; /* This function is called by function pass_states to add an achieved STATE. */ static void -add_achieved_state (state) - state_t state; +add_achieved_state (state_t state) { VLA_PTR_ADD (all_achieved_states, state); } @@ -6176,9 +5996,7 @@ add_achieved_state (state) nonzero value) or by equiv_class_num_2 of the destination state. The function returns number of out arcs of STATE. */ static int -set_out_arc_insns_equiv_num (state, odd_iteration_flag) - state_t state; - int odd_iteration_flag; +set_out_arc_insns_equiv_num (state_t state, int odd_iteration_flag) { int state_out_arcs_num; arc_t arc; @@ -6205,8 +6023,7 @@ set_out_arc_insns_equiv_num (state, odd_iteration_flag) /* The function clears equivalence numbers and alt_states in all insns which mark all out arcs of STATE. */ static void -clear_arc_insns_equiv_num (state) - state_t state; +clear_arc_insns_equiv_num (state_t state) { arc_t arc; @@ -6220,9 +6037,7 @@ clear_arc_insns_equiv_num (state) /* The function copies pointers to equivalent states from vla FROM into vla TO. */ static void -copy_equiv_class (to, from) - vla_ptr_t *to; - const vla_ptr_t *from; +copy_equiv_class (vla_ptr_t *to, const vla_ptr_t *from) { state_t *class_ptr; @@ -6236,9 +6051,7 @@ copy_equiv_class (to, from) /* The following function returns TRUE if STATE reserves the unit with UNIT_NUM on the first cycle. */ static int -first_cycle_unit_presence (state, unit_num) - state_t state; - int unit_num; +first_cycle_unit_presence (state_t state, int unit_num) { int presence_p; @@ -6257,11 +6070,8 @@ first_cycle_unit_presence (state, unit_num) output arcs. Iteration of making equivalence partition is defined by ODD_ITERATION_FLAG. */ static int -state_is_differed (state, another_state, another_state_out_arcs_num, - odd_iteration_flag) - state_t state, another_state; - int another_state_out_arcs_num; - int odd_iteration_flag; +state_is_differed (state_t state, state_t another_state, + int another_state_out_arcs_num, int odd_iteration_flag) { arc_t arc; int state_out_arcs_num; @@ -6296,9 +6106,7 @@ state_is_differed (state, another_state, another_state_out_arcs_num, /* The function makes initial partition of STATES on equivalent classes. */ static state_t -init_equiv_class (states, states_num) - state_t *states; - int states_num; +init_equiv_class (state_t *states, int states_num) { state_t *state_ptr; state_t result_equiv_class; @@ -6321,12 +6129,9 @@ init_equiv_class (states, states_num) assigns it to the state equivalence number. If the class has been partitioned, the function returns nonzero value. */ static int -partition_equiv_class (equiv_class_ptr, odd_iteration_flag, - next_iteration_classes, new_equiv_class_num_ptr) - state_t *equiv_class_ptr; - int odd_iteration_flag; - vla_ptr_t *next_iteration_classes; - int *new_equiv_class_num_ptr; +partition_equiv_class (state_t *equiv_class_ptr, int odd_iteration_flag, + vla_ptr_t *next_iteration_classes, + int *new_equiv_class_num_ptr) { state_t new_equiv_class; int partition_p; @@ -6384,9 +6189,7 @@ partition_equiv_class (equiv_class_ptr, odd_iteration_flag, /* The function finds equivalent states of AUTOMATON. */ static void -evaluate_equiv_classes (automaton, equiv_classes) - automaton_t automaton; - vla_ptr_t *equiv_classes; +evaluate_equiv_classes (automaton_t automaton, vla_ptr_t *equiv_classes) { state_t new_equiv_class; int new_equiv_class_num; @@ -6395,7 +6198,7 @@ evaluate_equiv_classes (automaton, equiv_classes) vla_ptr_t next_iteration_classes; state_t *equiv_class_ptr; state_t *state_ptr; - + VLA_PTR_CREATE (all_achieved_states, 1500, "all achieved states"); pass_states (automaton, add_achieved_state); new_equiv_class = init_equiv_class (VLA_PTR_BEGIN (all_achieved_states), @@ -6432,9 +6235,7 @@ evaluate_equiv_classes (automaton, equiv_classes) /* The function merges equivalent states of AUTOMATON. */ static void -merge_states (automaton, equiv_classes) - automaton_t automaton; - vla_ptr_t *equiv_classes; +merge_states (automaton_t automaton, vla_ptr_t *equiv_classes) { state_t *equiv_class_ptr; state_t curr_state; @@ -6531,8 +6332,7 @@ merge_states (automaton, equiv_classes) /* The function sets up new_cycle_p for states if there is arc to the state marked by advance_cycle_insn_decl. */ static void -set_new_cycle_flags (state) - state_t state; +set_new_cycle_flags (state_t state) { arc_t arc; @@ -6545,8 +6345,7 @@ set_new_cycle_flags (state) /* The top level function for minimization of deterministic AUTOMATON. */ static void -minimize_DFA (automaton) - automaton_t automaton; +minimize_DFA (automaton_t automaton) { vla_ptr_t equiv_classes; @@ -6565,8 +6364,7 @@ static int curr_counted_arcs_num; /* The function is called by function `pass_states' to count states and arcs of an automaton. */ static void -incr_states_and_arcs_nums (state) - state_t state; +incr_states_and_arcs_nums (state_t state) { arc_t arc; @@ -6577,10 +6375,8 @@ incr_states_and_arcs_nums (state) /* The function counts states and arcs of AUTOMATON. */ static void -count_states_and_arcs (automaton, states_num, arcs_num) - automaton_t automaton; - int *states_num; - int *arcs_num; +count_states_and_arcs (automaton_t automaton, int *states_num, + int *arcs_num) { curr_counted_states_num = 0; curr_counted_arcs_num = 0; @@ -6593,8 +6389,7 @@ count_states_and_arcs (automaton, states_num, arcs_num) recognition after checking and simplifying IR of the description. */ static void -build_automaton (automaton) - automaton_t automaton; +build_automaton (automaton_t automaton) { int states_num; int arcs_num; @@ -6651,8 +6446,7 @@ static int curr_state_order_num; /* The function is called by function `pass_states' for enumerating states. */ static void -set_order_state_num (state) - state_t state; +set_order_state_num (state_t state) { state->order_state_num = curr_state_order_num; curr_state_order_num++; @@ -6660,8 +6454,7 @@ set_order_state_num (state) /* The function enumerates all states of AUTOMATON. */ static void -enumerate_states (automaton) - automaton_t automaton; +enumerate_states (automaton_t automaton) { curr_state_order_num = 0; pass_states (automaton, set_order_state_num); @@ -6676,9 +6469,8 @@ enumerate_states (automaton) /* The function inserts AINSN into cyclic list CYCLIC_EQUIV_CLASS_INSN_LIST of ainsns. */ static ainsn_t -insert_ainsn_into_equiv_class (ainsn, cyclic_equiv_class_insn_list) - ainsn_t ainsn; - ainsn_t cyclic_equiv_class_insn_list; +insert_ainsn_into_equiv_class (ainsn_t ainsn, + ainsn_t cyclic_equiv_class_insn_list) { if (cyclic_equiv_class_insn_list == NULL) ainsn->next_equiv_class_insn = ainsn; @@ -6694,8 +6486,7 @@ insert_ainsn_into_equiv_class (ainsn, cyclic_equiv_class_insn_list) /* The function deletes equiv_class_insn into cyclic list of equivalent ainsns. */ static void -delete_ainsn_from_equiv_class (equiv_class_insn) - ainsn_t equiv_class_insn; +delete_ainsn_from_equiv_class (ainsn_t equiv_class_insn) { ainsn_t curr_equiv_class_insn; ainsn_t prev_equiv_class_insn; @@ -6714,9 +6505,7 @@ delete_ainsn_from_equiv_class (equiv_class_insn) ainsns. INSN_ARCS_ARRAY is table: code of insn -> out arc of the state. */ static void -process_insn_equiv_class (ainsn, insn_arcs_array) - ainsn_t ainsn; - arc_t *insn_arcs_array; +process_insn_equiv_class (ainsn_t ainsn, arc_t *insn_arcs_array) { ainsn_t next_insn; ainsn_t curr_insn; @@ -6747,8 +6536,7 @@ process_insn_equiv_class (ainsn, insn_arcs_array) /* The function processes STATE in order to find equivalent ainsns. */ static void -process_state_for_insn_equiv_partition (state) - state_t state; +process_state_for_insn_equiv_partition (state_t state) { arc_t arc; arc_t *insn_arcs_array; @@ -6770,8 +6558,7 @@ process_state_for_insn_equiv_partition (state) /* The function searches for equivalent ainsns of AUTOMATON. */ static void -set_insn_equiv_classes (automaton) - automaton_t automaton; +set_insn_equiv_classes (automaton_t automaton) { ainsn_t ainsn; ainsn_t first_insn; @@ -6833,7 +6620,7 @@ set_insn_equiv_classes (automaton) /* The function estimate size of the single DFA used by PHR (pipeline hazards recognizer). */ static double -estimate_one_automaton_bound () +estimate_one_automaton_bound (void) { decl_t decl; double one_automaton_estimation_bound; @@ -6860,9 +6647,8 @@ estimate_one_automaton_bound () /* The function compares unit declarations according to their maximal cycle in reservations. */ static int -compare_max_occ_cycle_nums (unit_decl_1, unit_decl_2) - const void *unit_decl_1; - const void *unit_decl_2; +compare_max_occ_cycle_nums (const void *unit_decl_1, + const void *unit_decl_2) { if ((DECL_UNIT (*(decl_t *) unit_decl_1)->max_occ_cycle_num) < (DECL_UNIT (*(decl_t *) unit_decl_2)->max_occ_cycle_num)) @@ -6877,7 +6663,7 @@ compare_max_occ_cycle_nums (unit_decl_1, unit_decl_2) /* The function makes heuristic assigning automata to units. Actually efficacy of the algorithm has been checked yet??? */ static void -units_to_automata_heuristic_distr () +units_to_automata_heuristic_distr (void) { double estimation_bound; decl_t decl; @@ -6934,7 +6720,7 @@ units_to_automata_heuristic_distr () insn is simply insn for given automaton which makes reservation only of units of the automaton. */ static ainsn_t -create_ainsns () +create_ainsns (void) { decl_t decl; ainsn_t first_ainsn; @@ -6966,11 +6752,11 @@ create_ainsns () /* The function assigns automata to units according to constructions `define_automaton' in the description. */ static void -units_to_automata_distr () +units_to_automata_distr (void) { decl_t decl; int i; - + for (i = 0; i < description->decls_num; i++) { decl = description->decls [i]; @@ -6992,7 +6778,7 @@ units_to_automata_distr () /* The function creates DFA(s) for fast pipeline hazards recognition after checking and simplifying IR of the description. */ static void -create_automata () +create_automata (void) { automaton_t curr_automaton; automaton_t prev_automaton; @@ -7091,11 +6877,10 @@ create_automata () /* This recursive function forms string representation of regexp (without tailing '\0'). */ static void -form_regexp (regexp) - regexp_t regexp; +form_regexp (regexp_t regexp) { int i; - + if (regexp->mode == rm_unit || regexp->mode == rm_reserv) { const char *name = (regexp->mode == rm_unit @@ -7164,8 +6949,7 @@ form_regexp (regexp) /* The function returns string representation of REGEXP on IR obstack. */ static const char * -regexp_representation (regexp) - regexp_t regexp; +regexp_representation (regexp_t regexp) { form_regexp (regexp); obstack_1grow (&irp, '\0'); @@ -7175,10 +6959,10 @@ regexp_representation (regexp) /* The function frees memory allocated for last formed string representation of regexp. */ static void -finish_regexp_representation () +finish_regexp_representation (void) { int length = obstack_object_size (&irp); - + obstack_blank_fast (&irp, -length); } @@ -7194,10 +6978,8 @@ finish_regexp_representation () approximation. */ static void -output_range_type (f, min_range_value, max_range_value) - FILE *f; - long int min_range_value; - long int max_range_value; +output_range_type (FILE *f, long int min_range_value, + long int max_range_value) { if (min_range_value >= 0 && max_range_value <= 255) fprintf (f, "unsigned char"); @@ -7222,12 +7004,11 @@ output_range_type (f, min_range_value, max_range_value) `cycle advance' arcs. */ static int -longest_path_length (state) - state_t state; +longest_path_length (state_t state) { arc_t arc; int length, result; - + if (state->longest_path_length == ON_THE_PATH) /* We don't expect the path cycle here. Our graph may contain only cycles with one state on the path not containing `cycle @@ -7261,8 +7042,7 @@ static int max_dfa_issue_rate; from STATE to find MAX_DFA_ISSUE_RATE. */ static void -process_state_longest_path_length (state) - state_t state; +process_state_longest_path_length (state_t state) { int value; @@ -7280,7 +7060,7 @@ process_state_longest_path_length (state) global variable and outputs its declaration. */ static void -output_dfa_max_issue_rate () +output_dfa_max_issue_rate (void) { automaton_t automaton; @@ -7298,9 +7078,7 @@ output_dfa_max_issue_rate () /* The function outputs all initialization values of VECT with length vect_length. */ static void -output_vect (vect, vect_length) - vect_el_t *vect; - int vect_length; +output_vect (vect_el_t *vect, int vect_length) { int els_on_line; @@ -7335,9 +7113,7 @@ output_vect (vect, vect_length) /* The following is name of member which represents state of a DFA for PHR. */ static void -output_chip_member_name (f, automaton) - FILE *f; - automaton_t automaton; +output_chip_member_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "automaton_state_%d", automaton->automaton_order_num); @@ -7349,9 +7125,7 @@ output_chip_member_name (f, automaton) /* The following is name of temporary variable which stores state of a DFA for PHR. */ static void -output_temp_chip_member_name (f, automaton) - FILE *f; - automaton_t automaton; +output_temp_chip_member_name (FILE *f, automaton_t automaton) { fprintf (f, "_"); output_chip_member_name (f, automaton); @@ -7364,9 +7138,7 @@ output_temp_chip_member_name (f, automaton) /* Output name of translate vector for given automaton. */ static void -output_translate_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_translate_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "translate_%d", automaton->automaton_order_num); @@ -7376,9 +7148,7 @@ output_translate_vect_name (f, automaton) /* Output name for simple transition table representation. */ static void -output_trans_full_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_trans_full_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "transitions_%d", automaton->automaton_order_num); @@ -7390,9 +7160,7 @@ output_trans_full_vect_name (f, automaton) /* Output name of comb vector of the transition table for given automaton. */ static void -output_trans_comb_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_trans_comb_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "transitions_%d", automaton->automaton_order_num); @@ -7404,9 +7172,7 @@ output_trans_comb_vect_name (f, automaton) /* Output name of check vector of the transition table for given automaton. */ static void -output_trans_check_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_trans_check_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "check_%d", automaton->automaton_order_num); @@ -7417,9 +7183,7 @@ output_trans_check_vect_name (f, automaton) /* Output name of base vector of the transition table for given automaton. */ static void -output_trans_base_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_trans_base_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "base_%d", automaton->automaton_order_num); @@ -7429,9 +7193,7 @@ output_trans_base_vect_name (f, automaton) /* Output name for simple alternatives number representation. */ static void -output_state_alts_full_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_state_alts_full_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "state_alts_%d", automaton->automaton_order_num); @@ -7443,9 +7205,7 @@ output_state_alts_full_vect_name (f, automaton) /* Output name of comb vector of the alternatives number table for given automaton. */ static void -output_state_alts_comb_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_state_alts_comb_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "state_alts_%d", automaton->automaton_order_num); @@ -7457,9 +7217,7 @@ output_state_alts_comb_vect_name (f, automaton) /* Output name of check vector of the alternatives number table for given automaton. */ static void -output_state_alts_check_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_state_alts_check_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "check_state_alts_%d", automaton->automaton_order_num); @@ -7471,9 +7229,7 @@ output_state_alts_check_vect_name (f, automaton) /* Output name of base vector of the alternatives number table for given automaton. */ static void -output_state_alts_base_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_state_alts_base_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "base_state_alts_%d", automaton->automaton_order_num); @@ -7484,9 +7240,7 @@ output_state_alts_base_vect_name (f, automaton) /* Output name of simple min issue delay table representation. */ static void -output_min_issue_delay_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_min_issue_delay_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "min_issue_delay_%d", automaton->automaton_order_num); @@ -7497,9 +7251,7 @@ output_min_issue_delay_vect_name (f, automaton) /* Output name of deadlock vector for given automaton. */ static void -output_dead_lock_vect_name (f, automaton) - FILE *f; - automaton_t automaton; +output_dead_lock_vect_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "dead_lock_%d", automaton->automaton_order_num); @@ -7509,9 +7261,7 @@ output_dead_lock_vect_name (f, automaton) /* Output name of reserved units table for AUTOMATON into file F. */ static void -output_reserved_units_table_name (f, automaton) - FILE *f; - automaton_t automaton; +output_reserved_units_table_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "reserved_units_%d", automaton->automaton_order_num); @@ -7625,9 +7375,7 @@ output_reserved_units_table_name (f, automaton) /* Output C type which is used for representation of codes of states of AUTOMATON. */ static void -output_state_member_type (f, automaton) - FILE *f; - automaton_t automaton; +output_state_member_type (FILE *f, automaton_t automaton) { output_range_type (f, 0, automaton->achieved_states_num); } @@ -7635,7 +7383,7 @@ output_state_member_type (f, automaton) /* Output definition of the structure representing current DFA(s) state(s). */ static void -output_chip_definitions () +output_chip_definitions (void) { automaton_t automaton; @@ -7661,8 +7409,7 @@ output_chip_definitions () insn equivalence class number. The equivalence class number is used to access to table and vectors representing DFA(s). */ static void -output_translate_vect (automaton) - automaton_t automaton; +output_translate_vect (automaton_t automaton) { ainsn_t ainsn; int insn_value; @@ -7696,8 +7443,7 @@ static int undefined_vect_el_value; /* The following function returns nonzero value if the best representation of the table is comb vector. */ static int -comb_vect_p (tab) - state_ainsn_table_t tab; +comb_vect_p (state_ainsn_table_t tab) { return (2 * VLA_HWINT_LENGTH (tab->full_vect) > 5 * VLA_HWINT_LENGTH (tab->comb_vect)); @@ -7705,8 +7451,7 @@ comb_vect_p (tab) /* The following function creates new table for AUTOMATON. */ static state_ainsn_table_t -create_state_ainsn_table (automaton) - automaton_t automaton; +create_state_ainsn_table (automaton_t automaton) { state_ainsn_table_t tab; int full_vect_length; @@ -7734,16 +7479,11 @@ create_state_ainsn_table (automaton) /* The following function outputs the best C representation of the table TAB of given TABLE_NAME. */ static void -output_state_ainsn_table (tab, table_name, output_full_vect_name_func, - output_comb_vect_name_func, - output_check_vect_name_func, - output_base_vect_name_func) - state_ainsn_table_t tab; - char *table_name; - void (*output_full_vect_name_func) PARAMS ((FILE *, automaton_t)); - void (*output_comb_vect_name_func) PARAMS ((FILE *, automaton_t)); - void (*output_check_vect_name_func) PARAMS ((FILE *, automaton_t)); - void (*output_base_vect_name_func) PARAMS ((FILE *, automaton_t)); +output_state_ainsn_table (state_ainsn_table_t tab, char *table_name, + void (*output_full_vect_name_func) (FILE *, automaton_t), + void (*output_comb_vect_name_func) (FILE *, automaton_t), + void (*output_check_vect_name_func) (FILE *, automaton_t), + void (*output_base_vect_name_func) (FILE *, automaton_t)) { if (!comb_vect_p (tab)) { @@ -7796,11 +7536,8 @@ output_state_ainsn_table (tab, table_name, output_full_vect_name_func, elements pointed by VECT to table TAB as its line with number VECT_NUM. */ static void -add_vect (tab, vect_num, vect, vect_length) - state_ainsn_table_t tab; - int vect_num; - vect_el_t *vect; - int vect_length; +add_vect (state_ainsn_table_t tab, int vect_num, vect_el_t *vect, + int vect_length) { int real_vect_length; vect_el_t *comb_vect_start; @@ -7898,8 +7635,7 @@ add_vect (tab, vect_num, vect, vect_length) /* Return number of out arcs of STATE. */ static int -out_state_arcs_num (state) - state_t state; +out_state_arcs_num (state_t state) { int result; arc_t arc; @@ -7917,9 +7653,8 @@ out_state_arcs_num (state) /* Compare number of possible transitions from the states. */ static int -compare_transition_els_num (state_ptr_1, state_ptr_2) - const void *state_ptr_1; - const void *state_ptr_2; +compare_transition_els_num (const void *state_ptr_1, + const void *state_ptr_2) { int transition_els_num_1; int transition_els_num_2; @@ -7937,10 +7672,7 @@ compare_transition_els_num (state_ptr_1, state_ptr_2) /* The function adds element EL_VALUE to vector VECT for a table state x AINSN. */ static void -add_vect_el (vect, ainsn, el_value) - vla_hwint_t *vect; - ainsn_t ainsn; - int el_value; +add_vect_el (vla_hwint_t *vect, ainsn_t ainsn, int el_value) { int equiv_class_num; int vect_index; @@ -7961,8 +7693,7 @@ static vla_ptr_t output_states_vect; /* The function is called by function pass_states. The function adds STATE to `output_states_vect'. */ static void -add_states_vect_el (state) - state_t state; +add_states_vect_el (state_t state) { VLA_PTR_ADD (output_states_vect, state); } @@ -7970,8 +7701,7 @@ add_states_vect_el (state) /* Form and output vectors (comb, check, base or full vector) representing transition table of AUTOMATON. */ static void -output_trans_table (automaton) - automaton_t automaton; +output_trans_table (automaton_t automaton) { state_t *state_ptr; arc_t arc; @@ -8019,8 +7749,7 @@ output_trans_table (automaton) ainsn -> number of possible alternative reservations by the ainsn. */ static void -output_state_alts_table (automaton) - automaton_t automaton; +output_state_alts_table (automaton_t automaton) { state_t *state_ptr; arc_t arc; @@ -8072,9 +7801,7 @@ static int curr_state_pass_num; returns minimal issue delay value for AINSN in STATE or -1 if we enter into a loop. */ static int -min_issue_delay_pass_states (state, ainsn) - state_t state; - ainsn_t ainsn; +min_issue_delay_pass_states (state_t state, ainsn_t ainsn) { arc_t arc; int min_insn_issue_delay, insn_issue_delay; @@ -8116,9 +7843,7 @@ min_issue_delay_pass_states (state, ainsn) The function can return negative value if we can not issue AINSN. We will report about it later. */ static int -min_issue_delay (state, ainsn) - state_t state; - ainsn_t ainsn; +min_issue_delay (state_t state, ainsn_t ainsn) { curr_state_pass_num++; state->min_insn_issue_delay = min_issue_delay_pass_states (state, ainsn); @@ -8128,7 +7853,7 @@ min_issue_delay (state, ainsn) /* The function initiates code for finding minimal issue delay values. It should be called only once. */ static void -initiate_min_issue_delay_pass_states () +initiate_min_issue_delay_pass_states (void) { curr_state_pass_num = 0; } @@ -8137,8 +7862,7 @@ initiate_min_issue_delay_pass_states () AUTOMATON. The table is state x ainsn -> minimal issue delay of the ainsn. */ static void -output_min_issue_delay_table (automaton) - automaton_t automaton; +output_min_issue_delay_table (automaton_t automaton) { vla_hwint_t min_issue_delay_vect; vla_hwint_t compressed_min_issue_delay_vect; @@ -8231,8 +7955,7 @@ static int locked_states_num; /* Form and output vector representing the locked states of AUTOMATON. */ static void -output_dead_lock_vect (automaton) - automaton_t automaton; +output_dead_lock_vect (automaton_t automaton) { state_t *state_ptr; arc_t arc; @@ -8277,8 +8000,7 @@ output_dead_lock_vect (automaton) /* Form and output vector representing reserved units of the states of AUTOMATON. */ static void -output_reserved_units_table (automaton) - automaton_t automaton; +output_reserved_units_table (automaton_t automaton) { state_t *curr_state_ptr; vla_hwint_t reserved_units_table; @@ -8325,7 +8047,7 @@ output_reserved_units_table (automaton) /* The function outputs all tables representing DFA(s) used for fast pipeline hazards recognition. */ static void -output_tables () +output_tables (void) { automaton_t automaton; @@ -8358,7 +8080,7 @@ output_tables () `max_insn_queue_index'. Its value is not less than maximal queue length needed for the insn scheduler. */ static void -output_max_insn_queue_index_def () +output_max_insn_queue_index_def (void) { int i, max, latency; decl_t decl; @@ -8391,8 +8113,8 @@ output_max_insn_queue_index_def () /* The function outputs switch cases for insn reservations using function *output_automata_list_code. */ static void -output_insn_code_cases (output_automata_list_code) - void (*output_automata_list_code) PARAMS ((automata_list_el_t)); +output_insn_code_cases (void (*output_automata_list_code) + (automata_list_el_t)) { decl_t decl, decl2; int i, j; @@ -8432,8 +8154,7 @@ output_insn_code_cases (output_automata_list_code) /* The function outputs a code for evaluation of a minimal delay of issue of insns which have reservations in given AUTOMATA_LIST. */ static void -output_automata_list_min_issue_delay_code (automata_list) - automata_list_el_t automata_list; +output_automata_list_min_issue_delay_code (automata_list_el_t automata_list) { automata_list_el_t el; automaton_t automaton; @@ -8484,9 +8205,9 @@ output_automata_list_min_issue_delay_code (automata_list) /* Output function `internal_min_issue_delay'. */ static void -output_internal_min_issue_delay_func () +output_internal_min_issue_delay_func (void) { - fprintf (output_file, "static int %s PARAMS ((int, struct %s *));\n", + fprintf (output_file, "static int %s (int, struct %s *);\n", INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, CHIP_NAME); fprintf (output_file, "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s ATTRIBUTE_UNUSED;\n", @@ -8507,8 +8228,7 @@ output_internal_min_issue_delay_func () /* The function outputs a code changing state after issue of insns which have reservations in given AUTOMATA_LIST. */ static void -output_automata_list_transition_code (automata_list) - automata_list_el_t automata_list; +output_automata_list_transition_code (automata_list_el_t automata_list) { automata_list_el_t el, next_el; @@ -8601,9 +8321,9 @@ output_automata_list_transition_code (automata_list) /* Output function `internal_state_transition'. */ static void -output_internal_trans_func () +output_internal_trans_func (void) { - fprintf (output_file, "static int %s PARAMS ((int, struct %s *));\n", + fprintf (output_file, "static int %s (int, struct %s *);\n", INTERNAL_TRANSITION_FUNC_NAME, CHIP_NAME); fprintf (output_file, "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s ATTRIBUTE_UNUSED;\n", @@ -8631,10 +8351,9 @@ output_internal_trans_func () where insn denotes INSN_NAME, insn_code denotes INSN_CODE_NAME, and code denotes CODE. */ static void -output_internal_insn_code_evaluation (insn_name, insn_code_name, code) - const char *insn_name; - const char *insn_code_name; - int code; +output_internal_insn_code_evaluation (const char *insn_name, + const char *insn_code_name, + int code) { fprintf (output_file, "\n if (%s != 0)\n {\n", insn_name); fprintf (output_file, " %s = %s (%s);\n", insn_code_name, @@ -8649,12 +8368,12 @@ output_internal_insn_code_evaluation (insn_name, insn_code_name, code) /* This function outputs `dfa_insn_code' and its helper function `dfa_insn_code_enlarge'. */ static void -output_dfa_insn_code_func () +output_dfa_insn_code_func (void) { /* Emacs c-mode gets really confused if there's a { or } in column 0 inside a string, so don't do that. */ fprintf (output_file, "\ -static void dfa_insn_code_enlarge PARAMS ((int));\n\ +static void dfa_insn_code_enlarge (int);\n\ static void\n\ dfa_insn_code_enlarge (uid)\n\ int uid;\n{\n\ @@ -8664,14 +8383,14 @@ dfa_insn_code_enlarge (uid)\n\ %s * sizeof(int));\n\ for (; i < %s; i++)\n\ %s[i] = -1;\n}\n\n", - DFA_INSN_CODES_LENGTH_VARIABLE_NAME, - DFA_INSN_CODES_LENGTH_VARIABLE_NAME, - DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_VARIABLE_NAME, - DFA_INSN_CODES_LENGTH_VARIABLE_NAME, - DFA_INSN_CODES_LENGTH_VARIABLE_NAME, - DFA_INSN_CODES_VARIABLE_NAME); + DFA_INSN_CODES_LENGTH_VARIABLE_NAME, + DFA_INSN_CODES_LENGTH_VARIABLE_NAME, + DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_VARIABLE_NAME, + DFA_INSN_CODES_LENGTH_VARIABLE_NAME, + DFA_INSN_CODES_LENGTH_VARIABLE_NAME, + DFA_INSN_CODES_VARIABLE_NAME); fprintf (output_file, "\ -static inline int %s PARAMS ((rtx));\n\ +static inline int %s (rtx);\n\ static inline int\n%s (%s)\n\ rtx %s;\n{\n\ int uid = INSN_UID (%s);\n\ @@ -8701,7 +8420,7 @@ static inline int\n%s (%s)\n\ /* The function outputs PHR interface function `state_transition'. */ static void -output_trans_func () +output_trans_func (void) { fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n", TRANSITION_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME, @@ -8716,8 +8435,7 @@ output_trans_func () /* The function outputs a code for evaluation of alternative states number for insns which have reservations in given AUTOMATA_LIST. */ static void -output_automata_list_state_alts_code (automata_list) - automata_list_el_t automata_list; +output_automata_list_state_alts_code (automata_list_el_t automata_list) { automata_list_el_t el; automaton_t automaton; @@ -8777,9 +8495,9 @@ output_automata_list_state_alts_code (automata_list) /* Output function `internal_state_alts'. */ static void -output_internal_state_alts_func () +output_internal_state_alts_func (void) { - fprintf (output_file, "static int %s PARAMS ((int, struct %s *));\n", + fprintf (output_file, "static int %s (int, struct %s *);\n", INTERNAL_STATE_ALTS_FUNC_NAME, CHIP_NAME); fprintf (output_file, "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s;\n", @@ -8798,7 +8516,7 @@ output_internal_state_alts_func () /* The function outputs PHR interface function `state_alts'. */ static void -output_state_alts_func () +output_state_alts_func (void) { fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n", STATE_ALTS_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME, @@ -8812,7 +8530,7 @@ output_state_alts_func () /* Output function `min_issue_delay'. */ static void -output_min_issue_delay_func () +output_min_issue_delay_func (void) { fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n", MIN_ISSUE_DELAY_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME, @@ -8826,18 +8544,18 @@ output_min_issue_delay_func () fprintf (output_file, " }\n else\n %s = %s;\n", INTERNAL_INSN_CODE_NAME, ADVANCE_CYCLE_VALUE_NAME); fprintf (output_file, "\n return %s (%s, %s);\n", - INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN_CODE_NAME, + INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN_CODE_NAME, STATE_NAME); fprintf (output_file, "}\n\n"); } /* Output function `internal_dead_lock'. */ static void -output_internal_dead_lock_func () +output_internal_dead_lock_func (void) { automaton_t automaton; - fprintf (output_file, "static int %s PARAMS ((struct %s *));\n", + fprintf (output_file, "static int %s (struct %s *);\n", INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_NAME); fprintf (output_file, "static int\n%s (%s)\n\tstruct %s *%s;\n", INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_PARAMETER_NAME, CHIP_NAME, @@ -8858,7 +8576,7 @@ output_internal_dead_lock_func () /* The function outputs PHR interface function `state_dead_lock_p'. */ static void -output_dead_lock_func () +output_dead_lock_func (void) { fprintf (output_file, "int\n%s (%s)\n\t%s %s;\n", DEAD_LOCK_FUNC_NAME, STATE_NAME, STATE_TYPE_NAME, STATE_NAME); @@ -8868,9 +8586,9 @@ output_dead_lock_func () /* Output function `internal_reset'. */ static void -output_internal_reset_func () +output_internal_reset_func (void) { - fprintf (output_file, "static void %s PARAMS ((struct %s *));\n", + fprintf (output_file, "static void %s (struct %s *);\n", INTERNAL_RESET_FUNC_NAME, CHIP_NAME); fprintf (output_file, "static void\n%s (%s)\n\tstruct %s *%s;\n", INTERNAL_RESET_FUNC_NAME, CHIP_PARAMETER_NAME, @@ -8881,7 +8599,7 @@ output_internal_reset_func () /* The function outputs PHR interface function `state_size'. */ static void -output_size_func () +output_size_func (void) { fprintf (output_file, "int\n%s ()\n", SIZE_FUNC_NAME); fprintf (output_file, "{\n return sizeof (struct %s);\n}\n\n", CHIP_NAME); @@ -8889,7 +8607,7 @@ output_size_func () /* The function outputs PHR interface function `state_reset'. */ static void -output_reset_func () +output_reset_func (void) { fprintf (output_file, "void\n%s (%s)\n\t %s %s;\n", RESET_FUNC_NAME, STATE_NAME, STATE_TYPE_NAME, STATE_NAME); @@ -8899,13 +8617,13 @@ output_reset_func () /* Output function `min_insn_conflict_delay'. */ static void -output_min_insn_conflict_delay_func () +output_min_insn_conflict_delay_func (void) { fprintf (output_file, "int\n%s (%s, %s, %s)\n\t%s %s;\n\trtx %s;\n\trtx %s;\n", MIN_INSN_CONFLICT_DELAY_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME, - STATE_TYPE_NAME, STATE_NAME, + STATE_TYPE_NAME, STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); fprintf (output_file, "{\n struct %s %s;\n int %s, %s;\n", CHIP_NAME, CHIP_NAME, INTERNAL_INSN_CODE_NAME, @@ -8927,7 +8645,7 @@ output_min_insn_conflict_delay_func () /* Output function `internal_insn_latency'. */ static void -output_internal_insn_latency_func () +output_internal_insn_latency_func (void) { decl_t decl; struct bypass_decl *bypass; @@ -8946,8 +8664,8 @@ output_internal_insn_latency_func () if (DECL_INSN_RESERV (decl)->default_latency > USHRT_MAX) tabletype = "int"; } - - fprintf (output_file, "static int %s PARAMS ((int, int, rtx, rtx));\n", + + fprintf (output_file, "static int %s (int, int, rtx, rtx);\n", INTERNAL_INSN_LATENCY_FUNC_NAME); fprintf (output_file, "static int\n%s (%s, %s, %s, %s)", INTERNAL_INSN_LATENCY_FUNC_NAME, INTERNAL_INSN_CODE_NAME, @@ -9031,7 +8749,7 @@ output_internal_insn_latency_func () /* The function outputs PHR interface function `insn_latency'. */ static void -output_insn_latency_func () +output_insn_latency_func (void) { fprintf (output_file, "int\n%s (%s, %s)\n\trtx %s;\n\trtx %s;\n", INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME, @@ -9050,7 +8768,7 @@ output_insn_latency_func () /* The function outputs PHR interface function `print_reservation'. */ static void -output_print_reservation_func () +output_print_reservation_func (void) { decl_t decl; int i, j; @@ -9086,7 +8804,7 @@ output_print_reservation_func () } if (j != DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num) abort (); - + fprintf (output_file, "\n \"%s\"\n };\n int %s;\n\n", NOTHING_NAME, INTERNAL_INSN_CODE_NAME); @@ -9111,8 +8829,7 @@ output_print_reservation_func () /* The following function is used to sort unit declaration by their names. */ static int -units_cmp (unit1, unit2) - const void *unit1, *unit2; +units_cmp (const void *unit1, const void *unit2) { const unit_decl_t u1 = *(unit_decl_t *) unit1; const unit_decl_t u2 = *(unit_decl_t *) unit2; @@ -9141,11 +8858,11 @@ units_cmp (unit1, unit2) /* The following function outputs function to obtain internal cpu unit code by the cpu unit name. */ static void -output_get_cpu_unit_code_func () +output_get_cpu_unit_code_func (void) { int i; unit_decl_t *units; - + fprintf (output_file, "int\n%s (%s)\n\tconst char *%s;\n", GET_CPU_UNIT_CODE_FUNC_NAME, CPU_UNIT_NAME_PARAMETER_NAME, CPU_UNIT_NAME_PARAMETER_NAME); @@ -9192,7 +8909,7 @@ output_get_cpu_unit_code_func () unit (its internal code will be passed as the function argument) in given cpu state. */ static void -output_cpu_unit_reservation_p () +output_cpu_unit_reservation_p (void) { automaton_t automaton; @@ -9221,7 +8938,7 @@ output_cpu_unit_reservation_p () /* The function outputs PHR interface function `dfa_clean_insn_cache'. */ static void -output_dfa_clean_insn_cache_func () +output_dfa_clean_insn_cache_func (void) { fprintf (output_file, "void\n%s ()\n{\n int %s;\n\n", @@ -9235,7 +8952,7 @@ output_dfa_clean_insn_cache_func () /* The function outputs PHR interface function `dfa_start'. */ static void -output_dfa_start_func () +output_dfa_start_func (void) { fprintf (output_file, "void\n%s ()\n{\n %s = get_max_uid ();\n", @@ -9247,7 +8964,7 @@ output_dfa_start_func () /* The function outputs PHR interface function `dfa_finish'. */ static void -output_dfa_finish_func () +output_dfa_finish_func (void) { fprintf (output_file, "void\n%s ()\n{\n free (%s);\n}\n\n", DFA_FINISH_FUNC_NAME, DFA_INSN_CODES_VARIABLE_NAME); @@ -9260,8 +8977,7 @@ output_dfa_finish_func () /* The function outputs string representation of IR reservation. */ static void -output_regexp (regexp) - regexp_t regexp; +output_regexp (regexp_t regexp) { fprintf (output_description_file, "%s", regexp_representation (regexp)); finish_regexp_representation (); @@ -9269,8 +8985,7 @@ output_regexp (regexp) /* Output names of units in LIST separated by comma. */ static void -output_unit_set_el_list (list) - unit_set_el_t list; +output_unit_set_el_list (unit_set_el_t list) { unit_set_el_t el; @@ -9284,8 +8999,7 @@ output_unit_set_el_list (list) /* Output patterns in LIST separated by comma. */ static void -output_pattern_set_el_list (list) - pattern_set_el_t list; +output_pattern_set_el_list (pattern_set_el_t list) { pattern_set_el_t el; int i; @@ -9303,7 +9017,7 @@ output_pattern_set_el_list (list) /* The function outputs string representation of IR define_reservation and define_insn_reservation. */ static void -output_description () +output_description (void) { decl_t decl; int i; @@ -9333,8 +9047,8 @@ output_description () DECL_UNIT (decl)->name); output_pattern_set_el_list (DECL_UNIT (decl)->final_presence_list); - fprintf (output_description_file, "\n"); - } + fprintf (output_description_file, "\n"); + } if (DECL_UNIT (decl)->absence_list != NULL) { fprintf (output_description_file, "unit %s absence_set: ", @@ -9348,8 +9062,8 @@ output_description () DECL_UNIT (decl)->name); output_pattern_set_el_list (DECL_UNIT (decl)->final_absence_list); - fprintf (output_description_file, "\n"); - } + fprintf (output_description_file, "\n"); + } } } fprintf (output_description_file, "\n"); @@ -9384,9 +9098,7 @@ output_description () /* The function outputs name of AUTOMATON. */ static void -output_automaton_name (f, automaton) - FILE *f; - automaton_t automaton; +output_automaton_name (FILE *f, automaton_t automaton) { if (automaton->corresponding_automaton_decl == NULL) fprintf (f, "#%d", automaton->automaton_order_num); @@ -9400,8 +9112,7 @@ output_automaton_name (f, automaton) /* The function outputs units name belonging to AUTOMATON. */ static void -output_automaton_units (automaton) - automaton_t automaton; +output_automaton_units (automaton_t automaton) { decl_t decl; char *name; @@ -9446,8 +9157,7 @@ static vla_ptr_t state_reservs; /* The function forms `state_reservs' for STATE. */ static void -add_state_reservs (state) - state_t state; +add_state_reservs (state_t state) { alt_state_t curr_alt_state; reserv_sets_t reservs; @@ -9467,8 +9177,7 @@ add_state_reservs (state) /* The function outputs readable representation of all out arcs of STATE. */ static void -output_state_arcs (state) - state_t state; +output_state_arcs (state_t state) { arc_t arc; ainsn_t ainsn; @@ -9518,9 +9227,7 @@ output_state_arcs (state) /* The following function is used for sorting possible cpu unit reservation of a DFA state. */ static int -state_reservs_cmp (reservs_ptr_1, reservs_ptr_2) - const void *reservs_ptr_1; - const void *reservs_ptr_2; +state_reservs_cmp (const void *reservs_ptr_1, const void *reservs_ptr_2) { return reserv_sets_cmp (*(reserv_sets_t *) reservs_ptr_1, *(reserv_sets_t *) reservs_ptr_2); @@ -9529,7 +9236,7 @@ state_reservs_cmp (reservs_ptr_1, reservs_ptr_2) /* The following function is used for sorting possible cpu unit reservation of a DFA state. */ static void -remove_state_duplicate_reservs () +remove_state_duplicate_reservs (void) { reserv_sets_t *reservs_ptr; reserv_sets_t *last_formed_reservs_ptr; @@ -9553,8 +9260,7 @@ remove_state_duplicate_reservs () described by possible (current and scheduled) cpu unit reservations. */ static void -output_state (state) - state_t state; +output_state (state_t state) { reserv_sets_t *reservs_ptr; @@ -9582,7 +9288,7 @@ output_state (state) /* The following function output readable representation of DFAs used for fast recognition of pipeline hazards. */ static void -output_automaton_descriptions () +output_automaton_descriptions (void) { automaton_t automaton; @@ -9606,8 +9312,7 @@ output_automaton_descriptions () /* The function outputs statistics about work of different phases of DFA generator. */ static void -output_statistics (f) - FILE *f; +output_statistics (FILE *f) { automaton_t automaton; int states_num; @@ -9658,7 +9363,7 @@ output_statistics (f) automaton->min_issue_delay_table_compression_factor); transition_comb_vect_els += VLA_HWINT_LENGTH (automaton->trans_table->comb_vect); - transition_full_vect_els + transition_full_vect_els += VLA_HWINT_LENGTH (automaton->trans_table->full_vect); state_alts_comb_vect_els += VLA_HWINT_LENGTH (automaton->state_alts_table->comb_vect); @@ -9686,8 +9391,7 @@ output_statistics (f) /* The function output times of work of different phases of DFA generator. */ static void -output_time_statistics (f) - FILE *f; +output_time_statistics (FILE *f) { fprintf (f, "\n transformation: "); print_active_time (f, transform_time); @@ -9713,7 +9417,7 @@ output_time_statistics (f) for fast recognition of pipeline hazards. No errors during checking must be fixed before this function call. */ static void -generate () +generate (void) { automata_num = split_argument; if (description->units_num < automata_num) @@ -9734,7 +9438,7 @@ generate () /* The following function creates insn attribute whose values are number alternatives in insn reservations. */ static void -make_insn_alts_attr () +make_insn_alts_attr (void) { int i, insn_num; decl_t decl; @@ -9771,7 +9475,7 @@ make_insn_alts_attr () /* The following function creates attribute which is order number of insn in pipeline hazard description translator. */ static void -make_internal_dfa_insn_code_attr () +make_internal_dfa_insn_code_attr (void) { int i, insn_num; decl_t decl; @@ -9808,7 +9512,7 @@ make_internal_dfa_insn_code_attr () /* The following function creates attribute which order number of insn in pipeline hazard description translator. */ static void -make_default_insn_latency_attr () +make_default_insn_latency_attr (void) { int i, insn_num; decl_t decl; @@ -9842,13 +9546,13 @@ make_default_insn_latency_attr () /* The following function creates attribute which returns 1 if given output insn has bypassing and 0 otherwise. */ static void -make_bypass_attr () +make_bypass_attr (void) { int i, bypass_insn; int bypass_insns_num = 0; decl_t decl; rtx result_rtx; - + for (i = 0; i < description->decls_num; i++) { decl = description->decls [i]; @@ -9898,8 +9602,7 @@ make_bypass_attr () /* The function returns suffix of given file name. The returned string can not be changed. */ static const char * -file_name_suffix (file_name) - const char *file_name; +file_name_suffix (const char *file_name) { const char *last_period; @@ -9914,8 +9617,7 @@ file_name_suffix (file_name) given file name itself if the directory name is absent. The returned string can not be changed. */ static const char * -base_file_name (file_name) - const char *file_name; +base_file_name (const char *file_name) { int directory_name_length; @@ -9933,9 +9635,7 @@ base_file_name (file_name) /* The following is top level function to initialize the work of pipeline hazards description translator. */ void -initiate_automaton_gen (argc, argv) - int argc; - char **argv; +initiate_automaton_gen (int argc, char **argv) { const char *base_name; int i; @@ -9985,7 +9685,7 @@ initiate_automaton_gen (argc, argv) /* The following function checks existence at least one arc marked by each insn. */ static void -check_automata_insn_issues () +check_automata_insn_issues (void) { automaton_t automaton; ainsn_t ainsn, reserv_ainsn; @@ -10034,8 +9734,7 @@ static vla_ptr_t automaton_states; /* This function is called by function pass_states to add an achieved STATE. */ static void -add_automaton_state (state) - state_t state; +add_automaton_state (state_t state) { VLA_PTR_ADD (automaton_states, state); } @@ -10043,7 +9742,7 @@ add_automaton_state (state) /* The following function forms list of important automata (whose states may be changed after the insn issue) for each insn. */ static void -form_important_insn_automata_lists () +form_important_insn_automata_lists (void) { automaton_t automaton; state_t *state_ptr; @@ -10109,7 +9808,7 @@ form_important_insn_automata_lists () /* The following is top level function to generate automat(a,on) for fast recognition of pipeline hazards. */ void -expand_automata () +expand_automata (void) { int i; @@ -10164,7 +9863,7 @@ expand_automata () /* The following is top level function to output PHR and to finish work with pipeline description translator. */ void -write_automata () +write_automata (void) { fprintf (stderr, "done\n"); if (have_error) diff --git a/gcc/gencheck.c b/gcc/gencheck.c index 8041b64ade2..fd037bdd7f5 100644 --- a/gcc/gencheck.c +++ b/gcc/gencheck.c @@ -1,5 +1,6 @@ /* Generate check macros for tree codes. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -32,20 +33,16 @@ static const char *const tree_codes[] = { (char*) 0 }; -static void usage PARAMS ((void)); +static void usage (void); static void -usage () +usage (void) { fputs ("Usage: gencheck\n", stderr); } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char **argv ATTRIBUTE_UNUSED; +main (int argc, char **argv ATTRIBUTE_UNUSED) { int i; diff --git a/gcc/gencodes.c b/gcc/gencodes.c index e2c4656624b..13aa2c58773 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -2,7 +2,7 @@ - some macros CODE_FOR_... giving the insn_code_number value for each of the defined standard insn names. Copyright (C) 1987, 1991, 1995, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -30,12 +30,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "errors.h" #include "gensupport.h" -static void gen_insn PARAMS ((rtx, int)); - static void -gen_insn (insn, code) - rtx insn; - int code; +gen_insn (rtx insn, int code) { const char *name = XSTR (insn, 0); int truth = maybe_eval_c_test (XSTR (insn, 2)); @@ -52,12 +48,8 @@ gen_insn (insn, code) } } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; @@ -111,8 +103,7 @@ enum insn_code {"); /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/genconditions.c b/gcc/genconditions.c index 412f1f1d588..fc55d1c9dd2 100644 --- a/gcc/genconditions.c +++ b/gcc/genconditions.c @@ -1,5 +1,5 @@ /* Process machine description and calculate constant conditions. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -40,20 +40,17 @@ static int saw_eh_return; static htab_t condition_table; -static void add_condition PARAMS ((const char *)); -static void write_header PARAMS ((void)); -static void write_conditions PARAMS ((void)); -static int write_one_condition PARAMS ((PTR *, PTR)); - -extern int main PARAMS ((int, char **)); +static void add_condition (const char *); +static void write_header (void); +static void write_conditions (void); +static int write_one_condition (void **, void *); /* Record the C test expression EXPR in the condition_table. Duplicates clobber previous entries, which leaks memory, but we don't care for this application. */ static void -add_condition (expr) - const char *expr; +add_condition (const char *expr) { struct c_test *test; @@ -69,7 +66,7 @@ add_condition (expr) /* Generate the header for insn-conditions.c. */ static void -write_header () +write_header (void) { puts ("\ /* Generated automatically by the program `genconditions' from the target\n\ @@ -122,7 +119,7 @@ write_header () extern rtx insn;\n\ extern rtx ins1;\n\ extern rtx operands[];\n\ -extern int next_insn_tests_no_inequality PARAMS ((rtx));\n"); +extern int next_insn_tests_no_inequality (rtx);\n"); puts ("\ /* If we don't have __builtin_constant_p, or it's not acceptable in\n\ @@ -142,9 +139,7 @@ extern int next_insn_tests_no_inequality PARAMS ((rtx));\n"); MAYBE_EVAL (! optimize_size && ! TARGET_READ_MODIFY_WRITE) }, */ static int -write_one_condition (slot, dummy) - PTR *slot; - PTR dummy ATTRIBUTE_UNUSED; +write_one_condition (void **slot, void *dummy ATTRIBUTE_UNUSED) { const struct c_test *test = * (const struct c_test **) slot; const char *p; @@ -167,7 +162,7 @@ write_one_condition (slot, dummy) /* Write out the complete conditions table, its size, and a flag indicating that gensupport.c can now do insn elision. */ static void -write_conditions () +write_conditions (void) { puts ("\ /* This table lists each condition found in the machine description.\n\ @@ -186,9 +181,7 @@ const struct c_test insn_conditions[] = {"); } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; int pattern_lineno; /* not used */ diff --git a/gcc/genconfig.c b/gcc/genconfig.c index bb0dea9f92d..c76bdb9d645 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -1,7 +1,7 @@ /* Generate from machine description: - some #define configuration flags. - Copyright (C) 1987, 1991, 1997, 1998, - 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1987, 1991, 1997, 1998, 1999, 2000, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -50,12 +50,12 @@ static int max_insns_per_peep2; static int clobbers_seen_this_insn; static int dup_operands_seen_this_insn; -static void walk_insn_part PARAMS ((rtx, int, int)); -static void gen_insn PARAMS ((rtx)); -static void gen_expand PARAMS ((rtx)); -static void gen_split PARAMS ((rtx)); -static void gen_peephole PARAMS ((rtx)); -static void gen_peephole2 PARAMS ((rtx)); +static void walk_insn_part (rtx, int, int); +static void gen_insn (rtx); +static void gen_expand (rtx); +static void gen_split (rtx); +static void gen_peephole (rtx); +static void gen_peephole2 (rtx); /* RECOG_P will be nonzero if this pattern was seen in a context where it will be used to recognize, rather than just generate an insn. @@ -64,10 +64,7 @@ static void gen_peephole2 PARAMS ((rtx)); of a SET whose destination is not (pc). */ static void -walk_insn_part (part, recog_p, non_pc_set_src) - rtx part; - int recog_p; - int non_pc_set_src; +walk_insn_part (rtx part, int recog_p, int non_pc_set_src) { int i, j; RTX_CODE code; @@ -171,8 +168,7 @@ walk_insn_part (part, recog_p, non_pc_set_src) } static void -gen_insn (insn) - rtx insn; +gen_insn (rtx insn) { int i; @@ -192,8 +188,7 @@ gen_insn (insn) /* Similar but scan a define_expand. */ static void -gen_expand (insn) - rtx insn; +gen_expand (rtx insn) { int i; @@ -219,8 +214,7 @@ gen_expand (insn) /* Similar but scan a define_split. */ static void -gen_split (split) - rtx split; +gen_split (rtx split) { int i; @@ -234,8 +228,7 @@ gen_split (split) } static void -gen_peephole (peep) - rtx peep; +gen_peephole (rtx peep) { int i; @@ -246,8 +239,7 @@ gen_peephole (peep) } static void -gen_peephole2 (peep) - rtx peep; +gen_peephole2 (rtx peep) { int i, n; @@ -265,12 +257,8 @@ gen_peephole2 (peep) max_insns_per_peep2 = n; } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; @@ -379,8 +367,7 @@ main (argc, argv) /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/genconstants.c b/gcc/genconstants.c index 1c08040f8ec..a49c5476d25 100644 --- a/gcc/genconstants.c +++ b/gcc/genconstants.c @@ -2,8 +2,8 @@ a series of #define statements, one for each constant named in a (define_constants ...) pattern. - Copyright (C) 1987, 1991, 1995, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1987, 1991, 1995, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -34,16 +34,13 @@ Boston, MA 02111-1307, USA. */ #include "errors.h" #include "gensupport.h" -static int print_md_constant PARAMS ((void **, void *)); -extern int main PARAMS ((int, char **)); +static int print_md_constant (void **, void *); /* Called via traverse_md_constants; emit a #define for the current constant definition. */ static int -print_md_constant (slot, info) - void **slot; - void *info; +print_md_constant (void **slot, void *info) { struct md_constant *def = *slot; FILE *file = info; @@ -53,9 +50,7 @@ print_md_constant (slot, info) } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int dummy1, dummy2; rtx desc; diff --git a/gcc/genemit.c b/gcc/genemit.c index b86dc994419..619dfa0c2e8 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -1,6 +1,6 @@ /* Generate code from machine description to emit insns as rtl. - Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001, + 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -37,7 +37,7 @@ static int insn_code_number; static int insn_index_number; /* Data structure for recording the patterns of insns that have CLOBBERs. - We use this to output a function that adds these CLOBBERs to a + We use this to output a function that adds these CLOBBERs to a previously-allocated PARALLEL expression. */ struct clobber_pat @@ -57,22 +57,21 @@ struct clobber_ent struct clobber_ent *next; }; -static void max_operand_1 PARAMS ((rtx)); -static int max_operand_vec PARAMS ((rtx, int)); -static void print_code PARAMS ((RTX_CODE)); -static void gen_exp PARAMS ((rtx, enum rtx_code, char *)); -static void gen_insn PARAMS ((rtx, int)); -static void gen_expand PARAMS ((rtx)); -static void gen_split PARAMS ((rtx)); -static void output_add_clobbers PARAMS ((void)); -static void output_added_clobbers_hard_reg_p PARAMS ((void)); -static void gen_rtx_scratch PARAMS ((rtx, enum rtx_code)); -static void output_peephole2_scratches PARAMS ((rtx)); +static void max_operand_1 (rtx); +static int max_operand_vec (rtx, int); +static void print_code (RTX_CODE); +static void gen_exp (rtx, enum rtx_code, char *); +static void gen_insn (rtx, int); +static void gen_expand (rtx); +static void gen_split (rtx); +static void output_add_clobbers (void); +static void output_added_clobbers_hard_reg_p (void); +static void gen_rtx_scratch (rtx, enum rtx_code); +static void output_peephole2_scratches (rtx); static void -max_operand_1 (x) - rtx x; +max_operand_1 (rtx x) { RTX_CODE code; int i; @@ -112,9 +111,7 @@ max_operand_1 (x) } static int -max_operand_vec (insn, arg) - rtx insn; - int arg; +max_operand_vec (rtx insn, int arg) { int len = XVECLEN (insn, arg); int i; @@ -130,8 +127,7 @@ max_operand_vec (insn, arg) } static void -print_code (code) - RTX_CODE code; +print_code (RTX_CODE code) { const char *p1; for (p1 = GET_RTX_NAME (code); *p1; p1++) @@ -139,9 +135,7 @@ print_code (code) } static void -gen_rtx_scratch (x, subroutine_type) - rtx x; - enum rtx_code subroutine_type; +gen_rtx_scratch (rtx x, enum rtx_code subroutine_type) { if (subroutine_type == DEFINE_PEEPHOLE2) { @@ -157,10 +151,7 @@ gen_rtx_scratch (x, subroutine_type) substituting any operand references appearing within. */ static void -gen_exp (x, subroutine_type, used) - rtx x; - enum rtx_code subroutine_type; - char *used; +gen_exp (rtx x, enum rtx_code subroutine_type, char *used) { RTX_CODE code; int i; @@ -294,14 +285,12 @@ gen_exp (x, subroutine_type, used) abort (); } printf (")"); -} +} /* Generate the `gen_...' function for a DEFINE_INSN. */ static void -gen_insn (insn, lineno) - rtx insn; - int lineno; +gen_insn (rtx insn, int lineno) { int operands; int i; @@ -349,7 +338,7 @@ gen_insn (insn, lineno) rtx new = XEXP (XVECEXP (insn, 1, j), 0); /* OLD and NEW are the same if both are to be a SCRATCH - of the same mode, + of the same mode, or if both are registers of the same mode and number. */ if (! (GET_MODE (old) == GET_MODE (new) && ((GET_CODE (old) == MATCH_SCRATCH @@ -358,7 +347,7 @@ gen_insn (insn, lineno) && REGNO (old) == REGNO (new))))) break; } - + if (j == XVECLEN (insn, 1)) break; } @@ -366,7 +355,7 @@ gen_insn (insn, lineno) if (p == 0) { p = (struct clobber_pat *) xmalloc (sizeof (struct clobber_pat)); - + p->insns = 0; p->pattern = insn; p->first_clobber = i + 1; @@ -432,8 +421,7 @@ gen_insn (insn, lineno) /* Generate the `gen_...' function for a DEFINE_EXPAND. */ static void -gen_expand (expand) - rtx expand; +gen_expand (rtx expand) { int operands; int i; @@ -569,8 +557,7 @@ gen_expand (expand) /* Like gen_expand, but generates insns resulting from splitting SPLIT. */ static void -gen_split (split) - rtx split; +gen_split (rtx split) { int i; int operands; @@ -596,7 +583,7 @@ gen_split (split) /* Output the prototype, function name and argument declarations. */ if (GET_CODE (split) == DEFINE_PEEPHOLE2) { - printf ("extern rtx gen_%s_%d PARAMS ((rtx, rtx *));\n", + printf ("extern rtx gen_%s_%d (rtx, rtx *);\n", name, insn_code_number); printf ("rtx\ngen_%s_%d (curr_insn, operands)\n", name, insn_code_number); @@ -605,7 +592,7 @@ gen_split (split) } else { - printf ("extern rtx gen_split_%d PARAMS ((rtx *));\n", insn_code_number); + printf ("extern rtx gen_split_%d (rtx *);\n", insn_code_number); printf ("rtx\ngen_%s_%d (operands)\n", name, insn_code_number); printf (" rtx *operands%s;\n", unused); } @@ -724,7 +711,7 @@ output_add_clobbers () hard reg and 0 if they just clobber SCRATCH. */ static void -output_added_clobbers_hard_reg_p () +output_added_clobbers_hard_reg_p (void) { struct clobber_pat *clobber; struct clobber_ent *ent; @@ -761,8 +748,7 @@ output_added_clobbers_hard_reg_p () scratch registers used by the peephole2 pattern in SPLIT. */ static void -output_peephole2_scratches (split) - rtx split; +output_peephole2_scratches (rtx split) { int i; int insn_nr = 0; @@ -788,7 +774,7 @@ output_peephole2_scratches (split) cur_insn_nr++; printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\ - return NULL;\n", + return NULL;\n", XINT (elt, 0), insn_nr, last_insn_nr, XSTR (elt, 1), @@ -800,12 +786,8 @@ output_peephole2_scratches (split) } } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; @@ -896,8 +878,7 @@ from the machine description file `md'. */\n\n"); /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/genextract.c b/gcc/genextract.c index e80fd202d3f..e63c26288af 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -1,6 +1,6 @@ /* Generate code from machine description to extract operands from insn as rtl. - Copyright (C) 1987, 1991, 1992, 1993, 1997, 1998, - 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1987, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* This structure contains all the information needed to describe one - set of extractions methods. Each method may be used by more than + set of extractions methods. Each method may be used by more than one pattern if the operands are in the same place. The string for each operand describes that path to the operand and @@ -95,14 +95,13 @@ static int dupnums[MAX_DUP_OPERANDS]; static struct code_ptr *peepholes; -static void gen_insn PARAMS ((rtx)); -static void walk_rtx PARAMS ((rtx, const char *)); -static void print_path PARAMS ((const char *)); -static void record_insn_name PARAMS ((int, const char *)); +static void gen_insn (rtx); +static void walk_rtx (rtx, const char *); +static void print_path (const char *); +static void record_insn_name (int, const char *); static void -gen_insn (insn) - rtx insn; +gen_insn (rtx insn) { int i; struct extraction *p; @@ -181,9 +180,7 @@ gen_insn (insn) } static void -walk_rtx (x, path) - rtx x; - const char *path; +walk_rtx (rtx x, const char *path) { RTX_CODE code; int i; @@ -222,11 +219,11 @@ walk_rtx (x, path) duplocs[dup_count] = xstrdup (path); dupnums[dup_count] = XINT (x, 0); dup_count++; - + newpath = (char *) xmalloc (depth + 2); strcpy (newpath, path); newpath[depth + 1] = 0; - + for (i = XVECLEN (x, 1) - 1; i >= 0; i--) { newpath[depth] = (code == MATCH_OP_DUP ? '0' : 'a') + i; @@ -234,7 +231,7 @@ walk_rtx (x, path) } free (newpath); return; - + case MATCH_OPERATOR: oplocs[XINT (x, 0)] = xstrdup (path); op_count = MAX (op_count, XINT (x, 0) + 1); @@ -306,8 +303,7 @@ walk_rtx (x, path) evaluate to the rtx at that point. */ static void -print_path (path) - const char *path; +print_path (const char *path) { int len = strlen (path); int i; @@ -332,7 +328,7 @@ print_path (path) else abort (); } - + printf ("pat"); for (i = 0; i < len; i++) @@ -346,12 +342,9 @@ print_path (path) } } -extern int main PARAMS ((int, char **)); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; int i; @@ -458,7 +451,7 @@ from the machine description file `md'. */\n\n"); else printf (" case %d:\n", i); } - + for (i = 0; i < p->op_count; i++) { if (p->oplocs[i] == 0) @@ -522,7 +515,7 @@ record_insn_name (code, name) new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); insn_name_ptr = (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size); - memset (insn_name_ptr + insn_name_ptr_size, 0, + memset (insn_name_ptr + insn_name_ptr_size, 0, sizeof(char *) * (new_size - insn_name_ptr_size)); insn_name_ptr_size = new_size; } @@ -537,6 +530,6 @@ record_insn_name (code, name) last_real_name = new = xstrdup (name); last_real_code = code; } - + insn_name_ptr[code] = new; -} +} diff --git a/gcc/genflags.c b/gcc/genflags.c index ec90c1a6241..1eb3a730823 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -2,7 +2,7 @@ - some flags HAVE_... saying which simple standard instructions are available for this machine. Copyright (C) 1987, 1991, 1995, 1998, - 1999, 2000 Free Software Foundation, Inc. + 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -40,17 +40,16 @@ static int max_id_len; /* Max operand encountered in a scan over some insn. */ static int max_opno; -static void max_operand_1 PARAMS ((rtx)); -static int num_operands PARAMS ((rtx)); -static void gen_proto PARAMS ((rtx)); -static void gen_macro PARAMS ((const char *, int, int)); -static void gen_insn PARAMS ((rtx)); +static void max_operand_1 (rtx); +static int num_operands (rtx); +static void gen_proto (rtx); +static void gen_macro (const char *, int, int); +static void gen_insn (rtx); /* Count the number of match_operand's found. */ static void -max_operand_1 (x) - rtx x; +max_operand_1 (rtx x) { RTX_CODE code; int i; @@ -82,8 +81,7 @@ max_operand_1 (x) } static int -num_operands (insn) - rtx insn; +num_operands (rtx insn) { int len = XVECLEN (insn, 1); int i; @@ -100,9 +98,7 @@ num_operands (insn) of arguments it takes. Any missing arguments are assumed to be at the end. */ static void -gen_macro (name, real, expect) - const char *name; - int real, expect; +gen_macro (const char *name, int real, int expect) { int i; @@ -131,8 +127,7 @@ gen_macro (name, real, expect) does nothing. */ static void -gen_proto (insn) - rtx insn; +gen_proto (rtx insn) { int num = num_operands (insn); int i; @@ -159,9 +154,9 @@ gen_proto (insn) } if (truth != 0) - printf ("extern rtx gen_%-*s PARAMS ((", max_id_len, name); + printf ("extern rtx gen_%-*s (", max_id_len, name); else - printf ("static inline rtx gen_%-*s PARAMS ((", max_id_len, name); + printf ("static inline rtx gen_%-*s (", max_id_len, name); if (num == 0) fputs ("void", stdout); @@ -169,11 +164,11 @@ gen_proto (insn) { for (i = 1; i < num; i++) fputs ("rtx, ", stdout); - + fputs ("rtx", stdout); } - puts ("));"); + puts (");"); /* Some back ends want to take the address of generator functions, so we cannot simply use #define for these dummy definitions. */ @@ -197,8 +192,7 @@ gen_proto (insn) } static void -gen_insn (insn) - rtx insn; +gen_insn (rtx insn) { const char *name = XSTR (insn, 0); const char *p; @@ -238,12 +232,8 @@ gen_insn (insn) obstack_grow (&obstack, &insn, sizeof (rtx)); } -extern int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; rtx dummy; @@ -262,7 +252,7 @@ main (argc, argv) if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE) return (FATAL_EXIT_CODE); - + puts ("/* Generated automatically by the program `genflags'"); puts (" from the machine description file `md'. */\n"); puts ("#ifndef GCC_INSN_FLAGS_H"); @@ -299,8 +289,7 @@ main (argc, argv) /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index e4ac109ee3a..9dbb7342f08 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -1,5 +1,6 @@ /* Generate code to allocate RTL structures. - Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -44,24 +45,23 @@ static const struct rtx_definition defs[] = static const char *formats[NUM_RTX_CODE]; -static const char *type_from_format PARAMS ((int)); -static const char *accessor_from_format PARAMS ((int)); -static int special_format PARAMS ((const char *)); -static int special_rtx PARAMS ((int)); -static int excluded_rtx PARAMS ((int)); -static void find_formats PARAMS ((void)); -static void gendecl PARAMS ((const char *)); -static void genmacro PARAMS ((int)); -static void gendef PARAMS ((const char *)); -static void genlegend PARAMS ((void)); -static void genheader PARAMS ((void)); -static void gencode PARAMS ((void)); +static const char *type_from_format (int); +static const char *accessor_from_format (int); +static int special_format (const char *); +static int special_rtx (int); +static int excluded_rtx (int); +static void find_formats (void); +static void gendecl (const char *); +static void genmacro (int); +static void gendef (const char *); +static void genlegend (void); +static void genheader (void); +static void gencode (void); /* Decode a format letter into a C type string. */ static const char * -type_from_format (c) - int c; +type_from_format (int c) { switch (c) { @@ -93,8 +93,7 @@ type_from_format (c) /* Decode a format letter into the proper accessor function. */ static const char * -accessor_from_format (c) - int c; +accessor_from_format (int c) { switch (c) { @@ -131,8 +130,7 @@ accessor_from_format (c) the list of formats we write routines to create. */ static int -special_format (fmt) - const char *fmt; +special_format (const char *fmt) { return (strchr (fmt, '*') != 0 || strchr (fmt, 'V') != 0 @@ -145,8 +143,7 @@ special_format (fmt) is a wrapper in emit-rtl.c). */ static int -special_rtx (idx) - int idx; +special_rtx (int idx) { return (strcmp (defs[idx].enumname, "CONST_INT") == 0 || strcmp (defs[idx].enumname, "REG") == 0 @@ -160,8 +157,7 @@ special_rtx (idx) cannot have the obvious interface). */ static int -excluded_rtx (idx) - int idx; +excluded_rtx (int idx) { return (strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0); } @@ -169,7 +165,7 @@ excluded_rtx (idx) /* Place a list of all format specifiers we use into the array FORMAT. */ static void -find_formats () +find_formats (void) { int i; @@ -192,13 +188,12 @@ find_formats () /* Write the declarations for the routine to allocate RTL with FORMAT. */ static void -gendecl (format) - const char *format; +gendecl (const char *format) { const char *p; int i, pos; - printf ("extern rtx gen_rtx_fmt_%s\tPARAMS ((RTX_CODE, ", format); + printf ("extern rtx gen_rtx_fmt_%s\t (RTX_CODE, ", format); printf ("enum machine_mode mode"); /* Write each parameter that is needed and start a new line when the line @@ -216,15 +211,14 @@ gendecl (format) pos += ourlen; } - printf ("));\n"); + printf (");\n"); } /* Generate macros to generate RTL of code IDX using the functions we write. */ static void -genmacro (idx) - int idx; +genmacro (int idx) { const char *p; int i; @@ -257,8 +251,7 @@ genmacro (idx) format is FORMAT. */ static void -gendef (format) - const char *format; +gendef (const char *format) { const char *p; int i, j; @@ -298,7 +291,7 @@ gendef (format) /* Generate the documentation header for files we write. */ static void -genlegend () +genlegend (void) { puts ("/* Generated automatically by gengenrtl from rtl.def. */\n"); } @@ -306,7 +299,7 @@ genlegend () /* Generate the text of the header file we make, genrtl.h. */ static void -genheader () +genheader (void) { int i; const char **fmt; @@ -329,7 +322,7 @@ genheader () /* Generate the text of the code file we write, genrtl.c. */ static void -gencode () +gencode (void) { const char **fmt; @@ -348,12 +341,9 @@ gencode () /* This is the main program. We accept only one argument, "-h", which says we are writing the genrtl.h file. Otherwise we are writing the genrtl.c file. */ -extern int main PARAMS ((int, char **)); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { find_formats (); genlegend (); diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 1ad3e05d350..52e8780f492 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -32,10 +32,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Nonzero iff an error has occurred. */ static int hit_error = 0; -static void gen_rtx_next PARAMS ((void)); -static void write_rtx_next PARAMS ((void)); -static void open_base_files PARAMS ((void)); -static void close_output_files PARAMS ((void)); +static void gen_rtx_next (void); +static void write_rtx_next (void); +static void open_base_files (void); +static void close_output_files (void); /* Report an error at POS, printing MSG. */ @@ -43,7 +43,7 @@ void error_at_line (struct fileloc *pos, const char *msg, ...) { va_list ap; - + va_start (ap, msg); fprintf (stderr, "%s:%d: ", pos->file, pos->line); @@ -56,10 +56,7 @@ error_at_line (struct fileloc *pos, const char *msg, ...) /* vasprintf, but produces fatal message on out-of-memory. */ int -xvasprintf (result, format, args) - char ** result; - const char *format; - va_list args; +xvasprintf (char **result, const char *format, va_list args) { int ret = vasprintf (result, format, args); if (*result == NULL || ret < 0) @@ -76,7 +73,7 @@ xasprintf (const char *format, ...) { char *result; va_list ap; - + va_start (ap, format); xvasprintf (&result, format, ap); va_end (ap); @@ -88,7 +85,7 @@ xasprintf (const char *format, ...) struct type string_type = { TYPE_STRING, NULL, NULL, GC_USED UNION_INIT_ZERO -}; +}; /* Lists of various things. */ @@ -97,19 +94,16 @@ static type_p structures; static type_p param_structs; static pair_p variables; -static void do_scalar_typedef PARAMS ((const char *, struct fileloc *)); -static type_p find_param_structure - PARAMS ((type_p t, type_p param[NUM_PARAM])); -static type_p adjust_field_tree_exp PARAMS ((type_p t, options_p opt)); -static type_p adjust_field_rtx_def PARAMS ((type_p t, options_p opt)); +static void do_scalar_typedef (const char *, struct fileloc *); +static type_p find_param_structure + (type_p t, type_p param[NUM_PARAM]); +static type_p adjust_field_tree_exp (type_p t, options_p opt); +static type_p adjust_field_rtx_def (type_p t, options_p opt); /* Define S as a typedef to T at POS. */ void -do_typedef (s, t, pos) - const char *s; - type_p t; - struct fileloc *pos; +do_typedef (const char *s, type_p t, struct fileloc *pos) { pair_p p; @@ -135,9 +129,7 @@ do_typedef (s, t, pos) /* Define S as a typename of a scalar. */ static void -do_scalar_typedef (s, pos) - const char *s; - struct fileloc *pos; +do_scalar_typedef (const char *s, struct fileloc *pos) { do_typedef (s, create_scalar_type (s, strlen (s)), pos); } @@ -145,9 +137,7 @@ do_scalar_typedef (s, pos) /* Return the type previously defined for S. Use POS to report errors. */ type_p -resolve_typedef (s, pos) - const char *s; - struct fileloc *pos; +resolve_typedef (const char *s, struct fileloc *pos) { pair_p p; for (p = typedefs; p != NULL; p = p->next) @@ -161,26 +151,22 @@ resolve_typedef (s, pos) at POS with fields FIELDS and options O. */ void -new_structure (name, isunion, pos, fields, o) - const char *name; - int isunion; - struct fileloc *pos; - pair_p fields; - options_p o; +new_structure (const char *name, int isunion, struct fileloc *pos, + pair_p fields, options_p o) { type_p si; type_p s = NULL; lang_bitmap bitmap = get_base_file_bitmap (pos->file); for (si = structures; si != NULL; si = si->next) - if (strcmp (name, si->u.s.tag) == 0 + if (strcmp (name, si->u.s.tag) == 0 && UNION_P (si) == isunion) { type_p ls = NULL; if (si->kind == TYPE_LANG_STRUCT) { ls = si; - + for (si = ls->u.s.lang_struct; si != NULL; si = si->next) if (si->u.s.bitmap == bitmap) s = si; @@ -209,7 +195,7 @@ new_structure (name, isunion, pos, fields, o) } break; } - + if (s == NULL) { s = xcalloc (1, sizeof (struct type)); @@ -239,14 +225,12 @@ new_structure (name, isunion, pos, fields, o) was defined previously. */ type_p -find_structure (name, isunion) - const char *name; - int isunion; +find_structure (const char *name, int isunion) { type_p s; for (s = structures; s != NULL; s = s->next) - if (strcmp (name, s->u.s.tag) == 0 + if (strcmp (name, s->u.s.tag) == 0 && UNION_P (s) == isunion) return s; @@ -264,15 +248,13 @@ find_structure (name, isunion) union if none was defined previously. */ static type_p -find_param_structure (t, param) - type_p t; - type_p param[NUM_PARAM]; +find_param_structure (type_p t, type_p param[NUM_PARAM]) { type_p res; - + for (res = param_structs; res; res = res->next) if (res->u.param_struct.stru == t - && memcmp (res->u.param_struct.param, param, + && memcmp (res->u.param_struct.param, param, sizeof (type_p) * NUM_PARAM) == 0) break; if (res == NULL) @@ -290,9 +272,7 @@ find_param_structure (t, param) /* Return a scalar type with name NAME. */ type_p -create_scalar_type (name, name_len) - const char *name; - size_t name_len; +create_scalar_type (const char *name, size_t name_len) { type_p r = xcalloc (1, sizeof (struct type)); r->kind = TYPE_SCALAR; @@ -303,8 +283,7 @@ create_scalar_type (name, name_len) /* Return a pointer to T. */ type_p -create_pointer (t) - type_p t; +create_pointer (type_p t) { if (! t->pointer_to) { @@ -319,12 +298,10 @@ create_pointer (t) /* Return an array of length LEN. */ type_p -create_array (t, len) - type_p t; - const char *len; +create_array (type_p t, const char *len) { type_p v; - + v = xcalloc (1, sizeof (*v)); v->kind = TYPE_ARRAY; v->u.a.p = t; @@ -336,11 +313,7 @@ create_array (t, len) to `variables'. */ void -note_variable (s, t, o, pos) - const char *s; - type_p t; - options_p o; - struct fileloc *pos; +note_variable (const char *s, type_p t, options_p o, struct fileloc *pos) { pair_p n; n = xmalloc (sizeof (*n)); @@ -366,19 +339,19 @@ static int rtx_next_new[NUM_RTX_CODE]; in gengtype at all, but it's needed for adjust_field_rtx_def. */ static void -gen_rtx_next () +gen_rtx_next (void) { int i; for (i = 0; i < NUM_RTX_CODE; i++) { int k; - + rtx_next_new[i] = -1; if (strncmp (rtx_format[i], "iuu", 3) == 0) rtx_next_new[i] = 2; else if (i == COND_EXEC || i == SET || i == EXPR_LIST || i == INSN_LIST) rtx_next_new[i] = 1; - else + else for (k = strlen (rtx_format[i]) - 1; k >= 0; k--) if (rtx_format[i][k] == 'e' || rtx_format[i][k] == 'u') rtx_next_new[i] = k; @@ -387,18 +360,18 @@ gen_rtx_next () /* Write out the contents of the rtx_next array. */ static void -write_rtx_next () +write_rtx_next (void) { outf_p f = get_output_file_with_visibility (NULL); int i; - + oprintf (f, "\n/* Used to implement the RTX_NEXT macro. */\n"); oprintf (f, "const unsigned char rtx_next[NUM_RTX_CODE] = {\n"); for (i = 0; i < NUM_RTX_CODE; i++) if (rtx_next_new[i] == -1) oprintf (f, " 0,\n"); else - oprintf (f, + oprintf (f, " offsetof (struct rtx_def, fld) + %d * sizeof (rtunion),\n", rtx_next_new[i]); oprintf (f, "};\n"); @@ -409,9 +382,7 @@ write_rtx_next () are based in a complex way on the type of RTL. */ static type_p -adjust_field_rtx_def (t, opt) - type_p t; - options_p opt ATTRIBUTE_UNUSED; +adjust_field_rtx_def (type_p t, options_p opt ATTRIBUTE_UNUSED) { pair_p flds = NULL; options_p nodot; @@ -424,14 +395,14 @@ adjust_field_rtx_def (t, opt) #include "rtl.def" #undef DEF_RTL_EXPR }; - + if (t->kind != TYPE_ARRAY) { - error_at_line (&lexer_line, + error_at_line (&lexer_line, "special `rtx_def' must be applied to an array"); return &string_type; } - + nodot = xmalloc (sizeof (*nodot)); nodot->next = NULL; nodot->name = "dot"; @@ -453,7 +424,7 @@ adjust_field_rtx_def (t, opt) for (c = NOTE_INSN_BIAS; c <= NOTE_INSN_MAX; c++) { pair_p old_note_flds = note_flds; - + note_flds = xmalloc (sizeof (*note_flds)); note_flds->line.file = __FILE__; note_flds->line.line = __LINE__; @@ -478,7 +449,7 @@ adjust_field_rtx_def (t, opt) note_flds->name = "rttree"; note_flds->type = tree_tp; break; - + case NOTE_INSN_EXPECTED_VALUE: note_flds->name = "rtx"; note_flds->type = rtx_tp; @@ -492,7 +463,7 @@ adjust_field_rtx_def (t, opt) } new_structure ("rtx_def_note_subunion", 1, &lexer_line, note_flds, NULL); } - + note_union_tp = find_structure ("rtx_def_note_subunion", 1); for (i = 0; i < NUM_RTX_CODE; i++) @@ -553,14 +524,14 @@ adjust_field_rtx_def (t, opt) t = scalar_tp, subname = "rtint"; else { - error_at_line (&lexer_line, + error_at_line (&lexer_line, "rtx type `%s' has `0' in position %lu, can't handle", rtx_name[i], (unsigned long) aindex); t = &string_type; subname = "rtint"; } break; - + case 's': case 'S': case 'T': @@ -596,7 +567,7 @@ adjust_field_rtx_def (t, opt) break; default: - error_at_line (&lexer_line, + error_at_line (&lexer_line, "rtx type `%s' has `%c' in position %lu, can't handle", rtx_name[i], rtx_format[i][aindex], (unsigned long)aindex); @@ -654,14 +625,12 @@ adjust_field_rtx_def (t, opt) /* Handle `special("tree_exp")'. This is a special case for field `operands' of struct tree_exp, which although it claims to contain - pointers to trees, actually sometimes contains pointers to RTL too. + pointers to trees, actually sometimes contains pointers to RTL too. Passed T, the old type of the field, and OPT its options. Returns a new type for the field. */ static type_p -adjust_field_tree_exp (t, opt) - type_p t; - options_p opt ATTRIBUTE_UNUSED; +adjust_field_tree_exp (type_p t, options_p opt ATTRIBUTE_UNUSED) { pair_p flds; options_p nodot; @@ -677,14 +646,14 @@ adjust_field_tree_exp (t, opt) { "WITH_CLEANUP_EXPR", 2, 1 }, { "METHOD_CALL_EXPR", 3, 1 } }; - + if (t->kind != TYPE_ARRAY) { - error_at_line (&lexer_line, + error_at_line (&lexer_line, "special `tree_exp' must be applied to an array"); return &string_type; } - + nodot = xmalloc (sizeof (*nodot)); nodot->next = NULL; nodot->name = "dot"; @@ -707,16 +676,16 @@ adjust_field_tree_exp (t, opt) flds->opt->name = "default"; flds->opt->info = ""; } - + for (i = 0; i < ARRAY_SIZE (data); i++) { pair_p old_flds = flds; pair_p subfields = NULL; int r_index; const char *sname; - - for (r_index = 0; - r_index < data[i].first_rtl + data[i].num_rtl; + + for (r_index = 0; + r_index < data[i].first_rtl + data[i].num_rtl; r_index++) { pair_p old_subf = subfields; @@ -758,12 +727,10 @@ adjust_field_tree_exp (t, opt) - Converts structures for which a parameter is provided to TYPE_PARAM_STRUCT; - Handles "special" options. -*/ +*/ type_p -adjust_field_type (t, opt) - type_p t; - options_p opt; +adjust_field_type (type_p t, options_p opt) { int length_p = 0; const int pointer_p = t->kind == TYPE_POINTER; @@ -773,7 +740,7 @@ adjust_field_type (t, opt) for (i = 0; i < NUM_PARAM; i++) params[i] = NULL; - + for (; opt; opt = opt->next) if (strcmp (opt->name, "length") == 0) length_p = 1; @@ -787,7 +754,7 @@ adjust_field_type (t, opt) if (! UNION_OR_STRUCT_P (t) && (t->kind != TYPE_POINTER || ! UNION_OR_STRUCT_P (t->u.p))) { - error_at_line (&lexer_line, + error_at_line (&lexer_line, "option `%s' may only be applied to structures or structure pointers", opt->name); return t; @@ -815,7 +782,7 @@ adjust_field_type (t, opt) if (params_p) { type_p realt; - + if (pointer_p) t = t->u.p; realt = find_param_structure (t, params); @@ -842,19 +809,16 @@ adjust_field_type (t, opt) in TYPEINFO. POS is used for error messages. */ void -note_yacc_type (o, fields, typeinfo, pos) - options_p o; - pair_p fields; - pair_p typeinfo; - struct fileloc *pos; +note_yacc_type (options_p o, pair_p fields, pair_p typeinfo, + struct fileloc *pos) { pair_p p; pair_p *p_p; - + for (p = typeinfo; p; p = p->next) { pair_p m; - + if (p->name == NULL) continue; @@ -862,7 +826,7 @@ note_yacc_type (o, fields, typeinfo, pos) { pair_p pp; int ok = 0; - + for (pp = typeinfo; pp; pp = pp->next) if (pp->type != (type_p) 1 && strcmp (pp->opt->info, p->opt->info) == 0) @@ -879,12 +843,12 @@ note_yacc_type (o, fields, typeinfo, pos) p->type = m->type; if (p->type == NULL) { - error_at_line (&p->line, + error_at_line (&p->line, "couldn't match fieldname `%s'", p->name); p->name = NULL; } } - + p_p = &typeinfo; while (*p_p) { @@ -901,20 +865,16 @@ note_yacc_type (o, fields, typeinfo, pos) do_typedef ("YYSTYPE", find_structure ("yy_union", 1), pos); } -static void process_gc_options PARAMS ((options_p, enum gc_used_enum, - int *, int *, int *)); -static void set_gc_used_type PARAMS ((type_p, enum gc_used_enum, type_p *)); -static void set_gc_used PARAMS ((pair_p)); +static void process_gc_options (options_p, enum gc_used_enum, + int *, int *, int *); +static void set_gc_used_type (type_p, enum gc_used_enum, type_p *); +static void set_gc_used (pair_p); /* Handle OPT for set_gc_used_type. */ static void -process_gc_options (opt, level, maybe_undef, pass_param, length) - options_p opt; - enum gc_used_enum level; - int *maybe_undef; - int *pass_param; - int *length; +process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, + int *pass_param, int *length) { options_p o; for (o = opt; o; o = o->next) @@ -931,14 +891,11 @@ process_gc_options (opt, level, maybe_undef, pass_param, length) /* Set the gc_used field of T to LEVEL, and handle the types it references. */ static void -set_gc_used_type (t, level, param) - type_p t; - enum gc_used_enum level; - type_p param[NUM_PARAM]; +set_gc_used_type (type_p t, enum gc_used_enum level, type_p param[NUM_PARAM]) { if (t->gc_used >= level) return; - + t->gc_used = level; switch (t->kind) @@ -958,7 +915,7 @@ set_gc_used_type (t, level, param) int length = 0; process_gc_options (f->opt, level, &maybe_undef, &pass_param, &length); - + if (length && f->type->kind == TYPE_POINTER) set_gc_used_type (f->type->u.p, GC_USED, NULL); else if (maybe_undef && f->type->kind == TYPE_POINTER) @@ -979,7 +936,7 @@ set_gc_used_type (t, level, param) case TYPE_ARRAY: set_gc_used_type (t->u.a.p, GC_USED, param); break; - + case TYPE_LANG_STRUCT: for (t = t->u.s.lang_struct; t; t = t->next) set_gc_used_type (t, level, param); @@ -997,7 +954,7 @@ set_gc_used_type (t, level, param) else level = GC_USED; t->u.param_struct.stru->gc_used = GC_UNUSED; - set_gc_used_type (t->u.param_struct.stru, level, + set_gc_used_type (t->u.param_struct.stru, level, t->u.param_struct.param); break; @@ -1009,8 +966,7 @@ set_gc_used_type (t, level, param) /* Set the gc_used fields of all the types pointed to by VARIABLES. */ static void -set_gc_used (variables) - pair_p variables; +set_gc_used (pair_p variables) { pair_p p; for (p = variables; p; p = p->next) @@ -1040,19 +996,17 @@ static int srcdir_len = 0; #define NUM_BASE_FILES (ARRAY_SIZE (lang_dir_names) - 1) outf_p base_files[NUM_BASE_FILES]; -static outf_p create_file PARAMS ((const char *, const char *)); -static const char * get_file_basename PARAMS ((const char *)); +static outf_p create_file (const char *, const char *); +static const char * get_file_basename (const char *); /* Create and return an outf_p for a new file for NAME, to be called ONAME. */ static outf_p -create_file (name, oname) - const char *name; - const char *oname; +create_file (const char *name, const char *oname) { static const char *const hdr[] = { - " Copyright (C) 2002 Free Software Foundation, Inc.\n", + " Copyright (C) 2003 Free Software Foundation, Inc.\n", "\n", "This file is part of GCC.\n", "\n", @@ -1075,7 +1029,7 @@ create_file (name, oname) }; outf_p f; size_t i; - + f = xcalloc (sizeof (*f), 1); f->next = output_files; f->name = oname; @@ -1088,13 +1042,13 @@ create_file (name, oname) } /* Print, like fprintf, to O. */ -void +void oprintf (outf_p o, const char *format, ...) { char *s; size_t slength; va_list ap; - + va_start (ap, format); slength = xvasprintf (&s, format, ap); @@ -1118,14 +1072,14 @@ oprintf (outf_p o, const char *format, ...) /* Open the global header file and the language-specific header files. */ static void -open_base_files () +open_base_files (void) { size_t i; - + header_file = create_file ("GCC", "gtype-desc.h"); for (i = 0; i < NUM_BASE_FILES; i++) - base_files[i] = create_file (lang_dir_names[i], + base_files[i] = create_file (lang_dir_names[i], xasprintf ("gtype-%s.h", lang_dir_names[i])); /* gtype-desc.c is a little special, so we create it here. */ @@ -1141,7 +1095,7 @@ open_base_files () }; const char *const *ifp; outf_p gtype_desc_c; - + gtype_desc_c = create_file ("GCC", "gtype-desc.c"); for (ifp = ifiles; *ifp; ifp++) oprintf (gtype_desc_c, "#include \"%s\"\n", *ifp); @@ -1151,19 +1105,18 @@ open_base_files () /* Determine the pathname to F relative to $(srcdir). */ static const char * -get_file_basename (f) - const char *f; +get_file_basename (const char *f) { const char *basename; unsigned i; - + basename = strrchr (f, '/'); - + if (!basename) return f; - + basename++; - + for (i = 1; i < NUM_BASE_FILES; i++) { const char * s1; @@ -1182,12 +1135,12 @@ get_file_basename (f) break; } } - + return basename; } /* Return a bitmap which has bit `1 << BASE_FILE_<lang>' set iff - INPUT_FILE is used by <lang>. + INPUT_FILE is used by <lang>. This function should be written to assume that a file _is_ used if the situation is unclear. If it wrongly assumes a file _is_ used, @@ -1195,15 +1148,14 @@ get_file_basename (f) some GC roots may be missed, which is a much harder-to-debug problem. */ unsigned -get_base_file_bitmap (input_file) - const char *input_file; +get_base_file_bitmap (const char *input_file) { const char *basename = get_file_basename (input_file); const char *slashpos = strchr (basename, '/'); unsigned j; unsigned k; unsigned bitmap; - + if (slashpos) { size_t i; @@ -1235,7 +1187,7 @@ get_base_file_bitmap (input_file) } } } - + /* Otherwise, set all languages. */ if (!bitmap) bitmap = (1 << NUM_BASE_FILES) - 1; @@ -1248,8 +1200,7 @@ get_base_file_bitmap (input_file) INPUT_FILE. */ outf_p -get_output_file_with_visibility (input_file) - const char *input_file; +get_output_file_with_visibility (const char *input_file) { outf_p r; size_t len; @@ -1272,7 +1223,7 @@ get_output_file_with_visibility (input_file) || (len > 3 && memcmp (basename+len-3, ".in", 3) == 0)) { char *s; - + output_name = s = xasprintf ("gt-%s", basename); for (; *s != '.'; s++) if (! ISALNUM (*s) && *s != '-') @@ -1284,10 +1235,10 @@ get_output_file_with_visibility (input_file) output_name = "gt-c-common.h", for_name = "c-common.c"; else if (strcmp (basename, "c-tree.h") == 0) output_name = "gt-c-decl.h", for_name = "c-decl.c"; - else + else { size_t i; - + for (i = 0; i < NUM_BASE_FILES; i++) if (memcmp (basename, lang_dir_names[i], strlen (lang_dir_names[i])) == 0 && basename[strlen(lang_dir_names[i])] == '/') @@ -1313,8 +1264,7 @@ get_output_file_with_visibility (input_file) that uses INPUT_FILE. */ const char * -get_output_file_name (input_file) - const char *input_file; +get_output_file_name (const char *input_file) { return get_output_file_with_visibility (input_file)->name; } @@ -1322,13 +1272,13 @@ get_output_file_name (input_file) /* Copy the output to its final destination, but don't unnecessarily change modification times. */ -static void close_output_files PARAMS ((void)); +static void close_output_files (void); static void -close_output_files () +close_output_files (void) { outf_p of; - + for (of = output_files; of; of = of->next) { FILE * newfile; @@ -1385,14 +1335,14 @@ struct walk_type_data; For structures, given a pointer to the item in 'val'. For misc. pointers, given the item in 'val'. */ -typedef void (*process_field_fn) - PARAMS ((type_p f, const struct walk_type_data *p)); +typedef void (*process_field_fn) + (type_p f, const struct walk_type_data *p); typedef void (*func_name_fn) - PARAMS ((type_p s, const struct walk_type_data *p)); + (type_p s, const struct walk_type_data *p); /* Parameters for write_types. */ -struct write_types_data +struct write_types_data { const char *prefix; const char *param_prefix; @@ -1402,35 +1352,35 @@ struct write_types_data const char *comment; }; -static void output_escaped_param PARAMS ((struct walk_type_data *d, - const char *, const char *)); -static void output_mangled_typename PARAMS ((outf_p, type_p)); -static void walk_type PARAMS ((type_p t, struct walk_type_data *d)); +static void output_escaped_param (struct walk_type_data *d, + const char *, const char *); +static void output_mangled_typename (outf_p, type_p); +static void walk_type (type_p t, struct walk_type_data *d); static void write_func_for_structure - PARAMS ((type_p orig_s, type_p s, type_p * param, - const struct write_types_data *wtd)); -static void write_types_process_field - PARAMS ((type_p f, const struct walk_type_data *d)); -static void write_types PARAMS ((type_p structures, - type_p param_structs, - const struct write_types_data *wtd)); + (type_p orig_s, type_p s, type_p * param, + const struct write_types_data *wtd); +static void write_types_process_field + (type_p f, const struct walk_type_data *d); +static void write_types (type_p structures, + type_p param_structs, + const struct write_types_data *wtd); static void write_types_local_process_field - PARAMS ((type_p f, const struct walk_type_data *d)); + (type_p f, const struct walk_type_data *d); static void write_local_func_for_structure - PARAMS ((type_p orig_s, type_p s, type_p * param)); -static void write_local PARAMS ((type_p structures, - type_p param_structs)); -static void write_enum_defn PARAMS ((type_p structures, type_p param_structs)); -static int contains_scalar_p PARAMS ((type_p t)); -static void put_mangled_filename PARAMS ((outf_p , const char *)); -static void finish_root_table PARAMS ((struct flist *flp, const char *pfx, - const char *tname, const char *lastname, - const char *name)); -static void write_root PARAMS ((outf_p , pair_p, type_p, const char *, int, - struct fileloc *, const char *)); -static void write_array PARAMS ((outf_p f, pair_p v, - const struct write_types_data *wtd)); -static void write_roots PARAMS ((pair_p)); + (type_p orig_s, type_p s, type_p * param); +static void write_local (type_p structures, + type_p param_structs); +static void write_enum_defn (type_p structures, type_p param_structs); +static int contains_scalar_p (type_p t); +static void put_mangled_filename (outf_p , const char *); +static void finish_root_table (struct flist *flp, const char *pfx, + const char *tname, const char *lastname, + const char *name); +static void write_root (outf_p , pair_p, type_p, const char *, int, + struct fileloc *, const char *); +static void write_array (outf_p f, pair_p v, + const struct write_types_data *wtd); +static void write_roots (pair_p); /* Parameters for walk_type. */ @@ -1456,9 +1406,7 @@ struct walk_type_data /* Print a mangled name representing T to OF. */ static void -output_mangled_typename (of, t) - outf_p of; - type_p t; +output_mangled_typename (outf_p of, type_p t) { if (t == NULL) oprintf (of, "Z"); @@ -1485,7 +1433,7 @@ output_mangled_typename (of, t) for (i = 0; i < NUM_PARAM; i++) if (t->u.param_struct.param[i] != NULL) output_mangled_typename (of, t->u.param_struct.param[i]); - output_mangled_typename (of, t->u.param_struct.stru); + output_mangled_typename (of, t->u.param_struct.stru); } break; case TYPE_ARRAY: @@ -1499,13 +1447,11 @@ output_mangled_typename (of, t) print error messages. */ static void -output_escaped_param (d, param, oname) - struct walk_type_data *d; - const char *param; - const char *oname; +output_escaped_param (struct walk_type_data *d, const char *param, + const char *oname) { const char *p; - + for (p = param; *p; p++) if (*p != '%') oprintf (d->of, "%c", *p); @@ -1546,9 +1492,7 @@ output_escaped_param (d, param, oname) option). */ static void -walk_type (t, d) - type_p t; - struct walk_type_data *d; +walk_type (type_p t, struct walk_type_data *d) { const char *length = NULL; const char *desc = NULL; @@ -1556,7 +1500,7 @@ walk_type (t, d) int use_param_num = -1; int use_params_p = 0; options_p oo; - + d->needs_cast_p = 0; for (oo = d->opt; oo; oo = oo->next) if (strcmp (oo->name, "length") == 0) @@ -1603,23 +1547,23 @@ walk_type (t, d) if (use_params_p) { int pointer_p = t->kind == TYPE_POINTER; - + if (pointer_p) t = t->u.p; if (! UNION_OR_STRUCT_P (t)) error_at_line (d->line, "`use_params' option on unimplemented type"); - else + else t = find_param_structure (t, d->param); if (pointer_p) t = create_pointer (t); } - + if (use_param_num != -1) { if (d->param != NULL && d->param[use_param_num] != NULL) { type_p nt = d->param[use_param_num]; - + if (t->kind == TYPE_ARRAY) nt = create_array (nt, t->u.a.len); else if (length != NULL && t->kind == TYPE_POINTER) @@ -1633,23 +1577,23 @@ walk_type (t, d) error_at_line (d->line, "no parameter defined for `%s'", d->val); } - - if (maybe_undef_p + + if (maybe_undef_p && (t->kind != TYPE_POINTER || ! UNION_OR_STRUCT_P (t->u.p))) { - error_at_line (d->line, + error_at_line (d->line, "field `%s' has invalid option `maybe_undef_p'\n", d->val); return; } - + switch (t->kind) { case TYPE_SCALAR: case TYPE_STRING: d->process_field (t, d); break; - + case TYPE_POINTER: { if (maybe_undef_p @@ -1664,15 +1608,15 @@ walk_type (t, d) if (! UNION_OR_STRUCT_P (t->u.p) && t->u.p->kind != TYPE_PARAM_STRUCT) { - error_at_line (d->line, + error_at_line (d->line, "field `%s' is pointer to unimplemented type", d->val); break; } - + d->process_field (t->u.p, d); } - else + else { int loopcounter = d->counter++; const char *oldval = d->val; @@ -1683,7 +1627,7 @@ walk_type (t, d) d->indent += 2; oprintf (d->of, "%*ssize_t i%d;\n", d->indent, "", loopcounter); d->process_field(t, d); - oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "", + oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "", loopcounter, loopcounter); output_escaped_param (d, length, "length"); oprintf (d->of, "); i%d++) {\n", loopcounter); @@ -1714,11 +1658,11 @@ walk_type (t, d) any code. */ if (t->u.a.p->kind == TYPE_SCALAR) break; - + oprintf (d->of, "%*s{\n", d->indent, ""); d->indent += 2; oprintf (d->of, "%*ssize_t i%d;\n", d->indent, "", loopcounter); - oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "", + oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "", loopcounter, loopcounter); if (length) output_escaped_param (d, length, "length"); @@ -1738,7 +1682,7 @@ walk_type (t, d) oprintf (d->of, "%*s}\n", d->indent, ""); } break; - + case TYPE_STRUCT: case TYPE_UNION: { @@ -1823,7 +1767,7 @@ walk_type (t, d) seen_default_p = 1; } else if (! union_p && (default_p || tagid)) - error_at_line (d->line, + error_at_line (d->line, "can't use `%s' outside a union on field `%s'", default_p ? "default" : "tag", f->name); else if (union_p && ! (default_p || tagid) @@ -1835,10 +1779,10 @@ walk_type (t, d) continue; } else if (union_p && ! (default_p || tagid)) - error_at_line (d->line, + error_at_line (d->line, "field `%s' is missing `tag' or `default' option", f->name); - + d->line = &f->line; d->val = newval = xasprintf ("%s%s%s", oldval, dot, f->name); d->opt = f->opt; @@ -1892,13 +1836,13 @@ walk_type (t, d) case TYPE_PARAM_STRUCT: { type_p *oldparam = d->param; - + d->param = t->u.param_struct.param; walk_type (t->u.param_struct.stru, d); d->param = oldparam; } break; - + default: abort (); } @@ -1907,18 +1851,16 @@ walk_type (t, d) /* process_field routine for marking routines. */ static void -write_types_process_field (f, d) - type_p f; - const struct walk_type_data *d; +write_types_process_field (type_p f, const struct walk_type_data *d) { const struct write_types_data *wtd; const char *cast = d->needs_cast_p ? "(void *)" : ""; wtd = (const struct write_types_data *) d->cookie; - + switch (f->kind) { case TYPE_POINTER: - oprintf (d->of, "%*s%s (%s%s", d->indent, "", + oprintf (d->of, "%*s%s (%s%s", d->indent, "", wtd->subfield_marker_routine, cast, d->val); if (wtd->param_prefix) { @@ -1933,7 +1875,7 @@ write_types_process_field (f, d) } oprintf (d->of, ");\n"); if (d->reorder_fn && wtd->reorder_note_routine) - oprintf (d->of, "%*s%s (%s%s, %s, %s);\n", d->indent, "", + oprintf (d->of, "%*s%s (%s%s, %s, %s);\n", d->indent, "", wtd->reorder_note_routine, cast, d->val, d->prev_val[3], d->reorder_fn); break; @@ -1950,14 +1892,14 @@ write_types_process_field (f, d) output_mangled_typename (d->of, f); oprintf (d->of, " (%s%s);\n", cast, d->val); if (d->reorder_fn && wtd->reorder_note_routine) - oprintf (d->of, "%*s%s (%s%s, %s%s, %s);\n", d->indent, "", + oprintf (d->of, "%*s%s (%s%s, %s%s, %s);\n", d->indent, "", wtd->reorder_note_routine, cast, d->val, cast, d->val, d->reorder_fn); break; case TYPE_SCALAR: break; - + default: abort (); } @@ -1972,11 +1914,8 @@ write_types_process_field (f, d) */ static void -write_func_for_structure (orig_s, s, param, wtd) - type_p orig_s; - type_p s; - type_p * param; - const struct write_types_data *wtd; +write_func_for_structure (type_p orig_s, type_p s, type_p *param, + const struct write_types_data *wtd) { const char *fn = s->u.s.line.file; int i; @@ -1984,16 +1923,16 @@ write_func_for_structure (orig_s, s, param, wtd) const char *chain_prev = NULL; options_p opt; struct walk_type_data d; - + /* This is a hack, and not the good kind either. */ for (i = NUM_PARAM - 1; i >= 0; i--) - if (param && param[i] && param[i]->kind == TYPE_POINTER + if (param && param[i] && param[i]->kind == TYPE_POINTER && UNION_OR_STRUCT_P (param[i]->u.p)) fn = param[i]->u.p->u.s.line.file; - + memset (&d, 0, sizeof (d)); d.of = get_output_file_with_visibility (fn); - + for (opt = s->u.s.opt; opt; opt = opt->next) if (strcmp (opt->name, "chain_next") == 0) chain_next = (const char *) opt->info; @@ -2064,13 +2003,13 @@ write_func_for_structure (orig_s, s, param, wtd) oprintf (d.of, " {\n"); oprintf (d.of, " %s %s * const xprev = (", s->kind == TYPE_UNION ? "union" : "struct", s->u.s.tag); - + d.prev_val[2] = "*x"; output_escaped_param (&d, chain_prev, "chain_prev"); oprintf (d.of, ");\n"); oprintf (d.of, " if (xprev == NULL) break;\n"); oprintf (d.of, " x = xprev;\n"); - oprintf (d.of, " (void) %s (xprev", + oprintf (d.of, " (void) %s (xprev", wtd->marker_routine); if (wtd->param_prefix) { @@ -2083,11 +2022,11 @@ write_func_for_structure (orig_s, s, param, wtd) oprintf (d.of, " while (x != xlimit)\n"); } oprintf (d.of, " {\n"); - + d.prev_val[2] = "*x"; d.indent = 6; walk_type (s, &d); - + if (chain_next != NULL) { oprintf (d.of, " x = ("); @@ -2102,20 +2041,18 @@ write_func_for_structure (orig_s, s, param, wtd) /* Write out marker routines for STRUCTURES and PARAM_STRUCTS. */ static void -write_types (structures, param_structs, wtd) - type_p structures; - type_p param_structs; - const struct write_types_data *wtd; +write_types (type_p structures, type_p param_structs, + const struct write_types_data *wtd) { type_p s; - + oprintf (header_file, "\n/* %s*/\n", wtd->comment); for (s = structures; s; s = s->next) if (s->gc_used == GC_POINTED_TO || s->gc_used == GC_MAYBE_POINTED_TO) { options_p opt; - + if (s->gc_used == GC_MAYBE_POINTED_TO && s->u.s.line.file == NULL) continue; @@ -2124,23 +2061,23 @@ write_types (structures, param_structs, wtd) output_mangled_typename (header_file, s); oprintf (header_file, "(X) do { \\\n"); oprintf (header_file, - " if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix, + " if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix, s->u.s.tag); oprintf (header_file, " } while (0)\n"); - + for (opt = s->u.s.opt; opt; opt = opt->next) if (strcmp (opt->name, "ptr_alias") == 0) { type_p t = (type_p) opt->info; - if (t->kind == TYPE_STRUCT + if (t->kind == TYPE_STRUCT || t->kind == TYPE_UNION || t->kind == TYPE_LANG_STRUCT) oprintf (header_file, "#define gt_%sx_%s gt_%sx_%s\n", wtd->prefix, s->u.s.tag, wtd->prefix, t->u.s.tag); else - error_at_line (&s->u.s.line, + error_at_line (&s->u.s.line, "structure alias is not a structure"); break; } @@ -2148,17 +2085,17 @@ write_types (structures, param_structs, wtd) continue; /* Declare the marker procedure only once. */ - oprintf (header_file, - "extern void gt_%sx_%s PARAMS ((void *));\n", + oprintf (header_file, + "extern void gt_%sx_%s (void *);\n", wtd->prefix, s->u.s.tag); - + if (s->u.s.line.file == NULL) { - fprintf (stderr, "warning: structure `%s' used but not defined\n", + fprintf (stderr, "warning: structure `%s' used but not defined\n", s->u.s.tag); continue; } - + if (s->kind == TYPE_LANG_STRUCT) { type_p ss; @@ -2178,15 +2115,15 @@ write_types (structures, param_structs, wtd) /* Declare the marker procedure. */ oprintf (header_file, "extern void gt_%s_", wtd->prefix); output_mangled_typename (header_file, s); - oprintf (header_file, " PARAMS ((void *));\n"); - + oprintf (header_file, " (void *);\n"); + if (stru->u.s.line.file == NULL) { - fprintf (stderr, "warning: structure `%s' used but not defined\n", + fprintf (stderr, "warning: structure `%s' used but not defined\n", s->u.s.tag); continue; } - + if (stru->kind == TYPE_LANG_STRUCT) { type_p ss; @@ -2216,9 +2153,7 @@ static const struct write_types_data pch_wtd = /* process_field routine for local pointer-walking. */ static void -write_types_local_process_field (f, d) - type_p f; - const struct walk_type_data *d; +write_types_local_process_field (type_p f, const struct walk_type_data *d) { switch (f->kind) { @@ -2235,7 +2170,7 @@ write_types_local_process_field (f, d) case TYPE_SCALAR: break; - + default: abort (); } @@ -2248,24 +2183,21 @@ write_types_local_process_field (f, d) */ static void -write_local_func_for_structure (orig_s, s, param) - type_p orig_s; - type_p s; - type_p * param; +write_local_func_for_structure (type_p orig_s, type_p s, type_p *param) { const char *fn = s->u.s.line.file; int i; struct walk_type_data d; - + /* This is a hack, and not the good kind either. */ for (i = NUM_PARAM - 1; i >= 0; i--) - if (param && param[i] && param[i]->kind == TYPE_POINTER + if (param && param[i] && param[i]->kind == TYPE_POINTER && UNION_OR_STRUCT_P (param[i]->u.p)) fn = param[i]->u.p->u.s.line.file; - + memset (&d, 0, sizeof (d)); d.of = get_output_file_with_visibility (fn); - + d.process_field = write_types_local_process_field; d.opt = s->u.s.opt; d.line = &s->u.s.line; @@ -2297,19 +2229,17 @@ write_local_func_for_structure (orig_s, s, param) /* Write out local marker routines for STRUCTURES and PARAM_STRUCTS. */ static void -write_local (structures, param_structs) - type_p structures; - type_p param_structs; +write_local (type_p structures, type_p param_structs) { type_p s; - + oprintf (header_file, "\n/* Local pointer-walking routines. */\n"); for (s = structures; s; s = s->next) if (s->gc_used == GC_POINTED_TO || s->gc_used == GC_MAYBE_POINTED_TO) { options_p opt; - + if (s->u.s.line.file == NULL) continue; @@ -2317,7 +2247,7 @@ write_local (structures, param_structs) if (strcmp (opt->name, "ptr_alias") == 0) { type_p t = (type_p) opt->info; - if (t->kind == TYPE_STRUCT + if (t->kind == TYPE_STRUCT || t->kind == TYPE_UNION || t->kind == TYPE_LANG_STRUCT) { @@ -2328,7 +2258,7 @@ write_local (structures, param_structs) oprintf (header_file, "\n"); } else - error_at_line (&s->u.s.line, + error_at_line (&s->u.s.line, "structure alias is not a structure"); break; } @@ -2338,9 +2268,9 @@ write_local (structures, param_structs) /* Declare the marker procedure only once. */ oprintf (header_file, "extern void gt_pch_p_"); output_mangled_typename (header_file, s); - oprintf (header_file, - "\n PARAMS ((void *, void *, gt_pointer_operator, void *));\n"); - + oprintf (header_file, + "\n (void *, void *, gt_pointer_operator, void *);\n"); + if (s->kind == TYPE_LANG_STRUCT) { type_p ss; @@ -2360,16 +2290,16 @@ write_local (structures, param_structs) /* Declare the marker procedure. */ oprintf (header_file, "extern void gt_pch_p_"); output_mangled_typename (header_file, s); - oprintf (header_file, - "\n PARAMS ((void *, void *, gt_pointer_operator, void *));\n"); - + oprintf (header_file, + "\n (void *, void *, gt_pointer_operator, void *);\n"); + if (stru->u.s.line.file == NULL) { - fprintf (stderr, "warning: structure `%s' used but not defined\n", + fprintf (stderr, "warning: structure `%s' used but not defined\n", s->u.s.tag); continue; } - + if (stru->kind == TYPE_LANG_STRUCT) { type_p ss; @@ -2384,12 +2314,10 @@ write_local (structures, param_structs) /* Write out the 'enum' definition for gt_types_enum. */ static void -write_enum_defn (structures, param_structs) - type_p structures; - type_p param_structs; +write_enum_defn (type_p structures, type_p param_structs) { type_p s; - + oprintf (header_file, "\n/* Enumeration of types known. */\n"); oprintf (header_file, "enum gt_types_enum {\n"); for (s = structures; s; s = s->next) @@ -2418,8 +2346,7 @@ write_enum_defn (structures, param_structs) /* Might T contain any non-pointer elements? */ static int -contains_scalar_p (t) - type_p t; +contains_scalar_p (type_p t) { switch (t->kind) { @@ -2438,9 +2365,7 @@ contains_scalar_p (t) /* Mangle FN and print it to F. */ static void -put_mangled_filename (f, fn) - outf_p f; - const char *fn; +put_mangled_filename (outf_p f, const char *fn) { const char *name = get_output_file_name (fn); for (; *name != 0; name++) @@ -2455,15 +2380,11 @@ put_mangled_filename (f, fn) the resulting code. */ static void -finish_root_table (flp, pfx, lastname, tname, name) - struct flist *flp; - const char *pfx; - const char *tname; - const char *lastname; - const char *name; +finish_root_table (struct flist *flp, const char *pfx, const char *lastname, + const char *tname, const char *name) { struct flist *fli2; - + for (fli2 = flp; fli2; fli2 = fli2->next) if (fli2->started_p) { @@ -2487,7 +2408,7 @@ finish_root_table (flp, pfx, lastname, tname, name) oprintf (base_files[fnum], "[];\n"); } } - + { size_t fnum; for (fnum = 0; fnum < NUM_BASE_FILES; fnum++) @@ -2495,7 +2416,7 @@ finish_root_table (flp, pfx, lastname, tname, name) "const struct %s * const %s[] = {\n", tname, name); } - + for (fli2 = flp; fli2; fli2 = fli2->next) if (fli2->started_p) @@ -2530,14 +2451,8 @@ finish_root_table (flp, pfx, lastname, tname, name) is nonzero iff we are building the root table for hash table caches. */ static void -write_root (f, v, type, name, has_length, line, if_marked) - outf_p f; - pair_p v; - type_p type; - const char *name; - int has_length; - struct fileloc *line; - const char *if_marked; +write_root (outf_p f, pair_p v, type_p type, const char *name, int has_length, + struct fileloc *line, const char *if_marked) { switch (type->kind) { @@ -2549,7 +2464,7 @@ write_root (f, v, type, name, has_length, line, if_marked) int skip_p = 0; const char *desc = NULL; options_p o; - + for (o = fld->opt; o; o = o->next) if (strcmp (o->name, "skip") == 0) skip_p = 1; @@ -2559,26 +2474,26 @@ write_root (f, v, type, name, has_length, line, if_marked) error_at_line (line, "field `%s' of global `%s' has unknown option `%s'", fld->name, name, o->name); - + if (skip_p) continue; else if (desc && fld->type->kind == TYPE_UNION) { pair_p validf = NULL; pair_p ufld; - + for (ufld = fld->type->u.s.fields; ufld; ufld = ufld->next) { const char *tag = NULL; options_p oo; - + for (oo = ufld->opt; oo; oo = oo->next) if (strcmp (oo->name, "tag") == 0) tag = (const char *)oo->info; if (tag == NULL || strcmp (tag, desc) != 0) continue; if (validf != NULL) - error_at_line (line, + error_at_line (line, "both `%s.%s.%s' and `%s.%s.%s' have tag `%s'", name, fld->name, validf->name, name, fld->name, ufld->name, @@ -2588,7 +2503,7 @@ write_root (f, v, type, name, has_length, line, if_marked) if (validf != NULL) { char *newname; - newname = xasprintf ("%s.%s.%s", + newname = xasprintf ("%s.%s.%s", name, fld->name, validf->name); write_root (f, v, validf->type, newname, 0, line, if_marked); @@ -2596,7 +2511,7 @@ write_root (f, v, type, name, has_length, line, if_marked) } } else if (desc) - error_at_line (line, + error_at_line (line, "global `%s.%s' has `desc' option but is not union", name, fld->name); else @@ -2618,15 +2533,15 @@ write_root (f, v, type, name, has_length, line, if_marked) free (newname); } break; - + case TYPE_POINTER: { type_p ap, tp; - + oprintf (f, " {\n"); oprintf (f, " &%s,\n", name); oprintf (f, " 1"); - + for (ap = v->type; ap->kind == TYPE_ARRAY; ap = ap->u.a.p) if (ap->u.a.len[0]) oprintf (f, " * (%s)", ap->u.a.len); @@ -2637,9 +2552,9 @@ write_root (f, v, type, name, has_length, line, if_marked) for (ap = v->type; ap->kind == TYPE_ARRAY; ap = ap->u.a.p) oprintf (f, "[0]"); oprintf (f, "),\n"); - + tp = type->u.p; - + if (! has_length && UNION_OR_STRUCT_P (tp)) { oprintf (f, " >_ggc_mx_%s,\n", tp->u.s.tag); @@ -2660,7 +2575,7 @@ write_root (f, v, type, name, has_length, line, if_marked) } else { - error_at_line (line, + error_at_line (line, "global `%s' is pointer to unimplemented type", name); } @@ -2681,12 +2596,12 @@ write_root (f, v, type, name, has_length, line, if_marked) oprintf (f, " },\n"); } break; - + case TYPE_SCALAR: break; - + default: - error_at_line (line, + error_at_line (line, "global `%s' is unimplemented type", name); } @@ -2695,14 +2610,11 @@ write_root (f, v, type, name, has_length, line, if_marked) /* This generates a routine to walk an array. */ static void -write_array (f, v, wtd) - outf_p f; - pair_p v; - const struct write_types_data *wtd; +write_array (outf_p f, pair_p v, const struct write_types_data *wtd) { struct walk_type_data d; char *prevval3; - + memset (&d, 0, sizeof (d)); d.of = f; d.cookie = wtd; @@ -2717,9 +2629,9 @@ write_array (f, v, wtd) if (wtd->param_prefix) { oprintf (f, "static void gt_%sa_%s\n", wtd->param_prefix, v->name); - oprintf (f, - " PARAMS ((void *, void *, gt_pointer_operator, void *));\n"); - oprintf (f, "static void gt_%sa_%s (this_obj, x_p, op, cookie)\n", + oprintf (f, + " (void *, void *, gt_pointer_operator, void *);\n"); + oprintf (f, "static void gt_%sa_%s (this_obj, x_p, op, cookie)\n", wtd->param_prefix, v->name); oprintf (d.of, " void *this_obj ATTRIBUTE_UNUSED;\n"); oprintf (d.of, " void *x_p ATTRIBUTE_UNUSED;\n"); @@ -2733,7 +2645,7 @@ write_array (f, v, wtd) } d.opt = v->opt; - oprintf (f, "static void gt_%sa_%s PARAMS ((void *));\n", + oprintf (f, "static void gt_%sa_%s (void *);\n", wtd->prefix, v->name); oprintf (f, "static void\ngt_%sa_%s (x_p)\n", wtd->prefix, v->name); @@ -2749,8 +2661,7 @@ write_array (f, v, wtd) /* Output a table describing the locations and types of VARIABLES. */ static void -write_roots (variables) - pair_p variables; +write_roots (pair_p variables) { pair_p v; struct flist *flp = NULL; @@ -2770,14 +2681,14 @@ write_roots (variables) deletable_p = 1; else if (strcmp (o->name, "param_is") == 0) ; - else if (strncmp (o->name, "param", 5) == 0 + else if (strncmp (o->name, "param", 5) == 0 && ISDIGIT (o->name[5]) && strcmp (o->name + 6, "_is") == 0) ; else if (strcmp (o->name, "if_marked") == 0) ; else - error_at_line (&v->line, + error_at_line (&v->line, "global `%s' has unknown option `%s'", v->name, o->name); @@ -2814,7 +2725,7 @@ write_roots (variables) int skip_p = 0; int length_p = 0; options_p o; - + for (o = v->opt; o; o = o->next) if (strcmp (o->name, "length") == 0) length_p = 1; @@ -2840,7 +2751,7 @@ write_roots (variables) write_root (f, v, v->type, v->name, length_p, &v->line, NULL); } - finish_root_table (flp, "ggc_r", "LAST_GGC_ROOT_TAB", "ggc_root_tab", + finish_root_table (flp, "ggc_r", "LAST_GGC_ROOT_TAB", "ggc_root_tab", "gt_ggc_rtab"); for (v = variables; v; v = v->next) @@ -2870,11 +2781,11 @@ write_roots (variables) put_mangled_filename (f, v->line.file); oprintf (f, "[] = {\n"); } - + oprintf (f, " { &%s, 1, sizeof (%s), NULL, NULL },\n", v->name, v->name); } - + finish_root_table (flp, "ggc_rd", "LAST_GGC_ROOT_TAB", "ggc_root_tab", "gt_ggc_deletable_rtab"); @@ -2885,7 +2796,7 @@ write_roots (variables) const char *if_marked = NULL; int length_p = 0; options_p o; - + for (o = v->opt; o; o = o->next) if (strcmp (o->name, "length") == 0) length_p = 1; @@ -2914,11 +2825,11 @@ write_roots (variables) put_mangled_filename (f, v->line.file); oprintf (f, "[] = {\n"); } - + write_root (f, v, v->type->u.p->u.param_struct.param[0], v->name, length_p, &v->line, if_marked); } - + finish_root_table (flp, "ggc_rc", "LAST_GGC_CACHE_TAB", "ggc_cache_tab", "gt_ggc_cache_rtab"); @@ -2929,7 +2840,7 @@ write_roots (variables) int length_p = 0; int if_marked_p = 0; options_p o; - + for (o = v->opt; o; o = o->next) if (strcmp (o->name, "length") == 0) length_p = 1; @@ -2953,7 +2864,7 @@ write_roots (variables) write_root (f, v, v->type, v->name, length_p, &v->line, NULL); } - + finish_root_table (flp, "pch_rc", "LAST_GGC_ROOT_TAB", "ggc_root_tab", "gt_pch_cache_rtab"); @@ -2986,26 +2897,24 @@ write_roots (variables) put_mangled_filename (f, v->line.file); oprintf (f, "[] = {\n"); } - + oprintf (f, " { &%s, 1, sizeof (%s), NULL, NULL },\n", v->name, v->name); } - + finish_root_table (flp, "pch_rs", "LAST_GGC_ROOT_TAB", "ggc_root_tab", "gt_pch_scalar_rtab"); } -extern int main PARAMS ((int argc, char **argv)); -int -main(argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv ATTRIBUTE_UNUSED; +extern int main (int argc, char **argv); +int +main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { unsigned i; static struct fileloc pos = { __FILE__, __LINE__ }; unsigned j; - + gen_rtx_next (); srcdir_len = strlen (srcdir); diff --git a/gcc/gengtype.h b/gcc/gengtype.h index 0c23d95f44a..3a3157ec377 100644 --- a/gcc/gengtype.h +++ b/gcc/gengtype.h @@ -1,5 +1,5 @@ /* Process source files and output type information. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -111,36 +111,36 @@ extern struct fileloc lexer_line; /* Print an error message. */ extern void error_at_line - PARAMS ((struct fileloc *pos, const char *msg, ...)) ATTRIBUTE_PRINTF_2; + (struct fileloc *pos, const char *msg, ...) ATTRIBUTE_PRINTF_2; /* Combines xmalloc() and vasprintf(). */ -extern int xvasprintf PARAMS ((char **, const char *, va_list)) +extern int xvasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF (2, 0); /* Like the above, but more convenient for quick coding. */ -extern char * xasprintf PARAMS ((const char *, ...)) +extern char * xasprintf (const char *, ...) ATTRIBUTE_PRINTF_1; /* Constructor routines for types. */ -extern void do_typedef PARAMS ((const char *s, type_p t, struct fileloc *pos)); -extern type_p resolve_typedef PARAMS ((const char *s, struct fileloc *pos)); -extern void new_structure PARAMS ((const char *name, int isunion, - struct fileloc *pos, pair_p fields, - options_p o)); -extern type_p find_structure PARAMS ((const char *s, int isunion)); -extern type_p create_scalar_type PARAMS ((const char *name, size_t name_len)); -extern type_p create_pointer PARAMS ((type_p t)); -extern type_p create_array PARAMS ((type_p t, const char *len)); -extern type_p adjust_field_type PARAMS ((type_p, options_p)); -extern void note_variable PARAMS ((const char *s, type_p t, options_p o, - struct fileloc *pos)); -extern void note_yacc_type PARAMS ((options_p o, pair_p fields, - pair_p typeinfo, struct fileloc *pos)); +extern void do_typedef (const char *s, type_p t, struct fileloc *pos); +extern type_p resolve_typedef (const char *s, struct fileloc *pos); +extern void new_structure (const char *name, int isunion, + struct fileloc *pos, pair_p fields, + options_p o); +extern type_p find_structure (const char *s, int isunion); +extern type_p create_scalar_type (const char *name, size_t name_len); +extern type_p create_pointer (type_p t); +extern type_p create_array (type_p t, const char *len); +extern type_p adjust_field_type (type_p, options_p); +extern void note_variable (const char *s, type_p t, options_p o, + struct fileloc *pos); +extern void note_yacc_type (options_p o, pair_p fields, + pair_p typeinfo, struct fileloc *pos); /* Lexer and parser routines, most automatically generated. */ -extern int yylex PARAMS((void)); -extern void yyerror PARAMS ((const char *)); -extern int yyparse PARAMS ((void)); -extern void parse_file PARAMS ((const char *name)); +extern int yylex (void); +extern void yyerror (const char *); +extern int yyparse (void); +extern void parse_file (const char *name); /* Output file handling. */ @@ -164,8 +164,8 @@ extern outf_p header_file; made in INPUT_FILE and is linked into every language that uses INPUT_FILE. */ extern outf_p get_output_file_with_visibility - PARAMS ((const char *input_file)); -const char *get_output_file_name PARAMS ((const char *)); + (const char *input_file); +const char *get_output_file_name (const char *); /* A list of output files suitable for definitions. There is one BASE_FILES entry for each language. */ @@ -174,8 +174,8 @@ extern outf_p base_files[]; /* A bitmap that specifies which of BASE_FILES should be used to output a definition that is different for each language and must be defined once in each language that uses INPUT_FILE. */ -extern lang_bitmap get_base_file_bitmap PARAMS ((const char *input_file)); +extern lang_bitmap get_base_file_bitmap (const char *input_file); /* Print, like fprintf, to O. */ -extern void oprintf PARAMS ((outf_p o, const char *S, ...)) +extern void oprintf (outf_p o, const char *S, ...) ATTRIBUTE_PRINTF_2; diff --git a/gcc/genopinit.c b/gcc/genopinit.c index 5d996b59199..bba458d5f08 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -149,11 +149,10 @@ static const char * const optabs[] = "movstr_optab[$A] = CODE_FOR_$(movstr$a$)", "clrstr_optab[$A] = CODE_FOR_$(clrstr$a$)" }; -static void gen_insn PARAMS ((rtx)); +static void gen_insn (rtx); static void -gen_insn (insn) - rtx insn; +gen_insn (rtx insn) { const char *name = XSTR (insn, 0); int m1 = 0, m2 = 0, op = 0; @@ -321,12 +320,10 @@ gen_insn (insn) printf (";\n"); } -extern int main PARAMS ((int, char **)); +extern int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; @@ -377,8 +374,7 @@ from the machine description file `md'. */\n\n"); /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 44960961274..2f464cf2a62 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -99,8 +99,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define MAX_MAX_OPERANDS 40 -static int n_occurrences PARAMS ((int, const char *)); -static const char *strip_whitespace PARAMS ((const char *)); +static int n_occurrences (int, const char *); +static const char *strip_whitespace (const char *); /* insns in the machine description are assigned sequential code numbers that are used by insn-recog.c (produced by genrecog) to communicate @@ -173,28 +173,27 @@ struct data static struct data *idata, **idata_end = &idata; -static void output_prologue PARAMS ((void)); -static void output_predicate_decls PARAMS ((void)); -static void output_operand_data PARAMS ((void)); -static void output_insn_data PARAMS ((void)); -static void output_get_insn_name PARAMS ((void)); -static void scan_operands PARAMS ((struct data *, rtx, int, int)); -static int compare_operands PARAMS ((struct operand_data *, - struct operand_data *)); -static void place_operands PARAMS ((struct data *)); -static void process_template PARAMS ((struct data *, const char *)); -static void validate_insn_alternatives PARAMS ((struct data *)); -static void validate_insn_operands PARAMS ((struct data *)); -static void gen_insn PARAMS ((rtx, int)); -static void gen_peephole PARAMS ((rtx, int)); -static void gen_expand PARAMS ((rtx, int)); -static void gen_split PARAMS ((rtx, int)); -static void check_constraint_len PARAMS ((void)); -static int constraint_len PARAMS ((const char *, int)); +static void output_prologue (void); +static void output_predicate_decls (void); +static void output_operand_data (void); +static void output_insn_data (void); +static void output_get_insn_name (void); +static void scan_operands (struct data *, rtx, int, int); +static int compare_operands (struct operand_data *, + struct operand_data *); +static void place_operands (struct data *); +static void process_template (struct data *, const char *); +static void validate_insn_alternatives (struct data *); +static void validate_insn_operands (struct data *); +static void gen_insn (rtx, int); +static void gen_peephole (rtx, int); +static void gen_expand (rtx, int); +static void gen_split (rtx, int); +static void check_constraint_len (void); +static int constraint_len (const char *, int); const char * -get_insn_name (index) - int index; +get_insn_name (int index) { static char buf[100]; @@ -216,7 +215,7 @@ get_insn_name (index) } static void -output_prologue () +output_prologue (void) { printf ("/* Generated automatically by the program `genoutput'\n\ from the machine description file `md'. */\n\n"); @@ -251,7 +250,7 @@ output_prologue () struct predicate { const char *name; struct predicate *next; }; static void -output_predicate_decls () +output_predicate_decls (void) { struct predicate *predicates = 0; struct operand_data *d; @@ -266,7 +265,7 @@ output_predicate_decls () if (p == 0) { - printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n", + printf ("extern int %s (rtx, enum machine_mode);\n", d->predicate); p = (struct predicate *) xmalloc (sizeof (struct predicate)); p->name = d->predicate; @@ -284,7 +283,7 @@ output_predicate_decls () } static void -output_operand_data () +output_operand_data (void) { struct operand_data *d; @@ -311,7 +310,7 @@ output_operand_data () } static void -output_insn_data () +output_insn_data (void) { struct data *d; int name_offset = 0; @@ -369,7 +368,7 @@ output_insn_data () { const char *p = d->template; char prev = 0; - + printf (" \""); while (*p) { @@ -413,7 +412,7 @@ output_insn_data () } static void -output_get_insn_name () +output_get_insn_name (void) { printf ("const char *\n"); printf ("get_insn_name (code)\n"); @@ -438,11 +437,8 @@ static int max_opno; static int num_dups; static void -scan_operands (d, part, this_address_p, this_strict_low) - struct data *d; - rtx part; - int this_address_p; - int this_strict_low; +scan_operands (struct data *d, rtx part, int this_address_p, + int this_strict_low) { int i, j; const char *format_ptr; @@ -554,7 +550,7 @@ scan_operands (d, part, this_address_p, this_strict_low) case STRICT_LOW_PART: scan_operands (d, XEXP (part, 0), 0, 1); return; - + default: break; } @@ -579,8 +575,7 @@ scan_operands (d, part, this_address_p, this_strict_low) /* Compare two operands for content equality. */ static int -compare_operands (d0, d1) - struct operand_data *d0, *d1; +compare_operands (struct operand_data *d0, struct operand_data *d1) { const char *p0, *p1; @@ -618,8 +613,7 @@ compare_operands (d0, d1) find a subsequence that is the same, or allocate a new one at the end. */ static void -place_operands (d) - struct data *d; +place_operands (struct data *d) { struct operand_data *od, *od2; int i; @@ -673,9 +667,7 @@ place_operands (d) templates, or C code to generate the assembler code template. */ static void -process_template (d, template) - struct data *d; - const char *template; +process_template (struct data *d, const char *template) { const char *cp; int i; @@ -686,7 +678,7 @@ process_template (d, template) d->template = 0; d->output_format = INSN_OUTPUT_FORMAT_FUNCTION; - printf ("\nstatic const char *output_%d PARAMS ((rtx *, rtx));\n", + printf ("\nstatic const char *output_%d (rtx *, rtx);\n", d->code_number); puts ("\nstatic const char *"); printf ("output_%d (operands, insn)\n", d->code_number); @@ -744,8 +736,7 @@ process_template (d, template) /* Check insn D for consistency in number of constraint alternatives. */ static void -validate_insn_alternatives (d) - struct data *d; +validate_insn_alternatives (struct data *d) { int n = 0, start; @@ -816,8 +807,7 @@ validate_insn_alternatives (d) /* Verify that there are no gaps in operand numbers for INSNs. */ static void -validate_insn_operands (d) - struct data *d; +validate_insn_operands (struct data *d) { int i; @@ -834,9 +824,7 @@ validate_insn_operands (d) a hairy output action, output a function for now. */ static void -gen_insn (insn, lineno) - rtx insn; - int lineno; +gen_insn (rtx insn, int lineno) { struct data *d = (struct data *) xmalloc (sizeof (struct data)); int i; @@ -877,9 +865,7 @@ gen_insn (insn, lineno) If the insn has a hairy output action, output it now. */ static void -gen_peephole (peep, lineno) - rtx peep; - int lineno; +gen_peephole (rtx peep, int lineno) { struct data *d = (struct data *) xmalloc (sizeof (struct data)); int i; @@ -917,9 +903,7 @@ gen_peephole (peep, lineno) only for the purposes of `insn_gen_function'. */ static void -gen_expand (insn, lineno) - rtx insn; - int lineno; +gen_expand (rtx insn, int lineno) { struct data *d = (struct data *) xmalloc (sizeof (struct data)); int i; @@ -962,9 +946,7 @@ gen_expand (insn, lineno) only for reasons of consistency and to simplify genrecog. */ static void -gen_split (split, lineno) - rtx split; - int lineno; +gen_split (rtx split, int lineno) { struct data *d = (struct data *) xmalloc (sizeof (struct data)); int i; @@ -999,12 +981,10 @@ gen_split (split, lineno) place_operands (d); } -extern int main PARAMS ((int, char **)); +extern int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; @@ -1037,7 +1017,7 @@ main (argc, argv) if (GET_CODE (desc) == DEFINE_EXPAND) gen_expand (desc, line_no); if (GET_CODE (desc) == DEFINE_SPLIT - || GET_CODE (desc) == DEFINE_PEEPHOLE2) + || GET_CODE (desc) == DEFINE_PEEPHOLE2) gen_split (desc, line_no); next_index_number++; } @@ -1057,9 +1037,7 @@ main (argc, argv) -1 if S is the null string. */ static int -n_occurrences (c, s) - int c; - const char *s; +n_occurrences (int c, const char *s) { int n = 0; @@ -1076,8 +1054,7 @@ n_occurrences (c, s) Return a new string. */ static const char * -strip_whitespace (s) - const char *s; +strip_whitespace (const char *s) { char *p, *q; char ch; @@ -1098,7 +1075,7 @@ strip_whitespace (s) tampered with. This isn't bullet-proof, but it should catch most genuine mistakes. */ static void -check_constraint_len () +check_constraint_len (void) { const char *p; int d; @@ -1110,9 +1087,7 @@ check_constraint_len () } static int -constraint_len (p, genoutput_default_constraint_len) - const char *p; - int genoutput_default_constraint_len; +constraint_len (const char *p, int genoutput_default_constraint_len) { /* Check that we still match defaults.h . First we do a generation-time check that fails if the value is not the expected one... */ diff --git a/gcc/genpeep.c b/gcc/genpeep.c index f5fd84e1aab..5e22ec0b068 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -1,6 +1,6 @@ /* Generate code from machine description to perform peephole optimizations. Copyright (C) 1987, 1989, 1992, 1997, 1998, - 1999, 2000 Free Software Foundation, Inc. + 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -53,14 +53,13 @@ static int n_operands; static int insn_code_number = 0; -static void gen_peephole PARAMS ((rtx)); -static void match_rtx PARAMS ((rtx, struct link *, int)); -static void print_path PARAMS ((struct link *)); -static void print_code PARAMS ((RTX_CODE)); +static void gen_peephole (rtx); +static void match_rtx (rtx, struct link *, int); +static void print_path (struct link *); +static void print_code (RTX_CODE); static void -gen_peephole (peep) - rtx peep; +gen_peephole (rtx peep) { int ninsns = XVECLEN (peep, 0); int i; @@ -68,9 +67,6 @@ gen_peephole (peep) n_operands = 0; printf (" insn = ins1;\n"); -#if 0 - printf (" want_jump = 0;\n"); -#endif for (i = 0; i < ninsns; i++) { @@ -86,14 +82,9 @@ gen_peephole (peep) printf (" if (GET_CODE (insn) == CODE_LABEL\n\ || GET_CODE (insn) == BARRIER)\n goto L%d;\n", - insn_code_number); + insn_code_number); } -#if 0 - printf (" if (GET_CODE (insn) == JUMP_INSN)\n"); - printf (" want_jump = JUMP_LABEL (insn);\n"); -#endif - printf (" pat = PATTERN (insn);\n"); /* Walk the insn's pattern, remembering at all times the path @@ -117,15 +108,6 @@ gen_peephole (peep) printf (" PATTERN (ins1) = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (%d, operands));\n", n_operands); -#if 0 - printf (" if (want_jump && GET_CODE (ins1) != JUMP_INSN)\n"); - printf (" {\n"); - printf (" rtx insn2 = emit_jump_insn_before (PATTERN (ins1), ins1);\n"); - printf (" delete_related_insns (ins1);\n"); - printf (" ins1 = ins2;\n"); - printf (" }\n"); -#endif - /* Record this define_peephole's insn code in the insn, as if it had been recognized to match this. */ printf (" INSN_CODE (ins1) = %d;\n", @@ -143,10 +125,7 @@ gen_peephole (peep) } static void -match_rtx (x, path, fail_label) - rtx x; - struct link *path; - int fail_label; +match_rtx (rtx x, struct link *path, int fail_label) { RTX_CODE code; int i; @@ -256,7 +235,7 @@ match_rtx (x, path, fail_label) case ADDRESS: match_rtx (XEXP (x, 0), path, fail_label); return; - + default: break; } @@ -343,8 +322,7 @@ match_rtx (x, path, fail_label) evaluate to the rtx at that point. */ static void -print_path (path) - struct link *path; +print_path (struct link *path) { if (path == 0) printf ("pat"); @@ -363,20 +341,17 @@ print_path (path) } static void -print_code (code) - RTX_CODE code; +print_code (RTX_CODE code) { const char *p1; for (p1 = GET_RTX_NAME (code); *p1; p1++) putchar (TOUPPER(*p1)); } -extern int main PARAMS ((int, char **)); +extern int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; @@ -457,8 +432,7 @@ from the machine description file `md'. */\n\n"); /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/genpreds.c b/gcc/genpreds.c index f008526b3b0..e52e424dd3c 100644 --- a/gcc/genpreds.c +++ b/gcc/genpreds.c @@ -2,7 +2,7 @@ - some macros CODE_FOR_... giving the insn_code_number value for each of the defined standard insn names. Copyright (C) 1987, 1991, 1995, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -29,11 +29,9 @@ Boston, MA 02111-1307, USA. */ #define NO_GENRTL_H #include "rtl.h" -static void output_predicate_decls PARAMS ((void)); -extern int main PARAMS ((void)); static void -output_predicate_decls () +output_predicate_decls (void) { #ifdef PREDICATE_CODES static const struct { @@ -46,14 +44,14 @@ output_predicate_decls () puts ("#ifdef RTX_CODE\n"); for (i = 0; i < ARRAY_SIZE (predicate); i++) - printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n", + printf ("extern int %s (rtx, enum machine_mode);\n", predicate[i].name); puts ("\n#endif /* RTX_CODE */\n"); #endif } int -main () +main (void) { puts ("/* Generated automatically by the program `genpreds'. */\n"); puts ("#ifndef GCC_TM_PREDS_H"); diff --git a/gcc/genrecog.c b/gcc/genrecog.c index e1dc9b205ba..f6f733fe299 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -1,6 +1,6 @@ /* Generate code from machine description to recognize rtl as insns. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -229,96 +229,94 @@ static const char *const special_mode_pred_table[] = { #define NUM_SPECIAL_MODE_PREDS ARRAY_SIZE (special_mode_pred_table) static struct decision *new_decision - PARAMS ((const char *, struct decision_head *)); + (const char *, struct decision_head *); static struct decision_test *new_decision_test - PARAMS ((enum decision_type, struct decision_test ***)); + (enum decision_type, struct decision_test ***); static rtx find_operand - PARAMS ((rtx, int)); + (rtx, int); static rtx find_matching_operand - PARAMS ((rtx, int)); + (rtx, int); static void validate_pattern - PARAMS ((rtx, rtx, rtx, int)); + (rtx, rtx, rtx, int); static struct decision *add_to_sequence - PARAMS ((rtx, struct decision_head *, const char *, enum routine_type, int)); + (rtx, struct decision_head *, const char *, enum routine_type, int); static int maybe_both_true_2 - PARAMS ((struct decision_test *, struct decision_test *)); + (struct decision_test *, struct decision_test *); static int maybe_both_true_1 - PARAMS ((struct decision_test *, struct decision_test *)); + (struct decision_test *, struct decision_test *); static int maybe_both_true - PARAMS ((struct decision *, struct decision *, int)); + (struct decision *, struct decision *, int); static int nodes_identical_1 - PARAMS ((struct decision_test *, struct decision_test *)); + (struct decision_test *, struct decision_test *); static int nodes_identical - PARAMS ((struct decision *, struct decision *)); + (struct decision *, struct decision *); static void merge_accept_insn - PARAMS ((struct decision *, struct decision *)); + (struct decision *, struct decision *); static void merge_trees - PARAMS ((struct decision_head *, struct decision_head *)); + (struct decision_head *, struct decision_head *); static void factor_tests - PARAMS ((struct decision_head *)); + (struct decision_head *); static void simplify_tests - PARAMS ((struct decision_head *)); + (struct decision_head *); static int break_out_subroutines - PARAMS ((struct decision_head *, int)); + (struct decision_head *, int); static void find_afterward - PARAMS ((struct decision_head *, struct decision *)); + (struct decision_head *, struct decision *); static void change_state - PARAMS ((const char *, const char *, struct decision *, const char *)); + (const char *, const char *, struct decision *, const char *); static void print_code - PARAMS ((enum rtx_code)); + (enum rtx_code); static void write_afterward - PARAMS ((struct decision *, struct decision *, const char *)); + (struct decision *, struct decision *, const char *); static struct decision *write_switch - PARAMS ((struct decision *, int)); + (struct decision *, int); static void write_cond - PARAMS ((struct decision_test *, int, enum routine_type)); + (struct decision_test *, int, enum routine_type); static void write_action - PARAMS ((struct decision *, struct decision_test *, int, int, - struct decision *, enum routine_type)); + (struct decision *, struct decision_test *, int, int, + struct decision *, enum routine_type); static int is_unconditional - PARAMS ((struct decision_test *, enum routine_type)); + (struct decision_test *, enum routine_type); static int write_node - PARAMS ((struct decision *, int, enum routine_type)); + (struct decision *, int, enum routine_type); static void write_tree_1 - PARAMS ((struct decision_head *, int, enum routine_type)); + (struct decision_head *, int, enum routine_type); static void write_tree - PARAMS ((struct decision_head *, const char *, enum routine_type, int)); + (struct decision_head *, const char *, enum routine_type, int); static void write_subroutine - PARAMS ((struct decision_head *, enum routine_type)); + (struct decision_head *, enum routine_type); static void write_subroutines - PARAMS ((struct decision_head *, enum routine_type)); + (struct decision_head *, enum routine_type); static void write_header - PARAMS ((void)); + (void); static struct decision_head make_insn_sequence - PARAMS ((rtx, enum routine_type)); + (rtx, enum routine_type); static void process_tree - PARAMS ((struct decision_head *, enum routine_type)); + (struct decision_head *, enum routine_type); static void record_insn_name - PARAMS ((int, const char *)); + (int, const char *); static void debug_decision_0 - PARAMS ((struct decision *, int, int)); + (struct decision *, int, int); static void debug_decision_1 - PARAMS ((struct decision *, int)); + (struct decision *, int); static void debug_decision_2 - PARAMS ((struct decision_test *)); + (struct decision_test *); extern void debug_decision - PARAMS ((struct decision *)); + (struct decision *); extern void debug_decision_list - PARAMS ((struct decision *)); + (struct decision *); /* Create a new node in sequence after LAST. */ static struct decision * -new_decision (position, last) - const char *position; - struct decision_head *last; +new_decision (const char *position, struct decision_head *last) { struct decision *new = (struct decision *) xmalloc (sizeof (struct decision)); @@ -335,9 +333,7 @@ new_decision (position, last) /* Create a new test and link it in at PLACE. */ static struct decision_test * -new_decision_test (type, pplace) - enum decision_type type; - struct decision_test ***pplace; +new_decision_test (enum decision_type type, struct decision_test ***pplace) { struct decision_test **place = *pplace; struct decision_test *test; @@ -356,9 +352,7 @@ new_decision_test (type, pplace) /* Search for and return operand N. */ static rtx -find_operand (pattern, n) - rtx pattern; - int n; +find_operand (rtx pattern, int n) { const char *fmt; RTX_CODE code; @@ -411,9 +405,7 @@ find_operand (pattern, n) constraint for operand N. */ static rtx -find_matching_operand (pattern, n) - rtx pattern; - int n; +find_matching_operand (rtx pattern, int n) { const char *fmt; RTX_CODE code; @@ -466,11 +458,7 @@ find_matching_operand (pattern, n) '+' within a context that requires in-out constraints. */ static void -validate_pattern (pattern, insn, set, set_code) - rtx pattern; - rtx insn; - rtx set; - int set_code; +validate_pattern (rtx pattern, rtx insn, rtx set, int set_code) { const char *fmt; RTX_CODE code; @@ -553,7 +541,7 @@ validate_pattern (pattern, insn, set, set_code) { const char constraints0 = XSTR (pattern, 2)[0]; - /* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we + /* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we don't use the MATCH_OPERAND constraint, only the predicate. This is confusing to folks doing new ports, so help them not make the mistake. */ @@ -566,7 +554,7 @@ validate_pattern (pattern, insn, set, set_code) "warning: constraints not supported in %s", rtx_name[GET_CODE (insn)]); } - + /* A MATCH_OPERAND that is a SET should have an output reload. */ else if (set && constraints0) { @@ -590,7 +578,7 @@ validate_pattern (pattern, insn, set, set_code) else if (constraints0 != '=' && constraints0 != '+') { message_with_line (pattern_lineno, - "operand %d missing output reload", + "operand %d missing output reload", XINT (pattern, 0)); error_count++; } @@ -767,12 +755,8 @@ validate_pattern (pattern, insn, set, set_code) A pointer to the final node in the chain is returned. */ static struct decision * -add_to_sequence (pattern, last, position, insn_type, top) - rtx pattern; - struct decision_head *last; - const char *position; - enum routine_type insn_type; - int top; +add_to_sequence (rtx pattern, struct decision_head *last, const char *position, + enum routine_type insn_type, int top) { RTX_CODE code; struct decision *this, *sub; @@ -1062,8 +1046,7 @@ add_to_sequence (pattern, last, position, insn_type, top) Returns > 0 for "definitely both true" and < 0 for "maybe both true". */ static int -maybe_both_true_2 (d1, d2) - struct decision_test *d1, *d2; +maybe_both_true_2 (struct decision_test *d1, struct decision_test *d2) { if (d1->type == d2->type) { @@ -1173,8 +1156,7 @@ maybe_both_true_2 (d1, d2) Returns > 0 for "definitely both true" and < 0 for "maybe both true". */ static int -maybe_both_true_1 (d1, d2) - struct decision_test *d1, *d2; +maybe_both_true_1 (struct decision_test *d1, struct decision_test *d2) { struct decision_test *t1, *t2; @@ -1208,9 +1190,8 @@ maybe_both_true_1 (d1, d2) recursively descend. */ static int -maybe_both_true (d1, d2, toplevel) - struct decision *d1, *d2; - int toplevel; +maybe_both_true (struct decision *d1, struct decision *d2, + int toplevel) { struct decision *p1, *p2; int cmp; @@ -1277,8 +1258,7 @@ maybe_both_true (d1, d2, toplevel) /* A subroutine of nodes_identical. Examine two tests for equivalence. */ static int -nodes_identical_1 (d1, d2) - struct decision_test *d1, *d2; +nodes_identical_1 (struct decision_test *d1, struct decision_test *d2) { switch (d1->type) { @@ -1325,8 +1305,7 @@ nodes_identical_1 (d1, d2) consider different orderings on the tests. */ static int -nodes_identical (d1, d2) - struct decision *d1, *d2; +nodes_identical (struct decision *d1, struct decision *d2) { struct decision_test *t1, *t2; @@ -1362,8 +1341,7 @@ nodes_identical (d1, d2) source machine description. */ static void -merge_accept_insn (oldd, addd) - struct decision *oldd, *addd; +merge_accept_insn (struct decision *oldd, struct decision *addd) { struct decision_test *old, *add; @@ -1407,8 +1385,7 @@ merge_accept_insn (oldd, addd) /* Merge two decision trees OLDH and ADDH, modifying OLDH destructively. */ static void -merge_trees (oldh, addh) - struct decision_head *oldh, *addh; +merge_trees (struct decision_head *oldh, struct decision_head *addh) { struct decision *next, *add; @@ -1492,8 +1469,7 @@ merge_trees (oldh, addh) (depending on the test type) to emit switch statements later. */ static void -factor_tests (head) - struct decision_head *head; +factor_tests (struct decision_head *head) { struct decision *first, *next; @@ -1578,8 +1554,7 @@ factor_tests (head) predicates, remove them. */ static void -simplify_tests (head) - struct decision_head *head; +simplify_tests (struct decision_head *head) { struct decision *tree; @@ -1616,9 +1591,7 @@ simplify_tests (head) that is generated. */ static int -break_out_subroutines (head, initial) - struct decision_head *head; - int initial; +break_out_subroutines (struct decision_head *head, int initial) { int size = 0; struct decision *sub; @@ -1638,9 +1611,7 @@ break_out_subroutines (head, initial) when p is true. */ static void -find_afterward (head, real_afterward) - struct decision_head *head; - struct decision *real_afterward; +find_afterward (struct decision_head *head, struct decision *real_afterward) { struct decision *p, *q, *afterward; @@ -1687,11 +1658,8 @@ find_afterward (head, real_afterward) match multiple insns and we try to step past the end of the stream. */ static void -change_state (oldpos, newpos, afterward, indent) - const char *oldpos; - const char *newpos; - struct decision *afterward; - const char *indent; +change_state (const char *oldpos, const char *newpos, + struct decision *afterward, const char *indent) { int odepth = strlen (oldpos); int ndepth = strlen (newpos); @@ -1748,8 +1716,7 @@ change_state (oldpos, newpos, afterward, indent) the name. */ static void -print_code (code) - enum rtx_code code; +print_code (enum rtx_code code) { const char *p; for (p = GET_RTX_NAME (code); *p; p++) @@ -1759,10 +1726,8 @@ print_code (code) /* Emit code to cross an afterward link -- change state and branch. */ static void -write_afterward (start, afterward, indent) - struct decision *start; - struct decision *afterward; - const char *indent; +write_afterward (struct decision *start, struct decision *afterward, + const char *indent) { if (!afterward || start->subroutine_number > 0) printf("%sgoto ret0;\n", indent); @@ -1777,9 +1742,7 @@ write_afterward (start, afterward, indent) nodes at START. Return the first node yet untested. */ static struct decision * -write_switch (start, depth) - struct decision *start; - int depth; +write_switch (struct decision *start, int depth) { struct decision *p = start; enum decision_type type = p->tests->type; @@ -1976,10 +1939,8 @@ write_switch (start, depth) /* Emit code for one test. */ static void -write_cond (p, depth, subroutine_type) - struct decision_test *p; - int depth; - enum routine_type subroutine_type; +write_cond (struct decision_test *p, int depth, + enum routine_type subroutine_type) { switch (p->type) { @@ -2051,12 +2012,9 @@ write_cond (p, depth, subroutine_type) perform a state change. For the `accept' tests we must do more work. */ static void -write_action (p, test, depth, uncond, success, subroutine_type) - struct decision *p; - struct decision_test *test; - int depth, uncond; - struct decision *success; - enum routine_type subroutine_type; +write_action (struct decision *p, struct decision_test *test, + int depth, int uncond, struct decision *success, + enum routine_type subroutine_type) { const char *indent; int want_close = 0; @@ -2142,9 +2100,7 @@ write_action (p, test, depth, uncond, success, subroutine_type) /* ??? is_unconditional is a stupid name for a tri-state function. */ static int -is_unconditional (t, subroutine_type) - struct decision_test *t; - enum routine_type subroutine_type; +is_unconditional (struct decision_test *t, enum routine_type subroutine_type) { if (t->type == DT_accept_op) return 1; @@ -2171,10 +2127,8 @@ is_unconditional (t, subroutine_type) Return true if there is no fallthru path. */ static int -write_node (p, depth, subroutine_type) - struct decision *p; - int depth; - enum routine_type subroutine_type; +write_node (struct decision *p, int depth, + enum routine_type subroutine_type) { struct decision_test *test, *last_test; int uncond; @@ -2210,10 +2164,8 @@ write_node (p, depth, subroutine_type) /* Emit code for all of the sibling nodes of HEAD. */ static void -write_tree_1 (head, depth, subroutine_type) - struct decision_head *head; - int depth; - enum routine_type subroutine_type; +write_tree_1 (struct decision_head *head, int depth, + enum routine_type subroutine_type) { struct decision *p, *next; int uncond = 0; @@ -2246,11 +2198,8 @@ write_tree_1 (head, depth, subroutine_type) position at the node that branched to this node. */ static void -write_tree (head, prevpos, type, initial) - struct decision_head *head; - const char *prevpos; - enum routine_type type; - int initial; +write_tree (struct decision_head *head, const char *prevpos, + enum routine_type type, int initial) { struct decision *p = head->first; @@ -2306,9 +2255,7 @@ write_tree (head, prevpos, type, initial) node TREE. */ static void -write_subroutine (head, type) - struct decision_head *head; - enum routine_type type; +write_subroutine (struct decision_head *head, enum routine_type type) { int subfunction = head->first ? head->first->subroutine_number : 0; const char *s_or_e; @@ -2327,7 +2274,7 @@ write_subroutine (head, type) switch (type) { case RECOG: - printf ("%sint recog%s PARAMS ((rtx, rtx, int *));\n", s_or_e, extension); + printf ("%sint recog%s (rtx, rtx, int *);\n", s_or_e, extension); printf ("%sint\n\ recog%s (x0, insn, pnum_clobbers)\n\ rtx x0 ATTRIBUTE_UNUSED;\n\ @@ -2335,14 +2282,14 @@ recog%s (x0, insn, pnum_clobbers)\n\ int *pnum_clobbers ATTRIBUTE_UNUSED;\n", s_or_e, extension); break; case SPLIT: - printf ("%srtx split%s PARAMS ((rtx, rtx));\n", s_or_e, extension); + printf ("%srtx split%s (rtx, rtx);\n", s_or_e, extension); printf ("%srtx\n\ split%s (x0, insn)\n\ rtx x0 ATTRIBUTE_UNUSED;\n\ rtx insn ATTRIBUTE_UNUSED;\n", s_or_e, extension); break; case PEEPHOLE2: - printf ("%srtx peephole2%s PARAMS ((rtx, rtx, int *));\n", + printf ("%srtx peephole2%s (rtx, rtx, int *);\n", s_or_e, extension); printf ("%srtx\n\ peephole2%s (x0, insn, _pmatch_len)\n\ @@ -2373,9 +2320,7 @@ peephole2%s (x0, insn, _pmatch_len)\n\ subroutines, but did not write them out. Do so now. */ static void -write_subroutines (head, type) - struct decision_head *head; - enum routine_type type; +write_subroutines (struct decision_head *head, enum routine_type type) { struct decision *p; @@ -2390,7 +2335,7 @@ write_subroutines (head, type) /* Begin the output file. */ static void -write_header () +write_header (void) { puts ("\ /* Generated automatically by the program `genrecog' from the target\n\ @@ -2452,9 +2397,7 @@ write_header () TYPE says what type of routine we are recognizing (RECOG or SPLIT). */ static struct decision_head -make_insn_sequence (insn, type) - rtx insn; - enum routine_type type; +make_insn_sequence (rtx insn, enum routine_type type) { rtx x; const char *c_test = XSTR (insn, type == RECOG ? 2 : 1); @@ -2609,12 +2552,12 @@ make_insn_sequence (insn, type) case SPLIT: /* Define the subroutine we will call below and emit in genemit. */ - printf ("extern rtx gen_split_%d PARAMS ((rtx *));\n", next_insn_code); + printf ("extern rtx gen_split_%d (rtx *);\n", next_insn_code); break; case PEEPHOLE2: /* Define the subroutine we will call below and emit in genemit. */ - printf ("extern rtx gen_peephole2_%d PARAMS ((rtx, rtx *));\n", + printf ("extern rtx gen_peephole2_%d (rtx, rtx *);\n", next_insn_code); break; } @@ -2623,9 +2566,7 @@ make_insn_sequence (insn, type) } static void -process_tree (head, subroutine_type) - struct decision_head *head; - enum routine_type subroutine_type; +process_tree (struct decision_head *head, enum routine_type subroutine_type) { if (head->first == NULL) { @@ -2652,12 +2593,10 @@ process_tree (head, subroutine_type) write_subroutine (head, subroutine_type); } -extern int main PARAMS ((int, char **)); +extern int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { rtx desc; struct decision_head recog_tree, split_tree, peephole2_tree, h; @@ -2721,8 +2660,7 @@ main (argc, argv) /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code; +get_insn_name (int code) { if (code < insn_name_ptr_size) return insn_name_ptr[code]; @@ -2731,9 +2669,7 @@ get_insn_name (code) } static void -record_insn_name (code, name) - int code; - const char *name; +record_insn_name (int code, const char *name) { static const char *last_real_name = "insn"; static int last_real_code = 0; @@ -2765,8 +2701,7 @@ record_insn_name (code, name) } static void -debug_decision_2 (test) - struct decision_test *test; +debug_decision_2 (struct decision_test *test) { switch (test->type) { @@ -2823,9 +2758,7 @@ debug_decision_2 (test) } static void -debug_decision_1 (d, indent) - struct decision *d; - int indent; +debug_decision_1 (struct decision *d, int indent) { int i; struct decision_test *test; @@ -2858,9 +2791,7 @@ debug_decision_1 (d, indent) } static void -debug_decision_0 (d, indent, maxdepth) - struct decision *d; - int indent, maxdepth; +debug_decision_0 (struct decision *d, int indent, int maxdepth) { struct decision *n; int i; @@ -2881,15 +2812,13 @@ debug_decision_0 (d, indent, maxdepth) } void -debug_decision (d) - struct decision *d; +debug_decision (struct decision *d) { debug_decision_0 (d, 0, 1000000); } void -debug_decision_list (d) - struct decision *d; +debug_decision_list (struct decision *d) { while (d) { diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 9c46ded7922..979c3353320 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -1,5 +1,6 @@ /* Support routines for the various generation passes. - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GCC. @@ -68,8 +69,8 @@ static struct queue_elem **define_cond_exec_tail = &define_cond_exec_queue; static struct queue_elem *other_queue; static struct queue_elem **other_tail = &other_queue; -static void queue_pattern PARAMS ((rtx, struct queue_elem ***, - const char *, int)); +static void queue_pattern (rtx, struct queue_elem ***, + const char *, int); /* Current maximum length of directory names in the search path for include files. (Altered as we get more of them.) */ @@ -87,30 +88,30 @@ struct file_name_list *first_dir_md_include = 0; /* First dir to search */ struct file_name_list *first_bracket_include = 0; struct file_name_list *last_dir_md_include = 0; /* Last in chain */ -static void remove_constraints PARAMS ((rtx)); -static void process_rtx PARAMS ((rtx, int)); - -static int is_predicable PARAMS ((struct queue_elem *)); -static void identify_predicable_attribute PARAMS ((void)); -static int n_alternatives PARAMS ((const char *)); -static void collect_insn_data PARAMS ((rtx, int *, int *)); -static rtx alter_predicate_for_insn PARAMS ((rtx, int, int, int)); -static const char *alter_test_for_insn PARAMS ((struct queue_elem *, - struct queue_elem *)); -static char *shift_output_template PARAMS ((char *, const char *, int)); -static const char *alter_output_for_insn PARAMS ((struct queue_elem *, - struct queue_elem *, - int, int)); -static void process_one_cond_exec PARAMS ((struct queue_elem *)); -static void process_define_cond_exec PARAMS ((void)); -static void process_include PARAMS ((rtx, int)); -static char *save_string PARAMS ((const char *, int)); +static void remove_constraints (rtx); +static void process_rtx (rtx, int); + +static int is_predicable (struct queue_elem *); +static void identify_predicable_attribute (void); +static int n_alternatives (const char *); +static void collect_insn_data (rtx, int *, int *); +static rtx alter_predicate_for_insn (rtx, int, int, int); +static const char *alter_test_for_insn (struct queue_elem *, + struct queue_elem *); +static char *shift_output_template (char *, const char *, int); +static const char *alter_output_for_insn (struct queue_elem *, + struct queue_elem *, + int, int); +static void process_one_cond_exec (struct queue_elem *); +static void process_define_cond_exec (void); +static void process_include (rtx, int); +static char *save_string (const char *, int); void message_with_line (int lineno, const char *msg, ...) { va_list ap; - + va_start (ap, msg); fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno); @@ -124,9 +125,8 @@ message_with_line (int lineno, const char *msg, ...) the gensupport programs. */ rtx -gen_rtx_CONST_INT (mode, arg) - enum machine_mode mode ATTRIBUTE_UNUSED; - HOST_WIDE_INT arg; +gen_rtx_CONST_INT (enum machine_mode mode ATTRIBUTE_UNUSED, + HOST_WIDE_INT arg) { rtx rt = rtx_alloc (CONST_INT); @@ -137,11 +137,8 @@ gen_rtx_CONST_INT (mode, arg) /* Queue PATTERN on LIST_TAIL. */ static void -queue_pattern (pattern, list_tail, filename, lineno) - rtx pattern; - struct queue_elem ***list_tail; - const char *filename; - int lineno; +queue_pattern (rtx pattern, struct queue_elem ***list_tail, + const char *filename, int lineno) { struct queue_elem *e = (struct queue_elem *) xmalloc (sizeof (*e)); e->data = pattern; @@ -155,8 +152,7 @@ queue_pattern (pattern, list_tail, filename, lineno) /* Recursively remove constraints from an rtx. */ static void -remove_constraints (part) - rtx part; +remove_constraints (rtx part) { int i, j; const char *format_ptr; @@ -186,13 +182,11 @@ remove_constraints (part) } } -/* Process an include file assuming that it lives in gcc/config/{target}/ +/* Process an include file assuming that it lives in gcc/config/{target}/ if the include looks like (include "file"). */ static void -process_include (desc, lineno) - rtx desc; - int lineno; +process_include (rtx desc, int lineno) { const char *filename = XSTR (desc, 0); const char *old_filename; @@ -212,7 +206,7 @@ process_include (desc, lineno) pathname = concat (stackp->fname, sep, filename, NULL); input_file = fopen (pathname, "r"); - if (input_file != NULL) + if (input_file != NULL) goto success; free (pathname); } @@ -268,9 +262,7 @@ process_include (desc, lineno) /* Process a top level rtx in some way, queueing as appropriate. */ static void -process_rtx (desc, lineno) - rtx desc; - int lineno; +process_rtx (rtx desc, int lineno) { switch (GET_CODE (desc)) { @@ -338,8 +330,7 @@ process_rtx (desc, lineno) a DEFINE_INSN. */ static int -is_predicable (elem) - struct queue_elem *elem; +is_predicable (struct queue_elem *elem) { rtvec vec = XVEC (elem->data, 4); const char *value; @@ -427,7 +418,7 @@ is_predicable (elem) and its default. */ static void -identify_predicable_attribute () +identify_predicable_attribute (void) { struct queue_elem *elem; char *p_true, *p_false; @@ -494,8 +485,7 @@ identify_predicable_attribute () /* Return the number of alternatives in constraint S. */ static int -n_alternatives (s) - const char *s; +n_alternatives (const char *s) { int n = 1; @@ -510,9 +500,7 @@ n_alternatives (s) operands. */ static void -collect_insn_data (pattern, palt, pmax) - rtx pattern; - int *palt, *pmax; +collect_insn_data (rtx pattern, int *palt, int *pmax) { const char *fmt; enum rtx_code code; @@ -568,9 +556,7 @@ collect_insn_data (pattern, palt, pmax) } static rtx -alter_predicate_for_insn (pattern, alt, max_op, lineno) - rtx pattern; - int alt, max_op, lineno; +alter_predicate_for_insn (rtx pattern, int alt, int max_op, int lineno) { const char *fmt; enum rtx_code code; @@ -659,8 +645,8 @@ alter_predicate_for_insn (pattern, alt, max_op, lineno) } static const char * -alter_test_for_insn (ce_elem, insn_elem) - struct queue_elem *ce_elem, *insn_elem; +alter_test_for_insn (struct queue_elem *ce_elem, + struct queue_elem *insn_elem) { const char *ce_test, *insn_test; @@ -679,10 +665,7 @@ alter_test_for_insn (ce_elem, insn_elem) adjusted string. */ static char * -shift_output_template (new, old, disp) - char *new; - const char *old; - int disp; +shift_output_template (char *new, const char *old, int disp) { while (*old) { @@ -706,9 +689,9 @@ shift_output_template (new, old, disp) } static const char * -alter_output_for_insn (ce_elem, insn_elem, alt, max_op) - struct queue_elem *ce_elem, *insn_elem; - int alt, max_op; +alter_output_for_insn (struct queue_elem *ce_elem, + struct queue_elem *insn_elem, + int alt, int max_op) { const char *ce_out, *insn_out; char *new, *p; @@ -768,8 +751,7 @@ alter_output_for_insn (ce_elem, insn_elem, alt, max_op) /* Replicate insns as appropriate for the given DEFINE_COND_EXEC. */ static void -process_one_cond_exec (ce_elem) - struct queue_elem *ce_elem; +process_one_cond_exec (struct queue_elem *ce_elem) { struct queue_elem *insn_elem; for (insn_elem = define_insn_queue; insn_elem ; insn_elem = insn_elem->next) @@ -845,7 +827,7 @@ process_one_cond_exec (ce_elem) patterns appropriately. */ static void -process_define_cond_exec () +process_define_cond_exec (void) { struct queue_elem *elem; @@ -858,9 +840,7 @@ process_define_cond_exec () } static char * -save_string (s, len) - const char *s; - int len; +save_string (const char *s, int len) { register char *result = xmalloc (len + 1); @@ -873,9 +853,7 @@ save_string (s, len) /* The entry point for initializing the reader. */ int -init_md_reader_args (argc, argv) - int argc; - char **argv; +init_md_reader_args (int argc, char **argv) { int i; const char *in_fname; @@ -928,8 +906,7 @@ init_md_reader_args (argc, argv) /* The entry point for initializing the reader. */ int -init_md_reader (filename) - const char *filename; +init_md_reader (const char *filename) { FILE *input_file; int c; @@ -937,7 +914,7 @@ init_md_reader (filename) char *lastsl; lastsl = strrchr (filename, '/'); - if (lastsl != NULL) + if (lastsl != NULL) base_dir = save_string (filename, lastsl - filename + 1 ); read_rtx_filename = filename; @@ -987,9 +964,7 @@ init_md_reader (filename) /* The entry point for reading a single rtx from an md file. */ rtx -read_md_rtx (lineno, seqnr) - int *lineno; - int *seqnr; +read_md_rtx (int *lineno, int *seqnr) { struct queue_elem **queue, *elem; rtx desc; @@ -1052,8 +1027,7 @@ read_md_rtx (lineno, seqnr) /* Compute a hash function of a c_test structure, which is keyed by its ->expr field. */ hashval_t -hash_c_test (x) - const PTR x; +hash_c_test (const void *x) { const struct c_test *a = (const struct c_test *) x; const unsigned char *base, *s = (const unsigned char *) a->expr; @@ -1079,9 +1053,7 @@ hash_c_test (x) /* Compare two c_test expression structures. */ int -cmp_c_test (x, y) - const PTR x; - const PTR y; +cmp_c_test (const void *x, const void *y) { const struct c_test *a = (const struct c_test *) x; const struct c_test *b = (const struct c_test *) y; @@ -1094,8 +1066,7 @@ cmp_c_test (x, y) at compile time. Returns a tristate: 1 for known true, 0 for known false, -1 for unknown. */ int -maybe_eval_c_test (expr) - const char *expr; +maybe_eval_c_test (const char *expr) { const struct c_test *test; struct c_test dummy; @@ -1117,8 +1088,7 @@ maybe_eval_c_test (expr) /* Given a string, return the number of comma-separated elements in it. Return 0 for the null string. */ int -n_comma_elts (s) - const char *s; +n_comma_elts (const char *s) { int n; @@ -1139,8 +1109,7 @@ n_comma_elts (s) a comma and an element is ignored. */ const char * -scan_comma_elt (pstr) - const char **pstr; +scan_comma_elt (const char **pstr) { const char *start; const char *p = *pstr; diff --git a/gcc/gensupport.h b/gcc/gensupport.h index 8dbd0b70ea9..7ceccfbaeb1 100644 --- a/gcc/gensupport.h +++ b/gcc/gensupport.h @@ -1,5 +1,5 @@ /* Declarations for rtx-reader support for gen* routines. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -24,11 +24,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA struct obstack; extern struct obstack *rtl_obstack; -extern int init_md_reader_args PARAMS ((int, char **)); -extern int init_md_reader PARAMS ((const char *)); -extern rtx read_md_rtx PARAMS ((int *, int *)); +extern int init_md_reader_args (int, char **); +extern int init_md_reader (const char *); +extern rtx read_md_rtx (int *, int *); -extern void message_with_line PARAMS ((int, const char *, ...)) +extern void message_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2; /* Set this to 0 to disable automatic elision of insn patterns which @@ -46,7 +46,7 @@ extern const int insn_elision_unavailable; time, return its truth value; else return -1. The test must have appeared somewhere in the machine description when genconditions was run. */ -extern int maybe_eval_c_test PARAMS ((const char *)); +extern int maybe_eval_c_test (const char *); /* This table should not be accessed directly; use maybe_eval_c_test. */ struct c_test @@ -59,11 +59,11 @@ extern const struct c_test insn_conditions[]; extern const size_t n_insn_conditions; #ifdef __HASHTAB_H__ -extern hashval_t hash_c_test PARAMS ((const PTR)); -extern int cmp_c_test PARAMS ((const PTR, const PTR)); +extern hashval_t hash_c_test (const void *); +extern int cmp_c_test (const void *, const void *); #endif -extern int n_comma_elts PARAMS ((const char *)); -extern const char *scan_comma_elt PARAMS ((const char **)); +extern int n_comma_elts (const char *); +extern const char *scan_comma_elt (const char **); #endif /* GCC_GENSUPPORT_H */ diff --git a/gcc/intl.c b/gcc/intl.c index 3bda5cef7de..04613294ac4 100644 --- a/gcc/intl.c +++ b/gcc/intl.c @@ -1,5 +1,5 @@ /* Message translation utilities. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA terminal, so it has be set to output messages correctly. */ void -gcc_init_libintl () +gcc_init_libintl (void) { #ifdef HAVE_LC_MESSAGES setlocale (LC_CTYPE, ""); @@ -52,8 +52,7 @@ gcc_init_libintl () This is for indenting subsequent output. */ size_t -gcc_gettext_width (msgstr) - const char *msgstr; +gcc_gettext_width (const char *msgstr) { size_t nwcs = mbstowcs (0, msgstr, 0); wchar_t *wmsgstr = alloca ((nwcs + 1) * sizeof (wchar_t)); @@ -68,8 +67,7 @@ gcc_gettext_width (msgstr) the length of the string. */ size_t -gcc_gettext_width (msgstr) - const char *msgstr; +gcc_gettext_width (const char *msgstr) { return strlen (msgstr); } diff --git a/gcc/intl.h b/gcc/intl.h index c3274f70d0a..3acc511cc07 100644 --- a/gcc/intl.h +++ b/gcc/intl.h @@ -1,5 +1,5 @@ /* intl.h - internationalization - Copyright 1998, 2001 Free Software Foundation, Inc. + Copyright 1998, 2001, 2003 Free Software Foundation, Inc. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,8 +38,8 @@ #endif #ifdef ENABLE_NLS -extern void gcc_init_libintl PARAMS ((void)); -extern size_t gcc_gettext_width PARAMS ((const char *)); +extern void gcc_init_libintl (void); +extern size_t gcc_gettext_width (const char *); #else /* Stubs. */ # undef textdomain diff --git a/gcc/lists.c b/gcc/lists.c index 78accceccd8..57eda4b2f1f 100644 --- a/gcc/lists.c +++ b/gcc/lists.c @@ -1,6 +1,6 @@ /* List management for the GNU C-Compiler expander. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999 Free Software Foundation, Inc. + 1999, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -27,7 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "rtl.h" #include "ggc.h" -static void free_list PARAMS ((rtx *, rtx *)); +static void free_list (rtx *, rtx *); /* Functions for maintaining cache-able lists of EXPR_LIST and INSN_LISTs. */ @@ -43,8 +43,7 @@ static GTY ((deletable (""))) rtx unused_expr_list; nodes of one type only. This is only called by free_EXPR_LIST_list and free_INSN_LIST_list. */ static void -free_list (listp, unused_listp) - rtx *listp, *unused_listp; +free_list (rtx *listp, rtx *unused_listp) { rtx link, prev_link; @@ -66,8 +65,7 @@ free_list (listp, unused_listp) node available, we'll use it, otherwise a call to gen_rtx_INSN_LIST is made. */ rtx -alloc_INSN_LIST (val, next) - rtx val, next; +alloc_INSN_LIST (rtx val, rtx next) { rtx r; @@ -89,9 +87,7 @@ alloc_INSN_LIST (val, next) node available, we'll use it, otherwise a call to gen_rtx_EXPR_LIST is made. */ rtx -alloc_EXPR_LIST (kind, val, next) - int kind; - rtx val, next; +alloc_EXPR_LIST (int kind, rtx val, rtx next) { rtx r; @@ -111,8 +107,7 @@ alloc_EXPR_LIST (kind, val, next) /* This function will free up an entire list of EXPR_LIST nodes. */ void -free_EXPR_LIST_list (listp) - rtx *listp; +free_EXPR_LIST_list (rtx *listp) { if (*listp == 0) return; @@ -121,8 +116,7 @@ free_EXPR_LIST_list (listp) /* This function will free up an entire list of INSN_LIST nodes. */ void -free_INSN_LIST_list (listp) - rtx *listp; +free_INSN_LIST_list (rtx *listp) { if (*listp == 0) return; @@ -131,8 +125,7 @@ free_INSN_LIST_list (listp) /* This function will free up an individual EXPR_LIST node. */ void -free_EXPR_LIST_node (ptr) - rtx ptr; +free_EXPR_LIST_node (rtx ptr) { XEXP (ptr, 1) = unused_expr_list; unused_expr_list = ptr; @@ -140,8 +133,7 @@ free_EXPR_LIST_node (ptr) /* This function will free up an individual INSN_LIST node. */ void -free_INSN_LIST_node (ptr) - rtx ptr; +free_INSN_LIST_node (rtx ptr) { XEXP (ptr, 1) = unused_insn_list; unused_insn_list = ptr; diff --git a/gcc/params.c b/gcc/params.c index b4c7aa5fe76..3ef0a7fdf5a 100644 --- a/gcc/params.c +++ b/gcc/params.c @@ -1,5 +1,5 @@ /* params.c - Run-time parameters. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. Written by Mark Mitchell <mark@codesourcery.com>. This file is part of GCC. @@ -40,9 +40,7 @@ static size_t num_compiler_params; /* Add the N PARAMS to the current list of compiler parameters. */ void -add_params (params, n) - const param_info params[]; - size_t n; +add_params (const param_info params[], size_t n) { /* Allocate enough space for the new parameters. */ compiler_params = @@ -60,9 +58,7 @@ add_params (params, n) /* Set the VALUE associated with the parameter given by NAME. */ void -set_param_value (name, value) - const char *name; - int value; +set_param_value (const char *name, int value) { size_t i; diff --git a/gcc/params.h b/gcc/params.h index caddf853da5..0a784454ccd 100644 --- a/gcc/params.h +++ b/gcc/params.h @@ -1,5 +1,5 @@ /* params.h - Run-time parameters. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. Written by Mark Mitchell <mark@codesourcery.com>. This file is part of GCC. @@ -59,13 +59,11 @@ extern param_info *compiler_params; /* Add the N PARAMS to the current list of compiler parameters. */ -extern void add_params - PARAMS ((const param_info params[], size_t n)); +extern void add_params (const param_info params[], size_t n); /* Set the VALUE associated with the parameter given by NAME. */ -extern void set_param_value - PARAMS ((const char *name, int value)); +extern void set_param_value (const char *name, int value); /* The parameters in use by language-independent code. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 77b1f38fc28..ea0c9b38d5d 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -135,7 +135,7 @@ typedef union rtunion_def rtunion; /* RTL expression ("rtx"). */ -struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), +struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), chain_prev ("RTX_PREV (&%h)"))) { /* The kind of expression this is. */ @@ -377,75 +377,75 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int, ({ rtx const _rtx = (RTX); \ if (GET_CODE(_rtx) != C1) \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \ ({ rtx const _rtx = (RTX); \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \ rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \ ({ rtx const _rtx = (RTX); \ - if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ + if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ && GET_CODE(_rtx) != C3) \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \ ({ rtx const _rtx = (RTX); \ - if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ + if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \ ({ rtx const _rtx = (RTX); \ - if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ + if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C5) \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \ __extension__ \ ({ rtx const _rtx = (RTX); \ - if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ + if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \ rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \ __extension__ \ ({ rtx const _rtx = (RTX); \ - if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ + if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \ && GET_CODE(_rtx) != C7) \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) \ __extension__ \ ({ rtx const _rtx = (RTX); \ - if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ + if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \ && GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \ - __FUNCTION__); \ + __FUNCTION__); \ _rtx; }) extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *, - int, const char *)) + int, const char *)) ATTRIBUTE_NORETURN ; @@ -455,7 +455,7 @@ extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *, #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX) #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX) #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX) -#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX) +#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX) #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX) #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX) #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX) @@ -673,7 +673,7 @@ enum reg_note REG_CC_SETTER, REG_CC_USER, /* Points to a CODE_LABEL. Used by non-JUMP_INSNs to say that the - CODE_LABEL contained in the REG_LABEL note is used by the insn. + CODE_LABEL contained in the REG_LABEL note is used by the insn. This note is an INSN_LIST. */ REG_LABEL, @@ -724,14 +724,14 @@ enum reg_note /* Indicates that this insn (which is part of the prologue) computes a value which might not be used later, and if so it's OK to delete - the insn. Normally, deleting any insn in the prologue is an error. + the insn. Normally, deleting any insn in the prologue is an error. At present the parameter is unused and set to (const_int 0). */ REG_MAYBE_DEAD, /* Indicates that a call does not return. */ REG_NORETURN, - /* Indicates that an indirect jump is a non-local goto instead of a + /* Indicates that an indirect jump is a non-local goto instead of a computed goto. */ REG_NON_LOCAL_GOTO, @@ -782,7 +782,7 @@ extern const char * const reg_note_name[]; between ints and pointers if we use a different macro for the block number.) */ -#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE) +#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE) #define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE) #define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE) #define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE) @@ -795,7 +795,7 @@ extern const char * const reg_note_name[]; #define NOTE_LINE_NUMBER(INSN) XCINT (INSN, 5, NOTE) /* Nonzero if INSN is a note marking the beginning of a basic block. */ -#define NOTE_INSN_BASIC_BLOCK_P(INSN) \ +#define NOTE_INSN_BASIC_BLOCK_P(INSN) \ (GET_CODE (INSN) == NOTE \ && NOTE_LINE_NUMBER (INSN) == NOTE_INSN_BASIC_BLOCK) @@ -867,7 +867,7 @@ enum insn_note their homes, etc. */ NOTE_INSN_FUNCTION_BEG, - /* These note where exception handling regions begin and end. + /* These note where exception handling regions begin and end. Uses NOTE_EH_HANDLER to identify the region in question. */ NOTE_INSN_EH_REGION_BEG, NOTE_INSN_EH_REGION_END, @@ -1015,7 +1015,7 @@ enum label_kind /* For a CONST_DOUBLE: For a DImode, there are two integers CONST_DOUBLE_LOW is the low-order word and ..._HIGH the high-order. - For a float, there is a REAL_VALUE_TYPE structure, and + For a float, there is a REAL_VALUE_TYPE structure, and CONST_DOUBLE_REAL_VALUE(r) is a pointer to it. */ #define CONST_DOUBLE_LOW(r) XCWINT (r, 0, CONST_DOUBLE) #define CONST_DOUBLE_HIGH(r) XCWINT (r, 1, CONST_DOUBLE) @@ -1035,15 +1035,15 @@ enum label_kind /* in rtlanal.c */ extern unsigned int subreg_lsb PARAMS ((rtx)); -extern unsigned int subreg_regno_offset PARAMS ((unsigned int, - enum machine_mode, - unsigned int, +extern unsigned int subreg_regno_offset PARAMS ((unsigned int, + enum machine_mode, + unsigned int, enum machine_mode)); -extern bool subreg_offset_representable_p PARAMS ((unsigned int, - enum machine_mode, - unsigned int, +extern bool subreg_offset_representable_p PARAMS ((unsigned int, + enum machine_mode, + unsigned int, enum machine_mode)); -extern unsigned int subreg_regno PARAMS ((rtx)); +extern unsigned int subreg_regno PARAMS ((rtx)); /* 1 if RTX is a subreg containing a reg that is already known to be sign- or zero-extended from the mode of the subreg to the mode of @@ -1735,12 +1735,12 @@ extern rtx find_use_as_address PARAMS ((rtx, rtx, HOST_WIDE_INT)); /* lists.c */ -void free_EXPR_LIST_list PARAMS ((rtx *)); -void free_INSN_LIST_list PARAMS ((rtx *)); -void free_EXPR_LIST_node PARAMS ((rtx)); -void free_INSN_LIST_node PARAMS ((rtx)); -rtx alloc_INSN_LIST PARAMS ((rtx, rtx)); -rtx alloc_EXPR_LIST PARAMS ((int, rtx, rtx)); +void free_EXPR_LIST_list (rtx *); +void free_INSN_LIST_list (rtx *); +void free_EXPR_LIST_node (rtx); +void free_INSN_LIST_node (rtx); +rtx alloc_INSN_LIST (rtx, rtx); +rtx alloc_EXPR_LIST (int, rtx, rtx); /* regclass.c */ @@ -1931,7 +1931,7 @@ extern rtx gen_lowpart_SUBREG PARAMS ((enum machine_mode, rtx)); #define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4) /* Nonzero if REGNUM is a pointer into the stack frame. */ -#define REGNO_PTR_FRAME_P(REGNUM) \ +#define REGNO_PTR_FRAME_P(REGNUM) \ ((REGNUM) == STACK_POINTER_REGNUM \ || (REGNUM) == FRAME_POINTER_REGNUM \ || (REGNUM) == HARD_FRAME_POINTER_REGNUM \ @@ -2400,6 +2400,6 @@ extern void tracer PARAMS ((void)); /* Create libcall block around the call. */ #define ECF_LIBCALL_BLOCK 4096 -extern int flags_from_decl_or_type PARAMS ((tree)); +extern int flags_from_decl_or_type PARAMS ((tree)); #endif /* ! GCC_RTL_H */ |