OSDN Git Service

* config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / genpreds.c
1 /* Generate from machine description:
2    - some macros CODE_FOR_... giving the insn_code_number value
3    for each of the defined standard insn names.
4    Copyright (C) 1987, 1991, 1995, 1998,
5    1999, 2000, 2001 Free Software Foundation, Inc.
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.  */
23
24 #include "bconfig.h"
25 #include "system.h"
26 #include "coretypes.h"
27 #include "tm.h"
28
29 #define NO_GENRTL_H
30 #include "rtl.h"
31
32 static void output_predicate_decls PARAMS ((void));
33 extern int main PARAMS ((void));
34
35 static void
36 output_predicate_decls ()
37 {
38 #ifdef PREDICATE_CODES
39   static const struct {
40     const char *const name;
41     const RTX_CODE codes[NUM_RTX_CODE];
42   } predicate[] = {
43     PREDICATE_CODES
44   };
45   size_t i;
46
47   puts ("#ifdef RTX_CODE\n");
48   for (i = 0; i < ARRAY_SIZE (predicate); i++)
49     printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n",
50             predicate[i].name);
51   puts ("\n#endif /* RTX_CODE */\n");
52 #endif
53 }
54
55 int
56 main ()
57 {
58   puts ("/* Generated automatically by the program `genpreds'.  */\n");
59   puts ("#ifndef GCC_TM_PREDS_H");
60   puts ("#define GCC_TM_PREDS_H\n");
61
62   output_predicate_decls ();
63
64   puts ("#endif /* GCC_TM_PREDS_H */");
65
66   if (ferror (stdout) || fflush (stdout) || fclose (stdout))
67     return FATAL_EXIT_CODE;
68
69   return SUCCESS_EXIT_CODE;
70 }