diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-05 04:56:11 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-05 04:56:11 +0000 |
commit | 0d2d46acc0ab054d702677731f1ffd8abb1bf5ee (patch) | |
tree | b63a94b017b8ea34130c545a603c44169fe90865 | |
parent | ffd92f3c9672d23018c2a51d2469cf5ff2dcf7a4 (diff) | |
download | gcc-0d2d46acc0ab054d702677731f1ffd8abb1bf5ee.tar.gz |
* recog.h: Remove NO_MD_PROTOTYPES ifdefs.
* genflags.c: Use the max_operand_1 logic from genemit.c to
calculate how many arguments gen_insn prototypes have. Remove
NO_MD_PROTOTYPES ifdefs from the generated file.
* genoutput.c: Don't define NO_MD_PROTOTYPES in the generated
file. Cast gen_insn initializers to insn_gen_fn.
* config/alpha/vms.h: Don't define NO_MD_PROTOTYPES.
* gcc.texi: Remove documentation of NO_MD_PROTOTYPES.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31801 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/alpha/vms.h | 1 | ||||
-rw-r--r-- | gcc/gcc.texi | 22 | ||||
-rw-r--r-- | gcc/genflags.c | 80 | ||||
-rw-r--r-- | gcc/genoutput.c | 3 | ||||
-rw-r--r-- | gcc/recog.h | 4 |
6 files changed, 61 insertions, 60 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5a5f7ba8fc9..e74ee16fbd7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2000-02-04 Zack Weinberg <zack@wolery.cumb.org> + + * recog.h: Remove NO_MD_PROTOTYPES ifdefs. + * genflags.c: Use the max_operand_1 logic from genemit.c to + calculate how many arguments gen_insn prototypes have. Remove + NO_MD_PROTOTYPES ifdefs from the generated file. + * genoutput.c: Don't define NO_MD_PROTOTYPES in the generated + file. Cast gen_insn initializers to insn_gen_fn. + * config/alpha/vms.h: Don't define NO_MD_PROTOTYPES. + * gcc.texi: Remove documentation of NO_MD_PROTOTYPES. + 2000-02-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * fixinc/Makefile.in (HDR): Add machname.h. diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index 1baaf7e12ea..b40a3914e26 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -366,7 +366,6 @@ do { \ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ } while (0) -#define NO_MD_PROTOTYPES /* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. diff --git a/gcc/gcc.texi b/gcc/gcc.texi index 8585259653d..5e29909b75d 100644 --- a/gcc/gcc.texi +++ b/gcc/gcc.texi @@ -3782,24 +3782,14 @@ GCC. If @samp{USE_PROTOTYPES} is not defined, it will be determined automatically whether your compiler supports prototypes by checking if @samp{__STDC__} is defined. -@findex NO_MD_PROTOTYPES -@item NO_MD_PROTOTYPES -Define this if you wish suppression of prototypes generated from -the machine description file, but to use other prototypes within -GCC. If @samp{USE_PROTOTYPES} is defined to be 0, or the -host compiler does not support prototypes, this macro has no -effect. - @findex MD_CALL_PROTOTYPES @item MD_CALL_PROTOTYPES -Define this if you wish to generate prototypes for the -@code{gen_call} or @code{gen_call_value} functions generated from -the machine description file. If @samp{USE_PROTOTYPES} is -defined to be 0, or the host compiler does not support -prototypes, or @samp{NO_MD_PROTOTYPES} is defined, this macro has -no effect. As soon as all of the machine descriptions are -modified to have the appropriate number of arguments, this macro -will be removed. +Define this if you wish to generate prototypes for the @code{gen_call} +or @code{gen_call_value} functions generated from the machine +description file. If @samp{USE_PROTOTYPES} is defined to be 0, or the +host compiler does not support prototypes, this macro has no effect. As +soon as all of the machine descriptions are modified to have the +appropriate number of arguments, this macro will be removed. @findex PATH_SEPARATOR @item PATH_SEPARATOR diff --git a/gcc/genflags.c b/gcc/genflags.c index f801b57e142..4c376604b88 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -39,48 +39,63 @@ static struct obstack call_obstack, normal_obstack; /* Max size of names encountered. */ static int max_id_len; -static int num_operands PARAMS ((rtx)); -static void gen_proto PARAMS ((rtx)); -static void gen_nonproto PARAMS ((rtx)); -static void gen_insn PARAMS ((rtx)); +/* 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_nonproto PARAMS ((rtx)); +static void gen_insn PARAMS ((rtx)); /* Count the number of match_operand's found. */ -static int -num_operands (x) +static void +max_operand_1 (x) rtx x; { - int count = 0; - int i, j; - enum rtx_code code = GET_CODE (x); - const char *format_ptr = GET_RTX_FORMAT (code); + register RTX_CODE code; + register int i; + register int len; + register const char *fmt; - if (code == MATCH_OPERAND) - return 1; + if (x == 0) + return; - if (code == MATCH_OPERATOR || code == MATCH_PARALLEL) - count++; + code = GET_CODE (x); - for (i = 0; i < GET_RTX_LENGTH (code); i++) + if (code == MATCH_OPERAND || code == MATCH_OPERATOR + || code == MATCH_PARALLEL) + max_opno = MAX (max_opno, XINT (x, 0)); + + fmt = GET_RTX_FORMAT (code); + len = GET_RTX_LENGTH (code); + for (i = 0; i < len; i++) { - switch (*format_ptr++) + if (fmt[i] == 'e' || fmt[i] == 'u') + max_operand_1 (XEXP (x, i)); + else if (fmt[i] == 'E') { - case 'u': - case 'e': - count += num_operands (XEXP (x, i)); - break; - - case 'E': - if (XVEC (x, i) != NULL) - for (j = 0; j < XVECLEN (x, i); j++) - count += num_operands (XVECEXP (x, i, j)); - - break; + int j; + for (j = 0; j < XVECLEN (x, i); j++) + max_operand_1 (XVECEXP (x, i, j)); } } +} - return count; +static int +num_operands (insn) + rtx insn; +{ + register int len = XVECLEN (insn, 1); + register int i; + + max_opno = -1; + + for (i = 0; i < len; i++) + max_operand_1 (XVECEXP (insn, 1, i)); + + return max_opno + 1; } /* Print out prototype information for a function. */ @@ -251,7 +266,6 @@ from the machine description file `md'. */\n\n"); obstack_grow (&normal_obstack, &dummy, sizeof (rtx)); normal_insns = (rtx *) obstack_finish (&normal_obstack); - printf ("\n#ifndef NO_MD_PROTOTYPES\n"); for (insn_ptr = normal_insns; *insn_ptr; insn_ptr++) gen_proto (*insn_ptr); @@ -264,14 +278,6 @@ from the machine description file `md'. */\n\n"); gen_nonproto (*insn_ptr); printf ("#endif /* !MD_CALL_PROTOTYPES */\n"); - printf ("\n#else /* NO_MD_PROTOTYPES */\n"); - for (insn_ptr = normal_insns; *insn_ptr; insn_ptr++) - gen_nonproto (*insn_ptr); - - for (insn_ptr = call_insns; *insn_ptr; insn_ptr++) - gen_nonproto (*insn_ptr); - - printf ("#endif /* NO_MD_PROTOTYPES */\n"); fflush (stdout); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 5fd472de64c..ecac9c96fa0 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -221,7 +221,6 @@ output_prologue () printf ("/* Generated automatically by the program `genoutput'\n\ from the machine description file `md'. */\n\n"); - printf ("#define NO_MD_PROTOTYPES\n"); printf ("#include \"config.h\"\n"); printf ("#include \"system.h\"\n"); printf ("#include \"flags.h\"\n"); @@ -369,7 +368,7 @@ output_insn_data () } if (d->name && d->name[0] != '*') - printf (" gen_%s,\n", d->name); + printf (" (insn_gen_fn) gen_%s,\n", d->name); else printf (" 0,\n"); diff --git a/gcc/recog.h b/gcc/recog.h index a19e6a636a3..d9ca87a6311 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -190,11 +190,7 @@ extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALT typedef int (*insn_operand_predicate_fn) PARAMS ((rtx, enum machine_mode)); typedef const char * (*insn_output_fn) PARAMS ((rtx *, rtx)); -#ifndef NO_MD_PROTOTYPES typedef rtx (*insn_gen_fn) PARAMS ((rtx, ...)); -#else -typedef rtx (*insn_gen_fn) (); -#endif struct insn_operand_data { |