]>
Commit | Line | Data |
---|---|---|
5ba6e819 | 1 | /* Definitions for CHILL parsing and type checking. |
0a3d2db2 | 2 | Copyright (C) 1992, 93, 94, 98, 1999 Free Software Foundation, Inc. |
5ba6e819 PB |
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 | |
6f48294d JL |
18 | the Free Software Foundation, 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. */ | |
5ba6e819 PB |
20 | |
21 | #ifndef _CH_TREE_H | |
22 | #define _CH_TREE_H | |
23 | ||
5ba6e819 PB |
24 | /* Usage of TREE_LANG_FLAG_?: |
25 | 1: TUPLE_NAMED_FIELD | |
26 | " TYPE_FIELDS_READONLY (in ARRAY_TYPE, RECORD_TYPE or UNION_TYPE) | |
27 | " C_DECLARED_LABEL_FLAG | |
28 | " C_TYPE_VARIABLE_SIZE | |
29 | 2: C_TYPE_FIELDS_VOLATILE (in RECORD_TYPE or UNION_TYPE) | |
30 | " ELSE_LABEL_SPECIFIED (in CASE selector expression) | |
31 | 3: UNSATISFIED_FLAG | |
32 | 4: CH_USE_SEIZEFILE_RESTRICTED | |
33 | " CH_ALREADY_GRANTED | |
34 | 5: CH_DERIVED_FLAG (in EXPR or DECL) | |
35 | */ | |
36 | ||
37 | /* Usage of TYPE_LANG_FLAG_?: | |
38 | 0: CH_TYPE_NONVALUE_P | |
39 | 1: C_TYPE_VARIABLE_SIZE | |
40 | 2: CH_IS_ACCESS_MODE | |
41 | 3: CH_IS_BUFFER_MODE | |
42 | 4: CH_IS_EVENT_MODE | |
43 | 5: CH_ENUM_IS_NUMBERED | |
44 | 6: CH_IS_TEXT_MODE | |
45 | */ | |
46 | ||
47 | /* Language-dependent contents of an identifier. */ | |
48 | ||
49 | struct lang_identifier | |
50 | { | |
51 | /* These match the fields in c-tree.h. */ | |
52 | struct tree_identifier ignore; | |
53 | tree outer_value, local_value, implicit_decl; | |
54 | tree error_locus, limbo_value; | |
55 | ||
56 | /* These are Chill-specific. */ | |
57 | tree forbid; | |
58 | tree signal_dest; | |
59 | int signal_data; | |
60 | }; | |
61 | ||
62 | /* Macros for access to language-specific slots in an identifier. */ | |
63 | ||
64 | /* The outer_value is a chain of decls (normally a single decl), | |
65 | that have been granted into the scope surrounding all modules. */ | |
66 | #define IDENTIFIER_OUTER_VALUE(NODE) \ | |
67 | (((struct lang_identifier *)(NODE))->outer_value) | |
68 | #define IDENTIFIER_LOCAL_VALUE(NODE) \ | |
69 | (((struct lang_identifier *)(NODE))->local_value) | |
70 | #define IDENTIFIER_IMPLICIT_DECL(NODE) \ | |
71 | (((struct lang_identifier *)(NODE))->implicit_decl) | |
72 | #define IDENTIFIER_ERROR_LOCUS(NODE) \ | |
73 | (((struct lang_identifier *)(NODE))->error_locus) | |
74 | #define IDENTIFIER_FORBID(NODE) \ | |
75 | (((struct lang_identifier *)(NODE))->forbid) | |
76 | ||
77 | /* The nesting level increates by one for every nested 'group'. | |
78 | Predefined declarations have level -1; the global scope is level 0. | |
79 | */ | |
80 | #define DECL_NESTING_LEVEL(DECL) \ | |
81 | ((DECL)->decl.vindex ? TREE_INT_CST_LOW((DECL)->decl.vindex) : -1) | |
82 | ||
83 | /* Nesting of things that can have an ON-unit attached. */ | |
84 | extern int action_nesting_level; | |
85 | ||
86 | /* The DECL_NAME of a FIELD_DECL that represents the ELSE part of a variant. */ | |
87 | #define ELSE_VARIANT_NAME ridpointers[(int) RID_ELSE] | |
88 | ||
89 | /* For a LABEL_DECL: action_nesting_level of its target. */ | |
90 | #define DECL_ACTION_NESTING_LEVEL(NODE) ((NODE)->decl.saved_insns.i) | |
91 | ||
92 | #define DECL_OLD_PREFIX(DECL) ((DECL)->decl.initial) | |
93 | #define DECL_NEW_PREFIX(DECL) ((DECL)->decl.result) | |
94 | #define DECL_POSTFIX(DECL) ((DECL)->decl.arguments) | |
95 | extern tree ALL_POSTFIX; | |
96 | #define DECL_SEIZEFILE(DECL) ((DECL)->decl.size) | |
97 | #define DECL_POSTFIX_ALL(DECL) (DECL_POSTFIX(DECL) == ALL_POSTFIX) | |
98 | #define DECL_OLD_NAME(DECL) decl_old_name(DECL) | |
99 | /* For a siezefile name this means restricted usage of this file. | |
100 | In this case, the USE_SEIZE_FILE directive will not be copied | |
101 | into the grant file */ | |
102 | #define CH_USE_SEIZEFILE_RESTRICTED(NODE) TREE_LANG_FLAG_4(NODE) | |
103 | extern tree decl_old_name PROTO ((tree)); | |
104 | ||
105 | /* for selective granting, mark as already granted */ | |
106 | #define CH_ALREADY_GRANTED(NODE) TREE_LANG_FLAG_4(NODE) | |
107 | ||
108 | /* to store the receiving process of that signal | |
109 | at definition time */ | |
110 | #define IDENTIFIER_SIGNAL_DEST(NODE) \ | |
111 | (((struct lang_identifier *)(NODE))->signal_dest) | |
112 | ||
113 | /* indicates a signal with no data */ | |
114 | #define IDENTIFIER_SIGNAL_DATA(NODE) \ | |
115 | (((struct lang_identifier *)(NODE))->signal_data) | |
116 | ||
117 | /* In identifiers, C uses the following fields in a special way: | |
118 | TREE_PUBLIC to record that there was a previous local extern decl. | |
119 | TREE_USED to record that such a decl was used. | |
120 | TREE_ADDRESSABLE to record that the address of such a decl was used. */ | |
121 | ||
122 | /* Nonzero means reject anything that Z.200 Recommendation forbids. */ | |
123 | extern int pedantic; | |
124 | ||
125 | /* the prototypical CHILL INSTANCE type */ | |
126 | extern tree instance_type_node; | |
127 | ||
128 | /* Non-zero if type or expr depends on non-resolved identifier. */ | |
129 | #define UNSATISFIED(expr) \ | |
130 | (UNSATISFIED_FLAG (expr) || TREE_CODE (expr) == IDENTIFIER_NODE) | |
131 | #define UNSATISFIED_FLAG(expr) TREE_LANG_FLAG_3 (expr) | |
132 | ||
133 | /* Non-zero in a TREE_LIST if part of a labelled structure tuple. */ | |
134 | #define TUPLE_NAMED_FIELD(LIST) TREE_LANG_FLAG_1(LIST) | |
135 | ||
136 | /* In an ARRAY_TYPE, RECORD_TYPE or UNION_TYPE, nonzero if any component | |
137 | is read-only. */ | |
138 | #define TYPE_FIELDS_READONLY(type) TREE_LANG_FLAG_1 (type) | |
139 | ||
140 | /* True if TYPE has the "read-only property." */ | |
141 | #define TYPE_READONLY_PROPERTY(TYPE) \ | |
142 | (TYPE_READONLY (TYPE) || TYPE_FIELDS_READONLY (TYPE)) | |
143 | ||
144 | /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile. */ | |
145 | #define C_TYPE_FIELDS_VOLATILE(type) TREE_LANG_FLAG_2 (type) | |
146 | ||
147 | /* In a CASE selector expression, nonzero if any alternative specifies (ELSE) for | |
148 | that selector. */ | |
149 | #define ELSE_LABEL_SPECIFIED(expr) TREE_LANG_FLAG_2 (expr) | |
150 | ||
151 | /* CH_CHARS_TYPE_P(TYPE) is true iff TYPE is a character string type. | |
152 | ||
153 | There is no essential difference between a string and a (one-dimensional) | |
154 | character array, at least for non-varying types. I don't know where | |
155 | the Chill designers got the idea that it was useful to make a distinction. | |
156 | (I suspect packing might be involved, but on a byte-adressable machine | |
157 | we don't care.) Since we want the same code to be generated for | |
158 | char arrays as for char strings, we use the same representation for | |
159 | both. But we still need to distinguish them for the sake a Chill | |
160 | type checking. We do that using TYPE_STRING_FLAG. */ | |
161 | ||
162 | #define MARK_AS_STRING_TYPE(TYPE) (TYPE_STRING_FLAG (TYPE) = 1) | |
163 | ||
164 | #define CH_CHARS_TYPE_P(type) \ | |
165 | (TREE_CODE (type) == ARRAY_TYPE && TREE_CODE(TREE_TYPE(type)) == CHAR_TYPE \ | |
166 | && TYPE_STRING_FLAG (type)) | |
167 | ||
168 | /* True if TYPE is CHARS(1). */ | |
169 | #define CH_CHARS_ONE_P(TYPE) (CH_CHARS_TYPE_P(TYPE) \ | |
170 | && integer_zerop (TYPE_MAX_VALUE (TYPE_DOMAIN (TYPE)))) | |
171 | ||
172 | /* True if TYPE is a bitstring (BOOLS or BIT) type. | |
173 | The TYPE_STRING_FLAG is used to distinguish a bitstring from a powerset. */ | |
174 | ||
175 | #define CH_BOOLS_TYPE_P(type) \ | |
176 | (TREE_CODE (type) == SET_TYPE && TYPE_STRING_FLAG (type)) | |
177 | ||
178 | /* True if TYPE is BOOLS(1). */ | |
179 | #define CH_BOOLS_ONE_P(TYPE) (CH_BOOLS_TYPE_P(TYPE) \ | |
180 | && integer_zerop (TYPE_MAX_VALUE (TYPE_DOMAIN (TYPE)))) | |
181 | ||
182 | /* Value is nonzero if TYPE is a CHILL string type. | |
183 | See CH_CHARS_TYPE_P and CH_BOOLS_TYPE_P above. */ | |
184 | ||
185 | #define CH_STRING_TYPE_P(type) \ | |
186 | ((TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == SET_TYPE) \ | |
187 | && TYPE_STRING_FLAG (type)) | |
188 | ||
189 | /* In a RECORD_TYPE, a sorted array of the fields of the type. */ | |
190 | struct lang_type_record | |
191 | { | |
192 | int len; | |
193 | tree tasking_code_decl; | |
194 | tree elts[1]; | |
195 | }; | |
196 | ||
197 | struct lang_type | |
198 | { | |
199 | union | |
200 | { | |
201 | struct lang_type_record rec; | |
202 | } foo; | |
203 | }; | |
204 | ||
205 | struct lang_decl | |
206 | { | |
207 | union | |
208 | { | |
209 | tree stuff; | |
210 | } foo; | |
211 | }; | |
212 | /* A tasking type's corresponding tasking_code_variable has its | |
213 | decl pointer in here. */ | |
214 | #define DECL_TASKING_CODE_DECL(DECL) (DECL_LANG_SPECIFIC(DECL)) | |
215 | ||
216 | /* A pointer to an as-yet undefined type. */ | |
217 | extern tree unknown_type_node; | |
218 | ||
219 | /* The CHILL type INT (either integer_type_node or | |
220 | short_integer_type_node). */ | |
221 | extern tree chill_integer_type_node; | |
222 | extern tree chill_unsigned_type_node; | |
223 | ||
224 | /* Nonzero for FIELD_DECL node means that this FIELD_DECL is | |
225 | a member of a union construct. */ | |
226 | #define TREE_UNION_ELEM(NODE) ((NODE)->decl.regdecl_flag) /* overloaded! */ | |
227 | ||
228 | /* Mark which labels are explicitly declared. | |
229 | These may be shadowed, and may be referenced from nested functions. */ | |
230 | #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) | |
231 | ||
232 | /* Record whether a type was written with nonconstant size. | |
233 | Note that TYPE_SIZE may have simplified to a constant. */ | |
234 | #define C_TYPE_VARIABLE_SIZE(type) TYPE_LANG_FLAG_1 (type) | |
235 | ||
236 | #define DECL_WEAK_NAME(DECL) DECL_LANG_FLAG_0(DECL) | |
237 | ||
238 | /* These are for FUNCTION_DECLs. */ | |
239 | #define CH_DECL_GENERAL(DECL) DECL_LANG_FLAG_1(DECL) | |
240 | #define CH_DECL_SIMPLE(DECL) DECL_LANG_FLAG_2(DECL) | |
241 | #define CH_DECL_RECURSIVE(DECL) DECL_LANG_FLAG_3(DECL) | |
242 | #define CH_FUNCTION_SETS_RESULT(DECL) DECL_LANG_FLAG_6(DECL) | |
243 | ||
244 | /* For a CONST_DECL, indicates that it was implicitly declared | |
245 | in a SET mode declaration, and it should not be explicitly granted. */ | |
246 | #define CH_DECL_ENUM(DECL) DECL_LANG_FLAG_3(DECL) | |
247 | ||
248 | /* in a FIELD_DECL use DECL_LANG_FLAG_4 to mark FORBID in a grant-statement */ | |
249 | #define CH_DECL_FORBID(DECL) DECL_LANG_FLAG_4(DECL) | |
250 | ||
251 | /* in an ALIAS_DECL use DECL_LANG_FLAG_4 to mark decl was granted */ | |
252 | #define CH_DECL_GRANTED(DECL) DECL_LANG_FLAG_4(DECL) | |
253 | ||
254 | /* (in a non-FIELD_DECL) note that this decl was hidden by push_module(). */ | |
255 | #define DECL_HIDDEN_BY_MODULE(decl) DECL_LANG_FLAG_4 (decl) | |
256 | ||
257 | /* Record in each node resulting from a binary operator | |
258 | what operator was specified for it. */ | |
259 | #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp)) | |
260 | ||
261 | /* Store a value in that field. */ | |
262 | #define C_SET_EXP_ORIGINAL_CODE(exp, code) \ | |
263 | (TREE_COMPLEXITY (exp) = (int)(code)) | |
264 | ||
265 | /* Record whether a typedef for type `int' was actually `signed int'. */ | |
266 | #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp)) | |
267 | ||
268 | /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as | |
269 | TYPE_ARG_TYPES for functions with prototypes, but created for functions | |
270 | without prototypes. */ | |
271 | #define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_NONCOPIED_PARTS (NODE) | |
272 | ||
273 | /* For FUNCTION_TYPE or METHOD_TYPE, a list of the | |
274 | (names of) exceptions that this type can raise. */ | |
275 | #define TYPE_RAISES_EXCEPTIONS(NODE) ((NODE)->type.minval) | |
276 | ||
277 | /* For UNION_TYPE, the list of tag fields that distinguishes the members. */ | |
278 | #define TYPE_TAGFIELDS(NODE) ((NODE)->type.minval) | |
279 | ||
280 | /* For RECORD_TYPE, the tag values that select it. */ | |
281 | #define TYPE_TAG_VALUES(NODE) TYPE_BINFO(NODE) | |
282 | ||
283 | /* For VAR_DECL, TYPE_DECL, FUNCTION_DECL, indicates that | |
284 | the DECL was read from a seizefile but not seized */ | |
285 | #define CH_DECL_NOTDECLARED(DECL) DECL_LANG_FLAG_5(DECL) | |
286 | ||
287 | /* For FUNCTION_DECL's, mark as PROCESSEs. */ | |
288 | #define CH_DECL_PROCESS(DECL) DECL_LANG_FLAG_7(DECL) | |
289 | ||
290 | /* For TYPE_DECL's, mark as SIGNALs. */ | |
291 | #define CH_DECL_SIGNAL(DECL) DECL_LANG_FLAG_7(DECL) | |
292 | \f | |
293 | /* Macros using terminology of the CHILL Blue Book. */ | |
294 | ||
295 | /* A class is either Null, All, M-value, M-derived, or M-reference, | |
296 | where M is some mode (type). */ | |
297 | ||
298 | enum ch_class_kind { | |
299 | CH_ALL_CLASS, CH_NULL_CLASS, | |
300 | CH_VALUE_CLASS, CH_DERIVED_CLASS, CH_REFERENCE_CLASS | |
301 | }; | |
302 | ||
303 | typedef struct ch_class { | |
304 | enum ch_class_kind kind; | |
305 | tree mode; /* The 'M' in M-value, M-derived, or M-reference. */ | |
306 | } ch_class; | |
307 | ||
308 | struct mode_chain; /* Forward reference */ | |
309 | ||
310 | #define CH_IS_REFERENCE_MODE(MODE) (TREE_CODE (MODE) == POINTER_TYPE) | |
311 | #define CH_IS_BOUND_REFERENCE_MODE(MODE) \ | |
312 | (TREE_CODE (MODE) == POINTER_TYPE && TREE_TYPE(MODE) != void_type_node) | |
313 | #define CH_IS_PROCEDURE_MODE(MODE) (TREE_CODE (MODE) == FUNCTION_TYPE) | |
314 | #define CH_IS_INSTANCE_MODE(MODE) (CH_SIMILAR (MODE, instance_type_node)) | |
315 | #define CH_IS_BUFFER_MODE(MODE) (TYPE_LANG_FLAG_3(MODE)) | |
316 | #define CH_IS_EVENT_MODE(MODE) (TYPE_LANG_FLAG_4(MODE)) | |
317 | /* This is TRUE if the set is numbered, which makes pred/succ | |
318 | unusable */ | |
319 | #define CH_ENUM_IS_NUMBERED(MODE) (TYPE_LANG_FLAG_5(MODE)) | |
320 | ||
321 | /* for ACCESS, and TEXT mode */ | |
322 | #define CH_IS_ACCESS_MODE(MODE) (TYPE_LANG_FLAG_2(MODE)) | |
323 | #define CH_IS_TEXT_MODE(MODE) (TYPE_LANG_FLAG_6(MODE)) | |
324 | #define CH_IS_ASSOCIATION_MODE(MODE) (CH_SIMILAR (MODE, association_type_node)) | |
325 | #define CH_IS_USAGE_MODE(MODE) (CH_SIMILAR (MODE, usage_type_node)) | |
326 | #define CH_IS_WHERE_MODE(MODE) (CH_SIMILAR (MODE, where_type_node)) | |
327 | ||
328 | /* for RECORD or ARRAY type */ | |
329 | #define CH_TYPE_NONVALUE_P(MODE) (TYPE_LANG_FLAG_0(MODE)) | |
330 | ||
331 | /* CH_NOVELTY is the novelty of a mode: NULL_TREE means the novelty is nil; | |
332 | otherwise a TYPE_DECL matching the defining occurrence of a newmode. */ | |
333 | #define CH_NOVELTY(MODE) TYPE_CONTEXT(MODE) | |
334 | ||
335 | /* Set the novelty of MODE to NOVELTY (which is assumed to be non-nil). */ | |
336 | #define SET_CH_NOVELTY(MODE, NOVELTY) (CH_NOVELTY (MODE) = (NOVELTY)) | |
337 | #define SET_CH_NOVELTY_NONNIL(MODE, NOVELTY) (CH_NOVELTY (MODE) = (NOVELTY)) | |
338 | ||
339 | /* CH_DERIVED_FLAG is true the class of EXPR is X-derived for some X. */ | |
340 | #define CH_DERIVED_FLAG(EXPR) TREE_LANG_FLAG_5(EXPR) | |
341 | ||
342 | #define CH_HAS_REFERENCING_PROPERTY(MODE) \ | |
343 | (TREE_CODE (MODE) == POINTER_TYPE) /* incomplete FIXME! */ | |
344 | ||
345 | /* CH_COMPATIBLE(EXPR, MODE) is true if the class of EXPR is | |
346 | "compatible" with the type MODE. */ | |
347 | #define CH_COMPATIBLE(EXPR, MODE) chill_compatible(EXPR, MODE) | |
348 | #define CH_COMPATIBLE_CLASSES(EXPR1, EXPR2) chill_compatible_classes(EXPR1, EXPR2) | |
349 | #define CH_STATIC_MODE(MODE) 1 /* for now */ | |
350 | #define CH_SIMILAR(MODE1, MODE2) chill_similar(MODE1, MODE2, 0) | |
351 | #define CH_ROOT_MODE(MODE) chill_root_mode(MODE) | |
352 | #define CH_RESULTING_CLASS(C1, C2) chill_resulting_class(C1, C2) | |
353 | #define CH_ROOT_RESULTING_CLASS(E1, E2) \ | |
354 | CH_RESULTING_CLASS (chill_expr_class(E1), chill_expr_class(E2)) | |
355 | #define CH_RESULTING_MODE(MODE1, MODE2) chill_resulting_mode(MODE1, MODE2) | |
356 | #define CH_V_EQUIVALENT(MODE1, MODE2) (CH_SIMILAR(MODE1, MODE2) \ | |
357 | && CH_NOVELTY(MODE1) == CH_NOVELTY(MODE2)) | |
358 | #define CH_EQUIVALENT(MODE1, MODE2) \ | |
359 | (!integer_zerop (chill_equivalent (MODE1, MODE2, 0))) | |
360 | #define CH_RESTRICTABLE_TO(MODE1, MODE2) \ | |
361 | CH_EQUIVALENT(MODE1, MODE2) /* && some more stuff FIXME! */ | |
362 | ||
363 | /* pass an OFFSET_TYPE or REFERENCE_TYPE's underlying type to SCALAR_P */ | |
364 | #define CH_READ_COMPATIBLE(modeM, modeN) chill_read_compatible(modeM, modeN) | |
365 | ||
366 | #define SCALAR_P(TYPE) (TYPE != NULL_TREE \ | |
367 | && (TREE_CODE (TYPE) == INTEGER_TYPE \ | |
368 | || TREE_CODE (TYPE) == REAL_TYPE \ | |
369 | || TREE_CODE (TYPE) == ENUMERAL_TYPE \ | |
370 | || TREE_CODE (TYPE) == BOOLEAN_TYPE \ | |
371 | || TREE_CODE (TYPE) == CHAR_TYPE \ | |
372 | || TREE_CODE (TYPE) == POINTER_TYPE \ | |
373 | || TREE_CODE (TYPE) == INSTANCE_TYPE)) | |
374 | #define CH_REFERABLE(EXPR) chill_referable(EXPR) | |
375 | #define CH_LOCATION_P(EXPR) chill_location (EXPR) | |
376 | \f | |
377 | extern int maybe_objc_comptypes (); | |
378 | extern tree maybe_building_objc_message_expr (); | |
379 | \f | |
380 | /* Standard named or nameless data types of the C compiler. */ | |
381 | ||
382 | /* Nonzero means `$' can be in an identifier. */ | |
383 | ||
384 | extern int dollars_in_ident; | |
385 | ||
386 | /* Nonzero means allow type mismatches in conditional expressions; | |
387 | just make their values `void'. */ | |
388 | ||
389 | extern int flag_cond_mismatch; | |
390 | ||
391 | /* Nonzero means don't recognize the keyword `asm'. */ | |
392 | ||
393 | extern int flag_no_asm; | |
394 | ||
5ba6e819 PB |
395 | /* Nonzero means warn about implicit declarations. */ |
396 | ||
397 | extern int warn_implicit; | |
398 | ||
399 | /* Nonzero means give string constants the type `const char *' | |
400 | to get extra warnings from them. These warnings will be too numerous | |
401 | to be useful, except in thoroughly ANSIfied programs. */ | |
402 | ||
403 | extern int warn_write_strings; | |
404 | ||
405 | /* Nonzero means warn about sizeof (function) or addition/subtraction | |
406 | of function pointers. */ | |
407 | ||
408 | extern int warn_pointer_arith; | |
409 | ||
410 | /* Nonzero means warn for all old-style non-prototype function decls. */ | |
411 | ||
412 | extern int warn_strict_prototypes; | |
413 | ||
414 | /* Nonzero means warn about multiple (redundant) decls for the same single | |
415 | variable or function. */ | |
416 | ||
417 | extern int warn_redundant_decls; | |
418 | ||
419 | /* Nonzero means warn about extern declarations of objects not at | |
420 | file-scope level and about *all* declarations of functions (whether | |
421 | extern or static) not at file-scope level. Note that we exclude | |
422 | implicit function declarations. To get warnings about those, use | |
423 | -Wimplicit. */ | |
424 | ||
425 | extern int warn_nested_externs; | |
426 | ||
427 | /* Nonzero means warn about pointer casts that can drop a type qualifier | |
428 | from the pointer target type. */ | |
429 | ||
430 | extern int warn_cast_qual; | |
431 | ||
432 | /* Warn about traditional constructs whose meanings changed in ANSI C. */ | |
433 | ||
434 | extern int warn_traditional; | |
435 | ||
436 | /* Warn about *printf or *scanf format/argument anomalies. */ | |
437 | ||
438 | extern int warn_format; | |
439 | ||
440 | /* Warn about a subscript that has type char. */ | |
441 | ||
442 | extern int warn_char_subscripts; | |
443 | ||
444 | /* Warn if a type conversion is done that might have confusing results. */ | |
445 | ||
446 | extern int warn_conversion; | |
447 | ||
448 | /* Warn if switch labels aren't complete, or are duplicated */ | |
449 | ||
450 | extern int warn_switch; | |
451 | ||
452 | /* Nonzero means do some things the same way PCC does. */ | |
453 | ||
454 | extern int flag_traditional; | |
455 | ||
456 | /* Nonzero means warn about suggesting putting in ()'s. */ | |
457 | ||
458 | extern int warn_parentheses; | |
459 | ||
460 | /* Nonzero means this is a function to call to perform comptypes | |
461 | on two record types. */ | |
462 | ||
463 | extern int (*comptypes_record_hook) (); | |
464 | ||
465 | /* Nonzero means we are reading code that came from a system header file. */ | |
466 | extern int system_header_p; | |
467 | ||
468 | /* One means range checking is on; <= 0 off; -1 permanently off. */ | |
469 | extern int range_checking; | |
470 | ||
471 | /* 0 means empty checking is off, else it is on */ | |
472 | extern int empty_checking; | |
473 | ||
474 | /* 1 means -fruntime-checking specified (default), o means -fno-runtime-checking */ | |
475 | extern int runtime_checking_flag; | |
476 | ||
477 | /* Type node for boolean types. */ | |
478 | ||
479 | extern tree boolean_type_node; | |
480 | extern tree signed_boolean_type_node; | |
481 | ||
482 | extern tree string_one_type_node; | |
483 | extern tree bitstring_one_type_node, bit_zero_node, bit_one_node; | |
484 | ||
485 | extern tree float_type_node, double_type_node; | |
486 | extern tree void_type_node, ptr_type_node, const_ptr_type_node; | |
487 | ||
488 | /* a VOID_TYPE node, packaged in a TREE_LIST. */ | |
489 | ||
490 | extern tree void_list_node; | |
491 | ||
492 | /* Chill language-specific tree codes. */ | |
493 | #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, | |
494 | enum chill_tree_code { | |
495 | __DUMMY = LAST_AND_UNUSED_TREE_CODE, | |
496 | #include "ch-tree.def" | |
497 | LAST_CHILL_TREE_CODE | |
498 | }; | |
499 | #undef DEFTREECODE | |
500 | ||
501 | enum chill_built_in_function | |
502 | { | |
503 | DUMMY_FIRST_CHILL_BUILT_IN = END_BUILTINS, | |
504 | ||
505 | BUILT_IN_CH_ABS, | |
506 | BUILT_IN_ABSTIME, | |
507 | BUILT_IN_ADDR, | |
508 | BUILT_IN_ALLOCATE, | |
509 | BUILT_IN_ALLOCATE_GLOBAL_MEMORY, | |
510 | BUILT_IN_ALLOCATE_MEMORY, | |
511 | BUILT_IN_ARCCOS, | |
512 | BUILT_IN_ARCSIN, | |
513 | BUILT_IN_ARCTAN, | |
514 | BUILT_IN_ASSOCIATE, | |
515 | BUILT_IN_CARD, | |
516 | BUILT_IN_CONNECT, | |
517 | BUILT_IN_COPY_NUMBER, | |
518 | BUILT_IN_CH_COS, | |
519 | BUILT_IN_CREATE, | |
520 | BUILT_IN_DAYS, | |
521 | BUILT_IN_CH_DELETE, | |
522 | BUILT_IN_DESCR, | |
523 | BUILT_IN_DISCONNECT, | |
524 | BUILT_IN_DISSOCIATE, | |
525 | BUILT_IN_EOLN, | |
526 | BUILT_IN_EXP, | |
527 | BUILT_IN_EXPIRED, | |
528 | BUILT_IN_EXISTING, | |
529 | BUILT_IN_GEN_CODE, | |
530 | BUILT_IN_GEN_INST, | |
531 | BUILT_IN_GEN_PTYPE, | |
532 | BUILT_IN_GETASSOCIATION, | |
533 | BUILT_IN_GETSTACK, | |
534 | BUILT_IN_GETTEXTACCESS, | |
535 | BUILT_IN_GETTEXTINDEX, | |
536 | BUILT_IN_GETTEXTRECORD, | |
537 | BUILT_IN_GETUSAGE, | |
538 | BUILT_IN_HOURS, | |
539 | BUILT_IN_INDEXABLE, | |
540 | BUILT_IN_INTTIME, | |
541 | BUILT_IN_ISASSOCIATED, | |
542 | BUILT_IN_LENGTH, | |
543 | BUILT_IN_LOG, | |
544 | BUILT_IN_LOWER, | |
545 | BUILT_IN_LN, | |
546 | BUILT_IN_MAX, | |
547 | BUILT_IN_MILLISECS, | |
548 | BUILT_IN_MIN, | |
549 | BUILT_IN_MINUTES, | |
550 | BUILT_IN_MODIFY, | |
551 | BUILT_IN_NUM, | |
552 | BUILT_IN_OUTOFFILE, | |
553 | BUILT_IN_PRED, | |
554 | BUILT_IN_PROC_TYPE, | |
555 | BUILT_IN_QUEUE_LENGTH, | |
556 | BUILT_IN_READABLE, | |
557 | BUILT_IN_READRECORD, | |
558 | BUILT_IN_READTEXT, | |
559 | BUILT_IN_RETURN_MEMORY, | |
560 | BUILT_IN_SECS, | |
561 | BUILT_IN_SETTEXTACCESS, | |
562 | BUILT_IN_SETTEXTINDEX, | |
563 | BUILT_IN_SETTEXTRECORD, | |
564 | BUILT_IN_SEQUENCIBLE, | |
565 | BUILT_IN_SIZE, | |
566 | BUILT_IN_SQRT, | |
567 | BUILT_IN_SUCC, | |
568 | BUILT_IN_CH_SIN, | |
569 | BUILT_IN_TAN, | |
570 | BUILT_IN_TRUNC, | |
571 | BUILT_IN_TERMINATE, | |
572 | BUILT_IN_UPPER, | |
573 | BUILT_IN_VARIABLE, | |
574 | BUILT_IN_WAIT, | |
575 | BUILT_IN_WRITEABLE, | |
576 | BUILT_IN_WRITERECORD, | |
577 | BUILT_IN_WRITETEXT, | |
578 | }; | |
579 | \f | |
580 | /* name of additional (compiler generated) arguments for | |
581 | functions which may propagate exceptions. */ | |
582 | #define CALLER_FILE "__CALLER_FILE__" | |
583 | #define CALLER_LINE "__CALLER_LINE__" | |
584 | ||
585 | /* field-name strings for the fields of the structure which | |
586 | represents a CHILL VARYING array. The angle brackets assure | |
587 | that no user-defined structure can match this one. | |
588 | This field holds, at runtime, the current length of the | |
589 | array, in UNITS, not including the length itself. It's an | |
590 | integer_type_node */ | |
591 | #define VAR_LENGTH "__var_length" | |
592 | ||
593 | /* This field is statically allocated to the user-defined | |
594 | size, but contains valid array entries starting from the | |
595 | first allocated space, proceeding for VAR_LENGTH bytes. | |
596 | There are no holes in the data; the user isn't allowed | |
597 | to store beyond the first available entry. */ | |
598 | ||
599 | #define VAR_DATA "__var_data" | |
600 | ||
601 | /* This field is the name of the array, encapsulated in the CHILL | |
602 | structure used to represent an array type parameter. */ | |
603 | /*#define ARRAY_DATA "__array_data"*/ | |
604 | ||
605 | /* The CHILL INSTANCE type is composed of two CHILL integer | |
606 | fields, the process_type (set by the user with the | |
607 | process_type compiler directive, and the proc_copy field, | |
608 | which is set by the start_process call's first parameter. */ | |
609 | #define INS_PTYPE "__proc_type" | |
610 | #define INS_COPY "__proc_copy" | |
611 | ||
612 | /* This is the actual array type inside the VARYING struct */ | |
613 | #define CH_VARYING_ARRAY_TYPE(TYPE) TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (TYPE))) | |
614 | ||
615 | /* Identifiers which hold the VAR_LENGTH and VAR_DATA strings. */ | |
616 | extern tree var_length_id; | |
617 | extern tree var_data_id; | |
618 | ||
619 | /* A RANGE_EXPR representing an ELSE in a case label. */ | |
620 | extern tree case_else_node; | |
621 | ||
622 | #if 0 /* changed to function */ | |
623 | /* return non-zero if type is a compiler-generated VARYING array record */ | |
624 | #define CH_VARYING_TYPE_P(type) (TREE_CODE (type) == RECORD_TYPE && \ | |
625 | DECL_NAME (TYPE_FIELDS (type)) == \ | |
626 | get_identifier (VAR_LENGTH) && \ | |
627 | DECL_NAME (TREE_CHAIN (TYPE_FIELDS (type))) == \ | |
628 | get_identifier (VAR_DATA) && \ | |
629 | TREE_CHAIN (CH_VARYING_ARRAY_TYPE (type)) == NULL_TREE) | |
630 | ||
631 | #endif | |
632 | ||
633 | /* in c-aux-info.c */ | |
634 | extern void gen_aux_info_record PROTO((tree, int, int, int)); | |
635 | ||
636 | /* in c-common.c */ | |
637 | extern tree combine_strings PROTO((tree)); | |
638 | extern void constant_expression_warning PROTO((tree)); | |
639 | extern void decl_attributes PROTO((tree, tree)); | |
640 | extern void declare_function_name PROTO((void)); | |
75111422 | 641 | #ifdef BUFSIZ |
5ba6e819 | 642 | extern char *get_directive_line PROTO((FILE *)); |
75111422 | 643 | #endif |
5ba6e819 PB |
644 | extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *)); |
645 | ||
646 | /* in c-decl.c */ | |
647 | extern tree short_integer_type_node, integer_type_node; | |
648 | extern tree long_integer_type_node, long_long_integer_type_node; | |
649 | extern tree short_unsigned_type_node, unsigned_type_node; | |
650 | extern tree long_unsigned_type_node, long_long_unsigned_type_node; | |
651 | extern tree ptrdiff_type_node; | |
652 | extern tree unsigned_char_type_node, signed_char_type_node, char_type_node; | |
653 | extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node; | |
654 | extern tree float_type_node, double_type_node, long_double_type_node; | |
655 | extern tree void_type_node, ptr_type_node, const_ptr_type_node; | |
656 | extern tree default_function_type; | |
657 | extern tree double_ftype_double, double_ftype_double_double; | |
658 | extern tree int_ftype_int, long_ftype_long; | |
659 | extern tree void_ftype_ptr_ptr_int, int_ftype_ptr_ptr_int; | |
660 | extern tree void_ftype_ptr_int_int, string_ftype_ptr_ptr; | |
661 | extern tree int_ftype_string_string, int_ftype_cptr_cptr_sizet; | |
662 | /* Nodes for boolean constants TRUE and FALSE */ | |
663 | extern tree boolean_true_node, boolean_false_node; | |
664 | ||
665 | extern tree global_function_decl; | |
666 | ||
667 | /* in except.c */ | |
668 | extern void except_init_pass_2 PROTO((void)); | |
669 | ||
670 | /* in ch-loop.c */ | |
671 | extern int flag_local_loop_counter; | |
672 | extern void push_loop_block PROTO((void)); | |
673 | extern void pop_loop_block PROTO((void)); | |
674 | extern void build_loop_start PROTO((tree)); | |
675 | extern void top_loop_end_check PROTO((tree)); | |
676 | extern void build_loop_end PROTO((void)); | |
677 | extern void build_loop_iterator PROTO((tree, tree, tree, tree, int, int, int)); | |
678 | extern void begin_loop_scope PROTO((void)); | |
679 | extern void end_loop_scope PROTO((tree)); | |
680 | extern void nonvalue_begin_loop_scope PROTO((void)); | |
681 | extern void nonvalue_end_loop_scope PROTO((void)); | |
682 | ||
683 | extern tree build_enumerator PROTO((tree, tree)); | |
684 | extern tree builtin_function PROTO((char *, tree, enum built_in_function function_, char *)); | |
685 | extern tree c_build_type_variant PROTO((tree, int, int)); | |
686 | extern int c_decode_option PROTO((int, char **)); | |
687 | extern void c_mark_varargs PROTO((void)); | |
688 | extern void clear_parm_order PROTO((void)); | |
689 | extern tree combine_parm_decls PROTO((tree, tree, int)); | |
690 | extern int complete_array_type PROTO((tree, tree, int)); | |
691 | extern void declare_parm_level PROTO((int)); | |
692 | extern tree define_label PROTO((char *, int, tree)); | |
693 | extern void delete_block PROTO((tree)); | |
694 | extern void finish_decl PROTO((tree)); | |
695 | extern tree finish_enum PROTO((tree, tree)); | |
696 | extern void finish_function PROTO((int)); | |
697 | extern tree finish_struct PROTO((tree, tree)); | |
698 | extern tree get_parm_decls PROTO((void)); | |
699 | extern tree get_parm_info PROTO((int)); | |
700 | extern tree getdecls PROTO((void)); | |
701 | extern tree gettags PROTO((void)); | |
702 | extern int global_bindings_p PROTO((void)); | |
703 | extern tree grokfield PROTO((char *, int, tree, tree, tree)); | |
704 | extern tree groktypename PROTO((tree)); | |
705 | extern tree groktypename_in_parm_context PROTO((tree)); | |
706 | extern tree implicitly_declare PROTO((tree)); | |
707 | extern void init_decl_processing PROTO((void)); | |
708 | extern void insert_block PROTO((tree)); | |
709 | extern void keep_next_level PROTO((void)); | |
710 | extern int kept_level_p PROTO((void)); | |
711 | extern tree lookup_label PROTO((tree)); | |
712 | extern tree lookup_name PROTO((tree)); | |
713 | extern tree maybe_build_cleanup PROTO((tree)); | |
714 | extern void parmlist_tags_warning PROTO((void)); | |
715 | extern void pending_xref_error PROTO((void)); | |
716 | extern void pop_chill_function_context PROTO((void)); | |
717 | extern tree poplevel PROTO((int, int, int)); | |
75111422 | 718 | #ifdef BUFSIZ |
5ba6e819 PB |
719 | extern void print_lang_decl PROTO((FILE *,tree, int)); |
720 | extern void print_lang_identifier PROTO((FILE *,tree, int)); | |
721 | extern void print_lang_type PROTO((FILE *,tree, int)); | |
75111422 | 722 | #endif |
5ba6e819 PB |
723 | extern void push_chill_function_context PROTO((void)); |
724 | extern void push_parm_decl PROTO((tree)); | |
725 | extern tree pushdecl PROTO((tree)); | |
726 | extern tree pushdecl_top_level PROTO((tree)); | |
727 | extern void pushlevel PROTO((int)); | |
728 | extern void set_block PROTO((tree)); | |
729 | extern tree shadow_label PROTO((tree)); | |
730 | extern void shadow_record_fields PROTO((tree)); | |
731 | extern void shadow_tag PROTO((tree)); | |
732 | extern void shadow_tag_warned PROTO((tree, int)); | |
733 | extern tree start_enum PROTO((tree)); | |
734 | extern int start_function PROTO((tree, tree, int)); | |
735 | extern tree start_decl PROTO((tree, tree, int)); | |
736 | extern tree start_struct PROTO((enum tree_code, tree)); | |
737 | extern void store_parm_decls PROTO((void)); | |
738 | extern tree xref_tag PROTO((enum tree_code, tree)); | |
739 | ||
740 | /* in c-typeck.c */ | |
741 | extern tree build_array_ref PROTO((tree, tree)); | |
742 | extern tree build_c_cast PROTO((tree, tree)); | |
743 | extern tree build_chill_modify_expr PROTO((tree, tree)); | |
744 | extern tree build_chill_component_ref PROTO((tree, tree)); | |
745 | extern tree build_component_ref PROTO((tree, tree)); | |
746 | extern tree build_compound_expr PROTO((tree)); | |
747 | extern tree build_conditional_expr PROTO((tree, tree, tree)); | |
748 | extern tree build_function_call PROTO((tree, tree)); | |
749 | extern tree build_indirect_ref PROTO((tree, char *)); | |
750 | extern tree build_modify_expr PROTO((tree, enum tree_code, tree)); | |
751 | extern tree build_unary_op PROTO((enum tree_code, tree, int)); | |
752 | extern tree c_alignof PROTO((tree)); | |
753 | extern tree c_alignof_expr PROTO((tree)); | |
754 | extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int)); | |
755 | extern tree c_sizeof PROTO((tree)); | |
756 | extern void c_expand_return PROTO((tree)); | |
757 | extern tree c_expand_start_case PROTO((tree)); | |
758 | extern tree common_type PROTO((tree, tree)); | |
759 | extern tree copy_novelty PROTO((tree, tree)); | |
760 | extern tree default_conversion PROTO((tree)); | |
761 | extern void finish_init PROTO((void)); | |
762 | extern tree parser_build_binary_op PROTO((enum tree_code, tree, tree)); | |
763 | extern tree pop_init_level PROTO((int)); | |
764 | extern void process_init_default PROTO((tree)); | |
765 | extern void process_init_element PROTO((tree)); | |
766 | extern void push_init_level PROTO((int)); | |
767 | extern void really_start_incremental_init PROTO((tree)); | |
768 | extern void set_init_index PROTO((tree, tree)); | |
769 | extern void set_init_label PROTO((tree)); | |
770 | extern void start_init PROTO((tree, tree, int)); | |
771 | extern void store_init_value PROTO((tree, tree)); | |
772 | extern tree valid_array_index_p PROTO((tree, tree, char *, int)); | |
773 | ||
774 | /* in ch/actions.c */ | |
775 | extern int grant_only_flag; | |
776 | extern void allocate_lang_decl PROTO((tree)); | |
777 | extern tree build_chill_abs PROTO((tree)); | |
778 | extern tree build_chill_array_ref_1 PROTO((tree, tree)); | |
779 | extern tree build_chill_array_ref PROTO((tree, tree)); | |
780 | extern tree build_chill_bin_type PROTO((tree)); | |
781 | extern tree build_chill_binary_op PROTO((enum chill_tree_code, tree, tree)); | |
782 | extern tree build_chill_card PROTO((tree)); | |
783 | extern tree build_chill_case_expr PROTO((tree, tree, tree)); | |
784 | extern tree build_cause_exception PROTO((tree, int)); | |
75111422 | 785 | extern tree build_chill_exception_decl PROTO((char *)); |
5ba6e819 PB |
786 | extern tree build_chill_function_call PROTO((tree, tree)); |
787 | extern tree build_chill_length PROTO((tree)); | |
788 | extern tree build_chill_indirect_ref PROTO((tree, tree, int)); | |
789 | extern tree build_chill_lower PROTO((tree)); | |
790 | extern tree build_chill_max PROTO((tree)); | |
791 | extern tree build_chill_min PROTO((tree)); | |
792 | extern tree build_chill_num PROTO((tree)); | |
793 | extern tree build_chill_repetition_op PROTO((tree, tree)); | |
794 | extern tree build_chill_sizeof PROTO((tree)); | |
795 | extern tree build_chill_slice PROTO((tree, tree, tree)); | |
796 | extern tree build_chill_slice_with_range PROTO((tree, tree, tree)); | |
797 | extern tree build_chill_slice_with_length PROTO((tree, tree, tree)); | |
798 | extern tree build_chill_struct_type PROTO((tree)); | |
799 | extern tree build_chill_unary_op PROTO((enum chill_tree_code, tree)); | |
800 | extern tree build_chill_upper PROTO((tree)); | |
801 | extern tree build_exception_variant PROTO((tree, tree)); | |
802 | extern tree build_generalized_call PROTO((tree, tree)); | |
803 | extern tree build_lang_decl PROTO((enum chill_tree_code, tree, tree)); | |
804 | extern tree build_rts_call PROTO((char *, tree, tree)); | |
805 | extern tree build_varying_struct PROTO((tree)); | |
806 | extern void chill_check_decl PROTO((tree)); | |
807 | extern tree chill_convert_for_assignment PROTO((tree, tree, char*)); | |
808 | extern void chill_expand_return PROTO((tree, int)); | |
809 | extern void chill_expand_result PROTO((tree, int)); | |
75111422 | 810 | extern void chill_handle_case_default PROTO((void)); |
5ba6e819 PB |
811 | extern void chill_handle_case_label PROTO((tree, tree)); |
812 | extern int chill_varying_string_type_p PROTO((tree)); | |
813 | extern int chill_varying_type_p PROTO((tree)); | |
814 | extern int ch_singleton_set PROTO((tree)); | |
815 | extern tree check_expression PROTO((tree, tree, tree)); | |
75111422 | 816 | extern void check_missing_cases PROTO((tree)); |
5ba6e819 PB |
817 | extern tree check_non_null PROTO((tree)); |
818 | extern tree check_range PROTO((tree, tree, tree,tree)); | |
819 | extern void cond_type_range_exception PROTO((tree)); | |
820 | extern void expand_cause_exception PROTO((tree)); | |
821 | extern tree finish_chill_binary_op PROTO((tree)); | |
822 | extern tree finish_chill_unary_op PROTO((tree)); | |
823 | extern tree high_domain_value PROTO((tree)); | |
824 | extern tree low_domain_value PROTO((tree)); | |
825 | extern tree maybe_array_ref PROTO((tree, tree)); | |
826 | extern void maybe_chill_check_decl PROTO((tree)); | |
827 | extern tree powersetlen PROTO((tree)); | |
828 | extern tree test_range PROTO((tree, tree, tree)); | |
829 | /* in ch/convert.c */ | |
830 | extern tree build_array_type_for_scalar PROTO((tree)); | |
831 | extern tree convert PROTO((tree, tree)); | |
832 | extern tree convert_from_reference PROTO((tree)); | |
833 | extern tree convert_to_class PROTO((ch_class, tree)); | |
834 | extern char* display_int_cst PROTO((tree)); | |
835 | ||
836 | /* in ch/decl.c */ | |
837 | extern tree build_enumerator PROTO((tree, tree)); | |
838 | extern tree chill_munge_params PROTO((tree, tree, tree)); | |
839 | extern tree build_chill_function_type PROTO((tree, tree, tree, tree)); | |
840 | extern tree decl_temp1 PROTO((tree, tree, int, tree, int, int)); | |
841 | extern void do_based_decls PROTO((tree, tree, tree)); | |
842 | extern void do_chill_outparms PROTO((void)); | |
843 | extern tree do_decl PROTO((tree, tree, int, int, tree, int)); | |
844 | extern void do_decls PROTO((tree, tree, int, int, tree, int)); | |
845 | extern void expand_chill_outparms PROTO((void)); | |
75111422 | 846 | extern void find_granted_decls PROTO((void)); |
5ba6e819 PB |
847 | extern void finish_chill_function PROTO(()); |
848 | extern tree finish_enum PROTO((tree, tree)); | |
849 | extern void fixup_chill_parms PROTO((tree)); | |
850 | extern void finish_outer_function PROTO((void)); | |
75111422 | 851 | extern unsigned get_type_precision PROTO((tree, tree)); |
5ba6e819 PB |
852 | extern tree grok_chill_fixedfields PROTO((tree, tree, tree)); |
853 | extern tree grok_chill_variantdefs PROTO((tree, tree, tree)); | |
75111422 | 854 | extern void layout_enum PROTO((tree)); |
5ba6e819 | 855 | /* extern tree lookup_remembered_decl PROTO((HOST_WIDE_INT, tree)); */ |
75111422 | 856 | extern void lookup_and_expand_goto PROTO((tree)); |
5ba6e819 | 857 | extern tree lookup_tag_fields PROTO((tree, tree)); |
75111422 | 858 | extern void lookup_and_handle_exit PROTO((tree)); |
5ba6e819 PB |
859 | extern tree massage_param_node PROTO((tree, tree)); |
860 | extern void pop_module PROTO((void)); | |
861 | extern void print_mode PROTO((tree)); | |
862 | extern tree push_extern_function PROTO((tree, tree, tree, tree, int)); | |
863 | extern void push_extern_process PROTO((tree, tree, tree, int)); | |
864 | extern void push_extern_signal PROTO((tree, tree, tree)); | |
75111422 | 865 | extern void push_granted PROTO((tree, tree)); |
5ba6e819 PB |
866 | extern tree push_modedef PROTO((tree, tree, int)); |
867 | extern tree push_module PROTO((tree, int)); | |
868 | extern void push_parms PROTO((tree, tree, tree)); | |
869 | extern void push_syndecl PROTO((tree, tree, tree)); | |
870 | extern int result_never_set; | |
75111422 KG |
871 | extern void save_expr_under_name PROTO((tree, tree)); |
872 | extern tree set_module_name PROTO((tree)); | |
5ba6e819 PB |
873 | extern int start_chill_function PROTO((tree, tree, tree, tree, tree)); |
874 | extern void start_outer_function PROTO((void)); | |
875 | extern void switch_to_pass_2 PROTO((void)); | |
876 | ||
877 | /* in ch/except.c */ | |
878 | extern void chill_check_no_handlers PROTO((void)); | |
75111422 KG |
879 | extern void chill_finish_on PROTO((void)); |
880 | extern void chill_handle_on_labels PROTO((tree)); | |
5ba6e819 | 881 | extern void chill_reraise_exceptions PROTO((tree)); |
75111422 KG |
882 | extern void chill_start_default_handler PROTO((void)); |
883 | extern void chill_start_on PROTO((void)); | |
884 | extern void expand_goto_except_cleanup PROTO((int)); | |
885 | extern int is_handled PROTO((tree)); | |
5ba6e819 PB |
886 | |
887 | /* in ch/expr.c */ | |
888 | extern tree build_chill_addr_expr PROTO((tree, char *)); | |
889 | extern tree build_chill_arrow_expr PROTO((tree, int)); | |
890 | extern tree build_component_ref PROTO((tree, tree)); | |
75111422 | 891 | extern tree build_chill_compound_expr PROTO((tree)); |
5ba6e819 PB |
892 | extern tree build_chill_descr PROTO((tree)); |
893 | extern void build_chill_descr_type PROTO((void)); | |
894 | extern void build_chill_inttime_type PROTO((void)); | |
1f6b0ce0 | 895 | extern tree build_compare_expr PROTO((enum tree_code, |
5ba6e819 | 896 | tree, tree)); |
1f6b0ce0 | 897 | extern tree build_compare_discrete_expr PROTO((enum tree_code, |
5ba6e819 PB |
898 | tree, tree)); |
899 | extern tree check_case_selector PROTO((tree)); | |
900 | extern tree check_case_selector_list PROTO((tree)); | |
901 | extern tree check_have_mode PROTO((tree, char*)); | |
902 | extern void init_chill_expand PROTO((void)); | |
903 | extern void chill_expand_assignment PROTO((tree, enum chill_tree_code, tree)); | |
904 | extern void expand_assignment_action PROTO((tree, enum chill_tree_code, tree)); | |
905 | extern int compare_int_csts PROTO((enum chill_tree_code, | |
906 | tree, tree)); | |
907 | extern void expand_varying_length_assignment PROTO((tree, tree)); | |
908 | extern tree force_addr_of PROTO((tree)); | |
909 | extern tree resolve_component_ref PROTO((tree)); | |
910 | extern tree truthvalue_conversion PROTO((tree)); | |
911 | extern tree varying_to_slice PROTO((tree)); | |
912 | ||
913 | /* in ch/grant.c */ | |
914 | extern void chill_finish_compile PROTO((void)); | |
915 | extern void chill_seize PROTO((tree, tree, tree)); | |
916 | extern void start_outer_function PROTO((void)); | |
917 | extern void finish_chill_seize PROTO((tree)); | |
918 | extern void chill_grant PROTO((tree,tree, tree, tree)); | |
919 | extern void set_default_grant_file PROTO((void)); | |
75111422 | 920 | extern void set_identifier_size PROTO((int)); |
5ba6e819 PB |
921 | extern void write_grant_file PROTO((void)); |
922 | extern void write_spec_module PROTO((tree, tree)); | |
923 | ||
924 | /* in ch/lang.c */ | |
925 | extern tree string_index_type_dummy; | |
926 | extern tree integer_minus_one_node; | |
927 | extern int flag_old_strings; | |
928 | extern void GNU_xref_begin PROTO((void)); | |
929 | extern void GNU_xref_end PROTO((void)); | |
930 | extern tree build_chill_array_type PROTO((tree, tree, int, tree)); | |
931 | extern tree build_chill_struct_type PROTO((tree)); | |
932 | extern tree build_chill_pointer_type PROTO((tree)); | |
933 | extern tree build_chill_range_type PROTO((tree, tree, tree)); | |
934 | extern tree build_chill_reference_type PROTO((tree)); | |
935 | extern tree build_simple_array_type PROTO((tree, tree, tree)); | |
936 | extern tree const_expr PROTO((tree)); | |
937 | extern tree get_identifier3 PROTO((char*, char*, char*)); | |
938 | extern tree layout_chill_array_type PROTO((tree)); | |
939 | extern tree layout_chill_range_type PROTO((tree, int)); | |
940 | extern tree layout_chill_pointer_type PROTO((tree)); | |
941 | extern tree layout_chill_struct_type PROTO((tree)); | |
942 | extern tree layout_chill_variants PROTO((tree)); | |
943 | extern tree layout_powerset_type PROTO((tree)); | |
944 | extern tree lookup_interface PROTO((tree)); | |
945 | extern tree maybe_building_objc_message_expr PROTO((void)); | |
946 | extern void maybe_objc_check_decl PROTO((tree)); | |
947 | extern int maybe_objc_comptypes PROTO((tree, tree)); | |
948 | extern int recognize_objc_keyword PROTO((void)); | |
949 | ||
950 | /* in ch/lex.l */ | |
951 | extern tree use_seizefile_name; | |
952 | extern tree current_seizefile_name; | |
953 | extern tree build_chill_string PROTO((int, char *)); | |
954 | extern int check_newline PROTO((void)); | |
955 | extern tree get_chill_filename PROTO((void)); | |
956 | extern tree get_chill_linenumber PROTO((void)); | |
957 | extern void register_seize_path PROTO((char *)); | |
958 | extern void reinit_parse_for_function PROTO((void)); | |
959 | extern void mark_use_seizefile_written PROTO((tree)); | |
960 | ||
961 | /* in ch/loop.c */ | |
962 | extern void begin_chill_loop PROTO((tree, tree)); | |
963 | extern tree build_chill_iterator PROTO((tree, tree, tree, int, int, int)); | |
964 | extern void end_chill_loop PROTO((void)); | |
965 | extern tree get_unique_identifier PROTO((char *)); | |
966 | ||
967 | /* in ch/inout.c */ | |
968 | extern tree access_recordmode PROTO((tree)); | |
969 | extern void invalidate_access_recordmode PROTO((tree)); | |
970 | extern tree access_indexmode PROTO((tree)); | |
971 | extern tree access_dynamic PROTO((tree)); | |
972 | extern tree association_init_value; | |
973 | extern tree association_type_node; | |
974 | extern tree build_access_mode PROTO((tree, tree, int)); | |
975 | extern tree build_chill_associate PROTO((tree, tree, tree)); | |
976 | extern tree build_chill_connect PROTO((tree, tree, tree, tree)); | |
977 | extern tree build_chill_create PROTO((tree)); | |
978 | extern tree build_chill_delete PROTO((tree)); | |
979 | extern tree build_chill_disconnect PROTO((tree)); | |
980 | extern tree build_chill_dissociate PROTO((tree)); | |
981 | extern tree build_chill_eoln PROTO((tree)); | |
982 | extern tree build_chill_existing PROTO((tree)); | |
983 | extern tree build_chill_gettextaccess PROTO((tree)); | |
984 | extern tree build_chill_getassociation PROTO((tree)); | |
985 | extern tree build_chill_gettextindex PROTO((tree)); | |
986 | extern tree build_chill_gettextrecord PROTO((tree)); | |
987 | extern tree build_chill_getusage PROTO((tree)); | |
988 | extern tree build_chill_indexable PROTO((tree)); | |
989 | extern tree build_chill_isassociated PROTO((tree)); | |
990 | extern tree build_chill_modify PROTO((tree, tree)); | |
991 | extern tree build_chill_outoffile PROTO((tree)); | |
992 | extern tree build_chill_readable PROTO((tree)); | |
993 | extern tree build_chill_readrecord PROTO((tree, tree)); | |
994 | extern tree build_chill_readtext PROTO((tree, tree)); | |
995 | extern tree build_chill_sequencible PROTO((tree)); | |
996 | extern tree build_chill_settextaccess PROTO((tree, tree)); | |
997 | extern tree build_chill_settextindex PROTO((tree, tree)); | |
998 | extern tree build_chill_settextrecord PROTO((tree, tree)); | |
999 | extern tree build_chill_variable PROTO((tree)); | |
1000 | extern tree build_chill_writeable PROTO((tree)); | |
1001 | extern tree build_chill_writerecord PROTO((tree, tree)); | |
1002 | extern tree build_chill_writetext PROTO((tree, tree)); | |
75111422 | 1003 | extern void build_enum_tables PROTO((void)); |
5ba6e819 | 1004 | extern tree build_text_mode PROTO((tree, tree, int)); |
5efaf7b0 | 1005 | extern tree check_text_length PROTO((tree)); |
5ba6e819 PB |
1006 | extern void init_access_location PROTO((tree, tree)); |
1007 | extern void init_text_location PROTO((tree, tree)); | |
1008 | extern void inout_init PROTO((void)); | |
1009 | extern tree text_dynamic PROTO((tree)); | |
1010 | extern tree text_indexmode PROTO((tree)); | |
1011 | extern tree text_length PROTO((tree)); | |
1012 | extern tree usage_type_node; | |
1013 | extern tree where_type_node; | |
1014 | ||
1015 | /* in ch/parse.c */ | |
1016 | extern tree get_type_of PROTO((tree)); | |
1017 | extern void set_yydebug PROTO((int)); | |
1018 | extern void yyerror PROTO((char *)); | |
1019 | extern int pass; | |
1020 | extern int ignoring; | |
1021 | extern int seen_action; | |
1022 | extern int build_constructor; | |
1023 | extern void possibly_define_exit_label PROTO((tree)); | |
1024 | extern void to_global_binding_level PROTO((void)); | |
1025 | ||
1026 | /* in ch/satisfy.c */ | |
1027 | extern tree satisfy_decl PROTO((tree, int)); | |
1028 | ||
1029 | /* in ch/tasking.c */ | |
1030 | extern void add_taskstuff_to_list PROTO((tree, char *, tree, tree, tree)); | |
1031 | extern void process_buffer_decls PROTO((tree, tree, int)); | |
1032 | extern tree buffer_element_mode PROTO((tree)); | |
1033 | extern void invalidate_buffer_element_mode PROTO((tree)); | |
1034 | extern tree build_buffer_descriptor PROTO((tree, tree, tree)); | |
1035 | extern tree build_buffer_type PROTO((tree, tree)); | |
1036 | extern void build_delay_action PROTO((tree, tree)); | |
1037 | extern tree build_delay_case_start PROTO((tree, tree)); | |
297a6bfc | 1038 | extern void build_delay_case_end PROTO((tree)); |
5ba6e819 PB |
1039 | extern void build_delay_case_label PROTO((tree, int)); |
1040 | extern tree build_event_type PROTO((tree)); | |
297a6bfc | 1041 | extern void build_receive_case_end PROTO((tree, tree)); |
5ba6e819 PB |
1042 | extern int build_receive_case_if_generated PROTO((void)); |
1043 | extern tree build_receive_case_label PROTO((tree, tree)); | |
1044 | extern tree build_receive_case_start PROTO((tree)); | |
1045 | extern void expand_continue_event PROTO((tree)); | |
1046 | extern void expand_send_buffer PROTO((tree, tree, tree, tree, tree)); | |
1047 | extern void expand_send_signal PROTO((tree, tree, tree, tree, tree)); | |
1048 | extern void build_start_process PROTO((tree, tree, tree, tree)); | |
1049 | extern tree build_copy_number PROTO((tree)); | |
1050 | extern tree build_gen_code PROTO((tree)); | |
1051 | extern tree build_gen_inst PROTO((tree, tree)); | |
1052 | extern tree build_gen_ptype PROTO((tree)); | |
1053 | extern void build_instance_type PROTO((void)); | |
1054 | extern tree build_process_header PROTO((tree, tree)); | |
1055 | extern void build_process_wrapper PROTO((tree, tree)); | |
1056 | extern tree build_proc_type PROTO((tree)); | |
1057 | extern tree build_queue_length PROTO((tree)); | |
1058 | extern tree build_signal_descriptor PROTO((tree, tree)); | |
1059 | extern tree build_signal_struct_type PROTO((tree, tree, tree)); | |
1060 | extern tree build_tasking_struct PROTO((void)); | |
1061 | extern tree chill_taskingcode_type_node; | |
297a6bfc | 1062 | extern tree check_queue_size PROTO((tree)); |
5ba6e819 PB |
1063 | extern tree generate_tasking_code_variable PROTO((tree, tree *, int)); |
1064 | extern tree get_signal_type_name PROTO((tree)); | |
1065 | extern tree get_struct_type_name PROTO((tree)); | |
1066 | extern tree get_tasking_code_name PROTO((tree)); | |
1067 | extern tree make_process_struct PROTO((tree, tree)); | |
1068 | extern tree make_signal_struct PROTO((tree)); | |
1069 | extern tree max_queue_size PROTO((tree)); | |
75111422 KG |
1070 | extern void tasking_init PROTO((void)); |
1071 | extern void tasking_registry PROTO((void)); | |
1072 | extern void tasking_setup PROTO((void)); | |
5ba6e819 PB |
1073 | |
1074 | /* in ch/timing.c */ | |
1075 | extern tree abs_timing_type_node; | |
1076 | extern tree after_stack; | |
1077 | extern void build_after_end PROTO((void)); | |
1078 | extern void build_after_start PROTO((tree, int)); | |
1079 | extern void build_after_timeout_start PROTO((void)); | |
1080 | extern void build_at_action PROTO((tree)); | |
1081 | extern void build_cycle_end PROTO((tree)); | |
1082 | extern tree build_cycle_start PROTO((tree)); | |
1083 | extern tree build_timeout_preface PROTO((void)); | |
1084 | extern void build_timesupervised_call PROTO((tree, tree)); | |
1085 | extern tree duration_timing_type_node; | |
1086 | extern void timing_init PROTO((void)); | |
1087 | ||
1088 | /* in ch/tree.c */ | |
1089 | extern tree build_alias_decl PROTO((tree, tree, tree)); | |
1090 | extern tree build_bitstring_type PROTO((tree)); | |
1091 | extern tree build_powerset_type PROTO((tree)); | |
1092 | extern tree build_string_type PROTO((tree, tree)); | |
1093 | extern tree decl_check_rename PROTO((tree, tree)); | |
1094 | extern tree discrete_count PROTO((tree)); | |
1095 | extern int list_length PROTO((tree)); | |
1096 | extern tree munge_exit_label PROTO((tree)); | |
1097 | extern tree save_if_needed PROTO((tree)); | |
1098 | ||
1099 | /* in ch/typeck.c */ | |
1100 | extern tree build_array_from_set PROTO((tree)); | |
1101 | extern tree build_chill_array_ref PROTO((tree, tree)); | |
1102 | extern tree build_chill_bitref PROTO((tree, tree)); | |
1103 | extern tree build_chill_cast PROTO((tree, tree)); | |
1104 | extern tree chill_equivalent PROTO((tree, tree, struct mode_chain*)); | |
1105 | extern tree build_init_struct PROTO((void)); | |
1106 | extern tree build_readonly_type PROTO((tree)); | |
1107 | extern int chill_compatible PROTO((tree, tree)); | |
1108 | extern int chill_compatible_classes PROTO((tree, tree)); | |
1109 | extern ch_class chill_expr_class PROTO((tree)); | |
1110 | extern tree chill_give_type_to_expr PROTO((tree, tree)); | |
1111 | extern tree chill_expand_tuple PROTO((tree, tree)); | |
1112 | extern ch_class chill_expr_class PROTO((tree)); | |
1113 | extern int chill_location PROTO((tree)); | |
1114 | extern tree chill_max_vary_array_index PROTO((tree)); | |
1115 | extern int chill_read_compatible PROTO((tree, tree)); | |
1116 | extern int chill_referable PROTO((tree)); | |
1117 | extern tree chill_root_mode PROTO((tree)); | |
1118 | extern ch_class chill_resulting_class PROTO((ch_class, ch_class)); | |
1119 | extern tree chill_resulting_mode PROTO((tree, tree)); | |
1120 | extern int chill_similar PROTO((tree, tree, struct mode_chain*)); | |
1121 | extern int discrete_type_p PROTO((tree)); | |
75111422 | 1122 | extern tree initializer_constant_valid_p PROTO((tree, tree)); |
5ba6e819 PB |
1123 | extern tree convert_to_discrete PROTO((tree)); |
1124 | extern tree smash_dummy_type PROTO((tree)); | |
1125 | extern tree string_assignment_condition PROTO((tree, tree)); | |
1126 | extern tree type_for_mode PROTO((enum machine_mode, int)); | |
1127 | extern tree type_for_size PROTO((unsigned, int)); | |
1128 | extern int valid_array_index PROTO((tree, tree)); | |
1129 | extern void validate_varying_array_ref PROTO((tree, tree)); | |
1130 | ||
1131 | /* in function.c */ | |
1132 | extern void expand_function_end PROTO((char *, int, int)); | |
1133 | extern void expand_function_start PROTO((tree, int)); | |
1134 | extern void init_function_start PROTO((tree, char *, int)); | |
1135 | extern void pop_function_context PROTO((void)); | |
1136 | extern void push_function_context PROTO((void)); | |
1137 | ||
1138 | /* in integrate.c */ | |
1139 | extern void output_inline_function PROTO((tree)); | |
1140 | ||
1141 | /* in stmt.c */ | |
1142 | extern void remember_end_note PROTO((tree)); | |
1143 | ||
1144 | /* in toplev.c */ | |
1145 | extern void announce_function PROTO((tree)); | |
1146 | extern int floor_log2_wide PROTO((unsigned HOST_WIDE_INT)); | |
5ba6e819 | 1147 | extern void rest_of_compilation PROTO((tree)); |
5ba6e819 PB |
1148 | |
1149 | /* in varasm.c */ | |
5ba6e819 PB |
1150 | extern void make_function_rtl PROTO((tree)); |
1151 | ||
1152 | /* in ???? */ | |
1153 | extern void init_iterators PROTO((void)); | |
1154 | extern int mark_addressable PROTO((tree)); | |
1155 | extern tree chill_result_decl; | |
1156 | #ifdef RTX_CODE | |
1157 | extern rtx label_rtx PROTO((tree)); | |
1158 | #endif | |
1159 | extern void permanent_allocation PROTO((int)); | |
1160 | ||
1161 | #ifndef SET_WORD_SIZE | |
1162 | #define SET_WORD_SIZE BITS_PER_WORD | |
1163 | #endif | |
1164 | ||
1165 | struct module | |
1166 | { | |
1167 | struct module *next_module; /* Next module, in order of their beginning. */ | |
1168 | struct module *prev_module; /* The surrounding module, if any. */ | |
1169 | tree name; | |
1170 | tree prefix_name; /* Usually same as name, expect for nested modules. | |
1171 | Used to generate DECL_ASSEMBLER_NAMEs. */ | |
1172 | /* procedure_seen indicates a procedure or process was declared. | |
1173 | After this, no SEIZE, DCL, SYN, NEWMODE, SYNMODE statement is allowed */ | |
1174 | int procedure_seen; | |
1175 | int is_spec_module; | |
1176 | ||
1177 | /* The value of current_nesting_level inside the module. */ | |
1178 | int nesting_level; | |
1179 | ||
1180 | /* A chain contain one ALIAS_DECL for each 'GRANT foo->bar'. | |
1181 | The DECL_NAME is get_identifier("bar"), and the DECL_INITIAL | |
1182 | is get_identifier("bar"). Only used in pass 1. */ | |
1183 | tree granted_decls; | |
1184 | }; | |
1185 | ||
1186 | extern struct module *current_module; | |
1187 | ||
1188 | /* fold a tree to constant as much as possible */ | |
1189 | extern tree deep_fold PROTO((tree)); | |
1190 | #endif |