1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
7 * C Implementation File *
9 * Copyright (C) 1992-2019, 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_short_enums
83 #undef flag_stack_check
84 enum stack_check_type flag_stack_check
= NO_STACK_CHECK
;
90 /* Declare functions we use as part of startup. */
91 extern void __gnat_initialize (void *);
92 extern void __gnat_install_SEH_handler (void *);
93 extern void adainit (void);
94 extern void _ada_gnat1drv (void);
100 /* The parser for the language. For us, we process the GNAT tree. */
103 gnat_parse_file (void)
107 /* Call the target specific initializations. */
108 __gnat_initialize (NULL
);
110 /* ??? Call the SEH initialization routine. This is to workaround
111 a bootstrap path problem. The call below should be removed at some
112 point and the SEH pointer passed to __gnat_initialize above. */
113 __gnat_install_SEH_handler ((void *)seh
);
115 /* Call the front-end elaboration procedures. */
118 /* Call the front end. */
121 /* Write the global declarations. */
122 gnat_write_global_declarations ();
125 /* Return language mask for option processing. */
128 gnat_option_lang_mask (void)
133 /* Decode all the language specific options that cannot be decoded by GCC.
134 The option decoding phase of GCC calls this routine on the flags that
135 are marked as Ada-specific. Return true on success or false on failure. */
138 gnat_handle_option (size_t scode
, const char *arg
, HOST_WIDE_INT value
,
139 int kind
, location_t loc
,
140 const struct cl_option_handlers
*handlers
)
142 enum opt_code code
= (enum opt_code
) scode
;
147 handle_generated_option (&global_options
, &global_options_set
,
148 OPT_Wunused
, NULL
, value
,
149 gnat_option_lang_mask (), kind
, loc
,
150 handlers
, true, global_dc
);
151 warn_uninitialized
= value
;
152 warn_maybe_uninitialized
= value
;
156 warning (0, "%<-gnat%> misspelled as %<-gant%>");
158 /* ... fall through ... */
166 /* These are handled by the front-end. */
170 case OPT_fshort_enums
:
171 case OPT_fsigned_char
:
172 case OPT_funsigned_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 return type warnings for Ada. */
266 warn_return_type
= 0;
268 /* No string overflow warnings for Ada. */
269 warn_stringop_overflow
= 0;
271 /* No caret by default for Ada. */
272 if (!global_options_set
.x_flag_diagnostics_show_caret
)
273 global_dc
->show_caret
= false;
275 /* Warn only if STABS is not the default: we don't want to emit a warning if
276 the user did not use a -gstabs option. */
277 if (PREFERRED_DEBUGGING_TYPE
!= DBX_DEBUG
&& write_symbols
== DBX_DEBUG
)
278 warning (0, "STABS debugging information for Ada is obsolete and not "
279 "supported anymore");
281 /* Copy global settings to local versions. */
282 gnat_encodings
= global_options
.x_gnat_encodings
;
283 optimize
= global_options
.x_optimize
;
284 optimize_size
= global_options
.x_optimize_size
;
285 flag_stack_check
= global_options
.x_flag_stack_check
;
286 flag_short_enums
= global_options
.x_flag_short_enums
;
288 /* Unfortunately the post_options hook is called before the value of
289 flag_short_enums is autodetected, if need be. Mimic the process
290 for our private flag_short_enums. */
291 if (flag_short_enums
== 2)
292 flag_short_enums
= targetm
.default_short_enums ();
297 /* Here is the function to handle the compiler error processing in GCC. */
300 internal_error_function (diagnostic_context
*context
, const char *msgid
,
304 char *buffer
, *p
, *loc
;
305 String_Template temp
, temp_loc
;
306 String_Pointer sp
, sp_loc
;
307 expanded_location xloc
;
309 /* Warn if plugins present. */
312 /* Reset the pretty-printer. */
313 pp_clear_output_area (context
->printer
);
315 /* Format the message into the pretty-printer. */
316 tinfo
.format_spec
= msgid
;
318 tinfo
.err_no
= errno
;
319 pp_format_verbatim (context
->printer
, &tinfo
);
321 /* Extract a (writable) pointer to the formatted text. */
322 buffer
= xstrdup (pp_formatted_text (context
->printer
));
324 /* Go up to the first newline. */
325 for (p
= buffer
; *p
; p
++)
333 temp
.High_Bound
= p
- buffer
;
337 xloc
= expand_location (input_location
);
338 if (context
->show_column
&& xloc
.column
!= 0)
339 loc
= xasprintf ("%s:%d:%d", xloc
.file
, xloc
.line
, xloc
.column
);
341 loc
= xasprintf ("%s:%d", xloc
.file
, xloc
.line
);
342 temp_loc
.Low_Bound
= 1;
343 temp_loc
.High_Bound
= strlen (loc
);
344 sp_loc
.Bounds
= &temp_loc
;
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 activates the support for exceptions in the compiler.
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,
407 Turn off -faggressive-loop-optimizations because it may optimize away
408 out-of-bound array accesses that we want to be able to catch.
409 If checks are disabled, we use the same settings as the C++ compiler,
410 except for the runtime on platforms where S'Machine_Overflow is true
411 because the runtime depends on FP (hardware) checks being properly
412 handled despite being compiled in -gnatp mode. */
414 flag_delete_dead_exceptions
= 1;
417 if (!global_options_set
.x_flag_non_call_exceptions
)
418 flag_non_call_exceptions
= Machine_Overflows_On_Target
&& GNAT_Mode
;
422 flag_non_call_exceptions
= 1;
423 flag_aggressive_loop_optimizations
= 0;
424 warn_aggressive_loop_optimizations
= 0;
430 /* Initialize the GCC support for floating-point operations. */
433 gnat_init_gcc_fp (void)
435 /* Disable FP optimizations that ignore the signedness of zero if
436 S'Signed_Zeros is true, but don't override the user if not. */
437 if (Signed_Zeros_On_Target
)
438 flag_signed_zeros
= 1;
439 else if (!global_options_set
.x_flag_signed_zeros
)
440 flag_signed_zeros
= 0;
442 /* Assume that FP operations can trap if S'Machine_Overflow is true,
443 but don't override the user if not. */
444 if (Machine_Overflows_On_Target
)
445 flag_trapping_math
= 1;
446 else if (!global_options_set
.x_flag_trapping_math
)
447 flag_trapping_math
= 0;
450 /* Print language-specific items in declaration NODE. */
453 gnat_print_decl (FILE *file
, tree node
, int indent
)
455 switch (TREE_CODE (node
))
458 print_node (file
, "corresponding var",
459 DECL_CONST_CORRESPONDING_VAR (node
), indent
+ 4);
463 print_node (file
, "original field", DECL_ORIGINAL_FIELD (node
),
468 if (DECL_LOOP_PARM_P (node
))
469 print_node (file
, "induction var", DECL_INDUCTION_VAR (node
),
472 print_node (file
, "renamed object", DECL_RENAMED_OBJECT (node
),
481 /* Print language-specific items in type NODE. */
484 gnat_print_type (FILE *file
, tree node
, int indent
)
486 switch (TREE_CODE (node
))
490 print_node (file
, "ci/co list", TYPE_CI_CO_LIST (node
), indent
+ 4);
494 if (TYPE_MODULAR_P (node
))
495 print_node_brief (file
, "modulus", TYPE_MODULUS (node
), indent
+ 4);
496 else if (TYPE_FIXED_POINT_P (node
))
497 print_node (file
, "scale factor", TYPE_SCALE_FACTOR (node
),
499 else if (TYPE_HAS_ACTUAL_BOUNDS_P (node
))
500 print_node (file
, "actual bounds", TYPE_ACTUAL_BOUNDS (node
),
503 print_node (file
, "index type", TYPE_INDEX_TYPE (node
), indent
+ 4);
505 /* ... fall through ... */
509 print_node_brief (file
, "RM size", TYPE_RM_SIZE (node
), indent
+ 4);
511 /* ... fall through ... */
514 print_node_brief (file
, "RM min", TYPE_RM_MIN_VALUE (node
), indent
+ 4);
515 print_node_brief (file
, "RM max", TYPE_RM_MAX_VALUE (node
), indent
+ 4);
519 print_node (file
,"actual bounds", TYPE_ACTUAL_BOUNDS (node
), indent
+ 4);
523 print_node (file
,"representative array",
524 TYPE_REPRESENTATIVE_ARRAY (node
), indent
+ 4);
528 if (TYPE_FAT_POINTER_P (node
) || TYPE_CONTAINS_TEMPLATE_P (node
))
529 print_node (file
, "unconstrained array",
530 TYPE_UNCONSTRAINED_ARRAY (node
), indent
+ 4);
532 print_node (file
, "Ada size", TYPE_ADA_SIZE (node
), indent
+ 4);
536 case QUAL_UNION_TYPE
:
537 print_node (file
, "Ada size", TYPE_ADA_SIZE (node
), indent
+ 4);
544 if (TYPE_CAN_HAVE_DEBUG_TYPE_P (node
) && TYPE_DEBUG_TYPE (node
))
545 print_node_brief (file
, "debug type", TYPE_DEBUG_TYPE (node
), indent
+ 4);
547 if (TYPE_IMPL_PACKED_ARRAY_P (node
) && TYPE_ORIGINAL_PACKED_ARRAY (node
))
548 print_node_brief (file
, "original packed array",
549 TYPE_ORIGINAL_PACKED_ARRAY (node
), indent
+ 4);
552 /* Return the name to be printed for DECL. */
555 gnat_printable_name (tree decl
, int verbosity
)
557 const char *coded_name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
558 char *ada_name
= (char *) ggc_alloc_atomic (strlen (coded_name
) * 2 + 60);
560 __gnat_decode (coded_name
, ada_name
, 0);
562 if (verbosity
== 2 && !DECL_IS_BUILTIN (decl
))
564 Set_Identifier_Casing (ada_name
, DECL_SOURCE_FILE (decl
));
565 return ggc_strdup (Name_Buffer
);
571 /* Return the name to be used in DWARF debug info for DECL. */
574 gnat_dwarf_name (tree decl
, int verbosity ATTRIBUTE_UNUSED
)
576 gcc_assert (DECL_P (decl
));
577 return (const char *) IDENTIFIER_POINTER (DECL_NAME (decl
));
580 /* Return the descriptive type associated with TYPE, if any. */
583 gnat_descriptive_type (const_tree type
)
585 if (TYPE_STUB_DECL (type
))
586 return DECL_PARALLEL_TYPE (TYPE_STUB_DECL (type
));
591 /* Return the underlying base type of an enumeration type. */
594 gnat_enum_underlying_base_type (const_tree
)
596 /* Enumeration types are base types in Ada. */
597 return void_type_node
;
600 /* Return the type to be used for debugging information instead of TYPE or
601 NULL_TREE if TYPE is fine. */
604 gnat_get_debug_type (const_tree type
)
606 if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type
) && TYPE_DEBUG_TYPE (type
))
608 type
= TYPE_DEBUG_TYPE (type
);
610 /* ??? The get_debug_type language hook is processed after the array
611 descriptor language hook, so if there is an array behind this type,
612 the latter is supposed to handle it. Still, we can get here with
613 a type we are not supposed to handle (e.g. when the DWARF back-end
614 processes the type of a variable), so keep this guard. */
615 if (type
&& TYPE_CAN_HAVE_DEBUG_TYPE_P (type
))
616 return const_cast<tree
> (type
);
622 /* Provide information in INFO for debugging output about the TYPE fixed-point
623 type. Return whether TYPE is handled. */
626 gnat_get_fixed_point_type_info (const_tree type
,
627 struct fixed_point_type_info
*info
)
631 /* GDB cannot handle fixed-point types yet, so rely on GNAT encodings
633 if (!TYPE_IS_FIXED_POINT_P (type
)
634 || gnat_encodings
!= DWARF_GNAT_ENCODINGS_MINIMAL
)
637 scale_factor
= TYPE_SCALE_FACTOR (type
);
639 /* We expect here only a finite set of pattern. See fixed-point types
640 handling in gnat_to_gnu_entity. */
642 /* Put invalid values when compiler internals cannot represent the scale
644 if (scale_factor
== integer_zero_node
)
646 info
->scale_factor_kind
= fixed_point_scale_factor_arbitrary
;
647 info
->scale_factor
.arbitrary
.numerator
= 0;
648 info
->scale_factor
.arbitrary
.denominator
= 0;
652 if (TREE_CODE (scale_factor
) == RDIV_EXPR
)
654 const tree num
= TREE_OPERAND (scale_factor
, 0);
655 const tree den
= TREE_OPERAND (scale_factor
, 1);
657 /* See if we have a binary or decimal scale. */
658 if (TREE_CODE (den
) == POWER_EXPR
)
660 const tree base
= TREE_OPERAND (den
, 0);
661 const tree exponent
= TREE_OPERAND (den
, 1);
663 /* We expect the scale factor to be 1 / 2 ** N or 1 / 10 ** N. */
664 gcc_assert (num
== integer_one_node
665 && TREE_CODE (base
) == INTEGER_CST
666 && TREE_CODE (exponent
) == INTEGER_CST
);
668 switch (tree_to_shwi (base
))
671 info
->scale_factor_kind
= fixed_point_scale_factor_binary
;
672 info
->scale_factor
.binary
= -tree_to_shwi (exponent
);
676 info
->scale_factor_kind
= fixed_point_scale_factor_decimal
;
677 info
->scale_factor
.decimal
= -tree_to_shwi (exponent
);
685 /* If we reach this point, we are handling an arbitrary scale factor. We
686 expect N / D with constant operands. */
687 gcc_assert (TREE_CODE (num
) == INTEGER_CST
688 && TREE_CODE (den
) == INTEGER_CST
);
690 info
->scale_factor_kind
= fixed_point_scale_factor_arbitrary
;
691 info
->scale_factor
.arbitrary
.numerator
= tree_to_uhwi (num
);
692 info
->scale_factor
.arbitrary
.denominator
= tree_to_shwi (den
);
699 /* Return true if types T1 and T2 are identical for type hashing purposes.
700 Called only after doing all language independent checks. At present,
701 this is only called when both types are FUNCTION_TYPE or METHOD_TYPE. */
704 gnat_type_hash_eq (const_tree t1
, const_tree t2
)
706 gcc_assert (FUNC_OR_METHOD_TYPE_P (t1
) && TREE_CODE (t1
) == TREE_CODE (t2
));
707 return fntype_same_flags_p (t1
, TYPE_CI_CO_LIST (t2
),
708 TYPE_RETURN_UNCONSTRAINED_P (t2
),
709 TYPE_RETURN_BY_DIRECT_REF_P (t2
),
710 TREE_ADDRESSABLE (t2
));
713 /* Do nothing (return the tree node passed). */
716 gnat_return_tree (tree t
)
721 /* Get the alias set corresponding to a type or expression. */
723 static alias_set_type
724 gnat_get_alias_set (tree type
)
726 /* If this is a padding type, use the type of the first field. */
727 if (TYPE_IS_PADDING_P (type
))
728 return get_alias_set (TREE_TYPE (TYPE_FIELDS (type
)));
730 /* If this is an extra subtype, use the base type. */
731 else if (TYPE_IS_EXTRA_SUBTYPE_P (type
))
732 return get_alias_set (get_base_type (type
));
734 /* If the type is an unconstrained array, use the type of the
735 self-referential array we make. */
736 else if (TREE_CODE (type
) == UNCONSTRAINED_ARRAY_TYPE
)
738 get_alias_set (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (type
)))));
740 /* If the type can alias any other types, return the alias set 0. */
741 else if (TYPE_P (type
)
742 && !TYPE_IS_DUMMY_P (type
)
743 && TYPE_UNIVERSAL_ALIASING_P (type
))
749 /* GNU_TYPE is a type. Return its maximum size in bytes, if known,
750 as a constant when possible. */
753 gnat_type_max_size (const_tree gnu_type
)
755 /* First see what we can get from TYPE_SIZE_UNIT, which might not
756 be constant even for simple expressions if it has already been
757 elaborated and possibly replaced by a VAR_DECL. */
758 tree max_size_unit
= max_size (TYPE_SIZE_UNIT (gnu_type
), true);
760 /* If we don't have a constant, see what we can get from TYPE_ADA_SIZE,
761 which should stay untouched. */
762 if (!tree_fits_uhwi_p (max_size_unit
)
763 && RECORD_OR_UNION_TYPE_P (gnu_type
)
764 && !TYPE_FAT_POINTER_P (gnu_type
)
765 && TYPE_ADA_SIZE (gnu_type
))
767 tree max_ada_size
= max_size (TYPE_ADA_SIZE (gnu_type
), true);
769 /* If we have succeeded in finding a constant, round it up to the
770 type's alignment and return the result in units. */
771 if (tree_fits_uhwi_p (max_ada_size
))
773 = size_binop (CEIL_DIV_EXPR
,
774 round_up (max_ada_size
, TYPE_ALIGN (gnu_type
)),
778 return max_size_unit
;
781 static tree
get_array_bit_stride (tree
);
783 /* Provide information in INFO for debug output about the TYPE array type.
784 Return whether TYPE is handled. */
787 gnat_get_array_descr_info (const_tree const_type
,
788 struct array_descr_info
*info
)
790 bool convention_fortran_p
;
791 bool is_array
= false;
792 bool is_fat_ptr
= false;
793 bool is_packed_array
= false;
794 tree type
= const_cast<tree
> (const_type
);
795 const_tree first_dimen
= NULL_TREE
;
796 const_tree last_dimen
= NULL_TREE
;
800 /* Temporaries created in the first pass and used in the second one for thin
801 pointers. The first one is an expression that yields the template record
802 from the base address (i.e. the PLACEHOLDER_EXPR). The second one is just
803 a cursor through this record's fields. */
804 tree thinptr_template_expr
= NULL_TREE
;
805 tree thinptr_bound_field
= NULL_TREE
;
807 /* ??? See gnat_get_debug_type. */
808 type
= maybe_debug_type (type
);
810 /* If we have an implementation type for a packed array, get the orignial
812 if (TYPE_IMPL_PACKED_ARRAY_P (type
) && TYPE_ORIGINAL_PACKED_ARRAY (type
))
814 type
= TYPE_ORIGINAL_PACKED_ARRAY (type
);
815 is_packed_array
= true;
818 /* First pass: gather all information about this array except everything
819 related to dimensions. */
821 /* Only handle ARRAY_TYPE nodes that come from GNAT. */
822 if (TREE_CODE (type
) == ARRAY_TYPE
823 && TYPE_DOMAIN (type
)
824 && TYPE_INDEX_TYPE (TYPE_DOMAIN (type
)))
828 info
->data_location
= NULL_TREE
;
831 else if (TYPE_IS_FAT_POINTER_P (type
)
832 && gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
834 const tree ua_type
= TYPE_UNCONSTRAINED_ARRAY (type
);
836 /* This will be our base object address. */
837 const tree placeholder_expr
= build0 (PLACEHOLDER_EXPR
, type
);
839 /* We assume below that maybe_unconstrained_array returns an INDIRECT_REF
842 = maybe_unconstrained_array (build_unary_op (INDIRECT_REF
,
847 first_dimen
= TREE_TYPE (ua_val
);
849 /* Get the *address* of the array, not the array itself. */
850 info
->data_location
= TREE_OPERAND (ua_val
, 0);
853 /* Unlike fat pointers (which appear for unconstrained arrays passed in
854 argument), thin pointers are used only for array access types, so we want
855 them to appear in the debug info as pointers to an array type. That's why
856 we match only the RECORD_TYPE here instead of the POINTER_TYPE with the
857 TYPE_IS_THIN_POINTER_P predicate. */
858 else if (TREE_CODE (type
) == RECORD_TYPE
859 && TYPE_CONTAINS_TEMPLATE_P (type
)
860 && gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
862 /* This will be our base object address. Note that we assume that
863 pointers to these will actually point to the array field (thin
864 pointers are shifted). */
865 const tree placeholder_expr
= build0 (PLACEHOLDER_EXPR
, type
);
866 const tree placeholder_addr
867 = build_unary_op (ADDR_EXPR
, NULL_TREE
, placeholder_expr
);
869 const tree bounds_field
= TYPE_FIELDS (type
);
870 const tree bounds_type
= TREE_TYPE (bounds_field
);
871 const tree array_field
= DECL_CHAIN (bounds_field
);
872 const tree array_type
= TREE_TYPE (array_field
);
874 /* Shift the thin pointer address to get the address of the template. */
875 const tree shift_amount
876 = fold_build1 (NEGATE_EXPR
, sizetype
, byte_position (array_field
));
878 = build_binary_op (POINTER_PLUS_EXPR
, TREE_TYPE (placeholder_addr
),
879 placeholder_addr
, shift_amount
);
881 = fold_convert (TYPE_POINTER_TO (bounds_type
), template_addr
);
883 first_dimen
= array_type
;
885 /* The thin pointer is already the pointer to the array data, so there's
886 no need for a specific "data location" expression. */
887 info
->data_location
= NULL_TREE
;
889 thinptr_template_expr
= build_unary_op (INDIRECT_REF
,
892 thinptr_bound_field
= TYPE_FIELDS (bounds_type
);
897 /* Second pass: compute the remaining information: dimensions and
898 corresponding bounds. */
900 if (TYPE_PACKED (first_dimen
))
901 is_packed_array
= true;
902 /* If this array has fortran convention, it's arranged in column-major
903 order, so our view here has reversed dimensions. */
904 convention_fortran_p
= TYPE_CONVENTION_FORTRAN_P (first_dimen
);
905 /* ??? For row major ordering, we probably want to emit nothing and
906 instead specify it as the default in Dw_TAG_compile_unit. */
907 info
->ordering
= (convention_fortran_p
908 ? array_descr_ordering_column_major
909 : array_descr_ordering_row_major
);
911 /* Count how many dimensions this array has. */
912 for (i
= 0, dimen
= first_dimen
; ; ++i
, dimen
= TREE_TYPE (dimen
))
915 && (TREE_CODE (dimen
) != ARRAY_TYPE
916 || !TYPE_MULTI_ARRAY_P (dimen
)))
921 info
->ndimensions
= i
;
922 info
->rank
= NULL_TREE
;
924 /* Too many dimensions? Give up generating proper description: yield instead
925 nested arrays. Note that in this case, this hook is invoked once on each
926 intermediate array type: be consistent and output nested arrays for all
928 if (info
->ndimensions
> DWARF2OUT_ARRAY_DESCR_INFO_MAX_DIMEN
929 || TYPE_MULTI_ARRAY_P (first_dimen
))
931 info
->ndimensions
= 1;
932 last_dimen
= first_dimen
;
935 info
->element_type
= TREE_TYPE (last_dimen
);
937 /* Now iterate over all dimensions in source-order and fill the info
939 for (i
= (convention_fortran_p
? info
->ndimensions
- 1 : 0),
941 IN_RANGE (i
, 0, info
->ndimensions
- 1);
942 i
+= (convention_fortran_p
? -1 : 1),
943 dimen
= TREE_TYPE (dimen
))
945 /* We are interested in the stored bounds for the debug info. */
946 tree index_type
= TYPE_INDEX_TYPE (TYPE_DOMAIN (dimen
));
948 if (is_array
|| is_fat_ptr
)
950 /* GDB does not handle very well the self-referencial bound
951 expressions we are able to generate here for XUA types (they are
952 used only by XUP encodings) so avoid them in this case. Note that
953 there are two cases where we generate self-referencial bound
954 expressions: arrays that are constrained by record discriminants
956 if (TYPE_CONTEXT (first_dimen
)
957 && TREE_CODE (TYPE_CONTEXT (first_dimen
)) != RECORD_TYPE
958 && CONTAINS_PLACEHOLDER_P (TYPE_MIN_VALUE (index_type
))
959 && gnat_encodings
!= DWARF_GNAT_ENCODINGS_MINIMAL
)
961 info
->dimen
[i
].lower_bound
= NULL_TREE
;
962 info
->dimen
[i
].upper_bound
= NULL_TREE
;
966 info
->dimen
[i
].lower_bound
967 = maybe_character_value (TYPE_MIN_VALUE (index_type
));
968 info
->dimen
[i
].upper_bound
969 = maybe_character_value (TYPE_MAX_VALUE (index_type
));
973 /* This is a thin pointer. */
976 info
->dimen
[i
].lower_bound
977 = build_component_ref (thinptr_template_expr
, thinptr_bound_field
,
979 thinptr_bound_field
= DECL_CHAIN (thinptr_bound_field
);
981 info
->dimen
[i
].upper_bound
982 = build_component_ref (thinptr_template_expr
, thinptr_bound_field
,
984 thinptr_bound_field
= DECL_CHAIN (thinptr_bound_field
);
987 /* The DWARF back-end will output BOUNDS_TYPE as the base type of
988 the array index, so get to the base type of INDEX_TYPE. */
989 while (TREE_TYPE (index_type
))
990 index_type
= TREE_TYPE (index_type
);
992 info
->dimen
[i
].bounds_type
= maybe_debug_type (index_type
);
993 info
->dimen
[i
].stride
= NULL_TREE
;
996 /* These are Fortran-specific fields. They make no sense here. */
997 info
->allocated
= NULL_TREE
;
998 info
->associated
= NULL_TREE
;
1000 if (gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
1002 /* When arrays contain dynamically-sized elements, we usually wrap them
1003 in padding types, or we create constrained types for them. Then, if
1004 such types are stripped in the debugging information output, the
1005 debugger needs a way to know the size that is reserved for each
1006 element. This is why we emit a stride in such situations. */
1007 tree source_element_type
= info
->element_type
;
1011 if (TYPE_DEBUG_TYPE (source_element_type
))
1012 source_element_type
= TYPE_DEBUG_TYPE (source_element_type
);
1013 else if (TYPE_IS_PADDING_P (source_element_type
))
1015 = TREE_TYPE (TYPE_FIELDS (source_element_type
));
1020 if (TREE_CODE (TYPE_SIZE_UNIT (source_element_type
)) != INTEGER_CST
)
1022 info
->stride
= TYPE_SIZE_UNIT (info
->element_type
);
1023 info
->stride_in_bits
= false;
1026 /* We need to specify a bit stride when it does not correspond to the
1027 natural size of the contained elements. ??? Note that we do not
1028 support packed records and nested packed arrays. */
1029 else if (is_packed_array
)
1031 info
->stride
= get_array_bit_stride (info
->element_type
);
1032 info
->stride_in_bits
= true;
1039 /* Given the component type COMP_TYPE of a packed array, return an expression
1040 that computes the bit stride of this packed array. Return NULL_TREE when
1044 get_array_bit_stride (tree comp_type
)
1046 struct array_descr_info info
;
1049 /* Simple case: the array contains an integral type: return its RM size. */
1050 if (INTEGRAL_TYPE_P (comp_type
))
1051 return TYPE_RM_SIZE (comp_type
);
1053 /* Otherwise, see if this is an array we can analyze; if it's not, punt. */
1054 memset (&info
, 0, sizeof (info
));
1055 if (!gnat_get_array_descr_info (comp_type
, &info
) || !info
.stride
)
1058 /* Otherwise, the array stride is the inner array's stride multiplied by the
1059 number of elements it contains. Note that if the inner array is not
1060 packed, then the stride is "natural" and thus does not deserve an
1062 stride
= info
.stride
;
1063 if (!info
.stride_in_bits
)
1065 stride
= fold_convert (bitsizetype
, stride
);
1066 stride
= build_binary_op (MULT_EXPR
, bitsizetype
,
1067 stride
, build_int_cst (bitsizetype
, 8));
1070 for (int i
= 0; i
< info
.ndimensions
; ++i
)
1074 if (!info
.dimen
[i
].lower_bound
|| !info
.dimen
[i
].upper_bound
)
1077 /* Put in count an expression that computes the length of this
1079 count
= build_binary_op (MINUS_EXPR
, sbitsizetype
,
1080 fold_convert (sbitsizetype
,
1081 info
.dimen
[i
].upper_bound
),
1082 fold_convert (sbitsizetype
,
1083 info
.dimen
[i
].lower_bound
)),
1084 count
= build_binary_op (PLUS_EXPR
, sbitsizetype
,
1085 count
, build_int_cst (sbitsizetype
, 1));
1086 count
= build_binary_op (MAX_EXPR
, sbitsizetype
,
1088 build_int_cst (sbitsizetype
, 0));
1089 count
= fold_convert (bitsizetype
, count
);
1090 stride
= build_binary_op (MULT_EXPR
, bitsizetype
, stride
, count
);
1096 /* GNU_TYPE is a subtype of an integral type. Set LOWVAL to the low bound
1097 and HIGHVAL to the high bound, respectively. */
1100 gnat_get_subrange_bounds (const_tree gnu_type
, tree
*lowval
, tree
*highval
)
1102 *lowval
= TYPE_MIN_VALUE (gnu_type
);
1103 *highval
= TYPE_MAX_VALUE (gnu_type
);
1106 /* Return the bias of GNU_TYPE, if any. */
1109 gnat_get_type_bias (const_tree gnu_type
)
1111 if (TREE_CODE (gnu_type
) == INTEGER_TYPE
1112 && TYPE_BIASED_REPRESENTATION_P (gnu_type
)
1113 && gnat_encodings
== DWARF_GNAT_ENCODINGS_MINIMAL
)
1114 return TYPE_RM_MIN_VALUE (gnu_type
);
1119 /* GNU_TYPE is the type of a subprogram parameter. Determine if it should be
1120 passed by reference by default. */
1123 default_pass_by_ref (tree gnu_type
)
1125 /* We pass aggregates by reference if they are sufficiently large for
1126 their alignment. The ratio is somewhat arbitrary. We also pass by
1127 reference if the target machine would either pass or return by
1128 reference. Strictly speaking, we need only check the return if this
1129 is an In Out parameter, but it's probably best to err on the side of
1130 passing more things by reference. */
1132 if (AGGREGATE_TYPE_P (gnu_type
)
1133 && (!valid_constant_size_p (TYPE_SIZE_UNIT (gnu_type
))
1134 || compare_tree_int (TYPE_SIZE_UNIT (gnu_type
),
1135 TYPE_ALIGN (gnu_type
)) > 0))
1138 if (pass_by_reference (NULL
, TYPE_MODE (gnu_type
), gnu_type
, true))
1141 if (targetm
.calls
.return_in_memory (gnu_type
, NULL_TREE
))
1147 /* GNU_TYPE is the type of a subprogram parameter. Determine if it must be
1148 passed by reference. */
1151 must_pass_by_ref (tree gnu_type
)
1153 /* We pass only unconstrained objects, those required by the language
1154 to be passed by reference, and objects of variable size. The latter
1155 is more efficient, avoids problems with variable size temporaries,
1156 and does not produce compatibility problems with C, since C does
1157 not have such objects. */
1158 return (TREE_CODE (gnu_type
) == UNCONSTRAINED_ARRAY_TYPE
1159 || TYPE_IS_BY_REFERENCE_P (gnu_type
)
1160 || (TYPE_SIZE_UNIT (gnu_type
)
1161 && TREE_CODE (TYPE_SIZE_UNIT (gnu_type
)) != INTEGER_CST
));
1164 /* This function is called by the front-end to enumerate all the supported
1165 modes for the machine, as well as some predefined C types. F is a function
1166 which is called back with the parameters as listed below, first a string,
1167 then seven ints. The name is any arbitrary null-terminated string and has
1168 no particular significance, except for the case of predefined C types, where
1169 it should be the name of the C type. For integer types, only signed types
1170 should be listed, unsigned versions are assumed. The order of types should
1171 be in order of preference, with the smallest/cheapest types first.
1173 In particular, C predefined types should be listed before other types,
1174 binary floating point types before decimal ones, and narrower/cheaper
1175 type versions before more expensive ones. In type selection the first
1176 matching variant will be used.
1178 NAME pointer to first char of type name
1179 DIGS number of decimal digits for floating-point modes, else 0
1180 COMPLEX_P nonzero is this represents a complex mode
1181 COUNT count of number of items, nonzero for vector mode
1182 FLOAT_REP Float_Rep_Kind for FP, otherwise undefined
1183 PRECISION number of bits used to store data
1184 SIZE number of bits occupied by the mode
1185 ALIGN number of bits to which mode is aligned. */
1188 enumerate_modes (void (*f
) (const char *, int, int, int, int, int, int, int))
1190 const tree c_types
[]
1191 = { float_type_node
, double_type_node
, long_double_type_node
};
1192 const char *const c_names
[]
1193 = { "float", "double", "long double" };
1196 /* We are going to compute it below. */
1197 fp_arith_may_widen
= false;
1199 for (iloop
= 0; iloop
< NUM_MACHINE_MODES
; iloop
++)
1201 machine_mode i
= (machine_mode
) iloop
;
1202 machine_mode inner_mode
= i
;
1203 bool float_p
= false;
1204 bool complex_p
= false;
1205 bool vector_p
= false;
1206 bool skip_p
= false;
1208 unsigned int nameloop
;
1209 Float_Rep_Kind float_rep
= IEEE_Binary
; /* Until proven otherwise */
1211 switch (GET_MODE_CLASS (i
))
1218 case MODE_COMPLEX_INT
:
1220 inner_mode
= GET_MODE_INNER (i
);
1222 case MODE_COMPLEX_FLOAT
:
1225 inner_mode
= GET_MODE_INNER (i
);
1227 case MODE_VECTOR_INT
:
1229 inner_mode
= GET_MODE_INNER (i
);
1231 case MODE_VECTOR_FLOAT
:
1234 inner_mode
= GET_MODE_INNER (i
);
1242 const struct real_format
*fmt
= REAL_MODE_FORMAT (inner_mode
);
1244 /* ??? Cope with the ghost XFmode of the ARM port. */
1248 /* Be conservative and consider that floating-point arithmetics may
1249 use wider intermediate results as soon as there is an extended
1250 Motorola or Intel mode supported by the machine. */
1251 if (fmt
== &ieee_extended_motorola_format
1252 || fmt
== &ieee_extended_intel_96_format
1253 || fmt
== &ieee_extended_intel_96_round_53_format
1254 || fmt
== &ieee_extended_intel_128_format
)
1256 #ifdef TARGET_FPMATH_DEFAULT
1257 if (TARGET_FPMATH_DEFAULT
== FPMATH_387
)
1259 fp_arith_may_widen
= true;
1263 digs
= (fmt
->p
- 1) * 1233 / 4096; /* scale by log (2) */
1265 else if (fmt
->b
== 10)
1272 /* First register any C types for this mode that the front end
1273 may need to know about, unless the mode should be skipped. */
1274 if (!skip_p
&& !vector_p
)
1275 for (nameloop
= 0; nameloop
< ARRAY_SIZE (c_types
); nameloop
++)
1277 tree type
= c_types
[nameloop
];
1278 const char *name
= c_names
[nameloop
];
1280 if (TYPE_MODE (type
) == i
)
1282 f (name
, digs
, complex_p
, 0, float_rep
, TYPE_PRECISION (type
),
1283 TREE_INT_CST_LOW (TYPE_SIZE (type
)), TYPE_ALIGN (type
));
1288 /* If no predefined C types were found, register the mode itself. */
1289 int nunits
, precision
, bitsize
;
1291 && GET_MODE_NUNITS (i
).is_constant (&nunits
)
1292 && GET_MODE_PRECISION (i
).is_constant (&precision
)
1293 && GET_MODE_BITSIZE (i
).is_constant (&bitsize
))
1294 f (GET_MODE_NAME (i
), digs
, complex_p
,
1295 vector_p
? nunits
: 0, float_rep
,
1296 precision
, bitsize
, GET_MODE_ALIGNMENT (i
));
1300 /* Return the size of the FP mode with precision PREC. */
1303 fp_prec_to_size (int prec
)
1305 opt_scalar_float_mode opt_mode
;
1307 FOR_EACH_MODE_IN_CLASS (opt_mode
, MODE_FLOAT
)
1309 scalar_float_mode mode
= opt_mode
.require ();
1310 if (GET_MODE_PRECISION (mode
) == prec
)
1311 return GET_MODE_BITSIZE (mode
);
1317 /* Return the precision of the FP mode with size SIZE. */
1320 fp_size_to_prec (int size
)
1322 opt_scalar_float_mode opt_mode
;
1324 FOR_EACH_MODE_IN_CLASS (opt_mode
, MODE_FLOAT
)
1326 scalar_mode mode
= opt_mode
.require ();
1327 if (GET_MODE_BITSIZE (mode
) == size
)
1328 return GET_MODE_PRECISION (mode
);
1334 static GTY(()) tree gnat_eh_personality_decl
;
1336 /* Return the GNAT personality function decl. */
1339 gnat_eh_personality (void)
1341 if (!gnat_eh_personality_decl
)
1342 gnat_eh_personality_decl
= build_personality_function ("gnat");
1343 return gnat_eh_personality_decl
;
1346 /* Initialize language-specific bits of tree_contains_struct. */
1351 MARK_TS_COMMON (UNCONSTRAINED_ARRAY_TYPE
);
1353 MARK_TS_TYPED (UNCONSTRAINED_ARRAY_REF
);
1354 MARK_TS_TYPED (NULL_EXPR
);
1355 MARK_TS_TYPED (PLUS_NOMOD_EXPR
);
1356 MARK_TS_TYPED (MINUS_NOMOD_EXPR
);
1357 MARK_TS_TYPED (POWER_EXPR
);
1358 MARK_TS_TYPED (ATTR_ADDR_EXPR
);
1359 MARK_TS_TYPED (STMT_STMT
);
1360 MARK_TS_TYPED (LOOP_STMT
);
1361 MARK_TS_TYPED (EXIT_STMT
);
1364 /* Return the size of a tree with CODE, which is a language-specific tree code
1365 in category tcc_constant, tcc_exceptional or tcc_type. The default expects
1366 never to be called. */
1369 gnat_tree_size (enum tree_code code
)
1371 gcc_checking_assert (code
>= NUM_TREE_CODES
);
1374 case UNCONSTRAINED_ARRAY_TYPE
:
1375 return sizeof (tree_type_non_common
);
1381 /* Return the lang specific structure attached to NODE. Allocate it (cleared)
1385 get_lang_specific (tree node
)
1387 if (!TYPE_LANG_SPECIFIC (node
))
1388 TYPE_LANG_SPECIFIC (node
) = ggc_cleared_alloc
<struct lang_type
> ();
1389 return TYPE_LANG_SPECIFIC (node
);
1392 /* Definitions for our language-specific hooks. */
1394 #undef LANG_HOOKS_NAME
1395 #define LANG_HOOKS_NAME "GNU Ada"
1396 #undef LANG_HOOKS_IDENTIFIER_SIZE
1397 #define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct tree_identifier)
1398 #undef LANG_HOOKS_TREE_SIZE
1399 #define LANG_HOOKS_TREE_SIZE gnat_tree_size
1400 #undef LANG_HOOKS_INIT
1401 #define LANG_HOOKS_INIT gnat_init
1402 #undef LANG_HOOKS_OPTION_LANG_MASK
1403 #define LANG_HOOKS_OPTION_LANG_MASK gnat_option_lang_mask
1404 #undef LANG_HOOKS_INIT_OPTIONS_STRUCT
1405 #define LANG_HOOKS_INIT_OPTIONS_STRUCT gnat_init_options_struct
1406 #undef LANG_HOOKS_INIT_OPTIONS
1407 #define LANG_HOOKS_INIT_OPTIONS gnat_init_options
1408 #undef LANG_HOOKS_HANDLE_OPTION
1409 #define LANG_HOOKS_HANDLE_OPTION gnat_handle_option
1410 #undef LANG_HOOKS_POST_OPTIONS
1411 #define LANG_HOOKS_POST_OPTIONS gnat_post_options
1412 #undef LANG_HOOKS_PARSE_FILE
1413 #define LANG_HOOKS_PARSE_FILE gnat_parse_file
1414 #undef LANG_HOOKS_TYPE_HASH_EQ
1415 #define LANG_HOOKS_TYPE_HASH_EQ gnat_type_hash_eq
1416 #undef LANG_HOOKS_GETDECLS
1417 #define LANG_HOOKS_GETDECLS hook_tree_void_null
1418 #undef LANG_HOOKS_PUSHDECL
1419 #define LANG_HOOKS_PUSHDECL gnat_return_tree
1420 #undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
1421 #define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL hook_bool_const_tree_false
1422 #undef LANG_HOOKS_GET_ALIAS_SET
1423 #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set
1424 #undef LANG_HOOKS_PRINT_DECL
1425 #define LANG_HOOKS_PRINT_DECL gnat_print_decl
1426 #undef LANG_HOOKS_PRINT_TYPE
1427 #define LANG_HOOKS_PRINT_TYPE gnat_print_type
1428 #undef LANG_HOOKS_TYPE_MAX_SIZE
1429 #define LANG_HOOKS_TYPE_MAX_SIZE gnat_type_max_size
1430 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
1431 #define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name
1432 #undef LANG_HOOKS_DWARF_NAME
1433 #define LANG_HOOKS_DWARF_NAME gnat_dwarf_name
1434 #undef LANG_HOOKS_GIMPLIFY_EXPR
1435 #define LANG_HOOKS_GIMPLIFY_EXPR gnat_gimplify_expr
1436 #undef LANG_HOOKS_TYPE_FOR_MODE
1437 #define LANG_HOOKS_TYPE_FOR_MODE gnat_type_for_mode
1438 #undef LANG_HOOKS_TYPE_FOR_SIZE
1439 #define LANG_HOOKS_TYPE_FOR_SIZE gnat_type_for_size
1440 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
1441 #define LANG_HOOKS_TYPES_COMPATIBLE_P gnat_types_compatible_p
1442 #undef LANG_HOOKS_GET_ARRAY_DESCR_INFO
1443 #define LANG_HOOKS_GET_ARRAY_DESCR_INFO gnat_get_array_descr_info
1444 #undef LANG_HOOKS_GET_SUBRANGE_BOUNDS
1445 #define LANG_HOOKS_GET_SUBRANGE_BOUNDS gnat_get_subrange_bounds
1446 #undef LANG_HOOKS_GET_TYPE_BIAS
1447 #define LANG_HOOKS_GET_TYPE_BIAS gnat_get_type_bias
1448 #undef LANG_HOOKS_DESCRIPTIVE_TYPE
1449 #define LANG_HOOKS_DESCRIPTIVE_TYPE gnat_descriptive_type
1450 #undef LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE
1451 #define LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE gnat_enum_underlying_base_type
1452 #undef LANG_HOOKS_GET_DEBUG_TYPE
1453 #define LANG_HOOKS_GET_DEBUG_TYPE gnat_get_debug_type
1454 #undef LANG_HOOKS_GET_FIXED_POINT_TYPE_INFO
1455 #define LANG_HOOKS_GET_FIXED_POINT_TYPE_INFO gnat_get_fixed_point_type_info
1456 #undef LANG_HOOKS_ATTRIBUTE_TABLE
1457 #define LANG_HOOKS_ATTRIBUTE_TABLE gnat_internal_attribute_table
1458 #undef LANG_HOOKS_BUILTIN_FUNCTION
1459 #define LANG_HOOKS_BUILTIN_FUNCTION gnat_builtin_function
1460 #undef LANG_HOOKS_INIT_TS
1461 #define LANG_HOOKS_INIT_TS gnat_init_ts
1462 #undef LANG_HOOKS_EH_PERSONALITY
1463 #define LANG_HOOKS_EH_PERSONALITY gnat_eh_personality
1464 #undef LANG_HOOKS_DEEP_UNSHARING
1465 #define LANG_HOOKS_DEEP_UNSHARING true
1466 #undef LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS
1467 #define LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS true
1469 struct lang_hooks lang_hooks
= LANG_HOOKS_INITIALIZER
;
1471 #include "gt-ada-misc.h"