aboutsummaryrefslogtreecommitdiff
path: root/gcc/gencodes.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-01-03 21:13:29 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-01-03 21:13:29 +0000
commit975d393ab8c7dc0527586d34881837924cbb0026 (patch)
tree4db5e76c3dc4ba9bc9acb3825530f9e397ea33bf /gcc/gencodes.c
parent03dc032560d43abc8a9867472fdb22cbf0c6b9c7 (diff)
downloadgcc-975d393ab8c7dc0527586d34881837924cbb0026.zip
gcc-975d393ab8c7dc0527586d34881837924cbb0026.tar.gz
gcc-975d393ab8c7dc0527586d34881837924cbb0026.tar.bz2
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
Diffstat (limited to 'gcc/gencodes.c')
-rw-r--r--gcc/gencodes.c29
1 files changed, 28 insertions, 1 deletions
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);