00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GCC_C_TREE_H
00023 #define GCC_C_TREE_H
00024
00025 #include "c-common.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 struct lang_identifier GTY(())
00038 {
00039 struct c_common_identifier common_id;
00040 tree global_value;
00041 tree local_value;
00042 tree label_value;
00043 tree implicit_decl;
00044 tree error_locus;
00045 tree limbo_value;
00046 };
00047
00048
00049
00050 union lang_tree_node
00051 GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
00052 chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
00053 {
00054 union tree_node GTY ((tag ("0"),
00055 desc ("tree_node_structure (&%h)")))
00056 generic;
00057 struct lang_identifier GTY ((tag ("1"))) identifier;
00058 };
00059
00060 /* Language-specific declaration information. */
00061
00062 struct lang_decl GTY(())
00063 {
00064 struct c_lang_decl base;
00065 /* The return types and parameter types may have variable size.
00066 This is a list of any SAVE_EXPRs that need to be evaluated to
00067 compute those sizes. */
00068 tree pending_sizes;
00069 };
00070
00071 /* Macros for access to language-specific slots in an identifier. */
00072 /* Each of these slots contains a DECL node or null. */
00073
00074 /* This represents the value which the identifier has in the
00075 file-scope namespace. */
00076 #define IDENTIFIER_GLOBAL_VALUE(NODE) \
00077 (((struct lang_identifier *) (NODE))->global_value)
00078 /* This represents the value which the identifier has in the current
00079 scope. */
00080 #define IDENTIFIER_LOCAL_VALUE(NODE) \
00081 (((struct lang_identifier *) (NODE))->local_value)
00082 /* This represents the value which the identifier has as a label in
00083 the current label scope. */
00084 #define IDENTIFIER_LABEL_VALUE(NODE) \
00085 (((struct lang_identifier *) (NODE))->label_value)
00086 /* This records the extern decl of this identifier, if it has had one
00087 at any point in this compilation. */
00088 #define IDENTIFIER_LIMBO_VALUE(NODE) \
00089 (((struct lang_identifier *) (NODE))->limbo_value)
00090 /* This records the implicit function decl of this identifier, if it
00091 has had one at any point in this compilation. */
00092 #define IDENTIFIER_IMPLICIT_DECL(NODE) \
00093 (((struct lang_identifier *) (NODE))->implicit_decl)
00094 /* This is the last function in which we printed an "undefined variable"
00095 message for this identifier. Value is a FUNCTION_DECL or null. */
00096 #define IDENTIFIER_ERROR_LOCUS(NODE) \
00097 (((struct lang_identifier *) (NODE))->error_locus)
00098
00099 /* In identifiers, C uses the following fields in a special way:
00100 TREE_PUBLIC to record that there was a previous local extern decl.
00101 TREE_USED to record that such a decl was used.
00102 TREE_ADDRESSABLE to record that the address of such a decl was used. */
00103
00104 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
00105 #define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE)
00106
00107 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile. */
00108 #define C_TYPE_FIELDS_VOLATILE(TYPE) TREE_LANG_FLAG_2 (TYPE)
00109
00110 /* In a RECORD_TYPE or UNION_TYPE or ENUMERAL_TYPE
00111 nonzero if the definition of the type has already started. */
00112 #define C_TYPE_BEING_DEFINED(TYPE) TYPE_LANG_FLAG_0 (TYPE)
00113
00114 /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
00115 keyword. C_RID_CODE (node) is then the RID_* value of the keyword,
00116 and C_RID_YYCODE is the token number wanted by Yacc. */
00117 #define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_0 (ID)
00118
00119 /* This function was declared inline. This flag controls the linkage
00120 semantics of 'inline'; whether or not the function is inlined is
00121 controlled by DECL_INLINE. */
00122 #define DECL_DECLARED_INLINE_P(NODE) \
00123 (DECL_LANG_SPECIFIC (NODE)->base.declared_inline)
00124
00125 /* In a RECORD_TYPE, a sorted array of the fields of the type. */
00126 struct lang_type GTY(())
00127 {
00128 int len;
00129 tree GTY((length ("%h.len"))) elts[1];
00130 };
00131
00132 /* Record whether a type or decl was written with nonconstant size.
00133 Note that TYPE_SIZE may have simplified to a constant. */
00134 #define C_TYPE_VARIABLE_SIZE(TYPE) TYPE_LANG_FLAG_1 (TYPE)
00135 #define C_DECL_VARIABLE_SIZE(TYPE) DECL_LANG_FLAG_0 (TYPE)
00136
00137 #if 0 /* Not used. */
00138 /* Record whether a decl for a function or function pointer has
00139 already been mentioned (in a warning) because it was called
00140 but didn't have a prototype. */
00141 #define C_MISSING_PROTOTYPE_WARNED(DECL) DECL_LANG_FLAG_2 (DECL)
00142 #endif
00143
00144 /* Store a value in that field. */
00145 #define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \
00146 (TREE_COMPLEXITY (EXP) = (int) (CODE))
00147
00148 /* Record whether a typedef for type `int' was actually `signed int'. */
00149 #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
00150
00151 /* For a FUNCTION_DECL, nonzero if it was defined without an explicit
00152 return type. */
00153 #define C_FUNCTION_IMPLICIT_INT(EXP) DECL_LANG_FLAG_1 (EXP)
00154
00155 /* Nonzero for a declaration of a built in function if there has been no
00156 occasion that would declare the function in ordinary C.
00157 Using the function draws a pedantic warning in this case. */
00158 #define C_DECL_ANTICIPATED(EXP) DECL_LANG_FLAG_3 (EXP)
00159
00160 /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
00161 TYPE_ARG_TYPES for functions with prototypes, but created for functions
00162 without prototypes. */
00163 #define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_BINFO (NODE)
00164
00165
00166 /* in c-lang.c and objc-act.c */
00167 extern tree lookup_interface PARAMS ((tree));
00168 extern tree is_class_name PARAMS ((tree));
00169 extern tree objc_is_id PARAMS ((tree));
00170 extern void objc_check_decl PARAMS ((tree));
00171 extern void finish_file PARAMS ((void));
00172 extern int objc_comptypes PARAMS ((tree, tree, int));
00173 extern tree objc_message_selector PARAMS ((void));
00174 extern tree lookup_objc_ivar PARAMS ((tree));
00175
00176
00177 /* in c-parse.in */
00178 extern void c_parse_init PARAMS ((void));
00179
00180 /* in c-aux-info.c */
00181 extern void gen_aux_info_record PARAMS ((tree, int, int, int));
00182
00183 /* in c-decl.c */
00184 extern int global_bindings_p PARAMS ((void));
00185 extern int kept_level_p PARAMS ((void));
00186 extern tree getdecls PARAMS ((void));
00187 extern void pushlevel PARAMS ((int));
00188 extern tree poplevel PARAMS ((int,int, int));
00189 extern void insert_block PARAMS ((tree));
00190 extern void set_block PARAMS ((tree));
00191 extern tree pushdecl PARAMS ((tree));
00192
00193 extern void c_insert_default_attributes PARAMS ((tree));
00194 extern void c_init_decl_processing PARAMS ((void));
00195 extern void c_dup_lang_specific_decl PARAMS ((tree));
00196 extern void c_print_identifier PARAMS ((FILE *, tree, int));
00197 extern tree build_array_declarator PARAMS ((tree, tree, int, int));
00198 extern tree build_enumerator PARAMS ((tree, tree));
00199 extern void check_for_loop_decls PARAMS ((void));
00200 extern void clear_parm_order PARAMS ((void));
00201 extern int complete_array_type PARAMS ((tree, tree, int));
00202 extern void declare_parm_level PARAMS ((int));
00203 extern tree define_label PARAMS ((const char *, int,
00204 tree));
00205 extern void finish_decl PARAMS ((tree, tree, tree));
00206 extern tree finish_enum PARAMS ((tree, tree, tree));
00207 extern void finish_function PARAMS ((int, int));
00208 extern tree finish_struct PARAMS ((tree, tree, tree));
00209 extern tree get_parm_info PARAMS ((int));
00210 extern tree grokfield PARAMS ((const char *, int, tree, tree, tree));
00211 extern tree groktypename PARAMS ((tree));
00212 extern tree groktypename_in_parm_context PARAMS ((tree));
00213 extern tree implicitly_declare PARAMS ((tree));
00214 extern void implicit_decl_warning PARAMS ((tree));
00215 extern int in_parm_level_p PARAMS ((void));
00216 extern void keep_next_level PARAMS ((void));
00217 extern tree lookup_name PARAMS ((tree));
00218 extern tree lookup_name_current_level PARAMS ((tree));
00219 extern void parmlist_tags_warning PARAMS ((void));
00220 extern void pending_xref_error PARAMS ((void));
00221 extern void c_push_function_context PARAMS ((struct function *));
00222 extern void c_pop_function_context PARAMS ((struct function *));
00223 extern void pop_label_level PARAMS ((void));
00224 extern void push_label_level PARAMS ((void));
00225 extern void push_parm_decl PARAMS ((tree));
00226 extern tree pushdecl_top_level PARAMS ((tree));
00227 extern void pushtag PARAMS ((tree, tree));
00228 extern tree set_array_declarator_type PARAMS ((tree, tree, int));
00229 extern tree shadow_label PARAMS ((tree));
00230 extern void shadow_tag PARAMS ((tree));
00231 extern void shadow_tag_warned PARAMS ((tree, int));
00232 extern tree start_enum PARAMS ((tree));
00233 extern int start_function PARAMS ((tree, tree, tree));
00234 extern tree start_decl PARAMS ((tree, tree, int,
00235 tree));
00236 extern tree start_struct PARAMS ((enum tree_code, tree));
00237 extern void store_parm_decls PARAMS ((void));
00238 extern tree xref_tag PARAMS ((enum tree_code, tree));
00239 extern tree c_begin_compound_stmt PARAMS ((void));
00240 extern void c_expand_deferred_function PARAMS ((tree));
00241 extern void c_expand_decl_stmt PARAMS ((tree));
00242 extern tree make_pointer_declarator PARAMS ((tree, tree));
00243
00244 /* in c-objc-common.c */
00245 extern int c_disregard_inline_limits PARAMS ((tree));
00246 extern int c_cannot_inline_tree_fn PARAMS ((tree *));
00247 extern const char *c_objc_common_init PARAMS ((const char *));
00248 extern int c_missing_noreturn_ok_p PARAMS ((tree));
00249 extern void c_objc_common_finish_file PARAMS ((void));
00250 extern int defer_fn PARAMS ((tree));
00251 extern bool c_warn_unused_global_decl PARAMS ((tree));
00252
00253 #define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \
00254 c_build_qualified_type ((TYPE), \
00255 ((CONST_P) ? TYPE_QUAL_CONST : 0) | \
00256 ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
00257
00258 #define c_sizeof_nowarn(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 0)
00259 /* in c-typeck.c */
00260 extern tree require_complete_type PARAMS ((tree));
00261 extern int comptypes PARAMS ((tree, tree));
00262 extern tree c_size_in_bytes PARAMS ((tree));
00263 extern bool c_mark_addressable PARAMS ((tree));
00264 extern void c_incomplete_type_error PARAMS ((tree, tree));
00265 extern tree c_type_promotes_to PARAMS ((tree));
00266 extern tree build_component_ref PARAMS ((tree, tree));
00267 extern tree build_indirect_ref PARAMS ((tree, const char *));
00268 extern tree build_array_ref PARAMS ((tree, tree));
00269 extern tree build_external_ref PARAMS ((tree, int));
00270 extern tree parser_build_binary_op PARAMS ((enum tree_code,
00271 tree, tree));
00272 extern int c_tree_expr_nonnegative_p PARAMS ((tree));
00273 extern void readonly_warning PARAMS ((tree, const char *));
00274 extern tree build_conditional_expr PARAMS ((tree, tree, tree));
00275 extern tree build_compound_expr PARAMS ((tree));
00276 extern tree c_cast_expr PARAMS ((tree, tree));
00277 extern tree build_c_cast PARAMS ((tree, tree));
00278 extern tree build_modify_expr PARAMS ((tree, enum tree_code,
00279 tree));
00280 extern void store_init_value PARAMS ((tree, tree));
00281 extern void error_init PARAMS ((const char *));
00282 extern void pedwarn_init PARAMS ((const char *));
00283 extern void start_init PARAMS ((tree, tree, int));
00284 extern void finish_init PARAMS ((void));
00285 extern void really_start_incremental_init PARAMS ((tree));
00286 extern void push_init_level PARAMS ((int));
00287 extern tree pop_init_level PARAMS ((int));
00288 extern void set_init_index PARAMS ((tree, tree));
00289 extern void set_init_label PARAMS ((tree));
00290 extern void process_init_element PARAMS ((tree));
00291 extern tree build_compound_literal PARAMS ((tree, tree));
00292 extern void pedwarn_c90 PARAMS ((const char *, ...))
00293 ATTRIBUTE_PRINTF_1;
00294 extern void pedwarn_c99 PARAMS ((const char *, ...))
00295 ATTRIBUTE_PRINTF_1;
00296 extern tree c_start_case PARAMS ((tree));
00297 extern void c_finish_case PARAMS ((void));
00298 extern tree simple_asm_stmt PARAMS ((tree));
00299 extern tree build_asm_stmt PARAMS ((tree, tree, tree,
00300 tree, tree));
00301 extern tree c_convert_parm_for_inlining PARAMS ((tree, tree, tree));
00302
00303 /* Set to 0 at beginning of a function definition, set to 1 if
00304 a return statement that specifies a return value is seen. */
00305
00306 extern int current_function_returns_value;
00307
00308 /* Set to 0 at beginning of a function definition, set to 1 if
00309 a return statement with no argument is seen. */
00310
00311 extern int current_function_returns_null;
00312
00313 /* Set to 0 at beginning of a function definition, set to 1 if
00314 a call to a noreturn function is seen. */
00315
00316 extern int current_function_returns_abnormally;
00317
00318 /* Nonzero means we are reading code that came from a system header file. */
00319
00320 extern int system_header_p;
00321
00322 /* In c-decl.c */
00323 extern void c_finish_incomplete_decl PARAMS ((tree));
00324
00325 extern GTY(()) tree static_ctors;
00326 extern GTY(()) tree static_dtors;
00327
00328 #endif /* ! GCC_C_TREE_H */