diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-03 21:13:29 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-03 21:13:29 +0000 |
commit | 1d97a500067aac5a22615a5908a02d3e7a7c915e (patch) | |
tree | 4db5e76c3dc4ba9bc9acb3825530f9e397ea33bf /gcc/gencodes.c | |
parent | 76a6e674dcc99316839e64af6262dee504fd1b54 (diff) | |
download | gcc-1d97a500067aac5a22615a5908a02d3e7a7c915e.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38673 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gencodes.c')
-rw-r--r-- | gcc/gencodes.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/gencodes.c b/gcc/gencodes.c index ab96d9625cf..2df6f302497 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); |