* doc/install.texi: Fix a typo.
[official-gcc.git] / gcc / gensupport.h
blob71557175266b8d6f195765d01af7a4d5b157bda7
1 /* Declarations for rtx-reader support for gen* routines.
2 Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA. */
21 #ifndef GCC_GENSUPPORT_H
22 #define GCC_GENSUPPORT_H
24 struct obstack;
25 extern struct obstack *rtl_obstack;
26 extern const char *in_fname;
28 extern int init_md_reader_args_cb (int, char **, bool (*)(const char *));
29 extern int init_md_reader_args (int, char **);
30 extern rtx read_md_rtx (int *, int *);
32 extern void message_with_line (int, const char *, ...)
33 ATTRIBUTE_PRINTF_2;
35 /* Set this to 0 to disable automatic elision of insn patterns which
36 can never be used in this configuration. See genconditions.c.
37 Must be set before calling init_md_reader. */
38 extern int insn_elision;
40 /* If this is 1, the insn elision table doesn't even exist yet;
41 maybe_eval_c_test will always return -1. This is distinct from
42 insn_elision because genflags and gencodes need to see all the
43 patterns, but treat elided patterns differently. */
44 extern const int insn_elision_unavailable;
46 /* If the C test passed as the argument can be evaluated at compile
47 time, return its truth value; else return -1. The test must have
48 appeared somewhere in the machine description when genconditions
49 was run. */
50 extern int maybe_eval_c_test (const char *);
52 /* This table should not be accessed directly; use maybe_eval_c_test. */
53 struct c_test
55 const char *expr;
56 int value;
59 extern const struct c_test insn_conditions[];
60 extern const size_t n_insn_conditions;
62 #ifdef __HASHTAB_H__
63 extern hashval_t hash_c_test (const void *);
64 extern int cmp_c_test (const void *, const void *);
65 #endif
67 extern int n_comma_elts (const char *);
68 extern const char *scan_comma_elt (const char **);
70 /* Predicate handling: helper functions and data structures. */
72 struct pred_data
74 struct pred_data *next; /* for iterating over the set of all preds */
75 const char *name; /* predicate name */
76 bool special; /* special handling of modes? */
78 /* data used primarily by genpreds.c */
79 const char *c_block; /* C test block */
80 rtx exp; /* RTL test expression */
82 /* data used primarily by genrecog.c */
83 enum rtx_code singleton; /* if pred takes only one code, that code */
84 bool allows_non_lvalue; /* if pred allows non-lvalue expressions */
85 bool allows_non_const; /* if pred allows non-const expressions */
86 bool codes[NUM_RTX_CODE]; /* set of codes accepted */
89 extern struct pred_data *first_predicate;
90 extern struct pred_data *lookup_predicate (const char *);
91 extern void add_predicate (struct pred_data *);
93 #define FOR_ALL_PREDICATES(p) for (p = first_predicate; p; p = p->next)
95 /* This callback will be invoked whenever an rtl include directive is
96 processed. To be used for creation of the dependency file. */
97 extern void (*include_callback) (const char *);
99 #endif /* GCC_GENSUPPORT_H */