* timevar.def (TV_CPROP1, TV_CPROP2, TV_PRE, TV_HOIST, TV_LSM):
[official-gcc.git] / gcc / genpreds.c
blobb5601208df8b69aa7baa5bf832319e0baca8faa1
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, 2003 Free Software Foundation, Inc.
7 This file is part of GCC.
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.
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.
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. */
24 #include "bconfig.h"
25 #include "system.h"
26 #include "coretypes.h"
27 #include "tm.h"
28 #include "rtl.h"
30 static void
31 output_predicate_decls (void)
33 #ifdef PREDICATE_CODES
34 static const struct {
35 const char *const name;
36 const RTX_CODE codes[NUM_RTX_CODE];
37 } predicate[] = {
38 PREDICATE_CODES
40 size_t i;
42 puts ("#ifdef RTX_CODE\n");
43 for (i = 0; i < ARRAY_SIZE (predicate); i++)
44 printf ("extern int %s (rtx, enum machine_mode);\n",
45 predicate[i].name);
46 puts ("\n#endif /* RTX_CODE */\n");
47 #endif
50 int
51 main (void)
53 puts ("/* Generated automatically by the program `genpreds'. */\n");
54 puts ("#ifndef GCC_TM_PREDS_H");
55 puts ("#define GCC_TM_PREDS_H\n");
57 output_predicate_decls ();
59 puts ("#endif /* GCC_TM_PREDS_H */");
61 if (ferror (stdout) || fflush (stdout) || fclose (stdout))
62 return FATAL_EXIT_CODE;
64 return SUCCESS_EXIT_CODE;