]>
Commit | Line | Data |
---|---|---|
c5ddd6b5 | 1 | /* Declarations for rtx-reader support for gen* routines. |
cfaf579d | 2 | Copyright (C) 2000, 2002, 2003, 2004, 2007, 2008 |
3 | Free Software Foundation, Inc. | |
c5ddd6b5 | 4 | |
f12b58b3 | 5 | This file is part of GCC. |
c5ddd6b5 | 6 | |
f12b58b3 | 7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
8c4c00c1 | 9 | Software Foundation; either version 3, or (at your option) any later |
f12b58b3 | 10 | version. |
c5ddd6b5 | 11 | |
f12b58b3 | 12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
c5ddd6b5 | 16 | |
17 | You should have received a copy of the GNU General Public License | |
8c4c00c1 | 18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
c5ddd6b5 | 20 | |
b70bd542 | 21 | #ifndef GCC_GENSUPPORT_H |
22 | #define GCC_GENSUPPORT_H | |
23 | ||
96d905e5 | 24 | struct obstack; |
25 | extern struct obstack *rtl_obstack; | |
cbf464bd | 26 | extern const char *in_fname; |
96d905e5 | 27 | |
ba08da2c | 28 | extern int init_md_reader_args_cb (int, char **, bool (*)(const char *)); |
1a97be37 | 29 | extern int init_md_reader_args (int, char **); |
1a97be37 | 30 | extern rtx read_md_rtx (int *, int *); |
c5ddd6b5 | 31 | |
b70bd542 | 32 | /* Set this to 0 to disable automatic elision of insn patterns which |
33 | can never be used in this configuration. See genconditions.c. | |
34 | Must be set before calling init_md_reader. */ | |
35 | extern int insn_elision; | |
36 | ||
b70bd542 | 37 | /* If the C test passed as the argument can be evaluated at compile |
38 | time, return its truth value; else return -1. The test must have | |
39 | appeared somewhere in the machine description when genconditions | |
40 | was run. */ | |
1a97be37 | 41 | extern int maybe_eval_c_test (const char *); |
b70bd542 | 42 | |
af908c02 | 43 | /* Add an entry to the table of conditions. Used by genconditions and |
44 | by read-rtl.c. */ | |
45 | extern void add_c_test (const char *, int); | |
46 | ||
47 | /* This structure is used internally by gensupport.c and genconditions.c. */ | |
b70bd542 | 48 | struct c_test |
49 | { | |
50 | const char *expr; | |
51 | int value; | |
52 | }; | |
53 | ||
b70bd542 | 54 | #ifdef __HASHTAB_H__ |
1a97be37 | 55 | extern hashval_t hash_c_test (const void *); |
56 | extern int cmp_c_test (const void *, const void *); | |
af908c02 | 57 | extern void traverse_c_tests (htab_trav, void *); |
b70bd542 | 58 | #endif |
59 | ||
cbf464bd | 60 | /* Predicate handling: helper functions and data structures. */ |
61 | ||
62 | struct pred_data | |
63 | { | |
64 | struct pred_data *next; /* for iterating over the set of all preds */ | |
65 | const char *name; /* predicate name */ | |
66 | bool special; /* special handling of modes? */ | |
67 | ||
68 | /* data used primarily by genpreds.c */ | |
69 | const char *c_block; /* C test block */ | |
70 | rtx exp; /* RTL test expression */ | |
71 | ||
72 | /* data used primarily by genrecog.c */ | |
73 | enum rtx_code singleton; /* if pred takes only one code, that code */ | |
c7a4c804 | 74 | int num_codes; /* number of codes accepted */ |
cbf464bd | 75 | bool allows_non_lvalue; /* if pred allows non-lvalue expressions */ |
76 | bool allows_non_const; /* if pred allows non-const expressions */ | |
77 | bool codes[NUM_RTX_CODE]; /* set of codes accepted */ | |
78 | }; | |
79 | ||
80 | extern struct pred_data *first_predicate; | |
81 | extern struct pred_data *lookup_predicate (const char *); | |
c7a4c804 | 82 | extern void add_predicate_code (struct pred_data *, enum rtx_code); |
cbf464bd | 83 | extern void add_predicate (struct pred_data *); |
84 | ||
85 | #define FOR_ALL_PREDICATES(p) for (p = first_predicate; p; p = p->next) | |
86 | ||
96128417 | 87 | /* This callback will be invoked whenever an rtl include directive is |
88 | processed. To be used for creation of the dependency file. */ | |
89 | extern void (*include_callback) (const char *); | |
90 | ||
b70bd542 | 91 | #endif /* GCC_GENSUPPORT_H */ |