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>
* fixinc/Makefile.in (HDR): Add machname.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.
......
......@@ -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
......
......@@ -39,48 +39,63 @@ static struct obstack call_obstack, normal_obstack;
/* Max size of names encountered. */
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_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 (x == 0)
return;
if (code == MATCH_OPERAND)
return 1;
code = GET_CODE (x);
if (code == MATCH_OPERATOR || code == MATCH_PARALLEL)
count++;
if (code == MATCH_OPERAND || code == MATCH_OPERATOR
|| code == MATCH_PARALLEL)
max_opno = MAX (max_opno, XINT (x, 0));
for (i = 0; i < GET_RTX_LENGTH (code); i++)
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)
int j;
for (j = 0; j < XVECLEN (x, i); j++)
count += num_operands (XVECEXP (x, i, j));
break;
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);
......
......@@ -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");
......
......@@ -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
{
......
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