1 /* d-tree.h -- Definitions and declarations for code generation.
2 Copyright (C) 2006-2021 Free Software Foundation, Inc.
4 GCC is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
9 GCC is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with GCC; see the file COPYING3. If not see
16 <http://www.gnu.org/licenses/>. */
21 /* Forward type declarations to avoid including unnecessary headers. */
25 class AggregateDeclaration
;
26 class ClassDeclaration
;
27 class EnumDeclaration
;
28 class FuncDeclaration
;
29 class StructDeclaration
;
30 class TypeInfoDeclaration
;
33 class ClassReferenceExp
;
43 template <typename TYPE
> struct Array
;
44 typedef Array
<Expression
*> Expressions
;
46 /* Usage of TREE_LANG_FLAG_?:
48 1: CALL_EXPR_ARGS_ORDERED (in CALL_EXPR).
50 Usage of TYPE_LANG_FLAG_?:
52 1: TYPE_IMAGINARY_FLOAT (in REAL_TYPE).
53 ANON_AGGR_TYPE_P (in RECORD_TYPE, UNION_TYPE).
54 2: CLASS_TYPE_P (in RECORD_TYPE).
55 3: TYPE_DYNAMIC_ARRAY (in RECORD_TYPE).
56 4: TYPE_DELEGATE (in RECORD_TYPE).
57 5: TYPE_ASSOCIATIVE_ARRAY (in RECORD_TYPE).
59 Usage of DECL_LANG_FLAG_?:
60 0: LABEL_VARIABLE_CASE (in LABEL_DECL).
61 DECL_BUILT_IN_CTFE (in FUNCTION_DECL).
62 1: DECL_IN_UNITTEST_CONDITION_P (in FUNCTION_DECL).
63 2: DECL_INSTANTIATED (in FUNCTION_DECL, VAR_DECL). */
65 /* Language-specific tree checkers. */
67 #define VAR_OR_FUNCTION_DECL_CHECK(NODE) \
68 TREE_CHECK2 (NODE, VAR_DECL, FUNCTION_DECL)
70 /* The kinds of scopes we recognize. */
74 level_block
, /* An ordinary block scope. */
75 level_try
, /* A try-block. */
76 level_catch
, /* A catch-block. */
77 level_finally
, /* A finally-block. */
78 level_cond
, /* The scope for an if condition. */
79 level_switch
, /* The scope for a switch statement. */
80 level_loop
, /* A for, do-while, or unrolled-loop block. */
81 level_with
, /* The scope for a with statement. */
82 level_function
/* The block representing an entire function. */
85 /* List of codes for internally recognised compiler intrinsics. */
89 #define DEF_D_INTRINSIC(CODE, B, N, M, D, C) CODE,
91 #include "intrinsics.def"
93 #undef DEF_D_INTRINSIC
97 /* For use with break and continue statements. */
105 /* The datatype used to implement D scope. It is needed primarily to support
106 the back-end, but also helps debugging information for local variables. */
108 struct GTY((chain_next ("%h.level_chain"))) binding_level
110 /* A chain of declarations for all variables, constants and functions.
111 These are in the reverse of the order supplied. */
114 /* For each level (except the global one), a chain of BLOCK nodes for
115 all the levels that were entered and exited one level down. */
118 /* The binding level this one is contained in. */
119 binding_level
*level_chain
;
121 /* The kind of scope this object represents. */
122 ENUM_BITFIELD (level_kind
) kind
: 4;
125 /* The binding level currently in effect. */
126 extern GTY(()) binding_level
*current_binding_level
;
127 extern GTY(()) binding_level
*global_binding_level
;
129 /* Used only for jumps to as-yet undefined labels, since jumps to
130 defined labels can have their validity checked immediately. */
132 struct GTY((chain_next ("%h.next"))) d_label_use_entry
134 d_label_use_entry
*next
;
136 /* The frontend Statement associated with the jump. */
137 Statement
* GTY((skip
)) statement
;
139 /* The binding level to which this entry is *currently* attached.
140 This is initially the binding level in which the goto appeared,
141 but is modified as scopes are closed. */
142 binding_level
*level
;
145 /* A list of all LABEL_DECLs in the function that have names. Here so
146 we can clear out their names' definitions at the end of the
147 function, and so we can check the validity of jumps to these labels. */
149 struct GTY(()) d_label_entry
151 /* The label decl itself. */
154 /* The frontend Statement associated with the label. */
155 Statement
* GTY((skip
)) statement
;
157 /* The binding level to which the label is *currently* attached.
158 This is initially set to the binding level in which the label
159 is defined, but is modified as scopes are closed. */
160 binding_level
*level
;
162 /* A list of forward references of the label. */
163 d_label_use_entry
*fwdrefs
;
165 /* The following bits are set after the label is defined, and are
166 updated as scopes are popped. They indicate that a backward jump
167 to the label will illegally enter a scope of the given flavor. */
171 /* If set, the label we reference represents a break/continue pair. */
175 /* Frame information for a function declaration. */
177 struct GTY(()) tree_frame_info
179 struct tree_common common
;
183 /* True if the function creates a nested frame. */
184 #define FRAMEINFO_CREATES_FRAME(NODE) \
185 (TREE_LANG_FLAG_0 (FUNCFRAME_INFO_CHECK (NODE)))
187 /* True if the function has a static chain passed in its DECL_ARGUMENTS. */
188 #define FRAMEINFO_STATIC_CHAIN(NODE) \
189 (TREE_LANG_FLAG_1 (FUNCFRAME_INFO_CHECK (NODE)))
191 /* True if the function frame is a closure (initialized on the heap). */
192 #define FRAMEINFO_IS_CLOSURE(NODE) \
193 (TREE_LANG_FLAG_2 (FUNCFRAME_INFO_CHECK (NODE)))
195 #define FRAMEINFO_TYPE(NODE) \
196 (((tree_frame_info *) FUNCFRAME_INFO_CHECK (NODE))->frame_type)
198 /* Language-dependent contents of an identifier. */
200 struct GTY(()) lang_identifier
202 struct tree_identifier common
;
204 /* The identifier as the user sees it. */
207 /* The back-end tree associated with this identifier. */
210 /* The frontend Declaration associated with this identifier. */
211 Declaration
* GTY((skip
)) dsymbol
;
212 AggregateDeclaration
* GTY((skip
)) daggregate
;
215 #define IDENTIFIER_LANG_SPECIFIC(NODE) \
216 ((struct lang_identifier *) IDENTIFIER_NODE_CHECK (NODE))
218 #define IDENTIFIER_PRETTY_NAME(NODE) \
219 (IDENTIFIER_LANG_SPECIFIC (NODE)->pretty_ident)
221 #define IDENTIFIER_DECL_TREE(NODE) \
222 (IDENTIFIER_LANG_SPECIFIC (NODE)->decl_tree)
224 #define IDENTIFIER_DSYMBOL(NODE) \
225 (IDENTIFIER_LANG_SPECIFIC (NODE)->dsymbol)
227 #define IDENTIFIER_DAGGREGATE(NODE) \
228 (IDENTIFIER_LANG_SPECIFIC (NODE)->daggregate)
230 /* Global state pertinent to the current function. */
232 struct GTY(()) language_function
234 /* Our function and enclosing module. */
235 FuncDeclaration
* GTY((skip
)) function
;
236 Module
* GTY((skip
)) module
;
238 /* Static chain of function, for D2, this is a closure. */
241 /* Stack of statement lists being collected while we are
242 compiling the function. */
243 vec
<tree
, va_gc
> *stmt_list
;
245 /* Variables that are in scope that will need destruction later. */
246 vec
<tree
, va_gc
> *vars_in_scope
;
248 /* Table of all used or defined labels in the function. */
249 hash_map
<Statement
*, d_label_entry
> *labels
;
252 /* The D front end types have not been integrated into the GCC garbage
253 collection system. Handle this by using the "skip" attribute. */
255 struct GTY(()) lang_decl
257 Declaration
* GTY((skip
)) decl
;
259 /* FIELD_DECL in frame struct that this variable is allocated in. */
262 /* RESULT_DECL in a function that returns by nrvo. */
265 /* Chain of DECL_LANG_THUNKS in a function. */
268 /* In a FUNCTION_DECL, this is the THUNK_LANG_OFFSET. */
271 /* In a FUNCTION_DECL, if this is an intrinsic, the code for it. */
272 enum intrinsic_code intrinsic
;
274 /* FUNCFRAME_INFO in a function that has non-local references. */
278 /* The current D per-function global variables. */
280 #define d_function_chain (cfun ? cfun->language : NULL)
282 /* The D frontend Declaration AST for GCC decl NODE. */
283 #define DECL_LANG_FRONTEND(NODE) \
284 (DECL_LANG_SPECIFIC (NODE) \
285 ? DECL_LANG_SPECIFIC (NODE)->decl : NULL)
287 #define SET_DECL_LANG_FRAME_FIELD(NODE, VAL) \
288 DECL_LANG_SPECIFIC (NODE)->frame_field = VAL
290 #define DECL_LANG_FRAME_FIELD(NODE) \
292 ? DECL_LANG_SPECIFIC (NODE)->frame_field : NULL)
294 #define SET_DECL_LANG_NRVO(NODE, VAL) \
295 DECL_LANG_SPECIFIC (NODE)->named_result = VAL
297 #define DECL_LANG_NRVO(NODE) \
299 ? DECL_LANG_SPECIFIC (NODE)->named_result : NULL)
301 #define DECL_LANG_THUNKS(NODE) \
302 DECL_LANG_SPECIFIC (NODE)->thunks
304 #define THUNK_LANG_OFFSET(NODE) \
305 DECL_LANG_SPECIFIC (NODE)->offset
307 #define DECL_INTRINSIC_CODE(NODE) \
308 DECL_LANG_SPECIFIC (NODE)->intrinsic
310 #define DECL_LANG_FRAMEINFO(NODE) \
311 DECL_LANG_SPECIFIC (NODE)->frame_info
313 /* The lang_type field is not set for every GCC type. */
315 struct GTY(()) lang_type
317 Type
* GTY((skip
)) type
;
320 /* The D frontend Type AST for GCC type NODE. */
321 #define TYPE_LANG_FRONTEND(NODE) \
322 (TYPE_LANG_SPECIFIC (NODE) \
323 ? TYPE_LANG_SPECIFIC (NODE)->type : NULL)
326 enum d_tree_node_structure_enum
334 /* The resulting tree type. */
336 union GTY((desc ("d_tree_node_structure (&%h)"),
337 chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON)"
338 " ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
341 union tree_node
GTY ((tag ("TS_D_GENERIC"),
342 desc ("tree_node_structure (&%h)"))) generic
;
343 lang_identifier
GTY ((tag ("TS_D_IDENTIFIER"))) identifier
;
344 tree_frame_info
GTY ((tag ("TS_D_FRAMEINFO"))) frameinfo
;
347 /* True if the Tdelegate typed expression is not really a variable,
348 but a literal function / method reference. */
349 #define METHOD_CALL_EXPR(NODE) \
350 (TREE_LANG_FLAG_0 (NODE))
352 /* True if all arguments in a call expression should be evaluated in the
353 order they are given (left to right). */
354 #define CALL_EXPR_ARGS_ORDERED(NODE) \
355 (TREE_LANG_FLAG_1 (CALL_EXPR_CHECK (NODE)))
357 /* True if the type was declared 'shared'. */
358 #define TYPE_SHARED(NODE) \
359 (TYPE_LANG_FLAG_0 (NODE))
361 /* True if the type is an imaginary float type. */
362 #define TYPE_IMAGINARY_FLOAT(NODE) \
363 (TYPE_LANG_FLAG_1 (REAL_TYPE_CHECK (NODE)))
365 /* True if the type is an anonymous record or union. */
366 #define ANON_AGGR_TYPE_P(NODE) \
367 (TYPE_LANG_FLAG_1 (RECORD_OR_UNION_CHECK (NODE)))
369 /* True if the type is the underlying record for a class. */
370 #define CLASS_TYPE_P(NODE) \
371 (TYPE_LANG_FLAG_2 (RECORD_TYPE_CHECK (NODE)))
373 /* True if the type is a D dynamic array. */
374 #define TYPE_DYNAMIC_ARRAY(NODE) \
375 (TYPE_LANG_FLAG_3 (RECORD_TYPE_CHECK (NODE)))
377 /* True if the type is a D delegate. */
378 #define TYPE_DELEGATE(NODE) \
379 (TYPE_LANG_FLAG_4 (RECORD_TYPE_CHECK (NODE)))
381 /* True if the type is a D associative array. */
382 #define TYPE_ASSOCIATIVE_ARRAY(NODE) \
383 (TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE)))
385 /* True if the decl is a variable case label decl. */
386 #define LABEL_VARIABLE_CASE(NODE) \
387 (DECL_LANG_FLAG_0 (LABEL_DECL_CHECK (NODE)))
389 /* True if the decl is a CTFE built-in. */
390 #define DECL_BUILT_IN_CTFE(NODE) \
391 (DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE)))
393 /* True if the decl is only compiled in when unittests are turned on. */
394 #define DECL_IN_UNITTEST_CONDITION_P(NODE) \
395 (DECL_LANG_FLAG_1 (FUNCTION_DECL_CHECK (NODE)))
397 /* True if the decl comes from a template instance. */
398 #define DECL_INSTANTIATED(NODE) \
399 (DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE)))
403 DTI_VTABLE_ENTRY_TYPE
,
405 DTI_VTBL_INTERFACE_TYPE
,
435 extern GTY(()) tree d_global_trees
[DTI_MAX
];
437 #define vtable_entry_type d_global_trees[DTI_VTABLE_ENTRY_TYPE]
438 #define vtbl_ptr_type_node d_global_trees[DTI_VTBL_PTR_TYPE]
439 #define vtbl_interface_type_node d_global_trees[DTI_VTBL_INTERFACE_TYPE]
440 /* D built-in language types. */
441 #define d_bool_type d_global_trees[DTI_BOOL_TYPE]
442 #define d_byte_type d_global_trees[DTI_BYTE_TYPE]
443 #define d_ubyte_type d_global_trees[DTI_UBYTE_TYPE]
444 #define d_short_type d_global_trees[DTI_SHORT_TYPE]
445 #define d_ushort_type d_global_trees[DTI_USHORT_TYPE]
446 #define d_int_type d_global_trees[DTI_INT_TYPE]
447 #define d_uint_type d_global_trees[DTI_UINT_TYPE]
448 #define d_long_type d_global_trees[DTI_LONG_TYPE]
449 #define d_ulong_type d_global_trees[DTI_ULONG_TYPE]
450 #define d_cent_type d_global_trees[DTI_CENT_TYPE]
451 #define d_ucent_type d_global_trees[DTI_UCENT_TYPE]
452 /* Imaginary floating-point types. */
453 #define ifloat_type_node d_global_trees[DTI_IFLOAT_TYPE]
454 #define idouble_type_node d_global_trees[DTI_IDOUBLE_TYPE]
455 #define ireal_type_node d_global_trees[DTI_IREAL_TYPE]
456 /* UTF-8, 16 and 32 types. */
457 #define char8_type_node d_global_trees[DTI_CHAR_TYPE]
458 #define char16_type_node d_global_trees[DTI_DCHAR_TYPE]
459 #define char32_type_node d_global_trees[DTI_WCHAR_TYPE]
460 /* Empty record type used as placeholder when real type is unknown. */
461 #define unknown_type_node d_global_trees[DTI_UNKNOWN_TYPE]
462 /* Generic dynamic array type void[]. */
463 #define array_type_node d_global_trees[DTI_ARRAY_TYPE]
464 /* Null initializer for dynamic arrays. */
465 #define null_array_node d_global_trees[DTI_NULL_ARRAY]
467 /* A prefix for internal variables, which are not user-visible. */
468 #if !defined (NO_DOT_IN_LABEL)
469 # define GDC_PREFIX(x) "gdc." x
470 #elif !defined (NO_DOLLAR_IN_LABEL)
471 # define GDC_PREFIX(x) "gdc$" x
473 # define GDC_PREFIX(x) "gdc_" x
476 /* Internally recognised D runtime library functions. */
480 #define DEF_D_RUNTIME(CODE, N, T, P, F) LIBCALL_ ## CODE,
482 #include "runtime.def"
488 /* Gate for when the D frontend makes an early call into the codegen pass, such
489 as when it requires target information or CTFE evaluation. As full semantic
490 may not be completed, we only want to build the superficial tree structure
491 without finishing any decls or types. */
492 extern bool doing_semantic_analysis_p
;
494 /* In d-attribs.c. */
495 extern tree
insert_type_attribute (tree
, const char *, tree
= NULL_TREE
);
496 extern tree
insert_decl_attribute (tree
, const char *, tree
= NULL_TREE
);
497 extern void apply_user_attributes (Dsymbol
*, tree
);
499 /* In d-builtins.cc. */
500 extern const attribute_spec d_langhook_attribute_table
[];
501 extern const attribute_spec d_langhook_common_attribute_table
[];
502 extern Type
*build_frontend_type (tree
);
504 extern tree
d_builtin_function (tree
);
505 extern tree
d_builtin_function_ext_scope (tree
);
506 extern void d_init_builtins (void);
507 extern void d_register_builtin_type (tree
, const char *);
508 extern void d_build_builtins_module (Module
*);
509 extern void d_maybe_set_builtin (Module
*);
510 extern Expression
*d_eval_constant_expression (const Loc
&, tree
);
511 extern void d_init_versions (void);
513 /* In d-codegen.cc. */
514 extern location_t
make_location_t (const Loc
&);
515 extern tree
d_decl_context (Dsymbol
*);
516 extern tree
copy_aggregate_type (tree
);
517 extern bool declaration_reference_p (Declaration
*);
518 extern tree
declaration_type (Declaration
*);
519 extern bool parameter_reference_p (Parameter
*);
520 extern tree
parameter_type (Parameter
*);
521 extern tree
build_integer_cst (dinteger_t
, tree
= d_int_type
);
522 extern tree
build_float_cst (const real_t
&, Type
*);
523 extern tree
d_array_length (tree
);
524 extern tree
d_array_ptr (tree
);
525 extern tree
d_array_value (tree
, tree
, tree
);
526 extern tree
get_array_length (tree
, Type
*);
527 extern tree
build_class_binfo (tree
, ClassDeclaration
*);
528 extern tree
build_interface_binfo (tree
, ClassDeclaration
*, unsigned &);
529 extern tree
delegate_method (tree
);
530 extern tree
delegate_object (tree
);
531 extern tree
build_delegate_cst (tree
, tree
, Type
*);
532 extern tree
build_method_call (tree
, tree
, Type
*);
533 extern void extract_from_method_call (tree
, tree
&, tree
&);
534 extern tree
build_typeof_null_value (Type
*);
535 extern tree
build_vindex_ref (tree
, tree
, size_t);
536 extern tree
d_save_expr (tree
);
537 extern tree
stabilize_expr (tree
*);
538 extern tree
build_target_expr (tree
, tree
);
539 extern tree
force_target_expr (tree
);
540 extern tree
build_address (tree
);
541 extern tree
d_mark_addressable (tree
);
542 extern tree
d_mark_used (tree
);
543 extern tree
d_mark_read (tree
);
544 extern tree
build_memcmp_call (tree
, tree
, tree
);
545 extern tree
build_memcpy_call (tree
, tree
, tree
);
546 extern tree
build_memset_call (tree
, tree
= NULL_TREE
);
547 extern bool identity_compare_p (StructDeclaration
*);
548 extern tree
build_float_identity (tree_code
, tree
, tree
);
549 extern tree
build_struct_comparison (tree_code
, StructDeclaration
*,
551 extern tree
build_array_struct_comparison (tree_code
, StructDeclaration
*,
553 extern tree
build_struct_literal (tree
, vec
<constructor_elt
, va_gc
> *);
554 extern tree
component_ref (tree
, tree
);
555 extern tree
build_assign (tree_code
, tree
, tree
);
556 extern tree
modify_expr (tree
, tree
);
557 extern tree
build_nop (tree
, tree
);
558 extern tree
build_vconvert (tree
, tree
);
559 extern tree
build_boolop (tree_code
, tree
, tree
);
560 extern tree
build_condition (tree
, tree
, tree
, tree
);
561 extern tree
build_vcondition (tree
, tree
, tree
);
562 extern tree
compound_expr (tree
, tree
);
563 extern tree
return_expr (tree
);
564 extern tree
size_mult_expr (tree
, tree
);
565 extern tree
real_part (tree
);
566 extern tree
imaginary_part (tree
);
567 extern tree
complex_expr (tree
, tree
, tree
);
568 extern tree
indirect_ref (tree
, tree
);
569 extern tree
build_deref (tree
);
570 extern tree
build_array_index (tree
, tree
);
571 extern tree
build_offset_op (tree_code
, tree
, tree
);
572 extern tree
build_offset (tree
, tree
);
573 extern tree
build_memref (tree
, tree
, tree
);
574 extern tree
build_array_set (tree
, tree
, tree
);
575 extern tree
build_array_from_val (Type
*, tree
);
576 extern tree
build_array_from_exprs (Type
*, Expressions
*, bool);
577 extern tree
void_okay_p (tree
);
578 extern tree
build_array_bounds_call (const Loc
&);
579 extern tree
build_bounds_condition (const Loc
&, tree
, tree
, bool);
580 extern bool array_bounds_check (void);
581 extern tree
bind_expr (tree
, tree
);
582 extern TypeFunction
*get_function_type (Type
*);
583 extern bool call_by_alias_p (FuncDeclaration
*, FuncDeclaration
*);
584 extern tree
d_build_call_expr (FuncDeclaration
*, tree
, Expressions
*);
585 extern tree
d_build_call (TypeFunction
*, tree
, tree
, Expressions
*);
586 extern tree
d_assert_call (const Loc
&, libcall_fn
, tree
= NULL_TREE
);
587 extern tree
build_float_modulus (tree
, tree
, tree
);
588 extern tree
build_vthis_function (tree
, tree
);
589 extern tree
error_no_frame_access (Dsymbol
*);
590 extern tree
get_frame_for_symbol (Dsymbol
*);
591 extern tree
build_vthis (AggregateDeclaration
*);
592 extern void build_closure (FuncDeclaration
*);
593 extern tree
get_frameinfo (FuncDeclaration
*);
594 extern tree
get_framedecl (FuncDeclaration
*, FuncDeclaration
*);
596 /* In d-convert.cc. */
597 extern bool decl_with_nonnull_addr_p (const_tree
);
598 extern tree
d_truthvalue_conversion (tree
);
599 extern tree
d_convert (tree
, tree
);
600 extern tree
convert_expr (tree
, Type
*, Type
*);
601 extern tree
convert_for_rvalue (tree
, Type
*, Type
*);
602 extern tree
convert_for_assignment (tree
, Type
*, Type
*);
603 extern tree
convert_for_argument (tree
, Parameter
*);
604 extern tree
convert_for_condition (tree
, Type
*);
605 extern tree
d_array_convert (Expression
*);
606 extern tree
d_array_convert (Type
*, Expression
*);
608 /* In d-gimplify.cc. */
609 extern int d_gimplify_expr (tree
*, gimple_seq
*, gimple_seq
*);
611 /* In d-incpath.cc. */
612 extern void add_import_paths (const char *, const char *, bool);
615 extern void d_add_builtin_module (Module
*);
616 extern void d_add_entrypoint_module (Module
*, Module
*);
617 extern d_tree_node_structure_enum
d_tree_node_structure (lang_tree_node
*);
618 extern struct lang_type
*build_lang_type (Type
*);
619 extern struct lang_decl
*build_lang_decl (Declaration
*);
620 extern tree
d_pushdecl (tree
);
621 extern void d_keep (tree
);
624 extern const char *d_mangle_decl (Dsymbol
*);
625 extern tree
mangle_internal_decl (Dsymbol
*, const char *, const char *);
626 extern void build_decl_tree (Dsymbol
*);
627 extern tree
get_symbol_decl (Declaration
*);
628 extern tree
declare_extern_var (tree
, tree
);
629 extern void declare_local_var (VarDeclaration
*);
630 extern tree
build_local_temp (tree
);
631 extern tree
get_decl_tree (Declaration
*);
632 extern void d_finish_decl (tree
);
633 extern tree
make_thunk (FuncDeclaration
*, int);
634 extern tree
start_function (FuncDeclaration
*);
635 extern void finish_function (tree
);
636 extern tree
get_vtable_decl (ClassDeclaration
*);
637 extern tree
build_new_class_expr (ClassReferenceExp
*);
638 extern tree
aggregate_initializer_decl (AggregateDeclaration
*);
639 extern tree
layout_struct_initializer (StructDeclaration
*);
640 extern tree
layout_class_initializer (ClassDeclaration
*);
641 extern tree
enum_initializer_decl (EnumDeclaration
*);
642 extern tree
build_artificial_decl (tree
, tree
, const char * = NULL
);
643 extern tree
create_field_decl (tree
, const char *, int, int);
644 extern void build_type_decl (tree
, Dsymbol
*);
645 extern void set_linkage_for_decl (tree
);
648 extern tree
build_expr (Expression
*, bool = false, bool = false);
649 extern tree
build_expr_dtor (Expression
*);
650 extern tree
build_return_dtor (Expression
*, Type
*, TypeFunction
*);
653 extern tree
build_import_decl (Dsymbol
*);
655 /* In intrinsics.cc. */
656 extern void maybe_set_intrinsic (FuncDeclaration
*);
657 extern tree
maybe_expand_intrinsic (tree
);
660 extern void build_module_tree (Module
*);
661 extern tree
d_module_context (void);
662 extern void register_module_decl (Declaration
*);
663 extern void d_finish_compilation (tree
*, int);
666 extern tree
build_libcall (libcall_fn
, Type
*, int ...);
668 /* In typeinfo.cc. */
669 extern bool have_typeinfo_p (ClassDeclaration
*);
670 extern tree
layout_typeinfo (TypeInfoDeclaration
*);
671 extern tree
layout_classinfo (ClassDeclaration
*);
672 extern unsigned base_vtable_offset (ClassDeclaration
*, BaseClass
*);
673 extern tree
get_typeinfo_decl (TypeInfoDeclaration
*);
674 extern tree
get_classinfo_decl (ClassDeclaration
*);
675 extern void check_typeinfo_type (const Loc
&, Scope
*);
676 extern tree
build_typeinfo (const Loc
&, Type
*);
677 extern void create_typeinfo (Type
*, Module
*);
678 extern void create_tinfo_types (Module
*);
679 extern void layout_cpp_typeinfo (ClassDeclaration
*);
680 extern tree
get_cpp_typeinfo_decl (ClassDeclaration
*);
681 extern bool speculative_type_p (Type
*);
684 extern void push_binding_level (level_kind
);
685 extern tree
pop_binding_level (void);
686 extern void push_stmt_list (void);
687 extern tree
pop_stmt_list (void);
688 extern void add_stmt (tree
);
689 extern void build_function_body (FuncDeclaration
*);
692 extern tree
d_unsigned_type (tree
);
693 extern tree
d_signed_type (tree
);
694 extern bool valist_array_p (Type
*);
695 extern bool empty_aggregate_p (tree
);
696 extern bool same_type_p (Type
*, Type
*);
697 extern Type
*get_object_type (void);
698 extern tree
make_array_type (Type
*, unsigned HOST_WIDE_INT
);
699 extern tree
make_struct_type (const char *, int n
, ...);
700 extern tree
insert_type_modifiers (tree
, unsigned);
701 extern void insert_aggregate_field (tree
, tree
, size_t);
702 extern void finish_aggregate_type (unsigned, unsigned, tree
);
703 extern tree
build_ctype (Type
*);
705 #endif /* GCC_D_TREE_H */