1 /* Front-end tree definitions for GNU compiler.
2 Copyright (C) 1989 Free Software Foundation, Inc.
4 This file is part of GNU CC.
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 1, or (at your option)
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.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* codes of tree nodes */
23 #define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
28 LAST_AND_UNUSED_TREE_CODE
/* A convienent way to get a value for
34 /* Number of tree codes. */
35 #define NUM_TREE_CODES ((int)LAST_AND_UNUSED_TREE_CODE)
37 /* Indexed by enum tree_code, contains a character which is
38 `e' for an expression, `r' for a reference, `c' for a constant,
39 `d' for a decl, `t' for a type, `s' for a statement,
40 and `x' for anything else (TREE_LIST, IDENTIFIER, etc). */
42 extern char **tree_code_type
;
44 /* Number of argument-words in each kind of tree-node. */
46 extern int *tree_code_length
;
48 /* Names of tree components. */
50 extern char **tree_code_name
;
52 /* Get the definition of `enum machine_mode' */
54 #ifndef HAVE_MACHINE_MODES
55 #define DEF_MACHMODE(SYM, NAME, TYPE, SIZE, UNIT, WIDER) SYM,
58 #include "machmode.def"
63 #define HAVE_MACHINE_MODES
65 #endif /* not HAVE_MACHINE_MODES */
67 #ifndef NUM_MACHINE_MODES
68 #define NUM_MACHINE_MODES (int) MAX_MACHINE_MODE
71 /* Codes that identify the various built in functions
72 so that expand_call can identify them quickly. */
74 enum built_in_function
95 BUILT_IN_CLASSIFY_TYPE
,
104 /* The definition of tree nodes fills the next several pages. */
106 /* A tree node can represent a data type, a variable, an expression
107 or a statement. Each node has a TREE_CODE which says what kind of
108 thing it represents. Some common codes are:
109 INTEGER_TYPE -- represents a type of integers.
110 ARRAY_TYPE -- represents a type of pointer.
111 VAR_DECL -- represents a declared variable.
112 INTEGER_CST -- represents a constant integer value.
113 PLUS_EXPR -- represents a sum (an expression).
115 As for the contents of a tree node: there are some fields
116 that all nodes share. Each TREE_CODE has various special-purpose
117 fields as well. The fields of a node are never accessed directly,
118 always through accessor macros. */
120 /* This type is used everywhere to refer to a tree node. */
122 typedef union tree_node
*tree
;
124 #define NULL_TREE (tree) NULL
126 /* Every kind of tree node starts with this structure,
127 so all nodes have these fields.
129 See the accessor macros, defined below, for documentation of the fields. */
134 union tree_node
*chain
;
135 union tree_node
*type
;
136 unsigned char code
: 8;
138 unsigned external_attr
: 1;
139 unsigned public_attr
: 1;
140 unsigned static_attr
: 1;
141 unsigned volatile_attr
: 1;
142 unsigned packed_attr
: 1;
143 unsigned readonly_attr
: 1;
144 unsigned literal_attr
: 1;
145 unsigned nonlocal_attr
: 1;
146 unsigned permanent_attr
: 1;
147 unsigned addressable_attr
: 1;
148 unsigned regdecl_attr
: 1;
149 unsigned this_vol_attr
: 1;
150 unsigned unsigned_attr
: 1;
151 unsigned asm_written_attr
: 1;
152 unsigned inline_attr
: 1;
153 unsigned used_attr
: 1;
154 unsigned lang_flag_1
: 1;
155 unsigned lang_flag_2
: 1;
156 unsigned lang_flag_3
: 1;
157 unsigned lang_flag_4
: 1;
158 unsigned raises_attr
: 1;
159 /* There is room for three more attributes. */
162 /* Define accessors for the fields that all tree nodes have
163 (though some fields are not used for all kinds of nodes). */
165 /* The unique id of a tree node distinguishes it from all other nodes
166 in the same compiler run. */
167 #define TREE_UID(NODE) ((NODE)->common.uid)
169 /* The tree-code says what kind of node it is.
170 Codes are defined in tree.def. */
171 #define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
172 #define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (int) (VALUE))
174 /* In all nodes that are expressions, this is the data type of the expression.
175 In POINTER_TYPE nodes, this is the type that the pointer points to.
176 In ARRAY_TYPE nodes, this is the type of the elements. */
177 #define TREE_TYPE(NODE) ((NODE)->common.type)
179 /* Nodes are chained together for many purposes.
180 Types are chained together to record them for being output to the debugger
181 (see the function `chain_type').
182 Decls in the same scope are chained together to record the contents
184 Statement nodes for successive statements used to be chained together.
185 Often lists of things are represented by TREE_LIST nodes that
186 are chained together. */
188 #define TREE_CHAIN(NODE) ((NODE)->common.chain)
190 /* Define many boolean fields that all tree nodes have. */
192 /* In a VAR_DECL or FUNCTION_DECL,
193 nonzero means external reference:
194 do not allocate storage, and refer to a definition elsewhere. */
195 #define TREE_EXTERNAL(NODE) ((NODE)->common.external_attr)
197 /* In a VAR_DECL, nonzero means allocate static storage.
198 In a FUNCTION_DECL, currently nonzero if function has been defined. */
199 #define TREE_STATIC(NODE) ((NODE)->common.static_attr)
201 /* In a VAR_DECL or FUNCTION_DECL,
202 nonzero means name is to be accessible from outside this module. */
203 #define TREE_PUBLIC(NODE) ((NODE)->common.public_attr)
205 /* In VAR_DECL nodes, nonzero means address of this is needed.
206 So it cannot be in a register.
207 In a FUNCTION_DECL, nonzero means its address is needed.
208 So it must be compiled even if it is an inline function.
209 In CONSTRUCTOR nodes, it means the elements are all constants suitable
210 for output as assembly-language initializers.
211 In LABEL_DECL nodes, it means a goto for this label has been seen
212 from a place outside all binding contours that restore stack levels,
213 or that an error message about jumping into such a binding contour
214 has been printed for this label.
215 In ..._TYPE nodes, it means that objects of this type must
216 be fully addressable. This means that pieces of this
217 object cannot go into register parameters, for example. */
218 #define TREE_ADDRESSABLE(NODE) ((NODE)->common.addressable_attr)
220 /* In VAR_DECL nodes, nonzero means declared `register'. */
221 #define TREE_REGDECL(NODE) ((NODE)->common.regdecl_attr)
223 /* In any expression, nonzero means it has side effects or reevaluation
224 of the whole expression could produce a different value.
225 This is set if any subexpression is a function call, a side effect
226 or a reference to a volatile variable.
227 In a ..._DECL, this is set only if the declaration said `volatile'.
228 In a ..._TYPE, nonzero means the type is volatile-qualified. */
229 #define TREE_VOLATILE(NODE) ((NODE)->common.volatile_attr)
231 /* Nonzero means this expression is volatile in the C sense:
232 its address should be of type `volatile WHATEVER *'.
233 If this bit is set, so is `volatile_attr'. */
234 #define TREE_THIS_VOLATILE(NODE) ((NODE)->common.this_vol_attr)
236 /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
237 nonzero means it may not be the lhs of an assignment.
238 In a ..._TYPE node, means this type is const-qualified. */
239 #define TREE_READONLY(NODE) ((NODE)->common.readonly_attr)
241 /* Nonzero in a FIELD_DECL means it is a bit-field; it may occupy
242 less than a storage unit, and its address may not be taken, etc.
243 This controls layout of the containing record.
244 In a LABEL_DECL, nonzero means label was defined inside a binding
245 contour that restored a stack level and which is now exited. */
246 #define TREE_PACKED(NODE) ((NODE)->common.packed_attr)
248 /* Value of expression is constant.
249 Always appears in all ..._CST nodes.
250 May also appear in an arithmetic expression, an ADDR_EXPR or a CONSTRUCTOR
251 if the value is constant. */
252 #define TREE_LITERAL(NODE) ((NODE)->common.literal_attr)
254 /* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
255 For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
257 For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
259 Also set in some languages for variables, etc., outside the normal
260 lexical scope, such as class instance variables. */
261 #define TREE_NONLOCAL(NODE) ((NODE)->common.nonlocal_attr)
263 /* Nonzero means permanent node;
264 node will continue to exist for the entire compiler run.
265 Otherwise it will be recycled at the end of the function. */
266 #define TREE_PERMANENT(NODE) ((NODE)->common.permanent_attr)
268 /* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type.
269 In FIELD_DECL nodes, means an unsigned bit field. */
270 #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_attr)
272 /* Nonzero in a VAR_DECL means assembler code has been written.
273 Nonzero in a FUNCTION_DECL means that the function has been compiled.
274 This is interesting in an inline function, since it might not need
275 to be compiled separately. */
276 #define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_attr)
278 /* Nonzero in a FUNCTION_DECL means this function can be substituted
280 Nonzero in a VAR_DECL or PARM_DECL means this decl was made by inlining;
281 suppress any warnings about shadowing some other variable. */
282 #define TREE_INLINE(NODE) ((NODE)->common.inline_attr)
284 /* Nonzero in a _DECL if the name is used in its scope. */
285 #define TREE_USED(NODE) ((NODE)->common.used_attr)
287 #define TREE_LANG_FLAG_1(NODE) ((NODE)->common.lang_flag_1)
288 #define TREE_LANG_FLAG_2(NODE) ((NODE)->common.lang_flag_2)
289 #define TREE_LANG_FLAG_3(NODE) ((NODE)->common.lang_flag_3)
290 #define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4)
292 /* Nonzero for an expression that might raise an exception. */
293 #define TREE_RAISES(NODE) ((NODE)->common.raises_attr)
295 /* Define additional fields and accessors for nodes representing constants. */
297 /* In an INTEGER_CST node. These two together make a 64 bit integer.
298 If the data type is signed, the value is sign-extended to 64 bits
299 even though not all of them may really be in use.
300 In an unsigned constant shorter than 64 bits, the extra bits are 0. */
301 #define TREE_INT_CST_LOW(NODE) ((NODE)->int_cst.int_cst_low)
302 #define TREE_INT_CST_HIGH(NODE) ((NODE)->int_cst.int_cst_high)
304 #define INT_CST_LT(A, B) \
305 (TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \
306 || (TREE_INT_CST_HIGH (A) == TREE_INT_CST_HIGH (B) \
307 && ((unsigned) TREE_INT_CST_LOW (A) < (unsigned) TREE_INT_CST_LOW (B))))
309 #define INT_CST_LT_UNSIGNED(A, B) \
310 ((unsigned) TREE_INT_CST_HIGH (A) < (unsigned) TREE_INT_CST_HIGH (B) \
311 || ((unsigned) TREE_INT_CST_HIGH (A) == (unsigned) TREE_INT_CST_HIGH (B) \
312 && ((unsigned) TREE_INT_CST_LOW (A) < (unsigned) TREE_INT_CST_LOW (B))))
316 char common
[sizeof (struct tree_common
)];
321 /* In REAL_CST, STRING_CST, COMPLEX_CST nodes, and CONSTRUCTOR nodes,
322 and generally in all kinds of constants that could
323 be given labels (rather than being immediate). */
325 #define TREE_CST_RTL(NODE) ((NODE)->real_cst.rtl)
327 /* In a REAL_CST node. */
328 /* We can represent a real value as either a `double' or a string.
329 Strings don't allow for any optimization, but they do allow
330 for cross-compilation. */
332 #define TREE_REAL_CST(NODE) ((NODE)->real_cst.real_cst)
338 char common
[sizeof (struct tree_common
)];
339 struct rtx_def
*rtl
; /* acts as link to register transfer language
341 REAL_VALUE_TYPE real_cst
;
344 /* In a STRING_CST */
345 #define TREE_STRING_LENGTH(NODE) ((NODE)->string.length)
346 #define TREE_STRING_POINTER(NODE) ((NODE)->string.pointer)
350 char common
[sizeof (struct tree_common
)];
351 struct rtx_def
*rtl
; /* acts as link to register transfer language
357 /* In a COMPLEX_CST node. */
358 #define TREE_REALPART(NODE) ((NODE)->complex.real)
359 #define TREE_IMAGPART(NODE) ((NODE)->complex.imag)
363 char common
[sizeof (struct tree_common
)];
364 struct rtx_def
*rtl
; /* acts as link to register transfer language
366 union tree_node
*real
;
367 union tree_node
*imag
;
370 /* Define fields and accessors for some special-purpose tree nodes. */
372 #define IDENTIFIER_LENGTH(NODE) ((NODE)->identifier.length)
373 #define IDENTIFIER_POINTER(NODE) ((NODE)->identifier.pointer)
375 struct tree_identifier
377 char common
[sizeof (struct tree_common
)];
382 /* In a TREE_LIST node. */
383 #define TREE_PURPOSE(NODE) ((NODE)->list.purpose)
384 #define TREE_VALUE(NODE) ((NODE)->list.value)
388 char common
[sizeof (struct tree_common
)];
389 union tree_node
*purpose
;
390 union tree_node
*value
;
393 /* In a TREE_VEC node. */
394 #define TREE_VEC_LENGTH(NODE) ((NODE)->vec.length)
395 #define TREE_VEC_ELT(NODE,I) ((NODE)->vec.a[I])
396 #define TREE_VEC_END(NODE) (&((NODE)->vec.a[(NODE)->vec.length]))
400 char common
[sizeof (struct tree_common
)];
402 union tree_node
*a
[1];
405 /* Define fields and accessors for some nodes that represent expressions. */
407 /* In a SAVE_EXPR node. */
408 #define SAVE_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[1])
410 /* In a RTL_EXPR node. */
411 #define RTL_EXPR_SEQUENCE(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[0])
412 #define RTL_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[1])
414 /* In a CALL_EXPR node. */
415 #define CALL_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[2])
417 /* In a CONSTRUCTOR node. */
418 #define CONSTRUCTOR_ELTS(NODE) TREE_OPERAND (NODE, 1)
420 /* In expression and reference nodes. */
421 #define TREE_OPERAND(NODE, I) ((NODE)->exp.operands[I])
422 #define TREE_COMPLEXITY(NODE, I) ((NODE)->exp.complexity)
426 char common
[sizeof (struct tree_common
)];
428 union tree_node
*operands
[1];
431 /* Define fields and accessors for nodes representing data types. */
433 /* See tree.def for documentation of the use of these fields.
434 Look at the documentation of the various ..._TYPE tree codes. */
436 #define TYPE_SIZE(NODE) ((NODE)->type.size)
437 #define TYPE_SIZE_UNIT(NODE) ((NODE)->type.size_unit)
438 #define TYPE_MODE(NODE) ((NODE)->type.mode)
439 #define TYPE_ALIGN(NODE) ((NODE)->type.align)
440 #define TYPE_VALUES(NODE) ((NODE)->type.values)
441 #define TYPE_DOMAIN(NODE) ((NODE)->type.values)
442 #define TYPE_FIELDS(NODE) ((NODE)->type.values)
443 #define TYPE_ARG_TYPES(NODE) ((NODE)->type.values)
444 #define TYPE_METHOD_BASETYPE(NODE) ((NODE)->type.max)
445 #define TYPE_OFFSET_BASETYPE(NODE) ((NODE)->type.max)
446 #define TYPE_SEP(NODE) ((NODE)->type.sep)
447 #define TYPE_SEP_UNIT(NODE) ((NODE)->type.sep_unit)
448 #define TYPE_POINTER_TO(NODE) ((NODE)->type.pointer_to)
449 #define TYPE_REFERENCE_TO(NODE) ((NODE)->type.reference_to)
450 #define TYPE_MIN_VALUE(NODE) ((NODE)->type.sep)
451 #define TYPE_MAX_VALUE(NODE) ((NODE)->type.max)
452 #define TYPE_PRECISION(NODE) ((NODE)->type.sep_unit)
453 #define TYPE_SYMTAB_ADDRESS(NODE) ((NODE)->type.symtab_address)
454 #define TYPE_NAME(NODE) ((NODE)->type.name)
455 #define TYPE_NEXT_VARIANT(NODE) ((NODE)->type.next_variant)
456 #define TYPE_MAIN_VARIANT(NODE) ((NODE)->type.main_variant)
457 #define TYPE_BASETYPES(NODE) ((NODE)->type.basetypes)
458 #define TYPE_NONCOPIED_PARTS(NODE) ((NODE)->type.noncopied_parts)
459 #define TYPE_LANG_SPECIFIC(NODE) ((NODE)->type.lang_specific)
463 char common
[sizeof (struct tree_common
)];
464 union tree_node
*values
;
465 union tree_node
*sep
;
466 union tree_node
*size
;
468 enum machine_mode mode
: 8;
469 unsigned char size_unit
;
471 unsigned char sep_unit
;
473 union tree_node
*pointer_to
;
474 union tree_node
*reference_to
;
476 union tree_node
*name
;
477 union tree_node
*max
;
478 union tree_node
*next_variant
;
479 union tree_node
*main_variant
;
480 union tree_node
*basetypes
;
481 union tree_node
*noncopied_parts
;
482 /* Points to a structure whose details depend on the language in use. */
483 struct lang_type
*lang_specific
;
486 /* Define fields and accessors for nodes representing declared names. */
488 #define DECL_VOFFSET(NODE) ((NODE)->decl.voffset) /* In FIELD_DECLs and maybe PARM_DECLs. */
489 #define DECL_RESULT_TYPE(NODE) ((NODE)->decl.voffset) /* In FUNCTION_DECLs. */
490 #define DECL_VOFFSET_UNIT(NODE) ((NODE)->decl.voffset_unit)
491 #define DECL_OFFSET(NODE) ((NODE)->decl.offset)
492 #define DECL_FUNCTION_CODE(NODE) ((enum built_in_function) (NODE)->decl.offset)
493 #define DECL_SET_FUNCTION_CODE(NODE,VAL) ((NODE)->decl.offset = (int) (VAL))
494 #define DECL_NAME(NODE) ((NODE)->decl.name)
495 #define DECL_CONTEXT(NODE) ((NODE)->decl.context)
496 #define DECL_FIELD_CONTEXT(NODE) ((NODE)->decl.context)
497 #define DECL_ARGUMENTS(NODE) ((NODE)->decl.arguments) /* In FUNCTION_DECL. */
498 #define DECL_ARG_TYPE(NODE) ((NODE)->decl.initial) /* In PARM_DECL. */
499 #define DECL_INITIAL(NODE) ((NODE)->decl.initial)
500 #define DECL_SOURCE_FILE(NODE) ((NODE)->decl.filename)
501 #define DECL_SOURCE_LINE(NODE) ((NODE)->decl.linenum)
502 #define DECL_SIZE(NODE) ((NODE)->decl.size)
503 #define DECL_SIZE_UNIT(NODE) ((NODE)->decl.size_unit)
504 #define DECL_ALIGN(NODE) ((NODE)->decl.align)
505 #define DECL_MODE(NODE) ((NODE)->decl.mode)
506 #define DECL_RTL(NODE) ((NODE)->decl.rtl)
507 #define DECL_ASSEMBLER_NAME(NODE) ((NODE)->decl.assembler_name)
508 #define DECL_LANG_SPECIFIC(NODE) ((NODE)->decl.lang_specific)
512 char common
[sizeof (struct tree_common
)];
513 union tree_node
*size
;
514 enum machine_mode mode
: 8;
515 unsigned char size_unit
;
517 unsigned char voffset_unit
;
518 union tree_node
*name
;
519 union tree_node
*context
;
521 union tree_node
*voffset
;
522 union tree_node
*initial
;
523 union tree_node
*arguments
;
524 struct rtx_def
*rtl
; /* acts as link to register transfer language
526 /* Points to a structure whose details depend on the language in use. */
527 struct lang_decl
*lang_specific
;
529 /* Unused by PARM_DECL. */
532 char *assembler_name
;
535 #define DECL_PRINT_NAME(NODE) ((NODE)->function_decl.print_name)
536 #define DECL_RESULT(NODE) ((NODE)->function_decl.result)
537 #define DECL_BLOCK_SYMTAB_ADDRESS(NODE) ((NODE)->function_decl.block_symtab_address)
538 #define DECL_SAVED_INSNS(NODE) ((NODE)->function_decl.saved_insns)
539 #define DECL_FRAME_SIZE(NODE) ((NODE)->function_decl.frame_size)
541 struct tree_function_decl
543 struct tree_decl ignore
;
546 union tree_node
*result
;
547 int frame_size
; /* For FUNCTION_DECLs: size of stack frame */
548 struct rtx_def
*saved_insns
; /* For FUNCTION_DECLs: points to insn that
549 constitutes its definition on the
550 permanent obstack. */
551 int block_symtab_address
;
554 /* Define fields and accessors for nodes representing statements.
555 These are now obsolete for C, except for LET_STMT, which is used
556 to record the structure of binding contours (and the names declared
557 in each contour) for the sake of outputting debugging info.
558 Perhaps they will be used once again for other languages. */
560 /* For LABEL_STMT, GOTO_STMT, RETURN_STMT, COMPOUND_STMT, ASM_STMT. */
561 #define STMT_SOURCE_LINE(NODE) ((NODE)->stmt.linenum)
562 #define STMT_SOURCE_FILE(NODE) ((NODE)->stmt.filename)
563 #define STMT_BODY(NODE) ((NODE)->stmt.body)
567 char common
[sizeof (struct tree_common
)];
570 union tree_node
*body
;
575 /* #define STMT_SOURCE_LINE(NODE) */
576 /* #define STMT_SOURCE_FILE(NODE) */
577 #define STMT_COND(NODE) ((NODE)->if_stmt.cond)
578 #define STMT_THEN(NODE) ((NODE)->if_stmt.thenpart)
579 #define STMT_ELSE(NODE) ((NODE)->if_stmt.elsepart)
583 char common
[sizeof (struct tree_common
)];
586 union tree_node
*cond
, *thenpart
, *elsepart
;
590 #define STMT_LOOP_VARS(NODE) ((NODE)->loop_stmt.vars)
591 #define STMT_LOOP_COND(NODE) ((NODE)->loop_stmt.cond)
592 #define STMT_LOOP_BODY(NODE) ((NODE)->loop_stmt.body)
594 struct tree_loop_stmt
596 char common
[sizeof (struct tree_common
)];
599 union tree_node
*vars
, *cond
, *body
;
602 /* For LET_STMT and WITH_STMT. */
604 /* #define STMT_SOURCE_LINE(NODE) */
605 /* #define STMT_SOURCE_FILE(NODE) */
606 /* #define STMT_BODY(NODE) */
607 #define STMT_VARS(NODE) ((NODE)->bind_stmt.vars)
608 #define STMT_SUPERCONTEXT(NODE) ((NODE)->bind_stmt.supercontext)
609 #define STMT_BIND_SIZE(NODE) ((NODE)->bind_stmt.bind_size)
610 #define STMT_TYPE_TAGS(NODE) ((NODE)->bind_stmt.type_tags)
611 #define STMT_SUBBLOCKS(NODE) ((NODE)->bind_stmt.subblocks)
613 struct tree_bind_stmt
615 char common
[sizeof (struct tree_common
)];
618 union tree_node
*body
, *vars
, *supercontext
, *bind_size
, *type_tags
;
619 union tree_node
*subblocks
;
624 #define STMT_CASE_INDEX(NODE) ((NODE)->case_stmt.index)
625 #define STMT_CASE_LIST(NODE) ((NODE)->case_stmt.case_list)
627 struct tree_case_stmt
629 char common
[sizeof (struct tree_common
)];
632 union tree_node
*index
, *case_list
;
635 /* Define the overall contents of a tree node.
636 It may be any of the structures declared above
637 for various types of node. */
641 struct tree_common common
;
642 struct tree_int_cst int_cst
;
643 struct tree_real_cst real_cst
;
644 struct tree_string string
;
645 struct tree_complex
complex;
646 struct tree_identifier identifier
;
647 struct tree_decl decl
;
648 struct tree_function_decl function_decl
;
649 struct tree_type type
;
650 struct tree_list list
;
653 struct tree_stmt stmt
;
654 struct tree_if_stmt if_stmt
;
655 struct tree_loop_stmt loop_stmt
;
656 struct tree_bind_stmt bind_stmt
;
657 struct tree_case_stmt case_stmt
;
660 extern char *oballoc ();
661 extern char *permalloc ();
663 /* Lowest level primitive for allocating a node.
664 The TREE_CODE is the only argument. Contents are initialized
665 to zero except for a few of the common fields. */
667 extern tree
make_node ();
669 /* Make a copy of a node, with all the same contents except
670 for TREE_UID and TREE_PERMANENT. (The copy is permanent
671 iff nodes being made now are permanent.) */
673 extern tree
copy_node ();
675 /* Make a copy of a chain of TREE_LIST nodes. */
677 extern tree
copy_list ();
679 /* Make a TREE_VEC. */
681 extern tree
make_tree_vec ();
683 /* Return the (unique) IDENTIFIER_NODE node for a given name.
684 The name is supplied as a char *. */
686 extern tree
get_identifier ();
688 /* Construct various types of nodes. */
690 extern tree
build_int_2 ();
691 extern tree
build_real ();
692 extern tree
build_real_from_string ();
693 extern tree
build_real_from_int_cst ();
694 extern tree
build_complex ();
695 extern tree
build_string ();
696 extern tree
build (), build1 ();
697 extern tree
build_nt (), build_parse_node ();
698 extern tree
build_tree_list (), build_decl_list (), build_decl_list_1 ();
699 extern tree
build_op_identifier ();
700 extern tree
build_decl ();
701 extern tree
build_if ();
702 extern tree
build_loop ();
703 extern tree
build_let ();
705 /* Construct various nodes representing data types. */
707 extern tree
make_signed_type ();
708 extern tree
make_unsigned_type ();
709 extern void fixup_unsigned_type ();
710 extern tree
build_pointer_type ();
711 extern tree
build_reference_type ();
712 extern tree
build_index_type ();
713 extern tree
build_array_type ();
714 extern tree
build_function_type ();
715 extern tree
build_method_type ();
716 extern tree
build_offset_type ();
717 extern tree
array_type_nelts ();
719 /* Construct expressions, performing type checking. */
721 extern tree
build_binary_op ();
722 extern tree
build_indirect_ref ();
723 extern tree
build_unary_op ();
725 /* Given a type node TYPE, and CONSTP and VOLATILEP, return a type
726 for the same kind of data as TYPE describes.
727 Variants point to the "main variant" (which has neither CONST nor VOLATILE)
728 via TYPE_MAIN_VARIANT, and it points to a chain of other variants
729 so that duplicate variants are never made.
730 Only main variants should ever appear as types of expressions. */
732 extern tree
build_type_variant ();
734 /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
735 TYPE_ALIGN and TYPE_MODE fields.
736 If called more than once on one node, does nothing except
737 for the first time. */
739 extern void layout_type ();
741 /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
742 return a canonicalized ..._TYPE node, so that duplicates are not made.
743 How the hash code is computed is up to the caller, as long as any two
744 callers that could hash identical-looking type nodes agree. */
746 extern tree
type_hash_canon ();
748 /* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node,
749 calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE
750 fields. Call this only once for any given decl node.
752 Second argument is the boundary that this field can be assumed to
753 be starting at (in bits). Zero means it can be assumed aligned
754 on any boundary that may be needed. */
756 extern void layout_decl ();
758 /* Fold constants as much as possible in an expression.
759 Returns the simplified expression.
760 Acts only on the top level of the expression;
761 if the argument itself cannot be simplified, its
762 subexpressions are not changed. */
766 /* combine (tree_code, exp1, exp2) where EXP1 and EXP2 are constants
767 returns a constant expression for the result of performing
768 the operation specified by TREE_CODE on EXP1 and EXP2. */
770 extern tree
combine ();
772 extern tree
convert ();
773 extern tree
convert_units ();
774 extern tree
size_in_bytes ();
775 extern tree
genop ();
776 extern tree
build_int ();
777 extern tree
get_pending_sizes ();
779 /* Type for sizes of data-type. */
781 extern tree sizetype
;
783 /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
784 by making the last node in X point to Y.
785 Returns X, except if X is 0 returns Y. */
787 extern tree
chainon ();
789 /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */
791 extern tree
tree_cons (), perm_tree_cons (), temp_tree_cons ();
792 extern tree
saveable_tree_cons (), decl_tree_cons ();
794 /* Return the last tree node in a chain. */
796 extern tree
tree_last ();
798 /* Reverse the order of elements in a chain, and return the new head. */
800 extern tree
nreverse ();
802 /* Returns the length of a chain of nodes
803 (number of chain pointers to follow before reaching a null pointer). */
805 extern int list_length ();
807 /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0 */
809 extern int integer_zerop ();
811 /* integer_onep (tree x) is nonzero if X is an integer constant of value 1 */
813 extern int integer_onep ();
815 /* integer_all_onesp (tree x) is nonzero if X is an integer constant
816 all of whose significant bits are 1. */
818 extern int integer_all_onesp ();
820 /* type_unsigned_p (tree x) is nonzero if the type X is an unsigned type
821 (all of its possible values are >= 0).
822 If X is a pointer type, the value is 1.
823 If X is a real type, the value is 0. */
825 extern int type_unsigned_p ();
827 /* staticp (tree x) is nonzero if X is a reference to data allocated
828 at a fixed address in memory. */
830 extern int staticp ();
832 /* Gets an error if argument X is not an lvalue.
833 Also returns 1 if X is an lvalue, 0 if not. */
835 extern int lvalue_or_else ();
837 /* save_expr (EXP) returns an expression equivalent to EXP
838 but it can be used multiple times within context CTX
839 and only evaluate EXP once. */
841 extern tree
save_expr ();
843 /* stabilize_reference (EXP) returns an reference equivalent to EXP
844 but it can be used multiple times
845 and only evaluate the subexpressions once. */
847 extern tree
stabilize_reference ();
849 /* Return EXP, stripped of any conversions to wider types
850 in such a way that the result of converting to type FOR_TYPE
851 is the same as if EXP were converted to FOR_TYPE.
852 If FOR_TYPE is 0, it signifies EXP's type. */
854 extern tree
get_unwidened ();
856 /* Return OP or a simpler expression for a narrower value
857 which can be sign-extended or zero-extended to give back OP.
858 Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
859 or 0 if the value should be sign-extended. */
861 extern tree
get_narrower ();
863 /* Given PRECISION and UNSIGNEDP, return a suitable type-tree
864 for an integer type with at least that precision.
865 The definition of this resides in language-specific code
866 as the repertoire of available types may vary. */
868 extern tree
type_for_size ();
870 /* Given an integer type T, return a type like T but unsigned.
871 If T is unsigned, the value is T.
872 The definition of this resides in language-specific code
873 as the repertoire of available types may vary. */
875 extern tree
unsigned_type ();
877 /* Given an integer type T, return a type like T but signed.
878 If T is signed, the value is T.
879 The definition of this resides in language-specific code
880 as the repertoire of available types may vary. */
882 extern tree
signed_type ();
884 /* Return the floating type node for a given floating machine mode. */
886 extern tree
get_floating_type ();
888 /* Given the FUNCTION_DECL for the current function,
889 return zero if it is ok for this function to be inline.
890 Otherwise return a warning message with a single %s
891 for the function's name. */
893 extern char *function_cannot_inline_p ();
895 /* Declare commonly used variables for tree structure. */
897 /* An integer constant with value 0 */
898 extern tree integer_zero_node
;
900 /* An integer constant with value 1 */
901 extern tree integer_one_node
;
903 /* An integer constant with value 0 whose type is sizetype. */
904 extern tree size_zero_node
;
906 /* An integer constant with value 1 whose type is sizetype. */
907 extern tree size_one_node
;
909 /* A constant of type pointer-to-int and value 0 */
910 extern tree null_pointer_node
;
912 /* A node of type ERROR_MARK. */
913 extern tree error_mark_node
;
915 /* The type node for the void type. */
916 extern tree void_type_node
;
918 /* The type node for the ordinary (signed) integer type. */
919 extern tree integer_type_node
;
921 /* The type node for the unsigned integer type. */
922 extern tree unsigned_type_node
;
924 /* The type node for the ordinary character type. */
925 extern tree char_type_node
;
927 /* Points to the name of the input file from which the current input
928 being parsed originally came (before it went into cpp). */
929 extern char *input_filename
;
931 /* Nonzero for -pedantic switch: warn about anything
932 that standard C forbids. */
935 /* Nonzero means can safely call expand_expr now;
936 otherwise layout_type puts variable sizes onto `pending_sizes' instead. */
938 extern int immediate_size_expand
;
940 /* Points to the FUNCTION_DECL of the function whose body we are reading. */
942 extern tree current_function_decl
;
944 /* Nonzero if function being compiled can call setjmp. */
946 extern int current_function_calls_setjmp
;
948 /* Nonzero means all ..._TYPE nodes should be allocated permanently. */
950 extern int all_types_permanent
;
952 /* Pointer to function to compute the name to use to print a declaration. */
954 extern char *(*decl_printable_name
) ();
958 extern tree
expand_start_stmt_expr ();
959 extern tree
expand_end_stmt_expr ();
960 extern void expand_expr_stmt (), clear_last_expr ();
961 extern void expand_label (), expand_goto (), expand_asm ();
962 extern void expand_start_cond (), expand_end_cond ();
963 extern void expand_start_else (), expand_end_else ();
964 extern void expand_start_loop (), expand_start_loop_continue_elsewhere ();
965 extern void expand_loop_continue_here ();
966 extern void expand_end_loop ();
967 extern int expand_continue_loop ();
968 extern int expand_exit_loop (), expand_exit_loop_if_false ();
969 extern int expand_exit_something ();
971 extern void expand_start_delayed_expr ();
972 extern tree
expand_end_delayed_expr ();
973 extern void expand_emit_delayed_expr ();
975 extern void expand_null_return (), expand_return ();
976 extern void expand_start_bindings (), expand_end_bindings ();
977 extern void expand_start_case (), expand_end_case ();
978 extern int pushcase (), pushcase_range ();
979 extern void expand_start_function (), expand_end_function ();