gensupport.h revision 169689
1251212Spfg/* Declarations for rtx-reader support for gen* routines. 2122180Skan Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 3132718Skan 4122180SkanThis file is part of GCC. 5132718Skan 6122180SkanGCC is free software; you can redistribute it and/or modify it under 7122180Skanthe terms of the GNU General Public License as published by the Free 8122180SkanSoftware Foundation; either version 2, or (at your option) any later 9122180Skanversion. 10132718Skan 11122180SkanGCC is distributed in the hope that it will be useful, but WITHOUT ANY 12122180SkanWARRANTY; without even the implied warranty of MERCHANTABILITY or 13122180SkanFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14122180Skanfor more details. 15122180Skan 16132718SkanYou should have received a copy of the GNU General Public License 17169689Skanalong with GCC; see the file COPYING. If not, write to the Free 18169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 19122180Skan02110-1301, USA. */ 20122180Skan 21122180Skan#ifndef GCC_GENSUPPORT_H 22122180Skan#define GCC_GENSUPPORT_H 23122180Skan 24122180Skanstruct obstack; 25122180Skanextern struct obstack *rtl_obstack; 26122180Skanextern const char *in_fname; 27122180Skan 28169689Skanextern int init_md_reader_args_cb (int, char **, bool (*)(const char *)); 29122180Skanextern int init_md_reader_args (int, char **); 30122180Skanextern rtx read_md_rtx (int *, int *); 31122180Skan 32122180Skanextern void message_with_line (int, const char *, ...) 33251212Spfg ATTRIBUTE_PRINTF_2; 34251212Spfg 35251212Spfg/* Set this to 0 to disable automatic elision of insn patterns which 36251212Spfg can never be used in this configuration. See genconditions.c. 37251212Spfg Must be set before calling init_md_reader. */ 38122180Skanextern int insn_elision; 39122180Skan 40122180Skan/* If the C test passed as the argument can be evaluated at compile 41122180Skan time, return its truth value; else return -1. The test must have 42122180Skan appeared somewhere in the machine description when genconditions 43122180Skan was run. */ 44122180Skanextern int maybe_eval_c_test (const char *); 45122180Skan 46122180Skan/* Add an entry to the table of conditions. Used by genconditions and 47122180Skan by read-rtl.c. */ 48122180Skanextern void add_c_test (const char *, int); 49122180Skan 50122180Skan/* This structure is used internally by gensupport.c and genconditions.c. */ 51169689Skanstruct c_test 52122180Skan{ 53122180Skan const char *expr; 54122180Skan int value; 55122180Skan}; 56122180Skan 57169689Skan#ifdef __HASHTAB_H__ 58122180Skanextern hashval_t hash_c_test (const void *); 59122180Skanextern int cmp_c_test (const void *, const void *); 60122180Skanextern void traverse_c_tests (htab_trav, void *); 61122180Skan#endif 62122180Skan 63169689Skanextern int n_comma_elts (const char *); 64122180Skanextern const char *scan_comma_elt (const char **); 65122180Skan 66122180Skan/* Predicate handling: helper functions and data structures. */ 67122180Skan 68122180Skanstruct pred_data 69169689Skan{ 70122180Skan struct pred_data *next; /* for iterating over the set of all preds */ 71122180Skan const char *name; /* predicate name */ 72122180Skan bool special; /* special handling of modes? */ 73122180Skan 74122180Skan /* data used primarily by genpreds.c */ 75169689Skan const char *c_block; /* C test block */ 76122180Skan rtx exp; /* RTL test expression */ 77122180Skan 78122180Skan /* data used primarily by genrecog.c */ 79122180Skan enum rtx_code singleton; /* if pred takes only one code, that code */ 80122180Skan bool allows_non_lvalue; /* if pred allows non-lvalue expressions */ 81169689Skan bool allows_non_const; /* if pred allows non-const expressions */ 82122180Skan bool codes[NUM_RTX_CODE]; /* set of codes accepted */ 83122180Skan}; 84122180Skan 85122180Skanextern struct pred_data *first_predicate; 86122180Skanextern struct pred_data *lookup_predicate (const char *); 87169689Skanextern void add_predicate (struct pred_data *); 88122180Skan 89122180Skan#define FOR_ALL_PREDICATES(p) for (p = first_predicate; p; p = p->next) 90122180Skan 91122180Skan/* This callback will be invoked whenever an rtl include directive is 92122180Skan processed. To be used for creation of the dependency file. */ 93169689Skanextern void (*include_callback) (const char *); 94122180Skan 95122180Skan#endif /* GCC_GENSUPPORT_H */ 96122180Skan