comparison gcc/c-common.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents 855418dad1a3
children 326d9e06c2e3 b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
1 /* Definitions for c-common.c. 1 /* Definitions for c-common.c.
2 Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998, 2 Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998,
3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
28 28
29 /* Usage of TREE_LANG_FLAG_?: 29 /* Usage of TREE_LANG_FLAG_?:
30 0: TREE_NEGATED_INT (in INTEGER_CST). 30 0: TREE_NEGATED_INT (in INTEGER_CST).
31 IDENTIFIER_MARKED (used by search routines). 31 IDENTIFIER_MARKED (used by search routines).
32 DECL_PRETTY_FUNCTION_P (in VAR_DECL) 32 DECL_PRETTY_FUNCTION_P (in VAR_DECL)
33 C_MAYBE_CONST_EXPR_INT_OPERANDS (in C_MAYBE_CONST_EXPR, for C)
33 1: C_DECLARED_LABEL_FLAG (in LABEL_DECL) 34 1: C_DECLARED_LABEL_FLAG (in LABEL_DECL)
34 STATEMENT_LIST_STMT_EXPR (in STATEMENT_LIST) 35 STATEMENT_LIST_STMT_EXPR (in STATEMENT_LIST)
36 C_MAYBE_CONST_EXPR_NON_CONST (in C_MAYBE_CONST_EXPR, for C)
35 2: unused 37 2: unused
36 3: STATEMENT_LIST_HAS_LABEL (in STATEMENT_LIST) 38 3: STATEMENT_LIST_HAS_LABEL (in STATEMENT_LIST)
37 4: unused 39 4: unused
38 */ 40 */
39 41
58 /* C++ */ 60 /* C++ */
59 RID_FRIEND, RID_VIRTUAL, RID_EXPLICIT, RID_EXPORT, RID_MUTABLE, 61 RID_FRIEND, RID_VIRTUAL, RID_EXPLICIT, RID_EXPORT, RID_MUTABLE,
60 62
61 /* ObjC */ 63 /* ObjC */
62 RID_IN, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF, RID_ONEWAY, 64 RID_IN, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF, RID_ONEWAY,
65
66 /* C (reserved and imaginary types not implemented, so any use is a
67 syntax error) */
68 RID_IMAGINARY,
63 69
64 /* C */ 70 /* C */
65 RID_INT, RID_CHAR, RID_FLOAT, RID_DOUBLE, RID_VOID, 71 RID_INT, RID_CHAR, RID_FLOAT, RID_DOUBLE, RID_VOID,
66 RID_ENUM, RID_STRUCT, RID_UNION, RID_IF, RID_ELSE, 72 RID_ENUM, RID_STRUCT, RID_UNION, RID_IF, RID_ELSE,
67 RID_WHILE, RID_DO, RID_FOR, RID_SWITCH, RID_CASE, 73 RID_WHILE, RID_DO, RID_FOR, RID_SWITCH, RID_CASE,
102 RID_HAS_TRIVIAL_DESTRUCTOR, RID_HAS_VIRTUAL_DESTRUCTOR, 108 RID_HAS_TRIVIAL_DESTRUCTOR, RID_HAS_VIRTUAL_DESTRUCTOR,
103 RID_IS_ABSTRACT, RID_IS_BASE_OF, 109 RID_IS_ABSTRACT, RID_IS_BASE_OF,
104 RID_IS_CONVERTIBLE_TO, RID_IS_CLASS, 110 RID_IS_CONVERTIBLE_TO, RID_IS_CLASS,
105 RID_IS_EMPTY, RID_IS_ENUM, 111 RID_IS_EMPTY, RID_IS_ENUM,
106 RID_IS_POD, RID_IS_POLYMORPHIC, 112 RID_IS_POD, RID_IS_POLYMORPHIC,
113 RID_IS_STD_LAYOUT, RID_IS_TRIVIAL,
107 RID_IS_UNION, 114 RID_IS_UNION,
108 115
109 /* C++0x */ 116 /* C++0x */
110 RID_STATIC_ASSERT, RID_DECLTYPE, 117 RID_STATIC_ASSERT, RID_CONSTEXPR, RID_DECLTYPE,
111 118
112 /* Objective-C */ 119 /* Objective-C */
113 RID_AT_ENCODE, RID_AT_END, 120 RID_AT_ENCODE, RID_AT_END,
114 RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS, 121 RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS,
115 RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC, 122 RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC,
117 RID_AT_THROW, RID_AT_TRY, RID_AT_CATCH, 124 RID_AT_THROW, RID_AT_TRY, RID_AT_CATCH,
118 RID_AT_FINALLY, RID_AT_SYNCHRONIZED, 125 RID_AT_FINALLY, RID_AT_SYNCHRONIZED,
119 RID_AT_INTERFACE, 126 RID_AT_INTERFACE,
120 RID_AT_IMPLEMENTATION, 127 RID_AT_IMPLEMENTATION,
121 128
129 /* Named address support, mapping the keyword to a particular named address
130 number. Named address space 0 is reserved for the generic address. If
131 there are more than 254 named addresses, the addr_space_t type will need
132 to be grown from an unsigned char to unsigned short. */
133 RID_ADDR_SPACE_0, /* generic address */
134 RID_ADDR_SPACE_1,
135 RID_ADDR_SPACE_2,
136 RID_ADDR_SPACE_3,
137 RID_ADDR_SPACE_4,
138 RID_ADDR_SPACE_5,
139 RID_ADDR_SPACE_6,
140 RID_ADDR_SPACE_7,
141 RID_ADDR_SPACE_8,
142 RID_ADDR_SPACE_9,
143 RID_ADDR_SPACE_10,
144 RID_ADDR_SPACE_11,
145 RID_ADDR_SPACE_12,
146 RID_ADDR_SPACE_13,
147 RID_ADDR_SPACE_14,
148 RID_ADDR_SPACE_15,
149
150 RID_FIRST_ADDR_SPACE = RID_ADDR_SPACE_0,
151 RID_LAST_ADDR_SPACE = RID_ADDR_SPACE_15,
152
122 RID_MAX, 153 RID_MAX,
123 154
124 RID_FIRST_MODIFIER = RID_STATIC, 155 RID_FIRST_MODIFIER = RID_STATIC,
125 RID_LAST_MODIFIER = RID_ONEWAY, 156 RID_LAST_MODIFIER = RID_ONEWAY,
126 157
149 enum c_tree_index 180 enum c_tree_index
150 { 181 {
151 CTI_CHAR16_TYPE, 182 CTI_CHAR16_TYPE,
152 CTI_CHAR32_TYPE, 183 CTI_CHAR32_TYPE,
153 CTI_WCHAR_TYPE, 184 CTI_WCHAR_TYPE,
154 CTI_SIGNED_WCHAR_TYPE, 185 CTI_UNDERLYING_WCHAR_TYPE,
155 CTI_UNSIGNED_WCHAR_TYPE,
156 CTI_WINT_TYPE, 186 CTI_WINT_TYPE,
157 CTI_SIGNED_SIZE_TYPE, /* For format checking only. */ 187 CTI_SIGNED_SIZE_TYPE, /* For format checking only. */
158 CTI_UNSIGNED_PTRDIFF_TYPE, /* For format checking only. */ 188 CTI_UNSIGNED_PTRDIFF_TYPE, /* For format checking only. */
159 CTI_INTMAX_TYPE, 189 CTI_INTMAX_TYPE,
160 CTI_UINTMAX_TYPE, 190 CTI_UINTMAX_TYPE,
161 CTI_WIDEST_INT_LIT_TYPE, 191 CTI_WIDEST_INT_LIT_TYPE,
162 CTI_WIDEST_UINT_LIT_TYPE, 192 CTI_WIDEST_UINT_LIT_TYPE,
163 193
194 /* Types for <stdint.h>, that may not be defined on all
195 targets. */
196 CTI_SIG_ATOMIC_TYPE,
197 CTI_INT8_TYPE,
198 CTI_INT16_TYPE,
199 CTI_INT32_TYPE,
200 CTI_INT64_TYPE,
201 CTI_UINT8_TYPE,
202 CTI_UINT16_TYPE,
203 CTI_UINT32_TYPE,
204 CTI_UINT64_TYPE,
205 CTI_INT_LEAST8_TYPE,
206 CTI_INT_LEAST16_TYPE,
207 CTI_INT_LEAST32_TYPE,
208 CTI_INT_LEAST64_TYPE,
209 CTI_UINT_LEAST8_TYPE,
210 CTI_UINT_LEAST16_TYPE,
211 CTI_UINT_LEAST32_TYPE,
212 CTI_UINT_LEAST64_TYPE,
213 CTI_INT_FAST8_TYPE,
214 CTI_INT_FAST16_TYPE,
215 CTI_INT_FAST32_TYPE,
216 CTI_INT_FAST64_TYPE,
217 CTI_UINT_FAST8_TYPE,
218 CTI_UINT_FAST16_TYPE,
219 CTI_UINT_FAST32_TYPE,
220 CTI_UINT_FAST64_TYPE,
221 CTI_INTPTR_TYPE,
222 CTI_UINTPTR_TYPE,
223
164 CTI_CHAR_ARRAY_TYPE, 224 CTI_CHAR_ARRAY_TYPE,
165 CTI_CHAR16_ARRAY_TYPE, 225 CTI_CHAR16_ARRAY_TYPE,
166 CTI_CHAR32_ARRAY_TYPE, 226 CTI_CHAR32_ARRAY_TYPE,
167 CTI_WCHAR_ARRAY_TYPE, 227 CTI_WCHAR_ARRAY_TYPE,
168 CTI_INT_ARRAY_TYPE, 228 CTI_INT_ARRAY_TYPE,
196 #define C_SET_RID_CODE(id, code) \ 256 #define C_SET_RID_CODE(id, code) \
197 (((struct c_common_identifier *) (id))->node.rid_code = (unsigned char) code) 257 (((struct c_common_identifier *) (id))->node.rid_code = (unsigned char) code)
198 258
199 /* Identifier part common to the C front ends. Inherits from 259 /* Identifier part common to the C front ends. Inherits from
200 tree_identifier, despite appearances. */ 260 tree_identifier, despite appearances. */
201 struct c_common_identifier GTY(()) 261 struct GTY(()) c_common_identifier {
202 {
203 struct tree_common common; 262 struct tree_common common;
204 struct cpp_hashnode node; 263 struct cpp_hashnode node;
205 }; 264 };
206 265
207 /* An entry in the reserved keyword table. */ 266 /* An entry in the reserved keyword table. */
226 #define D_ASM 0x040 /* Disabled by -fno-asm. */ 285 #define D_ASM 0x040 /* Disabled by -fno-asm. */
227 #define D_OBJC 0x080 /* In Objective C and neither C nor C++. */ 286 #define D_OBJC 0x080 /* In Objective C and neither C nor C++. */
228 #define D_CXX_OBJC 0x100 /* In Objective C, and C++, but not C. */ 287 #define D_CXX_OBJC 0x100 /* In Objective C, and C++, but not C. */
229 #define D_CXXWARN 0x200 /* In C warn with -Wcxx-compat. */ 288 #define D_CXXWARN 0x200 /* In C warn with -Wcxx-compat. */
230 289
290 /* Macro for backends to define named address keywords. */
291 #define ADDR_SPACE_KEYWORD(STRING, VALUE) \
292 { STRING, RID_FIRST_ADDR_SPACE + (VALUE), D_CONLY | D_EXT }
293
231 /* The reserved keyword table. */ 294 /* The reserved keyword table. */
232 extern const struct c_common_resword c_common_reswords[]; 295 extern const struct c_common_resword c_common_reswords[];
233 296
234 /* The number of items in the reserved keyword table. */ 297 /* The number of items in the reserved keyword table. */
235 extern const unsigned int num_c_common_reswords; 298 extern const unsigned int num_c_common_reswords;
236 299
237 #define char16_type_node c_global_trees[CTI_CHAR16_TYPE] 300 #define char16_type_node c_global_trees[CTI_CHAR16_TYPE]
238 #define char32_type_node c_global_trees[CTI_CHAR32_TYPE] 301 #define char32_type_node c_global_trees[CTI_CHAR32_TYPE]
239 #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE] 302 #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
240 #define signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE] 303 #define underlying_wchar_type_node c_global_trees[CTI_UNDERLYING_WCHAR_TYPE]
241 #define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
242 #define wint_type_node c_global_trees[CTI_WINT_TYPE] 304 #define wint_type_node c_global_trees[CTI_WINT_TYPE]
243 #define signed_size_type_node c_global_trees[CTI_SIGNED_SIZE_TYPE] 305 #define signed_size_type_node c_global_trees[CTI_SIGNED_SIZE_TYPE]
244 #define unsigned_ptrdiff_type_node c_global_trees[CTI_UNSIGNED_PTRDIFF_TYPE] 306 #define unsigned_ptrdiff_type_node c_global_trees[CTI_UNSIGNED_PTRDIFF_TYPE]
245 #define intmax_type_node c_global_trees[CTI_INTMAX_TYPE] 307 #define intmax_type_node c_global_trees[CTI_INTMAX_TYPE]
246 #define uintmax_type_node c_global_trees[CTI_UINTMAX_TYPE] 308 #define uintmax_type_node c_global_trees[CTI_UINTMAX_TYPE]
247 #define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE] 309 #define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
248 #define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE] 310 #define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
249 311
312 #define sig_atomic_type_node c_global_trees[CTI_SIG_ATOMIC_TYPE]
313 #define int8_type_node c_global_trees[CTI_INT8_TYPE]
314 #define int16_type_node c_global_trees[CTI_INT16_TYPE]
315 #define int32_type_node c_global_trees[CTI_INT32_TYPE]
316 #define int64_type_node c_global_trees[CTI_INT64_TYPE]
317 #define uint8_type_node c_global_trees[CTI_UINT8_TYPE]
318 #define uint16_type_node c_global_trees[CTI_UINT16_TYPE]
319 #define c_uint32_type_node c_global_trees[CTI_UINT32_TYPE]
320 #define c_uint64_type_node c_global_trees[CTI_UINT64_TYPE]
321 #define int_least8_type_node c_global_trees[CTI_INT_LEAST8_TYPE]
322 #define int_least16_type_node c_global_trees[CTI_INT_LEAST16_TYPE]
323 #define int_least32_type_node c_global_trees[CTI_INT_LEAST32_TYPE]
324 #define int_least64_type_node c_global_trees[CTI_INT_LEAST64_TYPE]
325 #define uint_least8_type_node c_global_trees[CTI_UINT_LEAST8_TYPE]
326 #define uint_least16_type_node c_global_trees[CTI_UINT_LEAST16_TYPE]
327 #define uint_least32_type_node c_global_trees[CTI_UINT_LEAST32_TYPE]
328 #define uint_least64_type_node c_global_trees[CTI_UINT_LEAST64_TYPE]
329 #define int_fast8_type_node c_global_trees[CTI_INT_FAST8_TYPE]
330 #define int_fast16_type_node c_global_trees[CTI_INT_FAST16_TYPE]
331 #define int_fast32_type_node c_global_trees[CTI_INT_FAST32_TYPE]
332 #define int_fast64_type_node c_global_trees[CTI_INT_FAST64_TYPE]
333 #define uint_fast8_type_node c_global_trees[CTI_UINT_FAST8_TYPE]
334 #define uint_fast16_type_node c_global_trees[CTI_UINT_FAST16_TYPE]
335 #define uint_fast32_type_node c_global_trees[CTI_UINT_FAST32_TYPE]
336 #define uint_fast64_type_node c_global_trees[CTI_UINT_FAST64_TYPE]
337 #define intptr_type_node c_global_trees[CTI_INTPTR_TYPE]
338 #define uintptr_type_node c_global_trees[CTI_UINTPTR_TYPE]
339
250 #define truthvalue_type_node c_global_trees[CTI_TRUTHVALUE_TYPE] 340 #define truthvalue_type_node c_global_trees[CTI_TRUTHVALUE_TYPE]
251 #define truthvalue_true_node c_global_trees[CTI_TRUTHVALUE_TRUE] 341 #define truthvalue_true_node c_global_trees[CTI_TRUTHVALUE_TRUE]
252 #define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE] 342 #define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE]
253 343
254 #define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE] 344 #define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE]
274 364
275 extern GTY(()) tree c_global_trees[CTI_MAX]; 365 extern GTY(()) tree c_global_trees[CTI_MAX];
276 366
277 /* In a RECORD_TYPE, a sorted array of the fields of the type, not a 367 /* In a RECORD_TYPE, a sorted array of the fields of the type, not a
278 tree for size reasons. */ 368 tree for size reasons. */
279 struct sorted_fields_type GTY(()) 369 struct GTY(()) sorted_fields_type {
280 {
281 int len; 370 int len;
282 tree GTY((length ("%h.len"))) elts[1]; 371 tree GTY((length ("%h.len"))) elts[1];
283 }; 372 };
284 373
285 /* Mark which labels are explicitly declared. 374 /* Mark which labels are explicitly declared.
297 386
298 /* To test for a specific language use c_language, defined by each 387 /* To test for a specific language use c_language, defined by each
299 front end. For "ObjC features" or "not C++" use the macros. */ 388 front end. For "ObjC features" or "not C++" use the macros. */
300 extern c_language_kind c_language; 389 extern c_language_kind c_language;
301 390
302 #define c_dialect_cxx() (c_language & clk_cxx) 391 #define c_dialect_cxx() ((c_language & clk_cxx) != 0)
303 #define c_dialect_objc() (c_language & clk_objc) 392 #define c_dialect_objc() ((c_language & clk_objc) != 0)
393
394 /* The various name of operator that appears in error messages. */
395 typedef enum ref_operator {
396 /* NULL */
397 RO_NULL,
398 /* array indexing */
399 RO_ARRAY_INDEXING,
400 /* unary * */
401 RO_UNARY_STAR,
402 /* -> */
403 RO_ARROW,
404 /* implicit conversion */
405 RO_IMPLICIT_CONVERSION
406 } ref_operator;
304 407
305 /* Information about a statement tree. */ 408 /* Information about a statement tree. */
306 409
307 struct stmt_tree_s GTY(()) { 410 struct GTY(()) stmt_tree_s {
308 /* The current statement list being collected. */ 411 /* The current statement list being collected. */
309 tree x_cur_stmt_list; 412 tree x_cur_stmt_list;
310 413
311 /* In C++, Nonzero if we should treat statements as full 414 /* In C++, Nonzero if we should treat statements as full
312 expressions. In particular, this variable is no-zero if at the 415 expressions. In particular, this variable is no-zero if at the
328 typedef struct stmt_tree_s *stmt_tree; 431 typedef struct stmt_tree_s *stmt_tree;
329 432
330 /* Global state pertinent to the current function. Some C dialects 433 /* Global state pertinent to the current function. Some C dialects
331 extend this structure with additional fields. */ 434 extend this structure with additional fields. */
332 435
333 struct c_language_function GTY(()) { 436 struct GTY(()) c_language_function {
334 /* While we are parsing the function, this contains information 437 /* While we are parsing the function, this contains information
335 about the statement-tree that we are building. */ 438 about the statement-tree that we are building. */
336 struct stmt_tree_s x_stmt_tree; 439 struct stmt_tree_s x_stmt_tree;
337 }; 440 };
338 441
355 extern tree pop_stmt_list (tree); 458 extern tree pop_stmt_list (tree);
356 extern tree add_stmt (tree); 459 extern tree add_stmt (tree);
357 extern void push_cleanup (tree, tree, bool); 460 extern void push_cleanup (tree, tree, bool);
358 extern tree pushdecl_top_level (tree); 461 extern tree pushdecl_top_level (tree);
359 extern tree pushdecl (tree); 462 extern tree pushdecl (tree);
360 extern tree build_modify_expr (location_t, tree, enum tree_code, tree); 463 extern tree build_modify_expr (location_t, tree, tree, enum tree_code,
361 extern tree build_indirect_ref (location_t, tree, const char *); 464 location_t, tree, tree);
465 extern tree build_indirect_ref (location_t, tree, ref_operator);
362 466
363 extern int c_expand_decl (tree); 467 extern int c_expand_decl (tree);
364 468
365 extern int field_decl_cmp (const void *, const void *); 469 extern int field_decl_cmp (const void *, const void *);
366 extern void resort_sorted_fields (void *, void *, gt_pointer_operator, 470 extern void resort_sorted_fields (void *, void *, gt_pointer_operator,
635 /* Nonzero (the default) means to generate thread-safe code for 739 /* Nonzero (the default) means to generate thread-safe code for
636 initializing local statics. */ 740 initializing local statics. */
637 741
638 extern int flag_threadsafe_statics; 742 extern int flag_threadsafe_statics;
639 743
744 /* Nonzero if we want to pretty-print template specializations as the
745 template signature followed by the arguments. */
746
747 extern int flag_pretty_templates;
748
640 /* Nonzero means warn about implicit declarations. */ 749 /* Nonzero means warn about implicit declarations. */
641 750
642 extern int warn_implicit; 751 extern int warn_implicit;
643 752
644 /* Warn about using __null (as NULL in C++) as sentinel. For code compiled 753 /* Warn about using __null (as NULL in C++) as sentinel. For code compiled
651 arbitrary, but it exists to limit the time it takes to notice 760 arbitrary, but it exists to limit the time it takes to notice
652 infinite template instantiations. */ 761 infinite template instantiations. */
653 762
654 extern int max_tinst_depth; 763 extern int max_tinst_depth;
655 764
656 /* Nonzero means the expression being parsed will never be evaluated. 765 /* Nonzero means that we should not issue warnings about problems that
657 This is a count, since unevaluated expressions can nest. */ 766 occur when the code is executed, because the code being processed
658 767 is not expected to be executed. This is set during parsing. This
659 extern int skip_evaluation; 768 is used for cases like sizeof() and "0 ? a : b". This is a count,
769 not a bool, because unexecuted expressions can nest. */
770
771 extern int c_inhibit_evaluation_warnings;
772
773 /* Whether lexing has been completed, so subsequent preprocessor
774 errors should use the compiler's input_location. */
775
776 extern bool done_lexing;
660 777
661 /* C types are partitioned into three subsets: object, function, and 778 /* C types are partitioned into three subsets: object, function, and
662 incomplete types. */ 779 incomplete types. */
663 #define C_TYPE_OBJECT_P(type) \ 780 #define C_TYPE_OBJECT_P(type) \
664 (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type)) 781 (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type))
681 /* Pointer to function to lazily generate the VAR_DECL for __FUNCTION__ etc. 798 /* Pointer to function to lazily generate the VAR_DECL for __FUNCTION__ etc.
682 ID is the identifier to use, NAME is the string. 799 ID is the identifier to use, NAME is the string.
683 TYPE_DEP indicates whether it depends on type of the function or not 800 TYPE_DEP indicates whether it depends on type of the function or not
684 (i.e. __PRETTY_FUNCTION__). */ 801 (i.e. __PRETTY_FUNCTION__). */
685 802
686 extern tree (*make_fname_decl) (tree, int); 803 extern tree (*make_fname_decl) (location_t, tree, int);
687 804
805 extern const char *c_addr_space_name (addr_space_t as);
688 extern tree identifier_global_value (tree); 806 extern tree identifier_global_value (tree);
689 extern void record_builtin_type (enum rid, const char *, tree); 807 extern void record_builtin_type (enum rid, const char *, tree);
690 extern tree build_void_list_node (void); 808 extern tree build_void_list_node (void);
691 extern void start_fname_decls (void); 809 extern void start_fname_decls (void);
692 extern void finish_fname_decls (void); 810 extern void finish_fname_decls (void);
713 extern tree c_common_unsigned_type (tree); 831 extern tree c_common_unsigned_type (tree);
714 extern tree c_common_signed_type (tree); 832 extern tree c_common_signed_type (tree);
715 extern tree c_common_signed_or_unsigned_type (int, tree); 833 extern tree c_common_signed_or_unsigned_type (int, tree);
716 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); 834 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
717 extern bool decl_with_nonnull_addr_p (const_tree); 835 extern bool decl_with_nonnull_addr_p (const_tree);
836 extern tree c_fully_fold (tree, bool, bool *);
837 extern tree decl_constant_value_for_optimization (tree);
838 extern tree c_wrap_maybe_const (tree, bool);
839 extern tree c_save_expr (tree);
718 extern tree c_common_truthvalue_conversion (location_t, tree); 840 extern tree c_common_truthvalue_conversion (location_t, tree);
719 extern void c_apply_type_quals_to_decl (int, tree); 841 extern void c_apply_type_quals_to_decl (int, tree);
720 extern tree c_sizeof_or_alignof_type (tree, bool, int); 842 extern tree c_sizeof_or_alignof_type (location_t, tree, bool, int);
721 extern tree c_alignof_expr (tree); 843 extern tree c_alignof_expr (location_t, tree);
722 /* Print an error message for invalid operands to arith operation CODE. 844 /* Print an error message for invalid operands to arith operation CODE.
723 NOP_EXPR is used as a special case (see truthvalue_conversion). */ 845 NOP_EXPR is used as a special case (see truthvalue_conversion). */
724 extern void binary_op_error (location_t, enum tree_code, tree, tree); 846 extern void binary_op_error (location_t, enum tree_code, tree, tree);
725 extern tree fix_string_type (tree); 847 extern tree fix_string_type (tree);
726 struct varray_head_tag; 848 struct varray_head_tag;
727 extern void constant_expression_warning (tree); 849 extern void constant_expression_warning (tree);
728 extern void constant_expression_error (tree); 850 extern void constant_expression_error (tree);
729 extern bool strict_aliasing_warning (tree, tree, tree); 851 extern bool strict_aliasing_warning (tree, tree, tree);
730 extern void warnings_for_convert_and_check (tree, tree, tree); 852 extern void warnings_for_convert_and_check (tree, tree, tree);
731 extern tree convert_and_check (tree, tree); 853 extern tree convert_and_check (tree, tree);
732 extern void overflow_warning (tree); 854 extern void overflow_warning (location_t, tree);
733 extern void warn_logical_operator (enum tree_code, tree, tree); 855 extern void warn_logical_operator (location_t, enum tree_code, tree,
856 enum tree_code, tree, enum tree_code, tree);
734 extern void check_main_parameter_types (tree decl); 857 extern void check_main_parameter_types (tree decl);
735 extern bool c_determine_visibility (tree); 858 extern bool c_determine_visibility (tree);
736 extern bool same_scalar_type_ignoring_signedness (tree, tree); 859 extern bool same_scalar_type_ignoring_signedness (tree, tree);
737 860 extern void mark_valid_location_for_stdc_pragma (bool);
738 #define c_sizeof(T) c_sizeof_or_alignof_type (T, true, 1) 861 extern bool valid_location_for_stdc_pragma_p (void);
739 #define c_alignof(T) c_sizeof_or_alignof_type (T, false, 1) 862 extern void set_float_const_decimal64 (void);
863 extern void clear_float_const_decimal64 (void);
864 extern bool float_const_decimal64_p (void);
865
866 #define c_sizeof(LOC, T) c_sizeof_or_alignof_type (LOC, T, true, 1)
867 #define c_alignof(LOC, T) c_sizeof_or_alignof_type (LOC, T, false, 1)
740 868
741 /* Subroutine of build_binary_op, used for certain operations. */ 869 /* Subroutine of build_binary_op, used for certain operations. */
742 extern tree shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise); 870 extern tree shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise);
743 871
744 /* Subroutine of build_binary_op, used for comparison operations. 872 /* Subroutine of build_binary_op, used for comparison operations.
745 See if the operands have both been converted from subword integer types 873 See if the operands have both been converted from subword integer types
746 and, if so, perhaps change them both back to their original type. */ 874 and, if so, perhaps change them both back to their original type. */
747 extern tree shorten_compare (tree *, tree *, tree *, enum tree_code *); 875 extern tree shorten_compare (tree *, tree *, tree *, enum tree_code *);
748 876
749 extern tree pointer_int_sum (enum tree_code, tree, tree); 877 extern tree pointer_int_sum (location_t, enum tree_code, tree, tree);
750 878
751 /* Add qualifiers to a type, in the fashion for C. */ 879 /* Add qualifiers to a type, in the fashion for C. */
752 extern tree c_build_qualified_type (tree, int); 880 extern tree c_build_qualified_type (tree, int);
753 881
754 /* Build tree nodes and builtin functions common to both C and C++ language 882 /* Build tree nodes and builtin functions common to both C and C++ language
755 frontends. */ 883 frontends. */
756 extern void c_common_nodes_and_builtins (void); 884 extern void c_common_nodes_and_builtins (void);
757 885
758 extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
759
760 extern void disable_builtin_function (const char *); 886 extern void disable_builtin_function (const char *);
761 887
762 extern void set_compound_literal_name (tree decl); 888 extern void set_compound_literal_name (tree decl);
763 889
764 extern tree build_va_arg (tree, tree); 890 extern tree build_va_arg (location_t, tree, tree);
765 891
766 extern unsigned int c_common_init_options (unsigned int, const char **); 892 extern unsigned int c_common_init_options (unsigned int, const char **);
767 extern bool c_common_post_options (const char **); 893 extern bool c_common_post_options (const char **);
768 extern bool c_common_init (void); 894 extern bool c_common_init (void);
769 extern void c_common_finish (void); 895 extern void c_common_finish (void);
791 917
792 /* Nonzero if a label has been added to the statement list. */ 918 /* Nonzero if a label has been added to the statement list. */
793 #define STATEMENT_LIST_HAS_LABEL(NODE) \ 919 #define STATEMENT_LIST_HAS_LABEL(NODE) \
794 TREE_LANG_FLAG_3 (STATEMENT_LIST_CHECK (NODE)) 920 TREE_LANG_FLAG_3 (STATEMENT_LIST_CHECK (NODE))
795 921
796 /* COMPOUND_LITERAL_EXPR accessors. */ 922 /* C_MAYBE_CONST_EXPR accessors. */
797 #define COMPOUND_LITERAL_EXPR_DECL_STMT(NODE) \ 923 #define C_MAYBE_CONST_EXPR_PRE(NODE) \
798 TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0) 924 TREE_OPERAND (C_MAYBE_CONST_EXPR_CHECK (NODE), 0)
799 #define COMPOUND_LITERAL_EXPR_DECL(NODE) \ 925 #define C_MAYBE_CONST_EXPR_EXPR(NODE) \
800 DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE)) 926 TREE_OPERAND (C_MAYBE_CONST_EXPR_CHECK (NODE), 1)
927 #define C_MAYBE_CONST_EXPR_INT_OPERANDS(NODE) \
928 TREE_LANG_FLAG_0 (C_MAYBE_CONST_EXPR_CHECK (NODE))
929 #define C_MAYBE_CONST_EXPR_NON_CONST(NODE) \
930 TREE_LANG_FLAG_1 (C_MAYBE_CONST_EXPR_CHECK (NODE))
931 #define EXPR_INT_CONST_OPERANDS(EXPR) \
932 (INTEGRAL_TYPE_P (TREE_TYPE (EXPR)) \
933 && (TREE_CODE (EXPR) == INTEGER_CST \
934 || (TREE_CODE (EXPR) == C_MAYBE_CONST_EXPR \
935 && C_MAYBE_CONST_EXPR_INT_OPERANDS (EXPR))))
801 936
802 /* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */ 937 /* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */
803 #define DECL_C_BIT_FIELD(NODE) \ 938 #define DECL_C_BIT_FIELD(NODE) \
804 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) == 1) 939 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) == 1)
805 #define SET_DECL_C_BIT_FIELD(NODE) \ 940 #define SET_DECL_C_BIT_FIELD(NODE) \
806 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 1) 941 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 1)
807 #define CLEAR_DECL_C_BIT_FIELD(NODE) \ 942 #define CLEAR_DECL_C_BIT_FIELD(NODE) \
808 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) 943 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0)
809 944
810 extern void emit_local_var (tree); 945 extern tree do_case (location_t, tree, tree);
811 extern tree do_case (tree, tree); 946 extern tree build_stmt (location_t, enum tree_code, ...);
812 extern tree build_stmt (enum tree_code, ...); 947 extern tree build_case_label (location_t, tree, tree, tree);
813 extern tree build_case_label (tree, tree, tree);
814 948
815 /* These functions must be defined by each front-end which implements 949 /* These functions must be defined by each front-end which implements
816 a variant of the C language. They are used in c-common.c. */ 950 a variant of the C language. They are used in c-common.c. */
817 951
818 extern tree build_unary_op (location_t, enum tree_code, tree, int); 952 extern tree build_unary_op (location_t, enum tree_code, tree, int);
834 /* Handle increment and decrement of boolean types. */ 968 /* Handle increment and decrement of boolean types. */
835 extern tree boolean_increment (enum tree_code, tree); 969 extern tree boolean_increment (enum tree_code, tree);
836 970
837 extern int case_compare (splay_tree_key, splay_tree_key); 971 extern int case_compare (splay_tree_key, splay_tree_key);
838 972
839 extern tree c_add_case_label (splay_tree, tree, tree, tree, tree); 973 extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, tree);
840 974
841 extern void c_do_switch_warnings (splay_tree, location_t, tree, tree); 975 extern void c_do_switch_warnings (splay_tree, location_t, tree, tree);
842 976
843 extern tree build_function_call (tree, tree); 977 extern tree build_function_call (location_t, tree, tree);
844 978
845 extern tree resolve_overloaded_builtin (tree, tree); 979 extern tree build_function_call_vec (location_t, tree,
980 VEC(tree,gc) *, VEC(tree,gc) *);
981
982 extern tree resolve_overloaded_builtin (location_t, tree, VEC(tree,gc) *);
846 983
847 extern tree finish_label_address_expr (tree, location_t); 984 extern tree finish_label_address_expr (tree, location_t);
848 985
849 /* Same function prototype, but the C and C++ front ends have 986 /* Same function prototype, but the C and C++ front ends have
850 different implementations. Used in c-common.c. */ 987 different implementations. Used in c-common.c. */
851 extern tree lookup_label (tree); 988 extern tree lookup_label (tree);
852 extern tree lookup_name (tree); 989 extern tree lookup_name (tree);
990 extern bool lvalue_p (const_tree);
853 991
854 extern bool vector_targets_convertible_p (const_tree t1, const_tree t2); 992 extern bool vector_targets_convertible_p (const_tree t1, const_tree t2);
855 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note); 993 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note);
856 994
857 extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *); 995 extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
858
859 extern tree c_staticp (tree);
860 996
861 extern void init_c_lex (void); 997 extern void init_c_lex (void);
862 998
863 extern void c_cpp_builtins (cpp_reader *); 999 extern void c_cpp_builtins (cpp_reader *);
864 extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree); 1000 extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree);
885 1021
886 struct c_fileinfo *get_fileinfo (const char *); 1022 struct c_fileinfo *get_fileinfo (const char *);
887 extern void dump_time_statistics (void); 1023 extern void dump_time_statistics (void);
888 1024
889 extern bool c_dump_tree (void *, tree); 1025 extern bool c_dump_tree (void *, tree);
890
891 extern void c_warn_unused_result (gimple_seq);
892 1026
893 extern void verify_sequence_points (tree); 1027 extern void verify_sequence_points (tree);
894 1028
895 extern tree fold_offsetof (tree, tree); 1029 extern tree fold_offsetof (tree, tree);
896 1030
916 enum tree_code, tree, 1050 enum tree_code, tree,
917 enum tree_code, tree); 1051 enum tree_code, tree);
918 extern void warn_for_unused_label (tree label); 1052 extern void warn_for_unused_label (tree label);
919 extern void warn_for_div_by_zero (location_t, tree divisor); 1053 extern void warn_for_div_by_zero (location_t, tree divisor);
920 extern void warn_for_sign_compare (location_t, 1054 extern void warn_for_sign_compare (location_t,
921 tree orig_op0, tree orig_op1, 1055 tree orig_op0, tree orig_op1,
922 tree op0, tree op1, 1056 tree op0, tree op1,
923 tree result_type, 1057 tree result_type,
924 enum tree_code resultcode); 1058 enum tree_code resultcode);
1059 extern void set_underlying_type (tree x);
1060 extern bool is_typedef_decl (tree x);
1061 extern VEC(tree,gc) *make_tree_vector (void);
1062 extern void release_tree_vector (VEC(tree,gc) *);
1063 extern VEC(tree,gc) *make_tree_vector_single (tree);
1064 extern VEC(tree,gc) *make_tree_vector_copy (const VEC(tree,gc) *);
925 1065
926 /* In c-gimplify.c */ 1066 /* In c-gimplify.c */
927 extern void c_genericize (tree); 1067 extern void c_genericize (tree);
928 extern int c_gimplify_expr (tree *, gimple_seq *, gimple_seq *); 1068 extern int c_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
929 extern tree c_build_bind_expr (tree, tree); 1069 extern tree c_build_bind_expr (location_t, tree, tree);
930 1070
931 /* In c-pch.c */ 1071 /* In c-pch.c */
932 extern void pch_init (void); 1072 extern void pch_init (void);
933 extern int c_common_valid_pch (cpp_reader *pfile, const char *name, int fd); 1073 extern int c_common_valid_pch (cpp_reader *pfile, const char *name, int fd);
934 extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd, 1074 extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd,
944 /* In c-cppbuiltin.c */ 1084 /* In c-cppbuiltin.c */
945 extern void builtin_define_std (const char *macro); 1085 extern void builtin_define_std (const char *macro);
946 extern void builtin_define_with_value (const char *, const char *, int); 1086 extern void builtin_define_with_value (const char *, const char *, int);
947 extern void c_stddef_cpp_builtins (void); 1087 extern void c_stddef_cpp_builtins (void);
948 extern void fe_file_change (const struct line_map *); 1088 extern void fe_file_change (const struct line_map *);
949 extern void c_parse_error (const char *, enum cpp_ttype, tree); 1089 extern void c_parse_error (const char *, enum cpp_ttype, tree, unsigned char);
950 1090
951 /* Objective-C / Objective-C++ entry points. */ 1091 /* Objective-C / Objective-C++ entry points. */
952 1092
953 /* The following ObjC/ObjC++ functions are called by the C and/or C++ 1093 /* The following ObjC/ObjC++ functions are called by the C and/or C++
954 front-ends; they all must have corresponding stubs in stub-objc.c. */ 1094 front-ends; they all must have corresponding stubs in stub-objc.c. */
968 extern void objc_declare_alias (tree, tree); 1108 extern void objc_declare_alias (tree, tree);
969 extern void objc_declare_class (tree); 1109 extern void objc_declare_class (tree);
970 extern void objc_declare_protocols (tree); 1110 extern void objc_declare_protocols (tree);
971 extern tree objc_build_message_expr (tree); 1111 extern tree objc_build_message_expr (tree);
972 extern tree objc_finish_message_expr (tree, tree, tree); 1112 extern tree objc_finish_message_expr (tree, tree, tree);
973 extern tree objc_build_selector_expr (tree); 1113 extern tree objc_build_selector_expr (location_t, tree);
974 extern tree objc_build_protocol_expr (tree); 1114 extern tree objc_build_protocol_expr (tree);
975 extern tree objc_build_encode_expr (tree); 1115 extern tree objc_build_encode_expr (tree);
976 extern tree objc_build_string_object (tree); 1116 extern tree objc_build_string_object (tree);
977 extern tree objc_get_protocol_qualified_type (tree, tree); 1117 extern tree objc_get_protocol_qualified_type (tree, tree);
978 extern tree objc_get_class_reference (tree); 1118 extern tree objc_get_class_reference (tree);
992 extern void objc_add_method_declaration (tree); 1132 extern void objc_add_method_declaration (tree);
993 extern void objc_start_method_definition (tree); 1133 extern void objc_start_method_definition (tree);
994 extern void objc_finish_method_definition (tree); 1134 extern void objc_finish_method_definition (tree);
995 extern void objc_add_instance_variable (tree); 1135 extern void objc_add_instance_variable (tree);
996 extern tree objc_build_keyword_decl (tree, tree, tree); 1136 extern tree objc_build_keyword_decl (tree, tree, tree);
997 extern tree objc_build_throw_stmt (tree); 1137 extern tree objc_build_throw_stmt (location_t, tree);
998 extern void objc_begin_try_stmt (location_t, tree); 1138 extern void objc_begin_try_stmt (location_t, tree);
999 extern tree objc_finish_try_stmt (void); 1139 extern tree objc_finish_try_stmt (void);
1000 extern void objc_begin_catch_clause (tree); 1140 extern void objc_begin_catch_clause (tree);
1001 extern void objc_finish_catch_clause (void); 1141 extern void objc_finish_catch_clause (void);
1002 extern void objc_build_finally_clause (location_t, tree); 1142 extern void objc_build_finally_clause (location_t, tree);
1016 extern void pp_file_change (const struct line_map *); 1156 extern void pp_file_change (const struct line_map *);
1017 extern void pp_dir_change (cpp_reader *, const char *); 1157 extern void pp_dir_change (cpp_reader *, const char *);
1018 extern bool check_missing_format_attribute (tree, tree); 1158 extern bool check_missing_format_attribute (tree, tree);
1019 1159
1020 /* In c-omp.c */ 1160 /* In c-omp.c */
1021 extern tree c_finish_omp_master (tree); 1161 extern tree c_finish_omp_master (location_t, tree);
1022 extern tree c_finish_omp_critical (tree, tree); 1162 extern tree c_finish_omp_critical (location_t, tree, tree);
1023 extern tree c_finish_omp_ordered (tree); 1163 extern tree c_finish_omp_ordered (location_t, tree);
1024 extern void c_finish_omp_barrier (void); 1164 extern void c_finish_omp_barrier (location_t);
1025 extern tree c_finish_omp_atomic (enum tree_code, tree, tree); 1165 extern tree c_finish_omp_atomic (location_t, enum tree_code, tree, tree);
1026 extern void c_finish_omp_flush (void); 1166 extern void c_finish_omp_flush (location_t);
1027 extern void c_finish_omp_taskwait (void); 1167 extern void c_finish_omp_taskwait (location_t);
1028 extern tree c_finish_omp_for (location_t, tree, tree, tree, tree, tree, tree); 1168 extern tree c_finish_omp_for (location_t, tree, tree, tree, tree, tree, tree);
1029 extern void c_split_parallel_clauses (tree, tree *, tree *); 1169 extern void c_split_parallel_clauses (location_t, tree, tree *, tree *);
1030 extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree); 1170 extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree);
1031 1171
1032 /* Not in c-omp.c; provided by the front end. */ 1172 /* Not in c-omp.c; provided by the front end. */
1033 extern bool c_omp_sharing_predetermined (tree); 1173 extern bool c_omp_sharing_predetermined (tree);
1034 extern tree c_omp_remap_decl (tree, bool); 1174 extern tree c_omp_remap_decl (tree, bool);