From 975d393ab8c7dc0527586d34881837924cbb0026 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 3 Jan 2001 21:13:29 +0000 Subject: gencodes.c (output_predicate_decls): New function. * gencodes.c (output_predicate_decls): New function. (main): Call it. * machmode.h (GET_MODE_MASK): Arrange for it to be defined even if it is not the first time machmode.h is #included. * config/sh/sh.c (fpul_operand): Declare MODE argument. * tm.texi (PREDICATE_CODES): Document predicate declarations. * gcc.texi (Copyright): Added 2001. From-SVN: r38673 --- gcc/gencodes.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'gcc/gencodes.c') diff --git a/gcc/gencodes.c b/gcc/gencodes.c index ab96d96..2df6f30 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 Free Software Foundation, Inc. + 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ static int insn_code_number; static void gen_insn PARAMS ((rtx)); +static void output_predicate_decls PARAMS ((void)); static int print_md_constant PARAMS ((void **, void *)); static void @@ -46,6 +47,30 @@ gen_insn (insn) insn_code_number); } +/* Print out declarations for all predicates mentioned in + PREDICATE_CODES. */ + +static void +output_predicate_decls () +{ +#ifdef PREDICATE_CODES + static struct { + const char *name; + RTX_CODE codes[NUM_RTX_CODE]; + } *p, predicate[] = { + PREDICATE_CODES + {NULL, {}} + }; + + putc ('\n', stdout); + puts ("struct rtx_def;\n#include \"machmode.h\"\n"); + for (p = predicate; p->name; p++) + printf ("extern int %s PARAMS ((struct rtx_def *, enum machine_mode));\n", + p->name); + putc ('\n', stdout); +#endif +} + extern int main PARAMS ((int, char **)); int @@ -91,6 +116,8 @@ from the machine description file `md'. */\n\n"); traverse_md_constants (print_md_constant, stdout); + output_predicate_decls (); + printf ("\n#endif /* MAX_INSN_CODE */\n"); fflush (stdout); -- cgit v1.1