1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
7 * C Implementation File *
9 * Copyright (C) 1992-2016, Free Software Foundation, Inc. *
11 * GNAT is free software; you can redistribute it and/or modify it under *
12 * terms of the GNU General Public License as published by the Free Soft- *
13 * ware Foundation; either version 3, or (at your option) any later ver- *
14 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
15 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
16 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
17 * for more details. You should have received a copy of the GNU General *
18 * Public License distributed with GNAT; see file COPYING3. If not see *
19 * <http://www.gnu.org/licenses/>. *
21 * GNAT was originally developed by the GNAT team at New York University. *
22 * Extensive contributions were provided by Ada Core Technologies Inc. *
24 ****************************************************************************/
28 #include "coretypes.h"
31 #include "diagnostic.h"
34 #include "fold-const.h"
35 #include "stor-layout.h"
36 #include "print-tree.h"
38 #include "langhooks.h"
39 #include "langhooks-def.h"
41 #include "calls.h" /* For pass_by_reference. */
42 #include "dwarf2out.h"
45 #include "adadecode.h"
57 /* This symbol needs to be defined for the front-end. */
58 void *callgraph_info_file
= NULL
;
60 /* Command-line argc and argv. These variables are global since they are
61 imported in back_end.adb. */
62 unsigned int save_argc
;
63 const char **save_argv
;
65 /* GNAT argc and argv generated by the binder for all Ada programs. */
67 extern const char **gnat_argv
;
69 /* Ada code requires variables for these settings rather than elements
70 of the global_options structure because they are imported. */
72 enum dwarf_gnat_encodings gnat_encodings
= DWARF_GNAT_ENCODINGS_DEFAULT
;
80 #undef flag_compare_debug
81 int flag_compare_debug
;
83 #undef flag_short_enums
86 #undef flag_stack_check
87 enum stack_check_type flag_stack_check
= NO_STACK_CHECK
;
93 /* Declare functions we use as part of startup. */
94 extern void __gnat_initialize (void *);
95 extern void __gnat_install_SEH_handler (void *);
96 extern void adainit (void);
97 extern void _ada_gnat1drv (void);
103 /* The parser for the language. For us, we process the GNAT tree. */
106 gnat_parse_file (void)
110 /* Call the target specific initializations. */
111 __gnat_initialize (NULL
);
113 /* ??? Call the SEH initialization routine. This is to workaround
114 a bootstrap path problem. The call below should be removed at some
115 point and the SEH pointer passed to __gnat_initialize above. */
116 __gnat_install_SEH_handler ((void *)seh
);
118 /* Call the front-end elaboration procedures. */
121 /* Call the front end. */
124 /* Write the global declarations. */
125 gnat_write_global_declarations ();
128 /* Return language mask for option processing. */
131 gnat_option_lang_mask (void)
136 /* Decode all the language specific options that cannot be decoded by GCC.
137 The option decoding phase of GCC calls this routine on the flags that
138 are marked as Ada-specific. Return true on success or false on failure. */
141 gnat_handle_option (size_t scode
, const char *arg
, int value
, int kind
,
142 location_t loc
, const struct cl_option_handlers
*handlers
)
144 enum opt_code code
= (enum opt_code
) scode
;
149 handle_generated_option (&global_options
, &global_options_set
,
150 OPT_Wunused
, NULL
, value
,
151 gnat_option_lang_mask (), kind
, loc
,
152 handlers
, global_dc
);
153 warn_uninitialized
= value
;
154 warn_maybe_uninitialized
= value
;
158 warning (0, "%<-gnat%> misspelled as %<-gant%>");
160 /* ... fall through ... */
168 /* These are handled by the front-end. */
171 case OPT_fshort_enums
:
172 case OPT_fsigned_char
:
173 /* These are handled by the middle-end. */
176 case OPT_fbuiltin_printf
:
177 /* This is ignored in Ada but needs to be accepted so it can be
185 Ada_handle_option_auto (&global_options
, &global_options_set
,
187 gnat_option_lang_mask (), kind
, loc
,
188 handlers
, global_dc
);
192 /* Initialize options structure OPTS. */
195 gnat_init_options_struct (struct gcc_options
*opts
)
197 /* Uninitialized really means uninitialized in Ada. */
198 opts
->x_flag_zero_initialized_in_bss
= 0;
200 /* We don't care about errno in Ada and it causes __builtin_sqrt to
201 call the libm function rather than do it inline. */
202 opts
->x_flag_errno_math
= 0;
203 opts
->frontend_set_flag_errno_math
= true;
206 /* Initialize for option processing. */
209 gnat_init_options (unsigned int decoded_options_count
,
210 struct cl_decoded_option
*decoded_options
)
212 /* Reconstruct an argv array for use of back_end.adb.
214 ??? back_end.adb should not rely on this; instead, it should work with
215 decoded options without such reparsing, to ensure consistency in how
216 options are decoded. */
217 save_argv
= XNEWVEC (const char *, 2 * decoded_options_count
+ 1);
219 for (unsigned int i
= 0; i
< decoded_options_count
; i
++)
221 size_t num_elements
= decoded_options
[i
].canonical_option_num_elements
;
223 if (decoded_options
[i
].errors
224 || decoded_options
[i
].opt_index
== OPT_SPECIAL_unknown
225 || num_elements
== 0)
228 /* Deal with -I- specially since it must be a single switch. */
229 if (decoded_options
[i
].opt_index
== OPT_I
231 && decoded_options
[i
].canonical_option
[1][0] == '-'
232 && decoded_options
[i
].canonical_option
[1][1] == '\0')
233 save_argv
[save_argc
++] = "-I-";
236 gcc_assert (num_elements
>= 1 && num_elements
<= 2);
237 save_argv
[save_argc
++] = decoded_options
[i
].canonical_option
[0];
238 if (num_elements
>= 2)
239 save_argv
[save_argc
++] = decoded_options
[i
].canonical_option
[1];
242 save_argv
[save_argc
] = NULL
;
244 /* Pass just the name of the command through the regular channel. */
245 gnat_argv
= (const char **) xmalloc (sizeof (char *));
246 gnat_argv
[0] = xstrdup (save_argv
[0]);
250 /* Settings adjustments after switches processing by the back-end.
251 Note that the front-end switches processing (Scan_Compiler_Arguments)
252 has not been done yet at this point! */
255 gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED
)
257 /* Excess precision other than "fast" requires front-end support. */
258 if (flag_excess_precision_cmdline
== EXCESS_PRECISION_STANDARD
)
259 sorry ("-fexcess-precision=standard for Ada");
260 flag_excess_precision_cmdline
= EXCESS_PRECISION_FAST
;
262 /* No psABI change warnings for Ada. */
265 /* No caret by default for Ada. */
266 if (!global_options_set
.x_flag_diagnostics_show_caret
)
267 global_dc
->show_caret
= false;
269 /* Set strict overflow by default for Ada. */
270 if (!global_options_set
.x_flag_strict_overflow
)
271 global_options
.x_flag_strict_overflow
= true;
273 /* Warn only if STABS is not the default: we don't want to emit a warning if
274 the user did not use a -gstabs option. */
275 if (PREFERRED_DEBUGGING_TYPE
!= DBX_DEBUG
&& write_symbols
== DBX_DEBUG
)
276 warning (0, "STABS debugging information for Ada is obsolete and not "
277 "supported anymore");
279 /* Copy global settings to local versions. */
280 gnat_encodings
= global_options
.x_gnat_encodings
;
281 optimize
= global_options
.x_optimize
;
282 optimize_size
= global_options
.x_optimize_size
;
283 flag_compare_debug
= global_options
.x_flag_compare_debug
;
284 flag_stack_check
= global_options
.x_flag_stack_check
;
285 flag_short_enums
= global_options
.x_flag_short_enums
;
287 /* Unfortunately the post_options hook is called before the value of
288 flag_short_enums is autodetected, if need be. Mimic the process
289 for our private flag_short_enums. */
290 if (flag_short_enums
== 2)
291 flag_short_enums
= targetm
.default_short_enums ();
296 /* Here is the function to handle the compiler error processing in GCC. */
299 internal_error_function (diagnostic_context
*context
, const char *msgid
,
303 char *buffer
, *p
, *loc
;
304 String_Template temp
, temp_loc
;
305 String_Pointer sp
, sp_loc
;
306 expanded_location xloc
;
308 /* Warn if plugins present. */
311 /* Reset the pretty-printer. */
312 pp_clear_output_area (context
->printer
);
314 /* Format the message into the pretty-printer. */
315 tinfo
.format_spec
= msgid
;
317 tinfo
.err_no
= errno
;
318 pp_format_verbatim (context
->printer
, &tinfo
);
320 /* Extract a (writable) pointer to the formatted text. */
321 buffer
= xstrdup (pp_formatted_text (context
->printer
));
323 /* Go up to the first newline. */
324 for (p
= buffer
; *p
; p
++)
332 temp
.High_Bound
= p
- buffer
;
336 xloc
= expand_location (input_location
);
337 if (context
->show_column
&& xloc
.column
!= 0)
338 loc
= xasprintf ("%s:%d:%d", xloc
.file
, xloc
.line
, xloc
.column
);
340 loc
= xasprintf ("%s:%d", xloc
.file
, xloc
.line
);
341 temp_loc
.Low_Bound
= 1;
342 temp_loc
.High_Bound
= strlen (loc
);
343 sp_loc
.Bounds
= &temp_loc
;
346 Current_Error_Node
= error_gnat_node
;
347 Compiler_Abort (sp
, sp_loc
, true);
350 /* Perform all the initialization steps that are language-specific. */
355 /* Do little here, most of the standard declarations are set up after the
356 front-end has been run. Use the same `char' as C for Interfaces.C. */
357 build_common_tree_nodes (flag_signed_char
);
359 /* In Ada, we use an unsigned 8-bit type for the default boolean type. */
360 boolean_type_node
= make_unsigned_type (8);
361 TREE_SET_CODE (boolean_type_node
, BOOLEAN_TYPE
);
362 SET_TYPE_RM_MAX_VALUE (boolean_type_node
,
363 build_int_cst (boolean_type_node
, 1));
364 SET_TYPE_RM_SIZE (boolean_type_node
, bitsize_int (1));
365 boolean_true_node
= TYPE_MAX_VALUE (boolean_type_node
);
366 boolean_false_node
= TYPE_MIN_VALUE (boolean_type_node
);
368 sbitsize_one_node
= sbitsize_int (1);
369 sbitsize_unit_node
= sbitsize_int (BITS_PER_UNIT
);
371 /* Register our internal error function. */
372 global_dc
->internal_error
= &internal_error_function
;
377 /* Initialize the GCC support for exception handling. */
380 gnat_init_gcc_eh (void)
382 /* We shouldn't do anything if the No_Exceptions_Handler pragma is set,
383 though. This could for instance lead to the emission of tables with
384 references to symbols (such as the Ada eh personality routine) within
385 libraries we won't link against. */
386 if (No_Exception_Handlers_Set ())
389 /* Tell GCC we are handling cleanup actions through exception propagation.
390 This opens possibilities that we don't take advantage of yet, but is
391 nonetheless necessary to ensure that fixup code gets assigned to the
392 right exception regions. */
393 using_eh_for_cleanups ();
395 /* Turn on -fexceptions, -fnon-call-exceptions and -fdelete-dead-exceptions.
396 The first one triggers the generation of the necessary exception tables.
397 The second one is useful for two reasons: 1/ we map some asynchronous
398 signals like SEGV to exceptions, so we need to ensure that the insns
399 which can lead to such signals are correctly attached to the exception
400 region they pertain to, 2/ some calls to pure subprograms are handled as
401 libcall blocks and then marked as "cannot trap" if the flag is not set
402 (see emit_libcall_block). We should not let this be since it is possible
403 for such calls to actually raise in Ada.
404 The third one is an optimization that makes it possible to delete dead
405 instructions that may throw exceptions, most notably loads and stores,
406 as permitted in Ada. */
408 flag_non_call_exceptions
= 1;
409 flag_delete_dead_exceptions
= 1;
414 /* Initialize the GCC support for floating-point operations. */
417 gnat_init_gcc_fp (void)
419 /* Disable FP optimizations that ignore the signedness of zero if
420 S'Signed_Zeros is true, but don't override the user if not. */
421 if (Signed_Zeros_On_Target
)
422 flag_signed_zeros
= 1;
423 else if (!global_options_set
.x_flag_signed_zeros
)
424 flag_signed_zeros
= 0;
426 /* Assume that FP operations can trap if S'Machine_Overflow is true,
427 but don't override the user if not. */
428 if (Machine_Overflows_On_Target
)
429 flag_trapping_math
= 1;
430 else if (!global_options_set
.x_flag_trapping_math
)
431 flag_trapping_math
= 0;
434 /* Print language-specific items in declaration NODE. */
437 gnat_print_decl (FILE *file
, tree node
, int indent
)
439 switch (TREE_CODE (node
))
442 print_node (file
, "corresponding var",
443 DECL_CONST_CORRESPONDING_VAR (node
), indent
+ 4);
447 print_node (file
, "original field", DECL_ORIGINAL_FIELD (node
),
452 if (DECL_LOOP_PARM_P (node
))
453 print_node (file
, "induction var", DECL_INDUCTION_VAR (node
),
456 print_node (file
, "renamed object", DECL_RENAMED_OBJECT (node
),
465 /* Print language-specific items in type NODE. */
468 gnat_print_type (FILE *file
, tree node
, int indent
)
470 switch (TREE_CODE (node
))
473 print_node (file
, "ci/co list", TYPE_CI_CO_LIST (node
), indent
+ 4);
477 if (TYPE_MODULAR_P (node
))
478 print_node_brief (file
, "modulus", TYPE_MODULUS (node
), indent
+ 4);
479 else if (TYPE_FIXED_POINT_P (node
))
480 print_node (file
, "scale factor", TYPE_SCALE_FACTOR (node
),
482 else if (TYPE_HAS_ACTUAL_BOUNDS_P (node
))
483 print_node (file
, "actual bounds", TYPE_ACTUAL_BOUNDS (node
),
486 print_node (file
, "index type", TYPE_INDEX_TYPE (node
), indent
+ 4);
488 /* ... fall through ... */
492 print_node_brief (file
, "RM size", TYPE_RM_SIZE (node
), indent
+ 4);
494 /* ... fall through ... */
497 print_node_brief (file
, "RM min", TYPE_RM_MIN_VALUE (node
), indent
+ 4);
498 print_node_brief (file
, "RM max", TYPE_RM_MAX_VALUE (node
), indent
+ 4);
502 print_node (file
,"actual bounds", TYPE_ACTUAL_BOUNDS (node
), indent
+ 4);
506 print_node (file
,"representative array",
507 TYPE_REPRESENTATIVE_ARRAY (node
), indent
+ 4);
511 if (TYPE_FAT_POINTER_P (node
) || TYPE_CONTAINS_TEMPLATE_P (node
))
512 print_node (file
, "unconstrained array",
513 TYPE_UNCONSTRAINED_ARRAY (node
), indent
+ 4);
515 print_node (file
, "Ada size", TYPE_ADA_SIZE (node
), indent
+ 4);
519 case QUAL_UNION_TYPE
:
520 print_node (file
, "Ada size", TYPE_ADA_SIZE (node
), indent
+ 4);
527 if (TYPE_CAN_HAVE_DEBUG_TYPE_P (node
) && TYPE_DEBUG_TYPE (node
))
528 print_node_brief (file
, "debug type", TYPE_DEBUG_TYPE (node
), indent
+ 4);
530 if (TYPE_IMPL_PACKED_ARRAY_P (node
) && TYPE_ORIGINAL_PACKED_ARRAY (node
))
531 print_node_brief (file
, "original packed array",
532 TYPE_ORIGINAL_PACKED_ARRAY (node
), indent
+ 4);
535 /* Return the name to be printed for DECL. */
538 gnat_printable_name (tree decl
, int verbosity
)
540 const char *coded_name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
541 char *ada_name
= (char *) ggc_alloc_atomic (strlen (coded_name
) * 2 + 60);
543 __gnat_decode (coded_name
, ada_name
, 0);
545 if (verbosity
== 2 && !DECL_IS_BUILTIN (decl
))
547 Set_Identifier_Casing (ada_name
, DECL_SOURCE_FILE (decl
));
548 return ggc_strdup (Name_Buffer
);
554 /* Return the name to be used in DWARF debug info for DECL. */
557 gnat_dwarf_name (tree decl
, int verbosity ATTRIBUTE_UNUSED
)
559 gcc_assert (DECL_P (decl
));
560 return (const char *) IDENTIFIER_POINTER (DECL_NAME (decl
));
563 /* Return the descriptive type associated with TYPE, if any. */
566 gnat_descriptive_type (const_tree type
)
568 if (TYPE_STUB_DECL (type
))
569 return DECL_PARALLEL_TYPE (TYPE_STUB_DECL (type
));
574 /* Return the underlying base type of an enumeration type. */
577 gnat_enum_underlying_base_type (const_tree
)
579 /* Enumeration types are base types in Ada. */
580 return void_type_node
;
583 /* Return the type to be used for debugging information instead of TYPE or
584 NULL_TREE if TYPE is fine. */
587 gnat_get_debug_type (const_tree type
)
589 if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type
) && TYPE_DEBUG_TYPE (type
))
591 type
= TYPE_DEBUG_TYPE (type
);
593 /* ??? The get_debug_type language hook is processed after the array
594 descriptor language hook, so if there is an array behind this type,
595 the latter is supposed to handle it. Still, we can get here with
596 a type we are not supposed to handle (e.g. when the DWARF back-end
597 processes the type of a variable), so keep this guard. */
598 if (type
&& TYPE_CAN_HAVE_DEBUG_TYPE_P (type
))
599 return const_cast<tree
> (type
);
605 /* Provide information in INFO for debugging output about the TYPE fixed-point
606 type. Return whether TYPE is handled. */
609 gnat_get_fixed_point_type_info (const_tree type
,
610 struct fixed_point_type_info
*info
)
614 /* GDB cannot handle fixed-point types yet, so rely on GNAT encodings
616 if (!TYPE_IS_FIXED_POINT_P (type
)
617 || gnat_encodings
!= DWARF_GNAT_ENCODINGS_MINIMAL
)
620 scale_factor
= TYPE_SCALE_FACTOR (type
);
622 /* We expect here only a finite set of pattern. See fixed-point types
623 handling in gnat_to_gnu_entity. */
625 /* Put invalid values when compiler internals cannot represent the scale
627 if (scale_factor
== integer_zero_node
)
629 info
->scale_factor_kind
= fixed_point_scale_factor_arbitrary
;
630 info
->scale_factor
.arbitrary
.numerator
= 0;
631 info
->scale_factor
.arbitrary
.denominator
= 0;
635 if (TREE_CODE (scale_factor
) == RDIV_EXPR
)
637 const tree num
= TREE_OPERAND (scale_factor
, 0);
638 const tree den
= TREE_OPERAND (scale_factor
, 1);
640 /* See if we have a binary or decimal scale. */
641 if (TREE_CODE (den
) == POWER_EXPR
)
643 const tree base
= TREE_OPERAND (den
, 0);
644 const tree exponent
= TREE_OPERAND (den
, 1);
646 /* We expect the scale factor to be 1 / 2 ** N or 1 / 10 ** N. */
647 gcc_assert (num
== integer_one_node
648 && TREE_CODE (base
) == INTEGER_CST
649 && TREE_CODE (exponent
) == INTEGER_CST
);
651 switch (tree_to_shwi (base
))
654 info
->scale_factor_kind
= fixed_point_scale_factor_binary
;
655 info
->scale_factor
.binary
= -tree_to_shwi (exponent
);
659 info
->scale_factor_kind
= fixed_point_scale_factor_decimal
;
660 info
->scale_factor
.decimal
= -tree_to_shwi (exponent
);
668 /* If we reach this point, we are handling an arbitrary scale factor. We
669 expect N / D with constant operands. */
670 gcc_assert (TREE_CODE (num
) == INTEGER_CST
671 && TREE_CODE (den
) == INTEGER_CST
);
673 info
->scale_factor_kind
= fixed_point_scale_factor_arbitrary
;
674 info
->scale_factor
.arbitrary
.numerator
= tree_to_uhwi (num
);
675 info
->scale_factor
.arbitrary
.denominator
= tree_to_shwi (den
);
682 /* Return true if types T1 and T2 are identical for type hashing purposes.
683 Called only after doing all language independent checks. At present,
684 this function is only called when both types are FUNCTION_TYPE. */
687 gnat_type_hash_eq (const_tree t1
, const_tree t2
)
689 gcc_assert (TREE_CODE (t1
) == FUNCTION_TYPE
);
690 return fntype_same_flags_p (t1
, TYPE_CI_CO_LIST (t2
),
691 TYPE_RETURN_UNCONSTRAINED_P (t2
),
692 TYPE_RETURN_BY_DIRECT_REF_P (t2
),
693 TREE_ADDRESSABLE (t2
));
696 /* Do nothing (return the tree node passed). */
699 gnat_return_tree (tree t
)
704 /* Get the alias set corresponding to a type or expression. */
706 static alias_set_type
707 gnat_get_alias_set (tree type
)
709 /* If this is a padding type, use the type of the first field. */
710 if (TYPE_IS_PADDING_P (type
))
711 return get_alias_set (TREE_TYPE (TYPE_FIELDS (type
)));
713 /* If the type is an unconstrained array, use the type of the
714 self-referential array we make. */
715 else if (TREE_CODE (type
) == UNCONSTRAINED_ARRAY_TYPE
)
717 get_alias_set (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (type
)))));
719 /* If the type can alias any other types, return the alias set 0. */
720 else if (TYPE_P (type
)
721 && !TYPE_IS_DUMMY_P (type
)
722 && TYPE_UNIVERSAL_ALIASING_P (type
))
728 /* GNU_TYPE is a type. Return its maximum size in bytes, if known,
729 as a constant when possible. */
732 gnat_type_max_size (const_tree gnu_type
)
734 /* First see what we can get from TYPE_SIZE_UNIT, which might not
735 be constant even for simple expressions if it has already been
736 elaborated and possibly replaced by a VAR_DECL. */
737 tree max_unitsize
= max_size (TYPE_SIZE_UNIT (gnu_type
), true);
739 /* If we don't have a constant, see what we can get from TYPE_ADA_SIZE,
740 which should stay untouched. */
741 if (!tree_fits_uhwi_p (max_unitsize
)
742 && RECORD_OR_UNION_TYPE_P (gnu_type
)
743 && !TYPE_FAT_POINTER_P (gnu_type
)
744 && TYPE_ADA_SIZE (gnu_type
))
746 tree max_adasize
= max_size (TYPE_ADA_SIZE (gnu_type
), true);
748 /* If we have succeeded in finding a constant, round it up to the
749 type's alignment and return the result in units. */
750 if (tree_fits_uhwi_p (max_adasize
))
752 = size_binop (CEIL_DIV_EXPR
,
753 round_up (max_adasize
, TYPE_ALIGN (gnu_type
)),
760 static tree
get_array_bit_stride (tree
);
762 /* Provide information in INFO for debug output about the TYPE array type.
763 Return whether TYPE is handled. */
766 gnat_get_array_descr_info (const_tree const_type
,
767 struct array_descr_info
*info
)
769 bool convention_fortran_p
;
770 bool is_array
= false;
771 bool is_fat_ptr
= false;
772 bool is_packed_array
= false;
773 tree type
= const_cast<tree
> (const_type
);
774 const_tree first_dimen
= NULL_TREE
;
775 const_tree last_dimen
= NULL_TREE
;
779 /* Temporaries created in the first pass and used in the second one for thin
780 pointers. The first one is an expression that yields the template record
781 from the base address (i.e. the PLACEHOLDER_EXPR). The second one is just
782 a cursor through this record's fields. */
783 tree thinptr_template_expr
= NULL_TREE
;
784 tree thinptr_bound_field
= NULL_TREE
;
786 /* ??? See gnat_get_debug_type. */
787 type
= maybe_debug_type (type
);
789 /* If we have an implementation type for a packed array, get the orignial
791 if (TYPE_IMPL_PACKED_ARRAY_P (type
) && TYPE_ORIGINAL_PACKED_ARRAY (type
))
793 type
= TYPE_ORIGINAL_PACKED_ARRAY (type
);
794 is_packed_array
= true;
797 /* First pass: gather all information about this array except everything
798 related to dimensions. */
800 /* Only handle ARRAY_TYPE nodes that come from GNAT. */
801 if (TREE_CODE (type
) == ARRAY_TYPE
802 && TYPE_DOMAIN (type
)
803 && TYPE_INDEX_TYPE (TYPE_DOMAIN (type
)))
807 info
->data_location
= NULL_TREE
;
810 else if (TYPE_IS_FAT_POINTER_P (type
)
811 && gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
813 const tree ua_type
= TYPE_UNCONSTRAINED_ARRAY (type
);
815 /* This will be our base object address. */
816 const tree placeholder_expr
= build0 (PLACEHOLDER_EXPR
, type
);
818 /* We assume below that maybe_unconstrained_array returns an INDIRECT_REF
821 = maybe_unconstrained_array (build_unary_op (INDIRECT_REF
,
826 first_dimen
= TREE_TYPE (ua_val
);
828 /* Get the *address* of the array, not the array itself. */
829 info
->data_location
= TREE_OPERAND (ua_val
, 0);
832 /* Unlike fat pointers (which appear for unconstrained arrays passed in
833 argument), thin pointers are used only for array access types, so we want
834 them to appear in the debug info as pointers to an array type. That's why
835 we match only the RECORD_TYPE here instead of the POINTER_TYPE with the
836 TYPE_IS_THIN_POINTER_P predicate. */
837 else if (TREE_CODE (type
) == RECORD_TYPE
838 && TYPE_CONTAINS_TEMPLATE_P (type
)
839 && gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
841 /* This will be our base object address. Note that we assume that
842 pointers to these will actually point to the array field (thin
843 pointers are shifted). */
844 const tree placeholder_expr
= build0 (PLACEHOLDER_EXPR
, type
);
845 const tree placeholder_addr
846 = build_unary_op (ADDR_EXPR
, NULL_TREE
, placeholder_expr
);
848 const tree bounds_field
= TYPE_FIELDS (type
);
849 const tree bounds_type
= TREE_TYPE (bounds_field
);
850 const tree array_field
= DECL_CHAIN (bounds_field
);
851 const tree array_type
= TREE_TYPE (array_field
);
853 /* Shift the thin pointer address to get the address of the template. */
854 const tree shift_amount
855 = fold_build1 (NEGATE_EXPR
, sizetype
, byte_position (array_field
));
857 = build_binary_op (POINTER_PLUS_EXPR
, TREE_TYPE (placeholder_addr
),
858 placeholder_addr
, shift_amount
);
860 = fold_convert (TYPE_POINTER_TO (bounds_type
), template_addr
);
862 first_dimen
= array_type
;
864 /* The thin pointer is already the pointer to the array data, so there's
865 no need for a specific "data location" expression. */
866 info
->data_location
= NULL_TREE
;
868 thinptr_template_expr
= build_unary_op (INDIRECT_REF
,
871 thinptr_bound_field
= TYPE_FIELDS (bounds_type
);
876 /* Second pass: compute the remaining information: dimensions and
877 corresponding bounds. */
879 if (TYPE_PACKED (first_dimen
))
880 is_packed_array
= true;
881 /* If this array has fortran convention, it's arranged in column-major
882 order, so our view here has reversed dimensions. */
883 convention_fortran_p
= TYPE_CONVENTION_FORTRAN_P (first_dimen
);
884 /* ??? For row major ordering, we probably want to emit nothing and
885 instead specify it as the default in Dw_TAG_compile_unit. */
886 info
->ordering
= (convention_fortran_p
887 ? array_descr_ordering_column_major
888 : array_descr_ordering_row_major
);
890 /* Count how many dimensions this array has. */
891 for (i
= 0, dimen
= first_dimen
; ; ++i
, dimen
= TREE_TYPE (dimen
))
894 && (TREE_CODE (dimen
) != ARRAY_TYPE
895 || !TYPE_MULTI_ARRAY_P (dimen
)))
900 info
->ndimensions
= i
;
902 /* Too many dimensions? Give up generating proper description: yield instead
903 nested arrays. Note that in this case, this hook is invoked once on each
904 intermediate array type: be consistent and output nested arrays for all
906 if (info
->ndimensions
> DWARF2OUT_ARRAY_DESCR_INFO_MAX_DIMEN
907 || TYPE_MULTI_ARRAY_P (first_dimen
))
909 info
->ndimensions
= 1;
910 last_dimen
= first_dimen
;
913 info
->element_type
= TREE_TYPE (last_dimen
);
915 /* Now iterate over all dimensions in source-order and fill the info
917 for (i
= (convention_fortran_p
? info
->ndimensions
- 1 : 0),
919 0 <= i
&& i
< info
->ndimensions
;
920 i
+= (convention_fortran_p
? -1 : 1),
921 dimen
= TREE_TYPE (dimen
))
923 /* We are interested in the stored bounds for the debug info. */
924 tree index_type
= TYPE_INDEX_TYPE (TYPE_DOMAIN (dimen
));
926 if (is_array
|| is_fat_ptr
)
928 /* GDB does not handle very well the self-referencial bound
929 expressions we are able to generate here for XUA types (they are
930 used only by XUP encodings) so avoid them in this case. Note that
931 there are two cases where we generate self-referencial bound
932 expressions: arrays that are constrained by record discriminants
934 if (TYPE_CONTEXT (first_dimen
)
935 && TREE_CODE (TYPE_CONTEXT (first_dimen
)) != RECORD_TYPE
936 && CONTAINS_PLACEHOLDER_P (TYPE_MIN_VALUE (index_type
))
937 && gnat_encodings
!= DWARF_GNAT_ENCODINGS_MINIMAL
)
939 info
->dimen
[i
].lower_bound
= NULL_TREE
;
940 info
->dimen
[i
].upper_bound
= NULL_TREE
;
944 info
->dimen
[i
].lower_bound
945 = maybe_character_value (TYPE_MIN_VALUE (index_type
));
946 info
->dimen
[i
].upper_bound
947 = maybe_character_value (TYPE_MAX_VALUE (index_type
));
951 /* This is a thin pointer. */
954 info
->dimen
[i
].lower_bound
955 = build_component_ref (thinptr_template_expr
, thinptr_bound_field
,
957 thinptr_bound_field
= DECL_CHAIN (thinptr_bound_field
);
959 info
->dimen
[i
].upper_bound
960 = build_component_ref (thinptr_template_expr
, thinptr_bound_field
,
962 thinptr_bound_field
= DECL_CHAIN (thinptr_bound_field
);
965 /* The DWARF back-end will output BOUNDS_TYPE as the base type of
966 the array index, so get to the base type of INDEX_TYPE. */
967 while (TREE_TYPE (index_type
))
968 index_type
= TREE_TYPE (index_type
);
970 info
->dimen
[i
].bounds_type
= maybe_debug_type (index_type
);
971 info
->dimen
[i
].stride
= NULL_TREE
;
974 /* These are Fortran-specific fields. They make no sense here. */
975 info
->allocated
= NULL_TREE
;
976 info
->associated
= NULL_TREE
;
978 if (gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
980 /* When arrays contain dynamically-sized elements, we usually wrap them
981 in padding types, or we create constrained types for them. Then, if
982 such types are stripped in the debugging information output, the
983 debugger needs a way to know the size that is reserved for each
984 element. This is why we emit a stride in such situations. */
985 tree source_element_type
= info
->element_type
;
989 if (TYPE_DEBUG_TYPE (source_element_type
))
990 source_element_type
= TYPE_DEBUG_TYPE (source_element_type
);
991 else if (TYPE_IS_PADDING_P (source_element_type
))
993 = TREE_TYPE (TYPE_FIELDS (source_element_type
));
998 if (TREE_CODE (TYPE_SIZE_UNIT (source_element_type
)) != INTEGER_CST
)
1000 info
->stride
= TYPE_SIZE_UNIT (info
->element_type
);
1001 info
->stride_in_bits
= false;
1004 /* We need to specify a bit stride when it does not correspond to the
1005 natural size of the contained elements. ??? Note that we do not
1006 support packed records and nested packed arrays. */
1007 else if (is_packed_array
)
1009 info
->stride
= get_array_bit_stride (info
->element_type
);
1010 info
->stride_in_bits
= true;
1017 /* Given the component type COMP_TYPE of a packed array, return an expression
1018 that computes the bit stride of this packed array. Return NULL_TREE when
1022 get_array_bit_stride (tree comp_type
)
1024 struct array_descr_info info
;
1027 /* Simple case: the array contains an integral type: return its RM size. */
1028 if (INTEGRAL_TYPE_P (comp_type
))
1029 return TYPE_RM_SIZE (comp_type
);
1031 /* Otherwise, see if this is an array we can analyze; if it's not, punt. */
1032 memset (&info
, 0, sizeof (info
));
1033 if (!gnat_get_array_descr_info (comp_type
, &info
) || !info
.stride
)
1036 /* Otherwise, the array stride is the inner array's stride multiplied by the
1037 number of elements it contains. Note that if the inner array is not
1038 packed, then the stride is "natural" and thus does not deserve an
1040 stride
= info
.stride
;
1041 if (!info
.stride_in_bits
)
1043 stride
= fold_convert (bitsizetype
, stride
);
1044 stride
= build_binary_op (MULT_EXPR
, bitsizetype
,
1045 stride
, build_int_cst (bitsizetype
, 8));
1048 for (int i
= 0; i
< info
.ndimensions
; ++i
)
1052 if (!info
.dimen
[i
].lower_bound
|| !info
.dimen
[i
].upper_bound
)
1055 /* Put in count an expression that computes the length of this
1057 count
= build_binary_op (MINUS_EXPR
, sbitsizetype
,
1058 fold_convert (sbitsizetype
,
1059 info
.dimen
[i
].upper_bound
),
1060 fold_convert (sbitsizetype
,
1061 info
.dimen
[i
].lower_bound
)),
1062 count
= build_binary_op (PLUS_EXPR
, sbitsizetype
,
1063 count
, build_int_cst (sbitsizetype
, 1));
1064 count
= build_binary_op (MAX_EXPR
, sbitsizetype
,
1066 build_int_cst (sbitsizetype
, 0));
1067 count
= fold_convert (bitsizetype
, count
);
1068 stride
= build_binary_op (MULT_EXPR
, bitsizetype
, stride
, count
);
1074 /* GNU_TYPE is a subtype of an integral type. Set LOWVAL to the low bound
1075 and HIGHVAL to the high bound, respectively. */
1078 gnat_get_subrange_bounds (const_tree gnu_type
, tree
*lowval
, tree
*highval
)
1080 *lowval
= TYPE_MIN_VALUE (gnu_type
);
1081 *highval
= TYPE_MAX_VALUE (gnu_type
);
1084 /* Return the bias of GNU_TYPE, if any. */
1087 gnat_get_type_bias (const_tree gnu_type
)
1089 if (TREE_CODE (gnu_type
) == INTEGER_TYPE
1090 && TYPE_BIASED_REPRESENTATION_P (gnu_type
)
1091 && gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
1092 return TYPE_RM_MIN_VALUE (gnu_type
);
1097 /* GNU_TYPE is the type of a subprogram parameter. Determine if it should be
1098 passed by reference by default. */
1101 default_pass_by_ref (tree gnu_type
)
1103 /* We pass aggregates by reference if they are sufficiently large for
1104 their alignment. The ratio is somewhat arbitrary. We also pass by
1105 reference if the target machine would either pass or return by
1106 reference. Strictly speaking, we need only check the return if this
1107 is an In Out parameter, but it's probably best to err on the side of
1108 passing more things by reference. */
1110 if (pass_by_reference (NULL
, TYPE_MODE (gnu_type
), gnu_type
, true))
1113 if (targetm
.calls
.return_in_memory (gnu_type
, NULL_TREE
))
1116 if (AGGREGATE_TYPE_P (gnu_type
)
1117 && (!valid_constant_size_p (TYPE_SIZE_UNIT (gnu_type
))
1118 || 0 < compare_tree_int (TYPE_SIZE_UNIT (gnu_type
),
1119 TYPE_ALIGN (gnu_type
))))
1125 /* GNU_TYPE is the type of a subprogram parameter. Determine if it must be
1126 passed by reference. */
1129 must_pass_by_ref (tree gnu_type
)
1131 /* We pass only unconstrained objects, those required by the language
1132 to be passed by reference, and objects of variable size. The latter
1133 is more efficient, avoids problems with variable size temporaries,
1134 and does not produce compatibility problems with C, since C does
1135 not have such objects. */
1136 return (TREE_CODE (gnu_type
) == UNCONSTRAINED_ARRAY_TYPE
1137 || TYPE_IS_BY_REFERENCE_P (gnu_type
)
1138 || (TYPE_SIZE_UNIT (gnu_type
)
1139 && TREE_CODE (TYPE_SIZE_UNIT (gnu_type
)) != INTEGER_CST
));
1142 /* This function is called by the front-end to enumerate all the supported
1143 modes for the machine, as well as some predefined C types. F is a function
1144 which is called back with the parameters as listed below, first a string,
1145 then seven ints. The name is any arbitrary null-terminated string and has
1146 no particular significance, except for the case of predefined C types, where
1147 it should be the name of the C type. For integer types, only signed types
1148 should be listed, unsigned versions are assumed. The order of types should
1149 be in order of preference, with the smallest/cheapest types first.
1151 In particular, C predefined types should be listed before other types,
1152 binary floating point types before decimal ones, and narrower/cheaper
1153 type versions before more expensive ones. In type selection the first
1154 matching variant will be used.
1156 NAME pointer to first char of type name
1157 DIGS number of decimal digits for floating-point modes, else 0
1158 COMPLEX_P nonzero is this represents a complex mode
1159 COUNT count of number of items, nonzero for vector mode
1160 FLOAT_REP Float_Rep_Kind for FP, otherwise undefined
1161 PRECISION number of bits used to store data
1162 SIZE number of bits occupied by the mode
1163 ALIGN number of bits to which mode is aligned. */
1166 enumerate_modes (void (*f
) (const char *, int, int, int, int, int, int, int))
1168 const tree c_types
[]
1169 = { float_type_node
, double_type_node
, long_double_type_node
};
1170 const char *const c_names
[]
1171 = { "float", "double", "long double" };
1174 /* We are going to compute it below. */
1175 fp_arith_may_widen
= false;
1177 for (iloop
= 0; iloop
< NUM_MACHINE_MODES
; iloop
++)
1179 machine_mode i
= (machine_mode
) iloop
;
1180 machine_mode inner_mode
= i
;
1181 bool float_p
= false;
1182 bool complex_p
= false;
1183 bool vector_p
= false;
1184 bool skip_p
= false;
1186 unsigned int nameloop
;
1187 Float_Rep_Kind float_rep
= IEEE_Binary
; /* Until proven otherwise */
1189 switch (GET_MODE_CLASS (i
))
1196 case MODE_COMPLEX_INT
:
1198 inner_mode
= GET_MODE_INNER (i
);
1200 case MODE_COMPLEX_FLOAT
:
1203 inner_mode
= GET_MODE_INNER (i
);
1205 case MODE_VECTOR_INT
:
1207 inner_mode
= GET_MODE_INNER (i
);
1209 case MODE_VECTOR_FLOAT
:
1212 inner_mode
= GET_MODE_INNER (i
);
1220 const struct real_format
*fmt
= REAL_MODE_FORMAT (inner_mode
);
1222 /* ??? Cope with the ghost XFmode of the ARM port. */
1226 /* Be conservative and consider that floating-point arithmetics may
1227 use wider intermediate results as soon as there is an extended
1228 Motorola or Intel mode supported by the machine. */
1229 if (fmt
== &ieee_extended_motorola_format
1230 || fmt
== &ieee_extended_intel_96_format
1231 || fmt
== &ieee_extended_intel_96_round_53_format
1232 || fmt
== &ieee_extended_intel_128_format
)
1234 #ifdef TARGET_FPMATH_DEFAULT
1235 if (TARGET_FPMATH_DEFAULT
== FPMATH_387
)
1237 fp_arith_may_widen
= true;
1241 digs
= (fmt
->p
- 1) * 1233 / 4096; /* scale by log (2) */
1243 else if (fmt
->b
== 10)
1250 /* First register any C types for this mode that the front end
1251 may need to know about, unless the mode should be skipped. */
1252 if (!skip_p
&& !vector_p
)
1253 for (nameloop
= 0; nameloop
< ARRAY_SIZE (c_types
); nameloop
++)
1255 tree type
= c_types
[nameloop
];
1256 const char *name
= c_names
[nameloop
];
1258 if (TYPE_MODE (type
) == i
)
1260 f (name
, digs
, complex_p
, 0, float_rep
, TYPE_PRECISION (type
),
1261 TREE_INT_CST_LOW (TYPE_SIZE (type
)), TYPE_ALIGN (type
));
1266 /* If no predefined C types were found, register the mode itself. */
1268 f (GET_MODE_NAME (i
), digs
, complex_p
,
1269 vector_p
? GET_MODE_NUNITS (i
) : 0, float_rep
,
1270 GET_MODE_PRECISION (i
), GET_MODE_BITSIZE (i
),
1271 GET_MODE_ALIGNMENT (i
));
1275 /* Return the size of the FP mode with precision PREC. */
1278 fp_prec_to_size (int prec
)
1282 for (mode
= GET_CLASS_NARROWEST_MODE (MODE_FLOAT
); mode
!= VOIDmode
;
1283 mode
= GET_MODE_WIDER_MODE (mode
))
1284 if (GET_MODE_PRECISION (mode
) == prec
)
1285 return GET_MODE_BITSIZE (mode
);
1290 /* Return the precision of the FP mode with size SIZE. */
1293 fp_size_to_prec (int size
)
1297 for (mode
= GET_CLASS_NARROWEST_MODE (MODE_FLOAT
); mode
!= VOIDmode
;
1298 mode
= GET_MODE_WIDER_MODE (mode
))
1299 if (GET_MODE_BITSIZE (mode
) == size
)
1300 return GET_MODE_PRECISION (mode
);
1305 static GTY(()) tree gnat_eh_personality_decl
;
1307 /* Return the GNAT personality function decl. */
1310 gnat_eh_personality (void)
1312 if (!gnat_eh_personality_decl
)
1313 gnat_eh_personality_decl
= build_personality_function ("gnat");
1314 return gnat_eh_personality_decl
;
1317 /* Initialize language-specific bits of tree_contains_struct. */
1322 MARK_TS_COMMON (UNCONSTRAINED_ARRAY_TYPE
);
1324 MARK_TS_TYPED (UNCONSTRAINED_ARRAY_REF
);
1325 MARK_TS_TYPED (NULL_EXPR
);
1326 MARK_TS_TYPED (PLUS_NOMOD_EXPR
);
1327 MARK_TS_TYPED (MINUS_NOMOD_EXPR
);
1328 MARK_TS_TYPED (POWER_EXPR
);
1329 MARK_TS_TYPED (ATTR_ADDR_EXPR
);
1330 MARK_TS_TYPED (STMT_STMT
);
1331 MARK_TS_TYPED (LOOP_STMT
);
1332 MARK_TS_TYPED (EXIT_STMT
);
1335 /* Return the lang specific structure attached to NODE. Allocate it (cleared)
1339 get_lang_specific (tree node
)
1341 if (!TYPE_LANG_SPECIFIC (node
))
1342 TYPE_LANG_SPECIFIC (node
) = ggc_cleared_alloc
<struct lang_type
> ();
1343 return TYPE_LANG_SPECIFIC (node
);
1346 /* Definitions for our language-specific hooks. */
1348 #undef LANG_HOOKS_NAME
1349 #define LANG_HOOKS_NAME "GNU Ada"
1350 #undef LANG_HOOKS_IDENTIFIER_SIZE
1351 #define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct tree_identifier)
1352 #undef LANG_HOOKS_INIT
1353 #define LANG_HOOKS_INIT gnat_init
1354 #undef LANG_HOOKS_OPTION_LANG_MASK
1355 #define LANG_HOOKS_OPTION_LANG_MASK gnat_option_lang_mask
1356 #undef LANG_HOOKS_INIT_OPTIONS_STRUCT
1357 #define LANG_HOOKS_INIT_OPTIONS_STRUCT gnat_init_options_struct
1358 #undef LANG_HOOKS_INIT_OPTIONS
1359 #define LANG_HOOKS_INIT_OPTIONS gnat_init_options
1360 #undef LANG_HOOKS_HANDLE_OPTION
1361 #define LANG_HOOKS_HANDLE_OPTION gnat_handle_option
1362 #undef LANG_HOOKS_POST_OPTIONS
1363 #define LANG_HOOKS_POST_OPTIONS gnat_post_options
1364 #undef LANG_HOOKS_PARSE_FILE
1365 #define LANG_HOOKS_PARSE_FILE gnat_parse_file
1366 #undef LANG_HOOKS_TYPE_HASH_EQ
1367 #define LANG_HOOKS_TYPE_HASH_EQ gnat_type_hash_eq
1368 #undef LANG_HOOKS_GETDECLS
1369 #define LANG_HOOKS_GETDECLS hook_tree_void_null
1370 #undef LANG_HOOKS_PUSHDECL
1371 #define LANG_HOOKS_PUSHDECL gnat_return_tree
1372 #undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
1373 #define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL hook_bool_const_tree_false
1374 #undef LANG_HOOKS_GET_ALIAS_SET
1375 #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set
1376 #undef LANG_HOOKS_PRINT_DECL
1377 #define LANG_HOOKS_PRINT_DECL gnat_print_decl
1378 #undef LANG_HOOKS_PRINT_TYPE
1379 #define LANG_HOOKS_PRINT_TYPE gnat_print_type
1380 #undef LANG_HOOKS_TYPE_MAX_SIZE
1381 #define LANG_HOOKS_TYPE_MAX_SIZE gnat_type_max_size
1382 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
1383 #define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name
1384 #undef LANG_HOOKS_DWARF_NAME
1385 #define LANG_HOOKS_DWARF_NAME gnat_dwarf_name
1386 #undef LANG_HOOKS_GIMPLIFY_EXPR
1387 #define LANG_HOOKS_GIMPLIFY_EXPR gnat_gimplify_expr
1388 #undef LANG_HOOKS_TYPE_FOR_MODE
1389 #define LANG_HOOKS_TYPE_FOR_MODE gnat_type_for_mode
1390 #undef LANG_HOOKS_TYPE_FOR_SIZE
1391 #define LANG_HOOKS_TYPE_FOR_SIZE gnat_type_for_size
1392 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
1393 #define LANG_HOOKS_TYPES_COMPATIBLE_P gnat_types_compatible_p
1394 #undef LANG_HOOKS_GET_ARRAY_DESCR_INFO
1395 #define LANG_HOOKS_GET_ARRAY_DESCR_INFO gnat_get_array_descr_info
1396 #undef LANG_HOOKS_GET_SUBRANGE_BOUNDS
1397 #define LANG_HOOKS_GET_SUBRANGE_BOUNDS gnat_get_subrange_bounds
1398 #undef LANG_HOOKS_GET_TYPE_BIAS
1399 #define LANG_HOOKS_GET_TYPE_BIAS gnat_get_type_bias
1400 #undef LANG_HOOKS_DESCRIPTIVE_TYPE
1401 #define LANG_HOOKS_DESCRIPTIVE_TYPE gnat_descriptive_type
1402 #undef LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE
1403 #define LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE gnat_enum_underlying_base_type
1404 #undef LANG_HOOKS_GET_DEBUG_TYPE
1405 #define LANG_HOOKS_GET_DEBUG_TYPE gnat_get_debug_type
1406 #undef LANG_HOOKS_GET_FIXED_POINT_TYPE_INFO
1407 #define LANG_HOOKS_GET_FIXED_POINT_TYPE_INFO gnat_get_fixed_point_type_info
1408 #undef LANG_HOOKS_ATTRIBUTE_TABLE
1409 #define LANG_HOOKS_ATTRIBUTE_TABLE gnat_internal_attribute_table
1410 #undef LANG_HOOKS_BUILTIN_FUNCTION
1411 #define LANG_HOOKS_BUILTIN_FUNCTION gnat_builtin_function
1412 #undef LANG_HOOKS_INIT_TS
1413 #define LANG_HOOKS_INIT_TS gnat_init_ts
1414 #undef LANG_HOOKS_EH_PERSONALITY
1415 #define LANG_HOOKS_EH_PERSONALITY gnat_eh_personality
1416 #undef LANG_HOOKS_DEEP_UNSHARING
1417 #define LANG_HOOKS_DEEP_UNSHARING true
1418 #undef LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS
1419 #define LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS true
1421 struct lang_hooks lang_hooks
= LANG_HOOKS_INITIALIZER
;
1423 #include "gt-ada-misc.h"