Commit 706b0f60 by Zack Weinberg Committed by Zack Weinberg

recog.h: Remove NO_MD_PROTOTYPES ifdefs.

 	* 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.

From-SVN: r31801
parent c05d48e6
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> 2000-02-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fixinc/Makefile.in (HDR): Add machname.h. * fixinc/Makefile.in (HDR): Add machname.h.
......
...@@ -366,7 +366,6 @@ do { \ ...@@ -366,7 +366,6 @@ do { \
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
} while (0) } while (0)
#define NO_MD_PROTOTYPES
/* Output assembler code for a block containing the constant parts /* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts. of a trampoline, leaving space for the variable parts.
......
...@@ -3782,24 +3782,14 @@ GCC. If @samp{USE_PROTOTYPES} is not defined, it will be ...@@ -3782,24 +3782,14 @@ GCC. If @samp{USE_PROTOTYPES} is not defined, it will be
determined automatically whether your compiler supports determined automatically whether your compiler supports
prototypes by checking if @samp{__STDC__} is defined. 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 @findex MD_CALL_PROTOTYPES
@item MD_CALL_PROTOTYPES @item MD_CALL_PROTOTYPES
Define this if you wish to generate prototypes for the Define this if you wish to generate prototypes for the @code{gen_call}
@code{gen_call} or @code{gen_call_value} functions generated from or @code{gen_call_value} functions generated from the machine
the machine description file. If @samp{USE_PROTOTYPES} is description file. If @samp{USE_PROTOTYPES} is defined to be 0, or the
defined to be 0, or the host compiler does not support host compiler does not support prototypes, this macro has no effect. As
prototypes, or @samp{NO_MD_PROTOTYPES} is defined, this macro has soon as all of the machine descriptions are modified to have the
no effect. As soon as all of the machine descriptions are appropriate number of arguments, this macro will be removed.
modified to have the appropriate number of arguments, this macro
will be removed.
@findex PATH_SEPARATOR @findex PATH_SEPARATOR
@item PATH_SEPARATOR @item PATH_SEPARATOR
......
...@@ -39,48 +39,63 @@ static struct obstack call_obstack, normal_obstack; ...@@ -39,48 +39,63 @@ static struct obstack call_obstack, normal_obstack;
/* Max size of names encountered. */ /* Max size of names encountered. */
static int max_id_len; static int max_id_len;
static int num_operands PARAMS ((rtx)); /* Max operand encountered in a scan over some insn. */
static void gen_proto PARAMS ((rtx)); static int max_opno;
static void gen_nonproto PARAMS ((rtx));
static void gen_insn PARAMS ((rtx));
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. */ /* Count the number of match_operand's found. */
static int static void
num_operands (x) max_operand_1 (x)
rtx x; rtx x;
{ {
int count = 0; register RTX_CODE code;
int i, j; register int i;
enum rtx_code code = GET_CODE (x); register int len;
const char *format_ptr = GET_RTX_FORMAT (code); register const char *fmt;
if (code == MATCH_OPERAND) if (x == 0)
return 1; return;
if (code == MATCH_OPERATOR || code == MATCH_PARALLEL) code = GET_CODE (x);
count++;
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': int j;
case 'e': for (j = 0; j < XVECLEN (x, i); j++)
count += num_operands (XEXP (x, i)); max_operand_1 (XVECEXP (x, i, j));
break;
case 'E':
if (XVEC (x, i) != NULL)
for (j = 0; j < XVECLEN (x, i); j++)
count += num_operands (XVECEXP (x, i, j));
break;
} }
} }
}
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. */ /* Print out prototype information for a function. */
...@@ -251,7 +266,6 @@ from the machine description file `md'. */\n\n"); ...@@ -251,7 +266,6 @@ from the machine description file `md'. */\n\n");
obstack_grow (&normal_obstack, &dummy, sizeof (rtx)); obstack_grow (&normal_obstack, &dummy, sizeof (rtx));
normal_insns = (rtx *) obstack_finish (&normal_obstack); normal_insns = (rtx *) obstack_finish (&normal_obstack);
printf ("\n#ifndef NO_MD_PROTOTYPES\n");
for (insn_ptr = normal_insns; *insn_ptr; insn_ptr++) for (insn_ptr = normal_insns; *insn_ptr; insn_ptr++)
gen_proto (*insn_ptr); gen_proto (*insn_ptr);
...@@ -264,14 +278,6 @@ from the machine description file `md'. */\n\n"); ...@@ -264,14 +278,6 @@ from the machine description file `md'. */\n\n");
gen_nonproto (*insn_ptr); gen_nonproto (*insn_ptr);
printf ("#endif /* !MD_CALL_PROTOTYPES */\n"); 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); fflush (stdout);
return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
......
...@@ -221,7 +221,6 @@ output_prologue () ...@@ -221,7 +221,6 @@ output_prologue ()
printf ("/* Generated automatically by the program `genoutput'\n\ printf ("/* Generated automatically by the program `genoutput'\n\
from the machine description file `md'. */\n\n"); from the machine description file `md'. */\n\n");
printf ("#define NO_MD_PROTOTYPES\n");
printf ("#include \"config.h\"\n"); printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n"); printf ("#include \"system.h\"\n");
printf ("#include \"flags.h\"\n"); printf ("#include \"flags.h\"\n");
...@@ -369,7 +368,7 @@ output_insn_data () ...@@ -369,7 +368,7 @@ output_insn_data ()
} }
if (d->name && d->name[0] != '*') if (d->name && d->name[0] != '*')
printf (" gen_%s,\n", d->name); printf (" (insn_gen_fn) gen_%s,\n", d->name);
else else
printf (" 0,\n"); printf (" 0,\n");
......
...@@ -190,11 +190,7 @@ extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALT ...@@ -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 int (*insn_operand_predicate_fn) PARAMS ((rtx, enum machine_mode));
typedef const char * (*insn_output_fn) PARAMS ((rtx *, rtx)); typedef const char * (*insn_output_fn) PARAMS ((rtx *, rtx));
#ifndef NO_MD_PROTOTYPES
typedef rtx (*insn_gen_fn) PARAMS ((rtx, ...)); typedef rtx (*insn_gen_fn) PARAMS ((rtx, ...));
#else
typedef rtx (*insn_gen_fn) ();
#endif
struct insn_operand_data struct insn_operand_data
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment