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