OSDN Git Service

* Makefile.in (c-decl.o): Depends on defaults.h.
[pf3gnuchains/gcc-fork.git] / gcc / c-common.h
1 /* Definitions for c-common.c.
2    Copyright (C) 1987, 93, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Standard named or nameless data types of the C compiler.  */
22
23 enum c_tree_index
24 {
25     CTI_INTQI_TYPE,
26     CTI_INTHI_TYPE,
27     CTI_INTSI_TYPE,
28     CTI_INTDI_TYPE,
29     CTI_INTTI_TYPE,
30
31     CTI_UINTQI_TYPE,
32     CTI_UINTHI_TYPE,
33     CTI_UINTSI_TYPE,
34     CTI_UINTDI_TYPE,
35     CTI_UINTTI_TYPE,
36     
37     CTI_SIGNED_CHAR_TYPE,
38     CTI_UNSIGNED_CHAR_TYPE,
39     CTI_WCHAR_TYPE,
40     CTI_SIGNED_WCHAR_TYPE,
41     CTI_UNSIGNED_WCHAR_TYPE,
42     CTI_SHORT_INTEGER_TYPE,
43     CTI_SHORT_UNSIGNED_TYPE,
44     CTI_LONG_INTEGER_TYPE,
45     CTI_LONG_UNSIGNED_TYPE,
46     CTI_LONG_LONG_INTEGER_TYPE,
47     CTI_LONG_LONG_UNSIGNED_TYPE,
48     CTI_WIDEST_INT_LIT_TYPE,
49     CTI_WIDEST_UINT_LIT_TYPE,
50
51     CTI_COMPLEX_INTEGER_TYPE,
52     CTI_COMPLEX_FLOAT_TYPE,
53     CTI_COMPLEX_DOUBLE_TYPE,
54     CTI_COMPLEX_LONG_DOUBLE_TYPE,
55
56     CTI_FLOAT_TYPE,
57     CTI_DOUBLE_TYPE,
58     CTI_LONG_DOUBLE_TYPE,
59
60     CTI_CHAR_ARRAY_TYPE,
61     CTI_WCHAR_ARRAY_TYPE,
62     CTI_INT_ARRAY_TYPE,
63     CTI_STRING_TYPE,
64     CTI_CONST_STRING_TYPE,
65
66     CTI_CONST_PTR_TYPE,
67     CTI_PTRDIFF_TYPE,
68
69     CTI_BOOLEAN_TYPE,
70     CTI_BOOLEAN_TRUE,
71     CTI_BOOLEAN_FALSE,
72     CTI_DEFAULT_FUNCTION_TYPE,
73     CTI_VOID_LIST,
74
75     CTI_VOID_FTYPE,
76     CTI_VOID_FTYPE_PTR,
77     CTI_INT_FTYPE_INT,
78     CTI_PTR_FTYPE_SIZETYPE,
79     
80     CTI_MAX
81 };
82
83 extern tree c_global_trees[CTI_MAX];
84
85 #define intQI_type_node                 c_global_trees[CTI_INTQI_TYPE]
86 #define intHI_type_node                 c_global_trees[CTI_INTHI_TYPE]
87 #define intSI_type_node                 c_global_trees[CTI_INTSI_TYPE]
88 #define intDI_type_node                 c_global_trees[CTI_INTDI_TYPE]
89 #if HOST_BITS_PER_WIDE_INT >= 64
90 #define intTI_type_node                 c_global_trees[CTI_INTTI_TYPE]
91 #endif
92
93 #define unsigned_intQI_type_node        c_global_trees[CTI_UINTQI_TYPE]
94 #define unsigned_intHI_type_node        c_global_trees[CTI_UINTHI_TYPE]
95 #define unsigned_intSI_type_node        c_global_trees[CTI_UINTSI_TYPE]
96 #define unsigned_intDI_type_node        c_global_trees[CTI_UINTDI_TYPE]
97 #if HOST_BITS_PER_WIDE_INT >= 64
98 #define unsigned_intTI_type_node        c_global_trees[CTI_UINTTI_TYPE]
99 #endif
100
101 #define signed_char_type_node           c_global_trees[CTI_SIGNED_CHAR_TYPE]
102 #define unsigned_char_type_node         c_global_trees[CTI_UNSIGNED_CHAR_TYPE]
103 #define wchar_type_node                 c_global_trees[CTI_WCHAR_TYPE]
104 #define signed_wchar_type_node          c_global_trees[CTI_SIGNED_WCHAR_TYPE]
105 #define unsigned_wchar_type_node        c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
106 #define short_integer_type_node         c_global_trees[CTI_SHORT_INTEGER_TYPE]
107 #define short_unsigned_type_node        c_global_trees[CTI_SHORT_UNSIGNED_TYPE]
108 #define long_integer_type_node          c_global_trees[CTI_LONG_INTEGER_TYPE]
109 #define long_unsigned_type_node         c_global_trees[CTI_LONG_UNSIGNED_TYPE]
110 #define long_long_integer_type_node     c_global_trees[CTI_LONG_LONG_INTEGER_TYPE]
111 #define long_long_unsigned_type_node    c_global_trees[CTI_LONG_LONG_UNSIGNED_TYPE]
112 #define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
113 #define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
114
115 #define float_type_node                 c_global_trees[CTI_FLOAT_TYPE]
116 #define double_type_node                c_global_trees[CTI_DOUBLE_TYPE]
117 #define long_double_type_node           c_global_trees[CTI_LONG_DOUBLE_TYPE]
118
119 #define complex_integer_type_node       c_global_trees[CTI_COMPLEX_INTEGER_TYPE]
120 #define complex_float_type_node         c_global_trees[CTI_COMPLEX_FLOAT_TYPE]
121 #define complex_double_type_node        c_global_trees[CTI_COMPLEX_DOUBLE_TYPE]
122 #define complex_long_double_type_node   c_global_trees[CTI_COMPLEX_LONG_DOUBLE_TYPE]
123
124 #define boolean_type_node               c_global_trees[CTI_BOOLEAN_TYPE]
125 #define boolean_true_node               c_global_trees[CTI_BOOLEAN_TRUE]
126 #define boolean_false_node              c_global_trees[CTI_BOOLEAN_FALSE]
127
128 #define const_ptr_type_node             c_global_trees[CTI_CONST_PTR_TYPE]
129 #define ptrdiff_type_node               c_global_trees[CTI_PTRDIFF_TYPE]
130
131 #define char_array_type_node            c_global_trees[CTI_CHAR_ARRAY_TYPE]
132 #define wchar_array_type_node           c_global_trees[CTI_WCHAR_ARRAY_TYPE]
133 #define int_array_type_node             c_global_trees[CTI_INT_ARRAY_TYPE]
134 #define string_type_node                c_global_trees[CTI_STRING_TYPE]
135 #define const_string_type_node          c_global_trees[CTI_CONST_STRING_TYPE]
136
137 #define default_function_type           c_global_trees[CTI_DEFAULT_FUNCTION_TYPE]
138 #define void_list_node                  c_global_trees[CTI_VOID_LIST]
139 #define void_ftype                      c_global_trees[CTI_VOID_FTYPE]
140 #define void_ftype_ptr                  c_global_trees[CTI_VOID_FTYPE_PTR]
141 #define int_ftype_int                   c_global_trees[CTI_INT_FTYPE_INT]
142 #define ptr_ftype_sizetype              c_global_trees[CTI_PTR_FTYPE_SIZETYPE]
143
144 extern void declare_function_name               PROTO((void));
145 extern void decl_attributes                     PROTO((tree, tree, tree));
146 extern void init_function_format_info           PROTO((void));
147 extern void check_function_format               PROTO((tree, tree, tree));
148 extern void c_apply_type_quals_to_decl          PROTO((int, tree));
149 extern int c_get_alias_set                      PROTO((tree));
150 /* Print an error message for invalid operands to arith operation CODE.
151    NOP_EXPR is used as a special case (see truthvalue_conversion).  */
152 extern void binary_op_error                     PROTO((enum tree_code));
153 extern void c_expand_expr_stmt                  PROTO((tree));
154 extern void c_expand_start_cond                 PROTO((tree, int, int));
155 extern void c_expand_start_else                 PROTO((void));
156 extern void c_expand_end_cond                   PROTO((void));
157 /* Validate the expression after `case' and apply default promotions.  */
158 extern tree check_case_value                    PROTO((tree));
159 /* Concatenate a list of STRING_CST nodes into one STRING_CST.  */
160 extern tree combine_strings                     PROTO((tree));
161 extern void constant_expression_warning         PROTO((tree));
162 extern tree convert_and_check                   PROTO((tree, tree));
163 extern void overflow_warning                    PROTO((tree));
164 extern void unsigned_conversion_warning         PROTO((tree, tree));
165 /* Read the rest of the current #-directive line.  */
166 #if USE_CPPLIB
167 extern char *get_directive_line                 PROTO((void));
168 #define GET_DIRECTIVE_LINE() get_directive_line ()
169 #else
170 extern char *get_directive_line                 PROTO((FILE *));
171 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
172 #endif
173
174 /* Subroutine of build_binary_op, used for comparison operations.
175    See if the operands have both been converted from subword integer types
176    and, if so, perhaps change them both back to their original type.  */
177 extern tree shorten_compare                     PROTO((tree *, tree *, tree *, enum tree_code *));
178 /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
179    or validate its data type for an `if' or `while' statement or ?..: exp. */
180 extern tree truthvalue_conversion               PROTO((tree));
181 extern tree type_for_mode                       PROTO((enum machine_mode, int));
182 extern tree type_for_size                       PROTO((unsigned, int));
183
184 /* Declare a predefined function.  Return the declaration.  This function is
185    provided by each language frontend.  */
186 extern tree builtin_function                    PROTO((const char *, tree, enum built_in_function, const char *));
187
188 /* Build tree nodes and builtin functions common to both C and C++ language
189    frontends.  */
190 extern void c_common_nodes_and_builtins         PROTO((int, int, int));
191
192 extern tree build_va_arg                        PROTO((tree, tree));
193
194 extern tree initializer_constant_valid_p        PROTO((tree, tree));