]> gcc.gnu.org Git - gcc.git/blame - gcc/genpreds.c
Makefile.in (HOST_CFLAGS): Take out -DGENERATOR_FILE.
[gcc.git] / gcc / genpreds.c
CommitLineData
1b0c37d7
ZW
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
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14GNU CC is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
21the Free Software Foundation, 59 Temple Place - Suite 330,
22Boston, MA 02111-1307, USA. */
23
24#include "hconfig.h"
25#include "system.h"
26
27#define NO_GENRTL_H
28#include "rtl.h"
29
30static void output_predicate_decls PARAMS ((void));
31extern int main PARAMS ((void));
32
33static void
34output_predicate_decls ()
35{
36#ifdef PREDICATE_CODES
37 static struct {
38 const char *name;
39 RTX_CODE codes[NUM_RTX_CODE];
40 } predicate[] = {
41 PREDICATE_CODES
42 };
43 size_t i;
44
45 puts ("#ifdef RTX_CODE\n");
46 for (i = 0; i < sizeof predicate / sizeof *predicate; i++)
47 printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n",
48 predicate[i].name);
49 puts ("\n#endif /* RTX_CODE */\n");
50#endif
51}
52
53int
54main ()
55{
56 puts ("/* Generated automatically by the program `genpreds'. */\n");
57 puts ("#ifndef GCC_TM_PREDS_H");
58 puts ("#define GCC_TM_PREDS_H\n");
59
60 output_predicate_decls ();
61
62 puts ("#endif /* GCC_TM_PREDS_H */");
63
64 if (ferror (stdout) || fflush (stdout) || fclose (stdout))
65 return FATAL_EXIT_CODE;
66
67 return SUCCESS_EXIT_CODE;
68}
This page took 0.029872 seconds and 5 git commands to generate.