diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-21 18:08:42 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-21 18:08:42 +0000 |
commit | 281de4253d972d89f21b2bc3ef4050f88e3fcf3c (patch) | |
tree | f786e3135d91f2f3676e58b54e313fc5e368cb9c | |
parent | b74c00bd10bc789bc2fc4d56b02e25bb431611f2 (diff) | |
parent | eda684e6a77890bd5e13ceab99d95bc1e8439212 (diff) | |
download | gcc-281de4253d972d89f21b2bc3ef4050f88e3fcf3c.zip gcc-281de4253d972d89f21b2bc3ef4050f88e3fcf3c.tar.gz gcc-281de4253d972d89f21b2bc3ef4050f88e3fcf3c.tar.bz2 |
Merge from trunk revision 274803.
From-SVN: r274804
296 files changed, 14713 insertions, 4749 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 895e5f1..7550e42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,675 @@ +2019-08-21 Richard Biener <rguenther@suse.de> + + PR tree-optimization/91482 + * tree-ssa-ccp.c (ccp_folder::fold_stmt): Remove useless + BUILT_IN_ASSUME_ALIGNED calls. + +2019-08-21 Richard Biener <rguenther@suse.de> + + PR target/91498 + PR target/91503 + * config/i386/i386-features.c + (general_scalar_chain::make_vector_copies): Copy stack temporary + rtx when using it multiple times. + (general_scalar_chain::convert_reg): Likewise. + +2019-08-20 Bernd Edlinger <bernd.edlinger@hotmail.de> + + * function.c (assign_parm_find_stack_rtl): Use known_eq instead of ==. + +2019-08-20 Matthew Beliveau <mbelivea@redhat.com> + + * tree-ssa-dse.c (dse_optimize_redundant_stores): Improved check to + catch more redundant zero initialization cases. + (dse_dom_walker::dse_optimize_stmt): Likewise. + +2019-08-20 Richard Biener <rguenther@suse.de> + + PR lto/91307 + * ipa.c (cgraph_build_static_cdtor_1): Use names not recognizable + by collect2 when targetm.have_ctors_dtors which avoids dragging + in temporary filenames from LTO input objects. + +2019-08-20 Richard Biener <rguenther@suse.de> + + PR tree-optimization/37242 + * tree-ssa-sccvn.c (visit_nary_op): Also CSE (T)(a + b) + to (T)a + (T)b if we know that a + b does not overflow. + +2019-08-20 Eric Botcazou <ebotcazou@adacore.com> + + PR rtl-optimization/91347 + * dse.c (scan_insn): Call add_wild_read for non-const/memset tail calls + before reload if HARD_FRAME_POINTER_IS_ARG_POINTER. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * calls.h (function_arg_info): Add a pass_by_reference field, + defaulting to false. + * calls.c (apply_pass_by_reference_rules): Set pass_by_reference + when applying pass-by-reference semantics. + (initialize_argument_information): Likewise. + (emit_library_call_value_1): Likewise. + * function.c (assign_parm_data_one): Remove passed_pointer field. + (assign_parm_find_data_types): Don't set it. + (assign_parm_find_stack_rtl, assign_parm_adjust_stack_rtl) + (assign_parm_setup_reg, assign_parms, gimplify_parameters): Use + arg.pass_by_reference instead of passed_pointer. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * calls.c (emit_library_call_value_1): Merge arg and orig_arg + into a single function_arg_info, updating its fields when we + apply pass-by-reference and promotion semantics. Use the + function_arg_info to track the mode rather than keeping it in + a separate local variable. + (initialize_argument_information): Likewise. Base the final + arg_to_skip on this new function_arg_info rather than creating + a new one from scratch. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * function.c (assign_parm_data_one): Replace passed_type, + promoted_mode and named_arg with a function_arg_info field. + (assign_parm_find_data_types): Remove local variables and + assign directly to "data". Make data->passed_mode shadow + data->arg.mode until promotion, then assign the promoted + mode to data->arg.mode. + (assign_parms_setup_varargs, assign_parm_find_entry_rtl) + (assign_parm_find_stack_rtl, assign_parm_adjust_entry_rtl) + (assign_parm_remove_parallels, assign_parm_setup_block_p) + (assign_parm_setup_block, assign_parm_setup_reg) + (assign_parm_setup_stack, assign_parms, gimplify_parameters): Use + arg.mode instead of promoted_mode, arg.type instead of passed_type + and arg.named instead of named_arg. Use data->arg for + function_arg_info structures that had the field values passed_type, + promoted_mode and named_arg. Base other function_arg_infos on + data->arg, changing the necessary properties. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * calls.h (apply_pass_by_reference_rules): Declare. + * calls.c (apply_pass_by_reference_rules): New function. + * config/c6x/c6x.c (c6x_call_saved_register_used): Use it. + * config/rs6000/rs6000-call.c (rs6000_parm_needs_stack): Likewise. + * config/s390/s390.c (s390_call_saved_register_used): Likewise. + * function.c (assign_parm_find_data_types): Likewise. + * var-tracking.c (prepare_call_arguments): Likewise. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (must_pass_in_stack): Take a function_arg_info instead + of a mode and a type. + * doc/tm.texi: Regenerate. + * calls.h (must_pass_in_stack_var_size): Take a function_arg_info + instead of a mode and a type. + (must_pass_in_stack_var_size_or_pad): Likewise. + * calls.c (must_pass_in_stack_var_size): Likewise. + (must_pass_in_stack_var_size_or_pad): Likewise. + (initialize_argument_information): Update call to + targetm.calls.must_pass_in_stack. + (must_pass_va_arg_on_stack): Likewise. + * function.c (assign_parm_find_entry_rtl): Likewise. + * targhooks.c (hook_pass_by_reference_must_pass_in_stack): Likewise. + * config/alpha/alpha.c (alpha_function_arg): Likewise. + (alpha_function_arg_advance): Likewise. + * config/cr16/cr16.c (cr16_function_arg): Likewise. + (cr16_function_arg_advance): Likewise. + * config/cris/cris.c (cris_pass_by_reference): Likewise. + (cris_arg_partial_bytes): Likewise. + * config/iq2000/iq2000.c (iq2000_pass_by_reference): Likewise. + * config/lm32/lm32.c (lm32_function_arg): Likewise. + * config/mcore/mcore.c (mcore_num_arg_regs): Likewise. + (mcore_function_arg, mcore_arg_partial_bytes): Likewise. + * config/mips/mips.c (mips_pass_by_reference): Likewise. + * config/mmix/mmix.c (mmix_function_arg_advance): Likewise. + (mmix_function_arg_1, mmix_pass_by_reference): Likewise. + * config/sh/sh.c (sh_pass_by_reference): Likewise. + * config/stormy16/stormy16.c (xstormy16_function_arg): Likewise. + * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. + * config/arm/arm.c (arm_must_pass_in_stack): Take a function_arg_info + instead of a mode and a type. + * config/fr30/fr30.c (fr30_must_pass_in_stack): Likewise. + (fr30_num_arg_regs): Likewise. + (fr30_setup_incoming_varargs): Update calls accordingly. + (fr30_arg_partial_bytes, fr30_function_arg): Likewise. + (fr30_function_arg_advance): Likewise. + * config/frv/frv.c (frv_must_pass_in_stack): Take a function_arg_info + instead of a mode and a type. + * config/gcn/gcn.c (num_arg_regs): Likewise. + (gcn_function_arg, gcn_function_arg_advance): Update calls to + num_arg_regs and targetm.calls.must_pass_in_stack. + (gcn_arg_partial_bytes): Likewise. + * config/i386/i386.c (ix86_must_pass_in_stack): Take a + function_arg_info instead of a mode and a type. + (classify_argument): Update call accordingly. + * config/nds32/nds32.c (nds32_must_pass_in_stack): Take a + function_arg_info instead of a mode and a type. + * config/rs6000/rs6000-internal.h (rs6000_must_pass_in_stack): + Likewise. + * config/rs6000/rs6000-call.c (rs6000_must_pass_in_stack): Likewise. + (rs6000_parm_needs_stack): Update call accordingly. + (setup_incoming_varargs): Likewise. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (callee_copies): Take a function_arg_info instead + of a mode, type and named flag. + * doc/tm.texi: Regenerate. + * targhooks.h (hook_callee_copies_named): Take a function_arg_info + instead of a mode, type and named flag. + (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Delete. + (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. + (hook_bool_CUMULATIVE_ARGS_arg_info_true): New function. + * targhooks.c (hook_callee_copies_named): Take a function_arg_info + instead of a mode, type and named flag. + (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Delete. + (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. + (hook_bool_CUMULATIVE_ARGS_arg_info_true): New function. + * calls.h (reference_callee_copied): Take a function_arg_info + instead of a mode, type and named flag. + * calls.c (reference_callee_copied): Likewise. + (initialize_argument_information): Update call accordingly. + (emit_library_call_value_1): Likewise. + * function.c (gimplify_parameters): Likewise. + * config/aarch64/aarch64.c (TARGET_CALLEE_COPIES): Define to + hook_bool_CUMULATIVE_ARGS_arg_info_false instead of + hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false. + * config/c6x/c6x.c (c6x_callee_copies): Delete. + (TARGET_CALLEE_COPIES): Define to + hook_bool_CUMULATIVE_ARGS_arg_info_true instead. + * config/epiphany/epiphany.c (TARGET_CALLEE_COPIES): Define to + hook_bool_CUMULATIVE_ARGS_arg_info_true instead of + hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. + * config/mips/mips.c (mips_callee_copies): Take a function_arg_info + instead of a mode, type and named flag. + * config/mmix/mmix.c (TARGET_CALLEE_COPIES): Define to + hook_bool_CUMULATIVE_ARGS_arg_info_true instead of + hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. + * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): Likewise. + * config/msp430/msp430.c (msp430_callee_copies): Delete. + (TARGET_CALLEE_COPIES): Define to + hook_bool_CUMULATIVE_ARGS_arg_info_true instead. + * config/pa/pa.c (pa_callee_copies): Take a function_arg_info + instead of a mode, type and named flag. + * config/sh/sh.c (sh_callee_copies): Likewise. + * config/v850/v850.c (TARGET_CALLEE_COPIES): Define to + hook_bool_CUMULATIVE_ARGS_arg_info_true instead of + hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (function_arg_advance): Take a function_arg_info instead + of a mode, type and named flag. + * doc/tm.texi: Regenerate. + * targhooks.h (default_function_arg_advance): Take a function_arg_info + instead of a mode, type and named flag. + * targhooks.c (default_function_arg_advance): Likewise. + * calls.c (initialize_argument_information): Update call to + targetm.calls.function_arg_advance. + (emit_library_call_value_1): Likewise. + * dse.c (get_call_args): Likewise. + * expr.c (block_move_libcall_safe_for_call_parm): Likewise. + * function.c (assign_parms, gimplify_parameters): Likewise. + * var-tracking.c (prepare_call_arguments): Likewise. + * config/aarch64/aarch64.c (aarch64_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (aarch64_setup_incoming_varargs): Update call accordingly. + * config/alpha/alpha.c (alpha_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (alpha_setup_incoming_varargs): Update call accordingly. + * config/arc/arc.c (arc_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (arc_setup_incoming_varargs): Update call accordingly. + * config/arm/arm.c (arm_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (cmse_func_args_or_return_in_stack): Update call accordingly. + (arm_function_ok_for_sibcall): Likewise. + (cmse_nonsecure_call_clear_caller_saved): Likewise. + * config/avr/avr.c (avr_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/bfin/bfin.c (bfin_function_arg_advance): Likewise. + * config/c6x/c6x.c (c6x_function_arg_advance): Likewise. + (c6x_call_saved_register_used): Update call accordingly. + * config/cr16/cr16.c (cr16_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/cris/cris.c (cris_function_arg_advance): Likewise. + * config/csky/csky.c (csky_function_arg_advance): Likewise. + (csky_setup_incoming_varargs): Update call accordingly. + * config/epiphany/epiphany.c (epiphany_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/fr30/fr30.c (fr30_function_arg_advance): Likewise. + * config/frv/frv.c (frv_function_arg_advance): Likewise. + * config/ft32/ft32.c (ft32_function_arg_advance): Likewise. + * config/gcn/gcn.c (gcn_function_arg_advance): Likewise. + * config/h8300/h8300.c (h8300_function_arg_advance): Likewise. + * config/i386/i386.c (ix86_function_arg_advance): Likewise. + (ix86_setup_incoming_varargs): Update call accordingly. + * config/ia64/ia64.c (ia64_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (ia64_setup_incoming_varargs): Update call accordingly. + * config/iq2000/iq2000.c (iq2000_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (iq2000_expand_prologue): Update call accordingly. + * config/lm32/lm32.c (lm32_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/m32c/m32c.c (m32c_function_arg_advance): Likewise. + * config/m32r/m32r.c (m32r_function_arg_advance): Likewise. + * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. + * config/mcore/mcore.c (mcore_function_arg_advance): Likewise. + * config/microblaze/microblaze.c (microblaze_function_arg_advance): + Likewise. + (microblaze_expand_prologue): Update call accordingly. + * config/mips/mips.c (mips_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (mips_setup_incoming_varargs): Update call accordingly. + (mips_output_args_xfer): Likewise. + * config/mmix/mmix.c (mmix_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/mn10300/mn10300.c (mn10300_function_arg_advance): Likewise. + * config/moxie/moxie.c (moxie_function_arg_advance): Likewise. + * config/msp430/msp430.c (msp430_function_arg_advance): Likewise. + * config/nds32/nds32.c (nds32_function_arg_advance): Likewise. + * config/nios2/nios2.c (nios2_function_arg_advance): Likewise. + (nios2_setup_incoming_varargs): Update call accordingly. + * config/nvptx/nvptx.c (nvptx_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/or1k/or1k.c (or1k_function_arg_advance): Likewise. + * config/pa/pa.c (pa_function_arg_advance): Likewise. + * config/pdp11/pdp11.c (pdp11_function_arg_advance): Likewise. + * config/pru/pru.c (pru_function_arg_advance): Likewise. + * config/riscv/riscv.c (riscv_function_arg_advance): Likewise. + (riscv_setup_incoming_varargs): Update call accordingly. + * config/rl78/rl78.c (rl78_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/rs6000/rs6000-internal.h (rs6000_function_arg_advance): + Likewise. + * config/rs6000/rs6000-call.c (rs6000_function_arg_advance): Likewise. + (rs6000_parm_needs_stack): Update call accordingly. + * config/rx/rx.c (rx_function_arg_advance): Take a function_arg_info + instead of a mode, type and named flag. + * config/s390/s390.c (s390_function_arg_advance): Likewise. + (s390_call_saved_register_used): Update call accordingly. + * config/sh/sh.c (sh_function_arg_advance): Take a function_arg_info + instead of a mode, type and named flag. + (sh_output_mi_thunk): Update call accordingly. + * config/sparc/sparc.c (sparc_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/spu/spu.c (spu_function_arg_advance): Likewise. + (spu_setup_incoming_varargs): Update call accordingly. + * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/tilegx/tilegx.c (tilegx_function_arg_advance): Likewise. + (tilegx_setup_incoming_varargs): Update call accordingly. + * config/tilepro/tilepro.c (tilepro_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + (tilegx_setup_incoming_varargs): Update call accordingly. + * config/v850/v850.c (v850_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + * config/vax/vax.c (vax_function_arg_advance): Likewise. + * config/visium/visium.c (visium_function_arg_advance): Likewise. + (visium_setup_incoming_varargs): Update call accordingly. + * config/xtensa/xtensa.c (xtensa_function_arg_advance): Take a + function_arg_info instead of a mode, type and named flag. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (function_arg, function_incoming_arg): Take a + function_arg_info instead of a mode, tree and named flag. + * doc/tm.texi: Regenerate. + * targhooks.h (default_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + (default_function_incoming_arg): Likewise. + * targhooks.c (default_function_arg): Likewise. + (default_function_incoming_arg): Likewise. + * calls.h (function_arg_info::end_marker_p): New function. + (function_arg_info::end_marker): Likewise. + * calls.c (prepare_call_address, initialize_argument_information) + (expand_call, emit_library_call_value_1): Update calls to + targetm.calls.function_arg and targetm.calls.function_incoming_arg. + * dse.c: Include calls.h. + (get_call_args): Update call to targetm.calls.function_arg. + * expr.c (block_move_libcall_safe_for_call_parm): Likewise. + * var-tracking.c (prepare_call_arguments): Likewise. + * function.c (assign_parm_find_entry_rtl): Update call to + targetm.calls.function_incoming_arg. + * config/aarch64/aarch64.c (aarch64_function_arg): Take a + function_arg_info instead of a mode, tree and named flag. + * config/alpha/alpha.c (alpha_function_arg): Likewise. + * config/arc/arc.c (arc_function_arg): Likewise. + * config/arm/arm.c (arm_function_arg): Likewise. + (cmse_func_args_or_return_in_stack): Update call accordingly. + (arm_function_ok_for_sibcall): Likewise. + (cmse_nonsecure_call_clear_caller_saved): Likewise. + * config/avr/avr.c (avr_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + * config/bfin/bfin.c (bfin_function_arg): Likewise. + * config/c6x/c6x.c (c6x_function_arg): Likewise. + (c6x_call_saved_register_used): Update call accordingly. + * config/cr16/cr16.c (cr16_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + * config/cris/cris.c (cris_function_arg, cris_function_incoming_arg) + (cris_function_arg_1): Likewise. + * config/csky/csky.c (csky_function_arg): Likewise. + * config/epiphany/epiphany.c (epiphany_function_arg): Likewise. + * config/fr30/fr30.c (fr30_function_arg): Likewise. + * config/frv/frv.c (frv_function_arg, frv_function_incoming_arg) + (frv_function_arg_1): Likewise. + * config/ft32/ft32.c (ft32_function_arg): Likewise. + * config/gcn/gcn.c (gcn_function_arg): Likewise. + * config/h8300/h8300.c (h8300_function_arg): Likewise. + * config/i386/i386.c (ix86_function_arg): Likewise. + * config/ia64/ia64.c (ia64_function_arg, ia64_function_incoming_arg) + (ia64_function_arg_1): Likewise. + * config/iq2000/iq2000.c (iq2000_function_arg): Likewise. + (iq2000_expand_prologue, iq2000_pass_by_reference): Update call + accordingly. + * config/lm32/lm32.c (lm32_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + * config/m32c/m32c.c (m32c_function_arg): Likewise. + * config/m32r/m32r.c (m32r_function_arg): Likewise. + * config/m68k/m68k.c (m68k_function_arg): Likewise. + * config/mcore/mcore.c (mcore_function_arg): Likewise. + * config/microblaze/microblaze.c (microblaze_function_arg): Likewise. + (microblaze_expand_prologue): Update call accordingly. + * config/mips/mips.c (mips_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + * config/mmix/mmix.c (mmix_function_incoming_arg, mmix_function_arg) + (mmix_function_arg_1): Likewise. + * config/mn10300/mn10300.c (mn10300_function_arg): Likewise. + * config/moxie/moxie.c (moxie_function_arg): Likewise. + * config/msp430/msp430.c (msp430_function_arg): Likewise. + * config/nds32/nds32.c (nds32_function_arg): Likewise. + * config/nios2/nios2.c (nios2_function_arg): Likewise. + * config/nvptx/nvptx.c (nvptx_function_arg): Likewise. + (nvptx_function_incoming_arg): Likewise. + * config/or1k/or1k.c (or1k_function_arg): Likewise. + * config/pa/pa.c (pa_function_arg): Likewise. + * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. + * config/pru/pru.c (pru_function_arg): Likewise. + * config/riscv/riscv.c (riscv_function_arg): Likewise. + * config/rl78/rl78.c (rl78_function_arg): Likewise. + * config/rs6000/rs6000-internal.h (rs6000_function_arg): Likewise. + * config/rs6000/rs6000-call.c (rs6000_function_arg): Likewise. + (rs6000_parm_needs_stack): Update call accordingly. + * config/rx/rx.c (rx_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + * config/s390/s390.c (s390_function_arg): Likewise. + (s390_call_saved_register_used): Update call accordingly. + * config/sh/sh.c (sh_function_arg): Take a function_arg_info + instead of a mode, tree and named flag. + (sh_output_mi_thunk): Update call accordingly. + * config/sparc/sparc.c (sparc_function_arg_1, sparc_function_arg) + (sparc_function_incoming_arg): Take a function_arg_info instead of + a mode, tree and named flag. + * config/spu/spu.c (spu_function_arg): Likewise. + * config/stormy16/stormy16.c (xstormy16_function_arg): Likewise. + * config/tilegx/tilegx.c (tilegx_function_arg): Likewise. + * config/tilepro/tilepro.c (tilepro_function_arg): Likewise. + * config/v850/v850.c (v850_function_arg): Likewise. + * config/vax/vax.c (vax_function_arg): Likewise. + * config/visium/visium.c (visium_function_arg): Likewise. + * config/xtensa/xtensa.c (xtensa_function_arg_1, xtensa_function_arg) + (xtensa_function_incoming_arg): Likewise. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (setup_incoming_varargs): Take a function_arg_info + instead of a mode and tree. + * doc/tm.texi: Regenerate. + * targhooks.h (default_setup_incoming_varargs): Take a + function_arg_info instead of a mode and tree. + * targhooks.c (default_setup_incoming_varargs): Likewise. + * config/aarch64/aarch64.c (aarch64_setup_incoming_varargs): Likewise. + * config/alpha/alpha.c (alpha_setup_incoming_varargs): Likewise. + * config/arc/arc.c (arc_setup_incoming_varargs): Likewise. + * config/arm/arm.c (arm_setup_incoming_varargs): Likewise. + * config/bfin/bfin.c (setup_incoming_varargs): Likewise. + * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. + * config/csky/csky.c (csky_setup_incoming_varargs): Likewise. + * config/epiphany/epiphany.c (epiphany_setup_incoming_varargs): + Likewise. + * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. + * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. + * config/ft32/ft32.c (ft32_setup_incoming_varargs): Likewise. + * config/i386/i386.c (ix86_setup_incoming_varargs): Likewise. + * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. + * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. + * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. + * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. + * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. + * config/mips/mips.c (mips_setup_incoming_varargs): Likewise. + * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. + * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. + * config/nds32/nds32.c (nds32_setup_incoming_varargs): Likewise. + * config/nios2/nios2.c (nios2_setup_incoming_varargs): Likewise. + * config/riscv/riscv.c (riscv_setup_incoming_varargs): Likewise. + * config/rs6000/rs6000-internal.h (setup_incoming_varargs): Likewise. + * config/rs6000/rs6000-call.c (setup_incoming_varargs): Likewise. + * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. + * config/spu/spu.c (spu_setup_incoming_varargs): Likewise. + * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs): Likewise. + * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs): Likewise. + * config/visium/visium.c (visium_setup_incoming_varargs): Likewise. + * function.c (assign_parms_setup_varargs): Update call to + targetm.calls.setup_incoming_varargs. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (pass_by_reference): Take a function_arg_info instead + of a mode, type and named flag. + * doc/tm.texi: Regenerate. + * targhooks.h (hook_pass_by_reference_must_pass_in_stack): Update + accordingly. + (hook_bool_CUMULATIVE_ARGS_arg_info_false): Declare. + * targhooks.c (hook_pass_by_reference_must_pass_in_stack): Take a + function_arg_info instead of a mode, type and named flag. + (hook_bool_CUMULATIVE_ARGS_arg_info_false): New function. + * calls.h (pass_by_reference): Take a function_arg_info instead of a + mode, type and named flag. + * calls.c (pass_by_reference): Likewise. + (pass_va_arg_by_reference): Update call accordingly. + (initialize_argument_information): Likewise. + (emit_library_call_value_1): Likewise. + * function.c (assign_parm_find_data_types): Likewise. + * var-tracking.c (prepare_call_arguments): Likewise. + * stor-layout.c: Include calls.h. + (compute_record_mode): Update call to targetm.calls.pass_by_reference. + * config/aarch64/aarch64.c (aarch64_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + * config/alpha/alpha.c (alpha_pass_by_reference): Likewise. + * config/arc/arc.c (arc_pass_by_reference): Likewise. + * config/arm/arm.c (arm_pass_by_reference): Likewise. + * config/bfin/bfin.c (bfin_pass_by_reference): Likewise. + * config/c6x/c6x.c (c6x_pass_by_reference): Likewise. + (c6x_call_saved_register_used): Update call to pass_by_reference. + * config/cris/cris.c (cris_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + * config/epiphany/epiphany.c (epiphany_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + (epiphany_arg_partial_bytes): Update call accordingly. + * config/ft32/ft32.c (ft32_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + (ft32_arg_partial_bytes): Update call accordingly. + * config/i386/i386.c (ix86_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + * config/iq2000/iq2000.c (iq2000_pass_by_reference): Likewise. + * config/m32c/m32c.c (m32c_pass_by_reference): Likewise. + * config/m32r/m32r.c (m32r_pass_by_reference): Likewise. + (m32r_return_in_memory): Update call accordingly. + * config/mips/mips.c (mips_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + * config/mmix/mmix.c (mmix_pass_by_reference): Likewise. + * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. + * config/moxie/moxie.c (moxie_pass_by_reference): Likewise. + (moxie_arg_partial_bytes): Update call accordingly. + * config/msp430/msp430.c (msp430_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + * config/nvptx/nvptx.c (nvptx_pass_by_reference): Likewise. + * config/or1k/or1k.c (or1k_pass_by_reference): Likewise. + * config/pa/pa.c (pa_pass_by_reference): Likewise. + * config/riscv/riscv.c (riscv_pass_by_reference): Likewise. + (riscv_return_in_memory): Update call accordingly. + * config/rs6000/rs6000-internal.h (rs6000_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + * config/rs6000/rs6000-call.c (rs6000_pass_by_reference): Likewise. + (rs6000_parm_needs_stack): Update call to pass_by_reference. + * config/s390/s390.c (s390_pass_by_reference): Take a + function_arg_info instead of a mode, type and named flag. + (s390_call_saved_register_used): Update call accordingly. + * config/sh/sh.c (sh_pass_by_reference): Take a function_arg_info + instead of a mode, type and named flag. + * config/sparc/sparc.c (sparc_pass_by_reference): Likewise. + * config/spu/spu.c (spu_pass_by_reference): Likewise. + * config/tilegx/tilegx.c (tilegx_pass_by_reference): Likewise. + * config/tilepro/tilepro.c (tilepro_pass_by_reference): Likewise. + * config/v850/v850.c (v850_pass_by_reference): Likewise. + * config/visium/visium.c (visium_pass_by_reference): Likewise. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * target.def (arg_partial_bytes): Take a function_arg_info instead + of a mode, type and named flag. + * doc/tm.texi: Regenerate. + * target.h (function_arg_info): Declare. + * calls.h (function_arg_info): New class. + * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Delete. + (hook_int_CUMULATIVE_ARGS_arg_info_0): Declare. + * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Delete. + (hook_int_CUMULATIVE_ARGS_arg_info_0): New function. + * calls.c (initialize_argument_information): Update call to + targetm.calls.partial_bytes. + (emit_library_call_value_1): Likewise. + * expr.c (block_move_libcall_safe_for_call_parm): Likewise. + * function.c (assign_parm_find_entry_rtl): Likewise. + * config/alpha/alpha.c (alpha_arg_partial_bytes): Take a + function_arg_info instead of a mode, type and named flag. + * config/arc/arc.c (arc_arg_partial_bytes): Likewise. + * config/arm/arm.c (arm_arg_partial_bytes): Likewise. + (cmse_func_args_or_return_in_stack): Update accordingly. + * config/bfin/bfin.c (bfin_arg_partial_bytes): Take a + function_arg_info instead of a mode, type and named flag. + * config/cris/cris.c (cris_arg_partial_bytes): Likewise. + * config/csky/csky.c (csky_arg_partial_bytes): Likewise. + * config/epiphany/epiphany.c (epiphany_arg_partial_bytes): Likewise. + * config/fr30/fr30.c: Include calls.h. + (fr30_arg_partial_bytes): Take a function_arg_info instead of a mode, + type and named flag. + * config/frv/frv.c: Include calls.h. + (frv_arg_partial_bytes): Take a function_arg_info instead of a mode, + type and named flag. + * config/ft32/ft32.c (ft32_arg_partial_bytes): Likewise. + * config/gcn/gcn.c (gcn_arg_partial_bytes): Likewise. + * config/ia64/ia64.c (ia64_arg_partial_bytes): Likewise. + * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Likewise. + * config/m32r/m32r.c (m32r_arg_partial_bytes): Likewise. + * config/mcore/mcore.c (mcore_arg_partial_bytes): Likewise. + * config/microblaze/microblaze.c (function_arg_partial_bytes): + Likewise. + * config/mips/mips.c (mips_arg_partial_bytes): Likewise. + * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Likewise. + * config/moxie/moxie.c (moxie_arg_partial_bytes): Likewise. + * config/msp430/msp430.c (msp430_arg_partial_bytes): Likewise. + * config/nds32/nds32.c (nds32_arg_partial_bytes): Likewise. + * config/nios2/nios2.c (nios2_arg_partial_bytes): Likewise. + * config/pa/pa.c (pa_arg_partial_bytes): Likewise. + * config/pru/pru.c (pru_arg_partial_bytes): Likewise. + * config/riscv/riscv.c (riscv_arg_partial_bytes): Likewise. + * config/rs6000/rs6000-internal.h (rs6000_arg_partial_bytes): Likewise. + * config/rs6000/rs6000-call.c (rs6000_arg_partial_bytes): Likewise. + (rs6000_parm_needs_stack): Update call accordingly. + * config/sh/sh.c (sh_arg_partial_bytes): Take a + function_arg_info instead of a mode, type and named flag. + * config/sparc/sparc.c (sparc_arg_partial_bytes): Likewise. + * config/v850/v850.c (v850_arg_partial_bytes): Likewise. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * calls.h (must_pass_va_arg_in_stack): Declare. + * calls.c (must_pass_va_arg_in_stack): New function. + * config/alpha/alpha.c (alpha_gimplify_va_arg_1): Use it. + * config/sh/sh.c (sh_gimplify_va_arg_expr): Likewise. + * config/stormy16/stormy16.c (xstormy16_gimplify_va_arg_expr): + Likewise. + * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * calls.h (pass_va_arg_by_reference): Declare. + * calls.c (pass_va_arg_by_reference): New function. + * config/aarch64/aarch64.c (aarch64_gimplify_va_arg_expr): Use it. + * config/alpha/alpha.c (alpha_gimplify_va_arg): Likewise. + * config/gcn/gcn.c (gcn_gimplify_va_arg_expr): Likewise. + * config/i386/i386.c (ix86_gimplify_va_arg): Likewise. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. + * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Likewise. + (mips_gimplify_va_arg_expr): Likewise. + * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Likewise. + * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. + * config/rs6000/rs6000-call.c (rs6000_gimplify_va_arg): Likewise. + * config/s390/s390.c (s390_gimplify_va_arg): Likewise. + * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. + * config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise. + * config/tilegx/tilegx.c (tilegx_gimplify_va_arg_expr): Likewise. + * config/tilepro/tilepro.c (tilepro_gimplify_va_arg_expr): Likewise. + * config/visium/visium.c (visium_gimplify_va_arg): Likewise. + * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise. + * targhooks.c (std_gimplify_va_arg_expr): Likewise. + +2019-08-20 Richard Biener <rguenther@suse.de> + + PR target/91498 + * config/i386/i386-features.c (general_scalar_chain::convert_op): + Use (vec_merge (vec_duplicate..)) style vector from scalar move. + (convert_scalars_to_vector): Add timode_p parameter and use it + to guard TImode-only operation. + (pass_stv::gate): Adjust so STV runs twice for TARGET_64BIT. + (pass_stv::execute): Pass down timode_p. + +2019-08-20 Lili Cui <lili.cui@intel.com> + + * common/config/i386/i386-common.c + (processor_names): Add tigerlake and cooperlake. + (processor_alias_table): Add tigerlake and cooperlake. + * config.gcc: Add -march=tigerlake and cooperlake. + * config/i386/driver-i386.c + (host_detect_local_cpu): Detect tigerlake and cooperlake. + Add "has_avx" to classify processor. + * config/i386/i386-builtins.c (processor_model) : + Add M_INTEL_COREI7_TIGERLAKE and M_INTEL_COREI7_COOPERLAKE. + (arch_names_table): Add tigerlake and cooperlake. + (get_builtin_code_for_version) : Handle PROCESSOR_TIGERLAKE + and PROCESSOR_COOPERLAKE. + * config/i386/i386-c.c + (ix86_target_macros_internal): Handle tigerlake and cooperlake. + * config/i386/i386-options.c + (m_TIGERLAKE) : Define. + (m_COOPERLAKE) : Ditto. + (m_CORE_AVX512): Ditto. + (processor_cost_table): Add cascadelake. + (ix86_option_override_internal): Hadle PTA_MOVDIRI, PTA_MOVDIR64B. + * config/i386/i386.h + (ix86_size_cost) : Define TARGET_TIGERLAKE and TARGET_COOPERLAKE. + (processor_type) : Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. + (PTA_MOVDIRI): Ditto. + (PTA_MOVDIR64B): Ditto. + (PTA_COOPERLAKE) : Ditto. + (PTA_TIGERLAKE) : Ditto. + (processor_type) : Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. + * doc/extend.texi: Add tigerlake and cooperlake. + * doc/invoke.texi: Add tigerlake and cooperlake. + +2019-08-20 Gerald Pfeifer <gerald@pfeifer.com> + + * doc/install.texi (Specific, alpha): Remove note to use + binutils 2.11.2 or later. + +2019-08-20 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR middle-end/89544 + * function.c (assign_parm_find_stack_rtl): Use larger alignment + when possible. + 2019-08-19 Joel Hutton <Joel.Hutton@arm.com> * config/aarch64/aarch64-protos.h (aarch64_fpconst_pow2_recip): New prototype diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 11222eb..8810ce1 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20190819 +20190821 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e59b709..53ecd1a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,404 @@ +2019-08-21 Vadim Godunko <godunko@adacore.com> + + * libgnat/g-expect.adb (Expect_Internal): Attempt to read + several times when 'read' returns non-positive. + +2019-08-21 Piotr Trojanek <trojanek@adacore.com> + + * einfo.adb (Is_Discriminal): Remove extra parens. + (Is_Constant_Object): Simplify by reusing Ekind_In. + (Is_Prival): Remove extra parens. + * checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor + reformattings. + +2019-08-21 Claire Dross <dross@adacore.com> + + * libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow + iteration. + (Iter_First, Iter_Next): Primitives used for iteration. + +2019-08-21 Yannick Moy <moy@adacore.com> + + * sem_ch3.adb (Analyze_Subtype_Declaration): Inherit RM_Size + field for formal type parameters in generic instantiations. + +2019-08-21 Yannick Moy <moy@adacore.com> + + * sem_spark.adb: Update references to the SPARK RM. + +2019-08-21 Eric Botcazou <ebotcazou@adacore.com> + + * repinfo.adb (List_Array_Info): In -gnatR4 mode, set the + relevant flag on the component type here instead of... + (List_Object_Info): Likewise for the object type. + (List_Entities): ...here. In -gnatR4 mode, recurse into + entities local to a record type. + (List_Component_Layout): In -gnatR4 mode, mark the type as + relevant. + +2019-08-21 Bob Duff <duff@adacore.com> + + * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-bitutil.o and + s-biutin.o. + * exp_ch5.adb (Expand_Assign_Array_Bitfield): New function to + generate a call to Copy_Bitfield. This is disabled for now. + (Expand_Assign_Array_Loop_Or_Bitfield): New function to decide + whether to call Expand_Assign_Array_Bitfield. + (Expand_Assign_Array): Call Expand_Assign_Array_Loop_Or_Bitfield + instead of Expand_Assign_Array_Loop. + * libgnat/s-bitfie.ads, libgnat/s-bituti.adb, + libgnat/s-bituti.ads: New units. + * rtsfind.ads: Add enum literals for accessing Copy_Bitfield. + +2019-08-21 Piotr Trojanek <trojanek@adacore.com> + + * bindo-graphs.ads (Iterate_Edges_To_Successors): Fix typo in + pragma Inline. + * bindo-graphs.adb (Delete_Edge): Fix layout in parameter list. + +2019-08-21 Gary Dismukes <dismukes@adacore.com> + + * exp_ch3.adb (Build_Master): Suppress call to + Build_Class_Wide_Master in the case where the + access-to-limited-class-wide type was created for a component in + an entry's formal parameter + block (Is_Parameter_Block_Component_Type), to prevent a master + from being created for such access types generated by the front + end in a task spec for entry formals in a parameter block. Add + a ??? about whether this suppression should be done more + generally (such as by using Comes_From_Source). + +2019-08-21 Eric Botcazou <ebotcazou@adacore.com> + + * exp_ch6.adb (Expand_N_Extended_Return_Statement): In the case + of a built-in-place function that doesn't need a BIP_Alloc_Form + parameter but returns unconstrained, build the return + consistently using the function's result subtype. Remove bypass + added in previous change. + +2019-08-21 Piotr Trojanek <trojanek@adacore.com> + + * sem_prag.adb (Max_Entry_Queue_Length): Do not substitute + expression of the pragma argument with its value during + analysis. + * sem_util.adb (Get_Max_Queue_Length): Compute value of the + pragma argument when needed. + +2019-08-21 Yannick Moy <moy@adacore.com> + + * checks.adb (Install_Null_Excluding_Check): Do not install + check in GNATprove mode. + +2019-08-21 Yannick Moy <moy@adacore.com> + + * sem_spark.adb (Process_Path): Do nothing on address of + subprogram. + +2019-08-21 Eric Botcazou <ebotcazou@adacore.com> + + * exp_util.adb (Finalize_Address): Deal consistently with + subtypes of private protected types. + +2019-08-21 Piotr Trojanek <trojanek@adacore.com> + + * exp_util.adb (Corresponding_Runtime_Package): Use high-level + Is_Protected_Type. + * sem_ch8.adb (Analyze_Renamed_Entry): Likewise. + * sem_ch9.adb (Analyze_Requeue): Likewise. + +2019-08-21 Javier Miranda <miranda@adacore.com> + + * sem_util.adb (Update_Named_Associations): Update + First_Named_Actual when the subprogram call has a single named + actual. + +2019-08-21 Joel Brobecker <brobecker@adacore.com> + + * doc/Makefile (mk_empty_dirs): New (PHONY) rule. + (%.html, %.pdf, %.txt, %.info, %.texinfo): Add dependencies on + mk_empty_dirs. + +2019-08-21 Justin Squirek <squirek@adacore.com> + + * doc/gnat_rm/implementation_defined_pragmas.rst: Modify + documentation to reflect expected behavior. + * gnat_rm.texi: Regenerate. + * sem_prag.adb (Analyze_Pragma): Modify handling of pragma + Max_Entry_Queue_Length to not reject integer values of negative + one. + * sem_util.adb (Get_Max_Queue_Length): Add processing for values + of negative one to fit within the current scheme. + +2019-08-20 Arnaud Charlet <charlet@adacore.com> + + * exp_unst.adb (Unnest_Subprograms, Unnest_Subprogram): Take + inlining (-gnatn) into account. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case + Storage_Size): If the expression for Storage_Size is not static + it may depend on characterstics of another type that may bot be + frozen yet, so the elaboration of the expression for the aspect + must be attached directly to the freeze actions of the type to + which it applies. + +2019-08-20 Piotr Trojanek <trojanek@adacore.com> + + * exp_util.adb (Build_DIC_Procedure_Declaration): Set the last + entity of the generated Default_Initial_Condition procedure in + order to construct a proper entity chain. + +2019-08-20 Yannick Moy <moy@adacore.com> + + * exp_spark.adb (Expand_SPARK_N_Slice_Or_Indexed_Component): + Renaming of function to apply to slices as well. + (Expand_SPARK): Expand prefix of slices of access type. + +2019-08-20 Bob Duff <duff@adacore.com> + + * exp_aggr.adb (Expand_Array_Aggregate): Use build-in-place in + the nonlimited case in STEP 4. This improves the efficiency of + things like (1 .. 1000 => <>). We still generate some code for + that, unfortunately, but it is much improved. + (Aggr_Assignment_OK_For_Backend): Return false if <> components + are present. + +2019-08-20 Bob Duff <duff@adacore.com> + + * exp_ch6.adb (Needs_BIP_Alloc_Form): Call + Requires_Transient_Scope rather than checking constrainedness + and so forth. We have previously improved + Requires_Transient_Scope to return False in various cases, + notably a limited record with an access discriminant. This + change takes advantage of that to avoid using the secondary + stack for functions returning such types. + (Make_Build_In_Place_Call_In_Allocator): Be consistent by + calling Needs_BIP_Alloc_Form rather than Is_Constrained and so + forth. + * sem_ch4.adb (Analyze_Allocator): The above change causes the + compiler to generate code that is not legal Ada, in particular + an uninitialized allocator for indefinite subtype. This is + harmless, so we suppress the error message in this case. + +2019-08-20 Gary Dismukes <dismukes@adacore.com> + + * ali.adb, ali.ads, aspects.adb, checks.ads, checks.adb, + doc/gnat_rm/implementation_defined_pragmas.rst, + doc/gnat_ugn/building_executable_programs_with_gnat.rst, + einfo.ads, exp_aggr.adb, exp_ch11.adb, exp_ch3.ads, exp_ch4.adb, + exp_disp.adb, inline.adb, libgnat/a-locale.ads, + libgnat/s-soflin.ads, par_sco.adb, repinfo.adb, sem_ch5.adb, + sem_disp.adb, sem_elab.adb, sem_eval.adb, sem_spark.adb, + sem_spark.ads, sinfo.ads: Minor reformattings, typo fixes and + and rewordings. + +2019-08-20 Dmitriy Anisimkov <anisimko@adacore.com> + + * adaint.c (__gnat_to_gm_time): On _WIN32, don't round time up + to even second. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * sem_ch3.adb (Analyze_Object_Declaration): If actual type is + private and distinct from nominal type in declaration, propagate + flags Is_Constr_Subt_For_U_Nominal and _UN_Aliased to full view + of private type. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * exp_attr.adb (Expand_Loop_Entry_Attribute): When expanding a + loop entry attribute for a while_loop we construct a function + that incorporates the expanded condition of the loop. The itypes + that may be generated in that expansion must carry the scope of + the constructed function for proper handling in gigi. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * exp_disp.adb (Build_Class_Wide_Check, Replace_Formals): When a + dispatching call tp a subprogram with a class-wide precondition + occurrs in the same declarative part as the ancestor subprogram + being called, the`expression for the precondition has not been + analyzed yet. Such a call may appear, e.g. in an expression + function. In that case, the replacement of formals by actuals in + the call cannot use the formal entities of the subprogram being + called, and the occurrence of the formals in the expression must + be located by name (Chars fields) as would be done at a later + freeze point, when the expression is resolved in the context of + the subprogram itself. + +2019-08-20 Bob Duff <duff@adacore.com> + + * sem_prag.adb (Persistent_BSS): If an initialization is present + because of Initialize_Scalars or Normalize_Scalars, generate an + implicit pragma Suppress_Initialization to remove that, because + initialization is not allowed for these variables. Other + initializations remain illegal. + +2019-08-20 Gary Dismukes <dismukes@adacore.com> + + * sem_ch3.adb (OK_For_Limited_Init_In_05): In the case of type + conversions, apply the recursive call to the Original_Node of + the expression Exp rather than the Expression of the + Original_Node, in the case where Exp has been rewritten; + otherwise, when Original_Node is the same as Exp, apply the + recursive call to the Expression. + (Check_Initialization): Revise condition for special check on + type conversions of limited function calls to test Original_Node + (avoiding spurious errors on expanded unchecked conversions + applied to build-in-place dispatching calls). + +2019-08-20 Patrick Bernardi <bernardi@adacore.com> + + * exp_aggr.adb (Expand_Record_Aggregate): Always convert a + record Aggregate to assignment statements if the option + Aggregate_Individually_Assign is set. + * opt.ads (Aggregate_Individually_Assign): New option. + * par-prag.adb (Prag): Add Pragma_Aggregate_Individually_Assign. + * sem_prag.adb (Analyze_Pragma): Likewise. + * snames.ads-tmpl: Add Pragma_Aggregate_Individually_Assign and + Name_Aggregate_Individually_Assign. + * doc/gnat_rm/implementation_defined_pragmas.rst: Document + pragma Aggregate_Individually_Assign. + * gnat_rm.texi: Regenerate. + +2019-08-20 Bob Duff <duff@adacore.com> + + * par-ch4.adb: Minor wording change in error messages. + * sem_aggr.adb (Resolve_Delta_Aggregate): Emit an error for Ada + versions prior to Ada 2020. + +2019-08-20 Bob Duff <duff@adacore.com> + + * freeze.adb (Is_Atomic_VFA_Aggregate): Make the temp for + initialization of the atomic variable be constant. This is + cleaner, and might improve efficiency. + +2019-08-20 Eric Botcazou <ebotcazou@adacore.com> + + * repinfo.adb (List_Record_Info): In -gnatR4 mode, set the + relevant flag on the implicit base type of a record subtype. + +2019-08-20 Bob Duff <duff@adacore.com> + + * sem_eval.adb (Expr_Value): Implement the case of an unchecked + conversion of a static expression. + +2019-08-20 Bob Duff <duff@adacore.com> + + * sem_ch13.adb (Is_Null_Array): New function, used to detect the + null array case; used to warn about uncheckedly converting to a + zero-sized array. It is unfortunate that we can't just check + the size, and warn on all cases of converting from a + nonzero-sized type to a zero-sized one. That's because "0" means + two different things: "size is zero" and "size is unknown". + Until we fix that design flaw, we need this more targeted fix. + +2019-08-20 Bob Duff <duff@adacore.com> + + * libgnat/a-cborma.adb, libgnat/a-cborse.adb (Clear): Repeatedly + call Delete. This avoids clearing the free list, which + substantially speeds up future Delete operations. + +2019-08-20 Bob Duff <duff@adacore.com> + + * sem_ch13.adb (Component_Order_Check): New procedure to check + for out-of-order clauses. + * warnsw.ads, warnsw.adb: New -gnatw_r switch. + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: + Document new switch. + * gnat_ugn.texi: Regenerate. + +2019-08-20 Bob Duff <duff@adacore.com> + + * sem_ch13.adb (Object_Size): Give an error for zero. It really + rubs me the wrong way that we don't honor "for T'Object_Size use + 0;", but it's not important enough to fix. In any case, if we're + not going to obey the clause, we should give an error. + +2019-08-20 Bob Duff <duff@adacore.com> + + * errout.adb (Error_Msg_Internal): Set Warn_Err in case of + Is_Style_Msg. + * erroutc.adb (Output_Msg_Text): Do Warnings_Treated_As_Errors + processing and [warning-as-error] modification for style + messages. Clean up code, simplify, remove unnecessary block + statement, add renaming of table entry. + * erroutc.ads (Warning_Treated_As_Error): Fix comment: no such + thing as Set_Warning_As_Error. + * opt.ads: Clean up comments and move related declarations near + each other. + * par-prag.adb: Process Warning_As_Error. This is necessary + because many style warning happen during parsing. + * sem_prag.adb: Use new Acquire_Warning_Match_String. + * sem_util.ads, sem_util.adb (Acquire_Warning_Match_String): New + function shared by par-prag.adb and sem_prag.adb. Replaces the + procedure in sem_prag.adb. Avoid use of global variables. + * stringt.ads, stringt.adb (To_String): New function to convert + String_Id to String. + * doc/gnat_rm/implementation_defined_pragmas.rst: Document the + new feature. + * gnat_rm.texi: Regenerate. + +2019-08-20 Eric Botcazou <ebotcazou@adacore.com> + + * lib.ads: Add with clause for GNAT.HTable. + Add pragma Inline for Is_Loaded and alphabetize the list. + (Unit_Name_Table_Size): New constant. + (Unit_Name_Header_Num): New subtype. + (Unit_Name_Hash): New function declaration. + (Unit_Names): New simple hash table. + (Init_Unit_Name): New procedure declaration. + * lib.adb (Set_Unit_Name): Unregister the old name in the table, + if any, and then register the new name. + (Init_Unit_Name): New procedure. + (Is_Loaded): Reimplement using a lookup in the names table. + (Remove_Unit): Unregister the name. + (Unit_Name_Hash): New function. + * lib-load.adb (Create_Dummy_Package_Unit): Call Init_Unit_Name. + (Load_Unit): Use a lookup in the names table to find out whether + the unit has already been loaded. Call Init_Unit_Name and then + Remove_Unit if the loading has failed. + (Make_Child_Decl_Unit): Call Init_Unit_Name. + (Make_Instance_Unit): Likewise. + * lib-writ.adb (Ensure_System_Dependency): Likewise. + +2019-08-20 Bob Duff <duff@adacore.com> + + * sem_ch13.adb (Record_Hole_Check): Initialize After_Last. + +2019-08-20 Piotr Trojanek <trojanek@adacore.com> + + * impunit.adb (Get_Kind_Of_Unit): Revert change for adapting + this routine for gnatprove. + +2019-08-20 Arnaud Charlet <charlet@adacore.com> + + * doc/gnat_rm/implementation_defined_pragmas.rst: Document + requirements for Pragma Lock_Free. + * gnat_rm.texi: Regenerate. + +2019-08-20 Philippe Gil <gil@adacore.com> + + * bindgen.adb (Gen_Main): Set gnat_argc/gnat_argv to argc/argv + only when still uninitialized. + +2019-08-20 Bob Duff <duff@adacore.com> + + * libgnat/g-comlin.ads (Exit_From_Command_Line): Fix + documentation for GNAT.Command_Line. + +2019-08-20 Pierre-Marie de Rodat <derodat@adacore.com> + + PR ada/91492 + * gcc-interface/lang.opt (-fdump-scos): Add missing dot at the + end of the documentation. + +2019-08-20 Richard Sandiford <richard.sandiford@arm.com> + + * gcc-interface/misc.c (default_pass_by_ref): Update call to + pass_by_reference. + 2019-08-19 Bob Duff <duff@adacore.com> * doc/gnat_rm/implementation_advice.rst: Fix documentation for diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index c1a422f..e5aa6b8 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -502,7 +502,9 @@ GNATRTL_NONTASKING_OBJS= \ s-atopri$(objext) \ s-auxdec$(objext) \ s-bignum$(objext) \ + s-bitfie$(objext) \ s-bitops$(objext) \ + s-bituti$(objext) \ s-boarop$(objext) \ s-boustr$(objext) \ s-bytswa$(objext) \ diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index fe8d955..7290f7a 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -344,7 +344,7 @@ int __gnat_use_acl = 1; system provides the routine readdir_r. ... but we never define it anywhere??? */ #undef HAVE_READDIR_R - + #define MAYBE_TO_PTR32(argv) argv static const char ATTR_UNSET = 127; @@ -411,13 +411,6 @@ __gnat_to_gm_time (OS_Time *p_time, int *p_year, int *p_month, int *p_day, struct tm *res; time_t time = (time_t) *p_time; -#ifdef _WIN32 - /* On Windows systems, the time is sometimes rounded up to the nearest - even second, so if the number of seconds is odd, increment it. */ - if (time & 1) - time++; -#endif - res = gmtime (&time); if (res) { diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb index ab98104..8d1d54a 100644 --- a/gcc/ada/ali.adb +++ b/gcc/ada/ali.adb @@ -649,7 +649,7 @@ package body ALI is Xref.Init; Xref_Section.Init; - -- Add dummy zero'th item in Linker_Options and Notes for sort calls + -- Add dummy zeroth item in Linker_Options and Notes for sort calls Linker_Options.Increment_Last; Notes.Increment_Last; diff --git a/gcc/ada/ali.ads b/gcc/ada/ali.ads index 22bf8a2..5e2ec71 100644 --- a/gcc/ada/ali.ads +++ b/gcc/ada/ali.ads @@ -727,9 +727,9 @@ package ALI is -- but before the entries from the run-time. end record; - -- The indexes of active entries in this table range from 1 to - -- the value of Linker_Options.Last. The zero'th element is for - -- convenience if the table needs to be sorted. + -- The indexes of active entries in this table range from 1 to the value of + -- Linker_Options.Last. The zeroth element is for convenience if the table + -- needs to be sorted. package Linker_Options is new Table.Table ( Table_Component_Type => Linker_Option_Record, @@ -765,9 +765,9 @@ package ALI is -- location to the last character on the line. end record; - -- The indexes of active entries in this table range from 1 to the - -- value of Notes.Last. The zero'th element is for convenience if - -- the table needs to be sorted. + -- The indexes of active entries in this table range from 1 to the value of + -- Notes.Last. The zeroth element is for convenience if the table needs to + -- be sorted. package Notes is new Table.Table ( Table_Component_Type => Notes_Record, diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb index d582abf..3b8b7c4 100644 --- a/gcc/ada/aspects.adb +++ b/gcc/ada/aspects.adb @@ -226,8 +226,8 @@ package body Aspects is end if; if Is_Private_Type (Owner) - and then Present (Full_View (Owner)) - and then not Operational_Aspect (A) + and then Present (Full_View (Owner)) + and then not Operational_Aspect (A) then Owner := Full_View (Owner); end if; diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 8ea8a6b..153043c 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -1826,18 +1826,25 @@ package body Bindgen is WBI (" begin"); - -- Acquire command line arguments if present on target + -- Acquire command-line arguments if present on target if CodePeer_Mode then null; elsif Command_Line_Args_On_Target then - WBI (" gnat_argc := argc;"); - WBI (" gnat_argv := argv;"); + + -- Initialize gnat_argc/gnat_argv only if not already initialized, + -- to avoid losing the result of any command-line processing done by + -- earlier GNAT run-time initialization. + + WBI (" if gnat_argc = 0 then"); + WBI (" gnat_argc := argc;"); + WBI (" gnat_argv := argv;"); + WBI (" end if;"); WBI (" gnat_envp := envp;"); WBI (""); - -- If configurable run time and no command line args, then nothing needs + -- If configurable run-time and no command-line args, then nothing needs -- to be done since the gnat_argc/argv/envp variables are suppressed in -- this case. diff --git a/gcc/ada/bindo-graphs.adb b/gcc/ada/bindo-graphs.adb index c2f9d6c..e7585e2 100644 --- a/gcc/ada/bindo-graphs.adb +++ b/gcc/ada/bindo-graphs.adb @@ -1144,7 +1144,7 @@ package body Bindo.Graphs is -- successor. procedure Delete_Edge - (G : Library_Graph; + (G : Library_Graph; Edge : Library_Graph_Edge_Id); pragma Inline (Delete_Edge); -- Delete edge Edge from library graph G diff --git a/gcc/ada/bindo-graphs.ads b/gcc/ada/bindo-graphs.ads index f376801..339c7f8 100644 --- a/gcc/ada/bindo-graphs.ads +++ b/gcc/ada/bindo-graphs.ads @@ -1406,7 +1406,7 @@ package Bindo.Graphs is function Iterate_Edges_To_Successors (G : Library_Graph; Vertex : Library_Graph_Vertex_Id) return Edges_To_Successors_Iterator; - pragma Inline (Iterate_Components); + pragma Inline (Iterate_Edges_To_Successors); -- Obtain an iterator over all edges to successors with predecessor -- vertex Vertex of library graph G. diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 03cfcef..caee9ad 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -2471,7 +2471,7 @@ package body Checks is (Formal : Entity_Id; Prag_Nam : Name_Id; For_Result : Boolean := False); - -- Add a single 'Valid[_Scalar] check which verifies the initialization + -- Add a single 'Valid[_Scalars] check which verifies the initialization -- of Formal. Prag_Nam denotes the pre or post condition pragma name. -- Set flag For_Result when to verify the result of a function. @@ -6994,7 +6994,7 @@ package body Checks is -- Next test for the case where the target type is within the bounds -- of the base type of the source type, since in this case we can - -- simply convert the bounds of the target type to this base bype + -- simply convert the bounds of the target type to this base type -- to do the test. -- [constraint_error when N not in @@ -7964,6 +7964,12 @@ package body Checks is return; end if; + -- In GNATprove mode, we do not apply the check + + if GNATprove_Mode then + return; + end if; + -- Otherwise install access check Insert_Action (N, diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads index e2ac6ae..9bf2908 100644 --- a/gcc/ada/checks.ads +++ b/gcc/ada/checks.ads @@ -161,7 +161,7 @@ package Checks is procedure Activate_Range_Check (N : Node_Id); pragma Inline (Activate_Range_Check); - -- Sets Do_Range_Check flag in node N, and handles possible local raise + -- Sets Do_Range_Check flag in node N, and handles possible local raise. -- Always call this routine rather than calling Set_Do_Range_Check to -- set an explicit value of True, to ensure handling the local raise case. diff --git a/gcc/ada/doc/Makefile b/gcc/ada/doc/Makefile index a2a9d7a..9a435eb 100644 --- a/gcc/ada/doc/Makefile +++ b/gcc/ada/doc/Makefile @@ -42,22 +42,26 @@ help: clean: -rm -rf $(BUILDDIR) -%.html: +.PHONY: mk_empty_dirs +mk_empty_dirs: + mkdir -p share/_static + +%.html: mk_empty_dirs $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/$*/html -%.pdf: +%.pdf: mk_empty_dirs $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/$*/pdf $(MAKE) -C $(BUILDDIR)/$*/pdf all-pdf LATEXOPTS="-interaction=nonstopmode" -%.txt: +%.txt: mk_empty_dirs $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/txt $(MAKE) -C $(BUILDDIR)/$*/txt plaintext -%.info: +%.info: mk_empty_dirs $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/info $(MAKE) -C $(BUILDDIR)/$*/info info -%.texinfo: +%.texinfo: mk_empty_dirs $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/texinfo sed -e 's/^@dircategory/@dircategory GNU Ada Tools/g' < $(BUILDDIR)/$*/texinfo/$*.texi > $(BUILDDIR)/../../$*.texi diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index a4ff222..625a38f 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -371,6 +371,21 @@ Syntax: This configuration pragma is a synonym for pragma Ada_12 and has the same syntax and effect. +Pragma Aggregate_Individually_Assign +==================================== + +Syntax: + +.. code-block:: ada + + pragma Aggregate_Individually_Assign; + +Where possible, GNAT will store the binary representation of a record aggregate +in memory for space and performance reasons. This configuration pragma changes +this behavior so that record aggregates are instead always converted into +individual assignment statements. + + Pragma Allow_Integer_Address ============================ @@ -3649,6 +3664,24 @@ the implementation of protected operations must be implemented without locks. Compilation fails if the compiler cannot generate lock-free code for the operations. +The current conditions required to support this pragma are: + +* Protected type declarations may not contain entries +* Protected subprogram declarations may not have nonelementary parameters + +In addition, each protected subprogram body must satisfy: + +* May reference only one protected component +* May not reference nonconstant entities outside the protected subprogram + scope. +* May not contain address representation items, allocators, or quantified + expressions. +* May not contain delay, goto, loop, or procedure-call statements. +* May not contain exported and imported entities +* May not dereferenced access values +* Function calls and attribute references must be static + + Pragma Loop_Invariant ===================== @@ -3855,8 +3888,10 @@ Syntax:: This pragma is used to specify the maximum callers per entry queue for individual protected entries and entry families. It accepts a single -positive integer as a parameter and must appear after the declaration -of an entry. +integer (-1 or more) as a parameter and must appear after the declaration of an +entry. + +A value of -1 represents no additional restriction on queue length. Pragma No_Body ============== @@ -7449,18 +7484,21 @@ Syntax: This configuration pragma allows the programmer to specify a set -of warnings that will be treated as errors. Any warning which +of warnings that will be treated as errors. Any warning that matches the pattern given by the pragma argument will be treated -as an error. This gives much more precise control that -gnatwe -which treats all warnings as errors. - -The pattern may contain asterisks, which match zero or more characters in -the message. For example, you can use -``pragma Warning_As_Error ("bits of*unused")`` to treat the warning -message ``warning: 960 bits of "a" unused`` as an error. No other regular -expression notations are permitted. All characters other than asterisk in -these three specific cases are treated as literal characters in the match. -The match is case insensitive, for example XYZ matches xyz. +as an error. This gives more precise control than -gnatwe, +which treats warnings as errors. + +This pragma can apply to regular warnings (messages enabled by -gnatw) +and to style warnings (messages that start with "(style)", +enabled by -gnaty). + +The pattern may contain asterisks, which match zero or more characters +in the message. For example, you can use ``pragma Warning_As_Error +("bits of*unused")`` to treat the warning message ``warning: 960 bits of +"a" unused`` as an error. All characters other than asterisk are treated +as literal characters in the match. The match is case insensitive; for +example XYZ matches xyz. Note that the pattern matches if it occurs anywhere within the warning message string (it is not necessary to put an asterisk at the start and diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 913d6b9..6f13452 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -2760,7 +2760,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). :switch:`-gnatwa` *Activate most optional warnings.* - This switch activates most optional warning messages. See the remaining list + This switch activates most optional warning messages. See the remaining list in this section for details on optional warning messages that can be individually controlled. The warnings that are not turned on by this switch are: @@ -2790,6 +2790,8 @@ of the pragma in the :title:`GNAT_Reference_manual`). * :switch:`-gnatw.q` (questionable layout of record types) + * :switch:`-gnatw_r` (out-of-order record representation clauses) + * :switch:`-gnatw.s` (overridden size clause) * :switch:`-gnatwt` (tracking of deleted conditional code) @@ -3708,7 +3710,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). warnings are given. -.. index:: -gnatwT (gcc) +.. index:: -gnatw.R (gcc) :switch:`-gnatw.R` *Suppress warnings for object renaming function.* @@ -3716,6 +3718,23 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch suppresses warnings for object renaming function. +.. index:: -gnatw_r (gcc) + +:switch:`-gnatw_r` + *Activate warnings for out-of-order record representation clauses.* + + This switch activates warnings for record representation clauses, + if the order of component declarations, component clauses, + and bit-level layout do not all agree. + The default is that these warnings are not given. + + +.. index:: -gnatw_R (gcc) + +:switch:`-gnatw_R` + *Suppress warnings for out-of-order record representation clauses.* + + .. index:: -gnatws (gcc) :switch:`-gnatws` @@ -4777,7 +4796,7 @@ checks to be performed. The following checks are defined: The set of style check switches is set to match that used by the GNAT sources. This may be useful when developing code that is eventually intended to be - incorporated into GNAT. Currently this is equivalent to :switch:`-gnatwydISux`) + incorporated into GNAT. Currently this is equivalent to :switch:`-gnatyydISux`) but additional style switches may be added to this set in the future without advance notice. diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 957bfe6..ebef3a0 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -8032,10 +8032,8 @@ package body Einfo is ------------------------ function Is_Constant_Object (Id : E) return B is - K : constant Entity_Kind := Ekind (Id); begin - return - K = E_Constant or else K = E_In_Parameter or else K = E_Loop_Parameter; + return Ekind_In (Id, E_Constant, E_In_Parameter, E_Loop_Parameter); end Is_Constant_Object; ------------------- @@ -8053,8 +8051,8 @@ package body Einfo is function Is_Discriminal (Id : E) return B is begin - return (Ekind_In (Id, E_Constant, E_In_Parameter) - and then Present (Discriminal_Link (Id))); + return Ekind_In (Id, E_Constant, E_In_Parameter) + and then Present (Discriminal_Link (Id)); end Is_Discriminal; ---------------------- @@ -8181,8 +8179,8 @@ package body Einfo is function Is_Prival (Id : E) return B is begin - return (Ekind_In (Id, E_Constant, E_Variable) - and then Present (Prival_Link (Id))); + return Ekind_In (Id, E_Constant, E_Variable) + and then Present (Prival_Link (Id)); end Is_Prival; ---------------------------- diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 089960a..e93a837 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -663,8 +663,8 @@ package Einfo is -- In that case, this field points to that subtype. -- -- For E_Class_Wide_Subtype, the presence of Equivalent_Type overrides --- this field. Note that this field ONLY appears in subtype entries, not --- in type entries, it is not defined, and it is an error to reference +-- this field. Note that this field ONLY appears in subtype entities, not +-- in type entities, it is not defined, and it is an error to reference -- Cloned_Subtype in an E_Record_Type or E_Class_Wide_Type entity. -- Comes_From_Source @@ -915,7 +915,7 @@ package Einfo is -- depends on a private type. -- Derived_Type_Link (Node31) --- Defined in all type and subtype entries. Set in a base type if +-- Defined in all type and subtype entities. Set in a base type if -- a derived type declaration is encountered which derives from -- this base type or one of its subtypes, and there are already -- primitive operations declared. In this case, it references the @@ -1228,7 +1228,7 @@ package Einfo is -- initial value). See Exp_Util.Expand_Class_Wide_Subtype for further -- details. For E_Exception_Type, this points to the record containing -- the data necessary to represent exceptions (for further details, see --- System.Standard_Library. For access_to_protected subprograms, it +-- System.Standard_Library). For access to protected subprograms, it -- denotes a record that holds pointers to the operation and to the -- protected object. For remote Access_To_Subprogram types, it denotes -- the record that is the fat pointer representation of an RAST. @@ -1616,7 +1616,7 @@ package Einfo is -- set, signalling that Freeze.Inherit_Delayed_Rep_Aspects must be called -- at the freeze point of the derived type. --- Has_DIC (syntherized) +-- Has_DIC (synthesized) -- Defined in all type entities. Set for a private type and its full view -- when the type is subject to pragma Default_Initial_Condition (DIC), or -- when the type inherits a DIC pragma from a parent type. @@ -1952,7 +1952,7 @@ package Einfo is -- Unmodified and Unreferenced pragmas. -- Has_Pragma_Unused (Flag294) --- Defined in all entries. Set if a valid pragma Unused applies to a +-- Defined in all entities. Set if a valid pragma Unused applies to a -- variable or entity, indicating that warnings should not be given if -- it is never modified or referenced. Note: This pragma is exactly -- equivalent Unmodified and Unreference combined. @@ -3327,7 +3327,7 @@ package Einfo is -- frozen. If set it indicates that the representation is known to be -- unsigned (i.e. that no negative values appear in the range). This is -- normally just a reflection of the lower bound of the subtype or base --- type, but there is one case in which the setting is non-obvious, +-- type, but there is one case in which the setting is not obvious, -- namely the case of an unsigned subtype of a signed type from which -- a further subtype is obtained using variable bounds. This further -- subtype is still unsigned, but this cannot be determined by looking diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index f5a4925..42c7cb9 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -1100,7 +1100,7 @@ package body Errout is -- Test if warning to be treated as error Warn_Err := - Is_Warning_Msg + (Is_Warning_Msg or Is_Style_Msg) and then (Warning_Treated_As_Error (Msg_Buffer (1 .. Msglen)) or else Warning_Treated_As_Error (Get_Warning_Tag (Cur_Msg))); diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index 81e2910..3bab352 100644 --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -624,155 +624,145 @@ package body Erroutc is Length : Nat; -- Maximum total length of lines - Text : constant String_Ptr := Errors.Table (E).Text; + E_Msg : Error_Msg_Object renames Errors.Table (E); + Text : constant String_Ptr := E_Msg.Text; Ptr : Natural; Split : Natural; Start : Natural; + Tag : constant String := Get_Warning_Tag (E); + Txt : String_Ptr; + Len : Natural; begin - declare - Tag : constant String := Get_Warning_Tag (E); - Txt : String_Ptr; - Len : Natural; + -- Postfix warning tag to message if needed - begin - -- Postfix warning tag to message if needed - - if Tag /= "" and then Warning_Doc_Switch then - if Include_Subprogram_In_Messages then - Txt := - new String' - (Subprogram_Name_Ptr (Errors.Table (E).Node) & - ": " & Text.all & ' ' & Tag); - else - Txt := new String'(Text.all & ' ' & Tag); - end if; - - elsif Include_Subprogram_In_Messages - and then (Errors.Table (E).Warn or else Errors.Table (E).Style) - then + if Tag /= "" and then Warning_Doc_Switch then + if Include_Subprogram_In_Messages then Txt := new String' - (Subprogram_Name_Ptr (Errors.Table (E).Node) & - ": " & Text.all); + (Subprogram_Name_Ptr (E_Msg.Node) & + ": " & Text.all & ' ' & Tag); else - Txt := Text; + Txt := new String'(Text.all & ' ' & Tag); end if; - -- Deal with warning case - - if Errors.Table (E).Warn or else Errors.Table (E).Info then + elsif Include_Subprogram_In_Messages + and then (E_Msg.Warn or else E_Msg.Style) + then + Txt := + new String'(Subprogram_Name_Ptr (E_Msg.Node) & ": " & Text.all); + else + Txt := Text; + end if; - -- For info messages, prefix message with "info: " + -- For info messages, prefix message with "info: " - if Errors.Table (E).Info then - Txt := new String'("info: " & Txt.all); + if E_Msg.Info then + Txt := new String'("info: " & Txt.all); - -- Warning treated as error + -- Warning treated as error - elsif Errors.Table (E).Warn_Err then + elsif E_Msg.Warn_Err then - -- We prefix with "error:" rather than warning: and postfix - -- [warning-as-error] at the end. + -- We prefix with "error:" rather than warning: and postfix + -- [warning-as-error] at the end. - Warnings_Treated_As_Errors := Warnings_Treated_As_Errors + 1; - Txt := new String'("error: " & Txt.all & " [warning-as-error]"); + Warnings_Treated_As_Errors := Warnings_Treated_As_Errors + 1; + Txt := new String'("error: " & Txt.all & " [warning-as-error]"); - -- Normal case, prefix with "warning: " + -- Normal warning, prefix with "warning: " - else - Txt := new String'("warning: " & Txt.all); - end if; + elsif E_Msg.Warn then + Txt := new String'("warning: " & Txt.all); - -- No prefix needed for style message, "(style)" is there already + -- No prefix needed for style message, "(style)" is there already - elsif Errors.Table (E).Style then - null; + elsif E_Msg.Style then + null; - -- No prefix needed for check message, severity is there already + -- No prefix needed for check message, severity is there already - elsif Errors.Table (E).Check then - null; + elsif E_Msg.Check then + null; - -- All other cases, add "error: " if unique error tag set + -- All other cases, add "error: " if unique error tag set - elsif Opt.Unique_Error_Tag then - Txt := new String'("error: " & Txt.all); - end if; + elsif Opt.Unique_Error_Tag then + Txt := new String'("error: " & Txt.all); + end if; - -- Set error message line length and length of message + -- Set error message line length and length of message - if Error_Msg_Line_Length = 0 then - Length := Nat'Last; - else - Length := Error_Msg_Line_Length; - end if; + if Error_Msg_Line_Length = 0 then + Length := Nat'Last; + else + Length := Error_Msg_Line_Length; + end if; - Max := Integer (Length - Column + 1); - Len := Txt'Length; + Max := Integer (Length - Column + 1); + Len := Txt'Length; - -- Here we have to split the message up into multiple lines + -- Here we have to split the message up into multiple lines - Ptr := 1; - loop - -- Make sure we do not have ludicrously small line + Ptr := 1; + loop + -- Make sure we do not have ludicrously small line - Max := Integer'Max (Max, 20); + Max := Integer'Max (Max, 20); - -- If remaining text fits, output it respecting LF and we are done + -- If remaining text fits, output it respecting LF and we are done - if Len - Ptr < Max then - for J in Ptr .. Len loop - if Txt (J) = ASCII.LF then - Write_Eol; - Write_Spaces (Offs); - else - Write_Char (Txt (J)); - end if; - end loop; + if Len - Ptr < Max then + for J in Ptr .. Len loop + if Txt (J) = ASCII.LF then + Write_Eol; + Write_Spaces (Offs); + else + Write_Char (Txt (J)); + end if; + end loop; - return; + return; - -- Line does not fit + -- Line does not fit - else - Start := Ptr; + else + Start := Ptr; - -- First scan forward looking for a hard end of line + -- First scan forward looking for a hard end of line - for Scan in Ptr .. Ptr + Max - 1 loop - if Txt (Scan) = ASCII.LF then - Split := Scan - 1; - Ptr := Scan + 1; - goto Continue; - end if; - end loop; + for Scan in Ptr .. Ptr + Max - 1 loop + if Txt (Scan) = ASCII.LF then + Split := Scan - 1; + Ptr := Scan + 1; + goto Continue; + end if; + end loop; - -- Otherwise scan backwards looking for a space + -- Otherwise scan backwards looking for a space - for Scan in reverse Ptr .. Ptr + Max - 1 loop - if Txt (Scan) = ' ' then - Split := Scan - 1; - Ptr := Scan + 1; - goto Continue; - end if; - end loop; + for Scan in reverse Ptr .. Ptr + Max - 1 loop + if Txt (Scan) = ' ' then + Split := Scan - 1; + Ptr := Scan + 1; + goto Continue; + end if; + end loop; - -- If we fall through, no space, so split line arbitrarily + -- If we fall through, no space, so split line arbitrarily - Split := Ptr + Max - 1; - Ptr := Split + 1; - end if; + Split := Ptr + Max - 1; + Ptr := Split + 1; + end if; - <<Continue>> - if Start <= Split then - Write_Line (Txt (Start .. Split)); - Write_Spaces (Offs); - end if; + <<Continue>> + if Start <= Split then + Write_Line (Txt (Start .. Split)); + Write_Spaces (Offs); + end if; - Max := Integer (Length - Column + 1); - end loop; - end; + Max := Integer (Length - Column + 1); + end loop; end Output_Msg_Text; --------------------- diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads index ff73fc4..3b34753 100644 --- a/gcc/ada/erroutc.ads +++ b/gcc/ada/erroutc.ads @@ -612,7 +612,7 @@ package Erroutc is function Warning_Treated_As_Error (Msg : String) return Boolean; -- Returns True if the warning message Msg matches any of the strings -- given by Warning_As_Error pragmas, as stored in the Warnings_As_Errors - -- table by Set_Warning_As_Error. + -- table. type Error_Msg_Proc is access procedure (Msg : String; Flag_Location : Source_Ptr); diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 6a756fd..7f11b41 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -5233,6 +5233,12 @@ package body Exp_Aggr is Value : Uint; begin + -- Back end doesn't know about <> + + if Has_Default_Init_Comps (N) then + return False; + end if; + -- Recurse as far as possible to find the innermost component type Ctyp := Etype (N); @@ -6292,9 +6298,7 @@ package body Exp_Aggr is -- previously excluded controlled components but this is an old -- oversight: the rules in 7.6 (17) are clear. - if (not Has_Default_Init_Comps (N) - or else Is_Limited_Type (Etype (N))) - and then Comes_From_Source (Parent_Node) + if Comes_From_Source (Parent_Node) and then Parent_Kind = N_Object_Declaration and then Present (Expression (Parent_Node)) and then not @@ -7478,6 +7482,12 @@ package body Exp_Aggr is return; end if; + -- If the pramga Aggregate_Individually_Assign is set, always convert to + -- assignments. + + if Aggregate_Individually_Assign then + Convert_To_Assignments (N, Typ); + -- Ada 2005 (AI-318-2): We need to convert to assignments if components -- are build-in-place function calls. The assignments will each turn -- into a build-in-place function call. If components are all static, @@ -7486,7 +7496,7 @@ package body Exp_Aggr is -- Extension aggregates, aggregates in extended return statements, and -- aggregates for C++ imported types must be expanded. - if Ada_Version >= Ada_2005 and then Is_Limited_View (Typ) then + elsif Ada_Version >= Ada_2005 and then Is_Limited_View (Typ) then if not Nkind_In (Parent (N), N_Component_Association, N_Object_Declaration) then diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 306c1b5..c7d1647 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -1436,6 +1436,25 @@ package body Exp_Attr is Insert_Action (Loop_Stmt, Func_Decl); Pop_Scope; + -- The analysis of the condition may have generated itypes + -- that are now used within the function: Adjust their + -- scopes accordingly so that their use appears in their + -- scope of definition. + + declare + Ityp : Entity_Id; + + begin + Ityp := First_Entity (Loop_Id); + + while Present (Ityp) loop + if Is_Itype (Ityp) then + Set_Scope (Ityp, Func_Id); + end if; + Next_Entity (Ityp); + end loop; + end; + -- Transform the original while loop into an infinite loop -- where the last statement checks the negated condition. This -- placement ensures that the condition will not be evaluated diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb index 29d8718..d45cb45 100644 --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp_ch11.adb @@ -63,10 +63,9 @@ package body Exp_Ch11 is -- N is the node on which the warning is placed. procedure Warn_If_No_Propagation (N : Node_Id); - -- Called for an exception raise that is not a local raise (and thus - -- cannot be optimized to a goto). Issues warning if - -- No_Exception_Propagation restriction is set. - -- N is the node for the raise or equivalent call. + -- Called for an exception raise that is not a local raise (and thus cannot + -- be optimized to a goto). Issues warning if No_Exception_Propagation + -- restriction is set. N is the node for the raise or equivalent call. --------------------------- -- Expand_At_End_Handler -- diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb index f3c2c01..f3da4ee 100644 --- a/gcc/ada/exp_ch13.adb +++ b/gcc/ada/exp_ch13.adb @@ -220,9 +220,9 @@ package body Exp_Ch13 is -- task_typeZ := expression if Ekind (Ent) = E_Task_Type then + declare Assign : Node_Id; - begin Assign := Make_Assignment_Statement (Loc, @@ -261,15 +261,35 @@ package body Exp_Ch13 is Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (Ent), 'V')); - -- Insert the declaration of the object - - Insert_Action (N, - Make_Object_Declaration (Loc, - Defining_Identifier => V, - Object_Definition => - New_Occurrence_Of (RTE (RE_Storage_Offset), Loc), - Expression => - Convert_To (RTE (RE_Storage_Offset), Expression (N)))); + -- Insert the declaration of the object. If the expression + -- is not static it may depend on some other type that is + -- not frozen yet, so attach the declaration that captures + -- the value of the expression to the actions of the freeze + -- node of the current type. + + declare + Decl : constant Node_Id := + Make_Object_Declaration (Loc, + Defining_Identifier => V, + Object_Definition => + New_Occurrence_Of (RTE (RE_Storage_Offset), Loc), + Expression => + Convert_To + (RTE (RE_Storage_Offset), Expression (N))); + begin + if not Is_OK_Static_Expression (Expression (N)) + and then Present (Freeze_Node (Ent)) + then + if No (Actions (Freeze_Node (Ent))) then + Set_Actions (Freeze_Node (Ent), New_List (Decl)); + else + Append (Decl, Actions (Freeze_Node (Ent))); + end if; + + else + Insert_Action (N, Decl); + end if; + end; Set_Storage_Size_Variable (Ent, Entity_Id (V)); end if; diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 1901ea5..8763600 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -5518,7 +5518,14 @@ package body Exp_Ch3 is -- Note: This code covers access-to-limited-interfaces because they -- can be used to reference tasks implementing them. - elsif Is_Limited_Class_Wide_Type (Desig_Typ) + -- Suppress the master creation for access types created for entry + -- formal parameters (parameter block component types). Seems like + -- suppression should be more general for compiler-generated types, + -- but testing Comes_From_Source, like the code above does, may be + -- too general in this case (affects some test output)??? + + elsif not Is_Param_Block_Component_Type (Ptr_Typ) + and then Is_Limited_Class_Wide_Type (Desig_Typ) and then Tasking_Allowed then Build_Class_Wide_Master (Ptr_Typ); diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads index 6ae0db7..197c053 100644 --- a/gcc/ada/exp_ch3.ads +++ b/gcc/ada/exp_ch3.ads @@ -102,10 +102,10 @@ package Exp_Ch3 is (Typ : Entity_Id; N : Node_Id; Size : Uint := No_Uint) return Node_Id; - -- Build an expression which represents the required initial value of type + -- Build an expression that represents the required initial value of type -- Typ for which predicate Needs_Simple_Initialization is True. N is a node - -- whose source location used in the construction of the expression. Size - -- is utilized as follows: + -- whose source location is used in the construction of the expression. + -- Size is used as follows: -- -- * If the size of the object to be initialized it is known, it should -- be passed to the routine. @@ -115,7 +115,7 @@ package Exp_Ch3 is -- -- The object size is needed to prepare a known invalid value for use by -- Normalize_Scalars. A call to this routine where Typ denotes a scalar - -- type is only valid when Normalize_Scalars or Initialize_Scalars is + -- type is valid only when Normalize_Scalars or Initialize_Scalars is -- active, or if N is the node for a 'Invalid_Value attribute node. procedure Init_Secondary_Tags diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 00f9aae..c288d6a 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -1852,7 +1852,7 @@ package body Exp_Ch4 is Statements => New_List (Loop_Stm))); -- If no separate indexes, return loop statement with explicit - -- iteration scheme on its own + -- iteration scheme on its own. else Loop_Stm := @@ -2014,7 +2014,7 @@ package body Exp_Ch4 is -- If the array type is distinct from the type of the arguments, it -- is the full view of a private type. Apply an unchecked conversion - -- to insure that analysis of the call succeeds. + -- to ensure that analysis of the call succeeds. declare L, R : Node_Id; @@ -2757,7 +2757,7 @@ package body Exp_Ch4 is -- The J'th entry in an expression node that represents the total length -- of operands 1 through J. It is either an integer literal node, or a -- reference to a constant entity with the right value, so it is fine - -- to just do a Copy_Node to get an appropriate copy. The extra zero'th + -- to just do a Copy_Node to get an appropriate copy. The extra zeroth -- entry always is set to zero. The length is of type Artyp. Low_Bound : Node_Id; @@ -4254,7 +4254,7 @@ package body Exp_Ch4 is -- 'Last - First (instead of 'Length) because for large arrays computing -- 'Last -'First + 1 causes overflow. This is done without using the -- attribute 'Size_In_Storage_Elements (which malfunctions for large - -- sizes ???) + -- sizes ???). ------------------------- -- Rewrite_Coextension -- @@ -4333,7 +4333,7 @@ package body Exp_Ch4 is -- to compute 'Length since for large arrays 'Last -'First + 1 -- causes overflow; therefore we compute 'Last - 'First (which -- is not the exact number of components but it is valid for - -- the purpose of this runtime check on 32-bit targets) + -- the purpose of this runtime check on 32-bit targets). else declare @@ -4371,7 +4371,7 @@ package body Exp_Ch4 is (Make_Integer_Literal (Loc, J))))); -- Handle superflat arrays, i.e. arrays with such bounds - -- as 4 .. 2, to insure that the result is correct. + -- as 4 .. 2, to ensure that the result is correct. -- Generate: -- (if X'Last > X'First then X'Last - X'First else 0) @@ -4421,7 +4421,7 @@ package body Exp_Ch4 is begin -- Warn on the presence of an allocator of an anonymous access type when - -- enabled except when its an object declaration at library level. + -- enabled, except when it's an object declaration at library level. if Warn_On_Anonymous_Allocators and then Ekind (PtrT) = E_Anonymous_Access_Type @@ -4643,7 +4643,7 @@ package body Exp_Ch4 is -- The check on No_Initialization is used here to prevent generating -- this runtime check twice when the allocator is locally replaced by - -- the expander by another one. + -- the expander with another one. if Is_Array_Type (Etyp) and then not No_Initialization (N) then declare @@ -4683,11 +4683,11 @@ package body Exp_Ch4 is if Is_Constrained (Siz_Typ) and then Ekind (Siz_Typ) /= E_String_Literal_Subtype then - -- For CCG targets the largest array may have up to 2**31-1 - -- components (i.e. 2 Gigabytes if each array component is - -- 1-byte). This insures that fat pointer fields do not + -- For CCG targets, the largest array may have up to 2**31-1 + -- components (i.e. 2 gigabytes if each array component is + -- one byte). This ensures that fat pointer fields do not -- overflow, since they are 32-bit integer types, and also - -- insures that 'Length can be computed at run time. + -- ensures that 'Length can be computed at run time. if Modify_Tree_For_C then Cond := @@ -11310,7 +11310,7 @@ package body Exp_Ch4 is end if; -- Nothing to do if expression was rewritten into a float-to-float - -- conversion, since this kind of conversions is handled elsewhere. + -- conversion, since this kind of conversion is handled elsewhere. if Is_Floating_Point_Type (Etype (Expr)) and then Is_Floating_Point_Type (Target_Type) diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 682c855..ba0b793 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -114,6 +114,28 @@ package body Exp_Ch5 is -- Auxiliary declarations are inserted before node N using the standard -- Insert_Actions mechanism. + function Expand_Assign_Array_Bitfield + (N : Node_Id; + Larray : Entity_Id; + Rarray : Entity_Id; + L_Type : Entity_Id; + R_Type : Entity_Id; + Rev : Boolean) return Node_Id; + -- Alternative to Expand_Assign_Array_Loop for packed bitfields. Generates + -- a call to the System.Bitfields.Copy_Bitfield, which is more efficient + -- than copying component-by-component. + + function Expand_Assign_Array_Loop_Or_Bitfield + (N : Node_Id; + Larray : Entity_Id; + Rarray : Entity_Id; + L_Type : Entity_Id; + R_Type : Entity_Id; + Ndim : Pos; + Rev : Boolean) return Node_Id; + -- Calls either Expand_Assign_Array_Loop or Expand_Assign_Array_Bitfield as + -- appropriate. + procedure Expand_Assign_Record (N : Node_Id); -- N is an assignment of an untagged record value. This routine handles -- the case where the assignment must be made component by component, @@ -314,6 +336,10 @@ package body Exp_Ch5 is Crep : constant Boolean := Change_Of_Representation (N); + pragma Assert + (Crep + or else Is_Bit_Packed_Array (L_Type) = Is_Bit_Packed_Array (R_Type)); + Larray : Node_Id; Rarray : Node_Id; @@ -939,7 +965,7 @@ package body Exp_Ch5 is else Rewrite (N, - Expand_Assign_Array_Loop + Expand_Assign_Array_Loop_Or_Bitfield (N, Larray, Rarray, L_Type, R_Type, Ndim, Rev => not Forwards_OK (N))); end if; @@ -1092,12 +1118,12 @@ package body Exp_Ch5 is Condition => Condition, Then_Statements => New_List ( - Expand_Assign_Array_Loop + Expand_Assign_Array_Loop_Or_Bitfield (N, Larray, Rarray, L_Type, R_Type, Ndim, Rev => False)), Else_Statements => New_List ( - Expand_Assign_Array_Loop + Expand_Assign_Array_Loop_Or_Bitfield (N, Larray, Rarray, L_Type, R_Type, Ndim, Rev => True)))); end if; @@ -1320,6 +1346,134 @@ package body Exp_Ch5 is return Assign; end Expand_Assign_Array_Loop; + ---------------------------------- + -- Expand_Assign_Array_Bitfield -- + ---------------------------------- + + function Expand_Assign_Array_Bitfield + (N : Node_Id; + Larray : Entity_Id; + Rarray : Entity_Id; + L_Type : Entity_Id; + R_Type : Entity_Id; + Rev : Boolean) return Node_Id + is + pragma Assert (not Rev); + -- Reverse copying is not yet supported by Copy_Bitfield. + + pragma Assert (not Change_Of_Representation (N)); + -- This won't work, for example, to copy a packed array to an unpacked + -- array. + + Loc : constant Source_Ptr := Sloc (N); + + L_Index_Typ : constant Node_Id := Etype (First_Index (L_Type)); + R_Index_Typ : constant Node_Id := Etype (First_Index (R_Type)); + Left_Lo : constant Node_Id := Type_Low_Bound (L_Index_Typ); + Right_Lo : constant Node_Id := Type_Low_Bound (R_Index_Typ); + + L_Addr : constant Node_Id := + Make_Attribute_Reference (Loc, + Prefix => + Make_Indexed_Component (Loc, + Prefix => + Duplicate_Subexpr (Larray, True), + Expressions => New_List (New_Copy_Tree (Left_Lo))), + Attribute_Name => Name_Address); + + L_Bit : constant Node_Id := + Make_Attribute_Reference (Loc, + Prefix => + Make_Indexed_Component (Loc, + Prefix => + Duplicate_Subexpr (Larray, True), + Expressions => New_List (New_Copy_Tree (Left_Lo))), + Attribute_Name => Name_Bit); + + R_Addr : constant Node_Id := + Make_Attribute_Reference (Loc, + Prefix => + Make_Indexed_Component (Loc, + Prefix => + Duplicate_Subexpr (Rarray, True), + Expressions => New_List (New_Copy_Tree (Right_Lo))), + Attribute_Name => Name_Address); + + R_Bit : constant Node_Id := + Make_Attribute_Reference (Loc, + Prefix => + Make_Indexed_Component (Loc, + Prefix => + Duplicate_Subexpr (Rarray, True), + Expressions => New_List (New_Copy_Tree (Right_Lo))), + Attribute_Name => Name_Bit); + + -- Compute the Size of the bitfield. ???We can't use Size here, because + -- it doesn't work properly for slices of packed arrays, so we compute + -- the L'Size as L'Length*L'Component_Size. + -- + -- Note that the length check has already been done, so we can use the + -- size of either L or R. + + Size : constant Node_Id := + Make_Op_Multiply (Loc, + Make_Attribute_Reference (Loc, + Prefix => + Duplicate_Subexpr (Name (N), True), + Attribute_Name => Name_Length), + Make_Attribute_Reference (Loc, + Prefix => + Duplicate_Subexpr (Name (N), True), + Attribute_Name => Name_Component_Size)); + + begin + return Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (RTE (RE_Copy_Bitfield), Loc), + Parameter_Associations => New_List ( + R_Addr, R_Bit, L_Addr, L_Bit, Size)); + end Expand_Assign_Array_Bitfield; + + ------------------------------------------ + -- Expand_Assign_Array_Loop_Or_Bitfield -- + ------------------------------------------ + + function Expand_Assign_Array_Loop_Or_Bitfield + (N : Node_Id; + Larray : Entity_Id; + Rarray : Entity_Id; + L_Type : Entity_Id; + R_Type : Entity_Id; + Ndim : Pos; + Rev : Boolean) return Node_Id + is + Slices : constant Boolean := + Nkind (Name (N)) = N_Slice or else Nkind (Expression (N)) = N_Slice; + begin + -- Determine whether Copy_Bitfield is appropriate (will work, and will + -- be more efficient than component-by-component copy). Copy_Bitfield + -- doesn't work for reversed storage orders. It is efficient only for + -- slices of bit-packed arrays. + + -- Note that Expand_Assign_Array_Bitfield is disabled for now + + if False -- ??? + and then Is_Bit_Packed_Array (L_Type) + and then Is_Bit_Packed_Array (R_Type) + and then RTE_Available (RE_Copy_Bitfield) + and then not Reverse_Storage_Order (L_Type) + and then not Reverse_Storage_Order (R_Type) + and then Ndim = 1 + and then not Rev + and then Slices + then + return Expand_Assign_Array_Bitfield + (N, Larray, Rarray, L_Type, R_Type, Rev); + else + return Expand_Assign_Array_Loop + (N, Larray, Rarray, L_Type, R_Type, Ndim, Rev); + end if; + end Expand_Assign_Array_Loop_Or_Bitfield; + -------------------------- -- Expand_Assign_Record -- -------------------------- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index c182072..e3109c2 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5199,7 +5199,7 @@ package body Exp_Ch6 is end if; -- When the function's subtype is unconstrained, a run-time - -- test is needed to determine the form of allocation to use + -- test may be needed to decide the form of allocation to use -- for the return object. The function has an implicit formal -- parameter indicating this. If the BIP_Alloc_Form formal has -- the value one, then the caller has passed access to an @@ -5235,13 +5235,6 @@ package body Exp_Ch6 is SS_Allocator : Node_Id; begin - -- Reuse the itype created for the function's implicit - -- access formal. This avoids the need to create a new - -- access type here, plus it allows assigning the access - -- formal directly without applying a conversion. - - -- Ref_Type := Etype (Object_Access); - -- Create an access type designating the function's -- result subtype. @@ -5572,6 +5565,64 @@ package body Exp_Ch6 is Obj_Acc_Formal := Alloc_Obj_Id; end; + + -- When the function's subtype is unconstrained and a run-time + -- test is not needed, we nevertheless need to build the return + -- using the function's result subtype. + + elsif not Is_Constrained (Underlying_Type (Etype (Func_Id))) + then + declare + Alloc_Obj_Id : Entity_Id; + Alloc_Obj_Decl : Node_Id; + Ptr_Type_Decl : Node_Id; + Ref_Type : Entity_Id; + + begin + -- Create an access type designating the function's + -- result subtype. + + Ref_Type := Make_Temporary (Loc, 'A'); + + Ptr_Type_Decl := + Make_Full_Type_Declaration (Loc, + Defining_Identifier => Ref_Type, + Type_Definition => + Make_Access_To_Object_Definition (Loc, + All_Present => True, + Subtype_Indication => + New_Occurrence_Of (Ret_Obj_Typ, Loc))); + + Insert_Before (Ret_Obj_Decl, Ptr_Type_Decl); + + -- Create an access object initialized to the conversion + -- of the implicit access value passed in by the caller. + + Alloc_Obj_Id := Make_Temporary (Loc, 'R'); + Set_Etype (Alloc_Obj_Id, Ref_Type); + + -- See the ??? comment a few lines above about the use of + -- an unchecked conversion here. + + Alloc_Obj_Decl := + Make_Object_Declaration (Loc, + Defining_Identifier => Alloc_Obj_Id, + Object_Definition => + New_Occurrence_Of (Ref_Type, Loc), + Expression => + Make_Unchecked_Type_Conversion (Loc, + Subtype_Mark => + New_Occurrence_Of (Ref_Type, Loc), + Expression => + New_Occurrence_Of (Obj_Acc_Formal, Loc))); + + Insert_Before (Ret_Obj_Decl, Alloc_Obj_Decl); + + -- Remember the local access object for use in the + -- dereference of the renaming created below. + + Obj_Acc_Formal := Alloc_Obj_Id; + end; end if; -- Replace the return object declaration with a renaming of a @@ -8108,13 +8159,41 @@ package body Exp_Ch6 is -- since it is already attached on the related finalization master. -- Here and in related routines, we must examine the full view of the - -- type, because the view at the point of call may differ from that - -- that in the function body, and the expansion mechanism depends on + -- type, because the view at the point of call may differ from the + -- one in the function body, and the expansion mechanism depends on -- the characteristics of the full view. - if Is_Constrained (Underlying_Type (Result_Subt)) - and then not Needs_Finalization (Underlying_Type (Result_Subt)) - then + if Needs_BIP_Alloc_Form (Function_Id) then + Temp_Init := Empty; + + -- Case of a user-defined storage pool. Pass an allocation parameter + -- indicating that the function should allocate its result in the + -- pool, and pass the pool. Use 'Unrestricted_Access because the + -- pool may not be aliased. + + if Present (Associated_Storage_Pool (Acc_Type)) then + Alloc_Form := User_Storage_Pool; + Pool := + Make_Attribute_Reference (Loc, + Prefix => + New_Occurrence_Of + (Associated_Storage_Pool (Acc_Type), Loc), + Attribute_Name => Name_Unrestricted_Access); + + -- No user-defined pool; pass an allocation parameter indicating that + -- the function should allocate its result on the heap. + + else + Alloc_Form := Global_Heap; + Pool := Make_Null (No_Location); + end if; + + -- The caller does not provide the return object in this case, so we + -- have to pass null for the object access actual. + + Return_Obj_Actual := Empty; + + else -- Replace the initialized allocator of form "new T'(Func (...))" -- with an uninitialized allocator of form "new T", where T is the -- result subtype of the called function. The call to the function @@ -8163,35 +8242,6 @@ package body Exp_Ch6 is -- perform the allocation of the return object, so we pass parameters -- indicating that. - else - Temp_Init := Empty; - - -- Case of a user-defined storage pool. Pass an allocation parameter - -- indicating that the function should allocate its result in the - -- pool, and pass the pool. Use 'Unrestricted_Access because the - -- pool may not be aliased. - - if Present (Associated_Storage_Pool (Acc_Type)) then - Alloc_Form := User_Storage_Pool; - Pool := - Make_Attribute_Reference (Loc, - Prefix => - New_Occurrence_Of - (Associated_Storage_Pool (Acc_Type), Loc), - Attribute_Name => Name_Unrestricted_Access); - - -- No user-defined pool; pass an allocation parameter indicating that - -- the function should allocate its result on the heap. - - else - Alloc_Form := Global_Heap; - Pool := Make_Null (No_Location); - end if; - - -- The caller does not provide the return object in this case, so we - -- have to pass null for the object access actual. - - Return_Obj_Actual := Empty; end if; -- Declare the temp object @@ -9279,30 +9329,8 @@ package body Exp_Ch6 is function Needs_BIP_Alloc_Form (Func_Id : Entity_Id) return Boolean is pragma Assert (Is_Build_In_Place_Function (Func_Id)); Func_Typ : constant Entity_Id := Underlying_Type (Etype (Func_Id)); - begin - -- A build-in-place function needs to know which allocation form to - -- use when: - -- - -- 1) The result subtype is unconstrained. In this case, depending on - -- the context of the call, the object may need to be created in the - -- secondary stack, the heap, or a user-defined storage pool. - -- - -- 2) The result subtype is tagged. In this case the function call may - -- dispatch on result and thus needs to be treated in the same way as - -- calls to functions with class-wide results, because a callee that - -- can be dispatched to may have any of various result subtypes, so - -- if any of the possible callees would require an allocation form to - -- be passed then they all do. - -- - -- 3) The result subtype needs finalization actions. In this case, based - -- on the context of the call, the object may need to be created at - -- the caller site, in the heap, or in a user-defined storage pool. - - return - not Is_Constrained (Func_Typ) - or else Is_Tagged_Type (Func_Typ) - or else Needs_Finalization (Func_Typ); + return Requires_Transient_Scope (Func_Typ); end Needs_BIP_Alloc_Form; -------------------------------------- diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 35fc484..640d205 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -728,23 +728,25 @@ package body Exp_Disp is -- corresponding actuals in the call, given that this check is -- performed outside of the body of the subprogram. + -- If the dispatching call appears in the same scope as the + -- declaration of the dispatching subprogram (for example in + -- the expression of a local expression function), the spec + -- has not been analyzed yet, in which case we use the Chars + -- field to recognize intended occurrences of the formals. + --------------------- -- Replace_Formals -- --------------------- function Replace_Formals (N : Node_Id) return Traverse_Result is + A : Node_Id; + F : Entity_Id; begin - if Is_Entity_Name (N) - and then Present (Entity (N)) - and then Is_Formal (Entity (N)) - then - declare - A : Node_Id; - F : Entity_Id; + if Is_Entity_Name (N) then + F := First_Formal (Subp); + A := First_Actual (Call_Node); - begin - F := First_Formal (Subp); - A := First_Actual (Call_Node); + if Present (Entity (N)) and then Is_Formal (Entity (N)) then while Present (F) loop if F = Entity (N) then Rewrite (N, New_Copy_Tree (A)); @@ -776,7 +778,25 @@ package body Exp_Disp is Next_Formal (F); Next_Actual (A); end loop; - end; + + -- If the node is not analyzed, recognize occurrences of a + -- formal by name, as would be done when resolving the aspect + -- expression in the context of the subprogram. + + elsif not Analyzed (N) + and then Nkind (N) = N_Identifier + and then No (Entity (N)) + then + while Present (F) loop + if Chars (N) = Chars (F) then + Rewrite (N, New_Copy_Tree (A)); + return Skip; + end if; + + Next_Formal (F); + Next_Actual (A); + end loop; + end if; end if; return OK; diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb index ea1381c..e64babe 100644 --- a/gcc/ada/exp_spark.adb +++ b/gcc/ada/exp_spark.adb @@ -59,9 +59,6 @@ package body Exp_SPARK is procedure Expand_SPARK_N_Freeze_Type (E : Entity_Id); -- Build the DIC procedure of a type when needed, if not already done - procedure Expand_SPARK_N_Indexed_Component (N : Node_Id); - -- Insert explicit dereference if required - procedure Expand_SPARK_N_Loop_Statement (N : Node_Id); -- Perform loop statement-specific expansion @@ -77,6 +74,9 @@ package body Exp_SPARK is procedure Expand_SPARK_N_Selected_Component (N : Node_Id); -- Insert explicit dereference if required + procedure Expand_SPARK_N_Slice_Or_Indexed_Component (N : Node_Id); + -- Insert explicit dereference if required + ------------------ -- Expand_SPARK -- ------------------ @@ -138,8 +138,10 @@ package body Exp_SPARK is Expand_SPARK_N_Freeze_Type (Entity (N)); end if; - when N_Indexed_Component => - Expand_SPARK_N_Indexed_Component (N); + when N_Indexed_Component + | N_Slice + => + Expand_SPARK_N_Slice_Or_Indexed_Component (N); when N_Selected_Component => Expand_SPARK_N_Selected_Component (N); @@ -326,21 +328,6 @@ package body Exp_SPARK is end if; end Expand_SPARK_N_Loop_Statement; - -------------------------------------- - -- Expand_SPARK_N_Indexed_Component -- - -------------------------------------- - - procedure Expand_SPARK_N_Indexed_Component (N : Node_Id) is - Pref : constant Node_Id := Prefix (N); - Typ : constant Entity_Id := Etype (Pref); - - begin - if Is_Access_Type (Typ) then - Insert_Explicit_Dereference (Pref); - Analyze_And_Resolve (Pref, Designated_Type (Typ)); - end if; - end Expand_SPARK_N_Indexed_Component; - --------------------------------------- -- Expand_SPARK_N_Object_Declaration -- --------------------------------------- @@ -552,4 +539,19 @@ package body Exp_SPARK is end if; end Expand_SPARK_N_Selected_Component; + ----------------------------------------------- + -- Expand_SPARK_N_Slice_Or_Indexed_Component -- + ----------------------------------------------- + + procedure Expand_SPARK_N_Slice_Or_Indexed_Component (N : Node_Id) is + Pref : constant Node_Id := Prefix (N); + Typ : constant Entity_Id := Etype (Pref); + + begin + if Is_Access_Type (Typ) then + Insert_Explicit_Dereference (Pref); + Analyze_And_Resolve (Pref, Designated_Type (Typ)); + end if; + end Expand_SPARK_N_Slice_Or_Indexed_Component; + end Exp_SPARK; diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index f146a6f..7cc9a6a4 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -53,13 +53,17 @@ package body Exp_Unst is -- Local Subprograms -- ----------------------- - procedure Unnest_Subprogram (Subp : Entity_Id; Subp_Body : Node_Id); + procedure Unnest_Subprogram + (Subp : Entity_Id; Subp_Body : Node_Id; For_Inline : Boolean := False); -- Subp is a library-level subprogram which has nested subprograms, and -- Subp_Body is the corresponding N_Subprogram_Body node. This procedure -- declares the AREC types and objects, adds assignments to the AREC record -- as required, defines the xxxPTR types for uplevel referenced objects, -- adds the ARECP parameter to all nested subprograms which need it, and - -- modifies all uplevel references appropriately. + -- modifies all uplevel references appropriately. If For_Inline is True, + -- we're unnesting this subprogram because it's on the list of inlined + -- subprograms and should unnest it despite it not being part of the main + -- unit. ----------- -- Calls -- @@ -297,7 +301,8 @@ package body Exp_Unst is -- Unnest_Subprogram -- ----------------------- - procedure Unnest_Subprogram (Subp : Entity_Id; Subp_Body : Node_Id) is + procedure Unnest_Subprogram + (Subp : Entity_Id; Subp_Body : Node_Id; For_Inline : Boolean := False) is function AREC_Name (J : Pos; S : String) return Name_Id; -- Returns name for string ARECjS, where j is the decimal value of j @@ -402,15 +407,18 @@ package body Exp_Unst is -- to determine whether the main unit is generic (the scope stack is not -- present when this is called on the main unit). - if Ekind (Cunit_Entity (Main_Unit)) = E_Package_Body + if not For_Inline + and then Ekind (Cunit_Entity (Main_Unit)) = E_Package_Body and then Is_Generic_Unit (Spec_Entity (Cunit_Entity (Main_Unit))) then return; - end if; - -- Only unnest when generating code for the main source unit + -- Only unnest when generating code for the main source unit or if we're + -- unnesting for inline. - if not In_Extended_Main_Code_Unit (Subp_Body) then + elsif not For_Inline + and then not In_Extended_Main_Code_Unit (Subp_Body) + then return; end if; @@ -2549,6 +2557,9 @@ package body Exp_Unst is return OK; end Search_Subprograms; + Subp : Entity_Id; + Subp_Body : Node_Id; + -- Start of processing for Unnest_Subprograms begin @@ -2568,6 +2579,24 @@ package body Exp_Unst is end if; Do_Search (N); + + -- Unnest any subprograms passed on the list of inlined subprograms + + Subp := First_Inlined_Subprogram (N); + + while Present (Subp) loop + Subp_Body := Parent (Declaration_Node (Subp)); + + if Nkind (Subp_Body) = N_Subprogram_Declaration + and then Present (Corresponding_Body (Subp_Body)) + then + Subp_Body := Parent (Declaration_Node + (Corresponding_Body (Subp_Body))); + Unnest_Subprogram (Subp, Subp_Body, For_Inline => True); + end if; + + Next_Inlined_Subprogram (Subp); + end loop; end Unnest_Subprograms; end Exp_Unst; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 41708c3..c3c5e79 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1977,6 +1977,7 @@ package body Exp_Util is Set_Scope (Obj_Id, Proc_Id); Set_First_Entity (Proc_Id, Obj_Id); + Set_Last_Entity (Proc_Id, Obj_Id); -- Generate: -- procedure <Work_Typ>DIC (_object : <Work_Typ>); @@ -4608,7 +4609,7 @@ package body Exp_Util is begin pragma Assert (Is_Concurrent_Type (Typ)); - if Ekind (Typ) in Protected_Kind then + if Is_Protected_Type (Typ) then if Has_Entries (Typ) -- A protected type without entries that covers an interface and @@ -5346,6 +5347,7 @@ package body Exp_Util is ---------------------- function Finalize_Address (Typ : Entity_Id) return Entity_Id is + Btyp : constant Entity_Id := Base_Type (Typ); Utyp : Entity_Id := Typ; begin @@ -5385,12 +5387,12 @@ package body Exp_Util is -- records do not automatically inherit operations, but maybe they -- should???) - if Is_Untagged_Derivation (Typ) then - if Is_Protected_Type (Typ) then - Utyp := Corresponding_Record_Type (Root_Type (Base_Type (Typ))); + if Is_Untagged_Derivation (Btyp) then + if Is_Protected_Type (Btyp) then + Utyp := Corresponding_Record_Type (Root_Type (Btyp)); else - Utyp := Underlying_Type (Root_Type (Base_Type (Typ))); + Utyp := Underlying_Type (Root_Type (Btyp)); if Is_Protected_Type (Utyp) then Utyp := Corresponding_Record_Type (Utyp); diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 70f4b9d..bb17e42 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -1771,6 +1771,7 @@ package body Freeze is New_N := Make_Object_Declaration (Loc, Defining_Identifier => Temp, + Constant_Present => True, Object_Definition => New_Occurrence_Of (Typ, Loc), Expression => Relocate_Node (N)); Insert_Before (Par, New_N); diff --git a/gcc/ada/gcc-interface/lang.opt b/gcc/ada/gcc-interface/lang.opt index 4295651..6691136 100644 --- a/gcc/ada/gcc-interface/lang.opt +++ b/gcc/ada/gcc-interface/lang.opt @@ -58,7 +58,7 @@ Enable most warning messages. fdump-scos Ada RejectNegative Var(flag_dump_scos) Init(0) -Dump Source Coverage Obligations +Dump Source Coverage Obligations. k8 Driver diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index d53374e..c5822f6 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -1136,7 +1136,7 @@ default_pass_by_ref (tree gnu_type) TYPE_ALIGN (gnu_type)) > 0)) return true; - if (pass_by_reference (NULL, TYPE_MODE (gnu_type), gnu_type, true)) + if (pass_by_reference (NULL, function_arg_info (gnu_type, /*named=*/true))) return true; if (targetm.calls.return_in_memory (gnu_type, NULL_TREE)) diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index be31ed8..d5aa396 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -107,6 +107,7 @@ Implementation Defined Pragmas * Pragma Ada_2005:: * Pragma Ada_12:: * Pragma Ada_2012:: +* Pragma Aggregate_Individually_Assign:: * Pragma Allow_Integer_Address:: * Pragma Annotate:: * Pragma Assert:: @@ -1184,6 +1185,7 @@ consideration, the use of these pragmas should be minimized. * Pragma Ada_2005:: * Pragma Ada_12:: * Pragma Ada_2012:: +* Pragma Aggregate_Individually_Assign:: * Pragma Allow_Integer_Address:: * Pragma Annotate:: * Pragma Assert:: @@ -1737,7 +1739,7 @@ extra subprograms marked this way from generating ambiguities in otherwise legal pre-Ada_2012 programs. The one argument form is intended for exclusive use in the GNAT run-time library. -@node Pragma Ada_2012,Pragma Allow_Integer_Address,Pragma Ada_12,Implementation Defined Pragmas +@node Pragma Ada_2012,Pragma Aggregate_Individually_Assign,Pragma Ada_12,Implementation Defined Pragmas @anchor{gnat_rm/implementation_defined_pragmas pragma-ada-2012}@anchor{27} @section Pragma Ada_2012 @@ -1751,8 +1753,24 @@ pragma Ada_2012; This configuration pragma is a synonym for pragma Ada_12 and has the same syntax and effect. -@node Pragma Allow_Integer_Address,Pragma Annotate,Pragma Ada_2012,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-allow-integer-address}@anchor{28} +@node Pragma Aggregate_Individually_Assign,Pragma Allow_Integer_Address,Pragma Ada_2012,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-aggregate-individually-assign}@anchor{28} +@section Pragma Aggregate_Individually_Assign + + +Syntax: + +@example +pragma Aggregate_Individually_Assign; +@end example + +Where possible, GNAT will store the binary representation of a record aggregate +in memory for space and performance reasons. This configuration pragma changes +this behavior so that record aggregates are instead always converted into +individual assignment statements. + +@node Pragma Allow_Integer_Address,Pragma Annotate,Pragma Aggregate_Individually_Assign,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-allow-integer-address}@anchor{29} @section Pragma Allow_Integer_Address @@ -1802,7 +1820,7 @@ rather than rejected to allow common sets of sources to be used in the two situations. @node Pragma Annotate,Pragma Assert,Pragma Allow_Integer_Address,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-annotate}@anchor{29}@anchor{gnat_rm/implementation_defined_pragmas id3}@anchor{2a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-annotate}@anchor{2a}@anchor{gnat_rm/implementation_defined_pragmas id3}@anchor{2b} @section Pragma Annotate @@ -1836,7 +1854,7 @@ affect the compilation process in any way. This pragma may be used as a configuration pragma. @node Pragma Assert,Pragma Assert_And_Cut,Pragma Annotate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assert}@anchor{2b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assert}@anchor{2c} @section Pragma Assert @@ -1902,7 +1920,7 @@ of Ada, and the DISABLE policy is an implementation-defined addition. @node Pragma Assert_And_Cut,Pragma Assertion_Policy,Pragma Assert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assert-and-cut}@anchor{2c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assert-and-cut}@anchor{2d} @section Pragma Assert_And_Cut @@ -1929,7 +1947,7 @@ formal verification. The pragma also serves as useful documentation. @node Pragma Assertion_Policy,Pragma Assume,Pragma Assert_And_Cut,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-policy}@anchor{2d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-policy}@anchor{2e} @section Pragma Assertion_Policy @@ -2013,7 +2031,7 @@ applies to @code{Assert}, @code{Assert_And_Cut}, @code{Assume}, @code{Loop_Invariant}, and @code{Loop_Variant}. @node Pragma Assume,Pragma Assume_No_Invalid_Values,Pragma Assertion_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assume}@anchor{2e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assume}@anchor{2f} @section Pragma Assume @@ -2047,7 +2065,7 @@ is met, and documents the need to ensure that it is met by reference to information outside the program. @node Pragma Assume_No_Invalid_Values,Pragma Async_Readers,Pragma Assume,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assume-no-invalid-values}@anchor{2f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assume-no-invalid-values}@anchor{30} @section Pragma Assume_No_Invalid_Values @@ -2100,7 +2118,7 @@ is erroneous so there are no guarantees that this will always be the case, and it is recommended that these two options not be used together. @node Pragma Async_Readers,Pragma Async_Writers,Pragma Assume_No_Invalid_Values,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-async-readers}@anchor{30}@anchor{gnat_rm/implementation_defined_pragmas id4}@anchor{31} +@anchor{gnat_rm/implementation_defined_pragmas pragma-async-readers}@anchor{31}@anchor{gnat_rm/implementation_defined_pragmas id4}@anchor{32} @section Pragma Async_Readers @@ -2114,7 +2132,7 @@ For the semantics of this pragma, see the entry for aspect @code{Async_Readers} the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Async_Writers,Pragma Attribute_Definition,Pragma Async_Readers,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id5}@anchor{32}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-writers}@anchor{33} +@anchor{gnat_rm/implementation_defined_pragmas id5}@anchor{33}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-writers}@anchor{34} @section Pragma Async_Writers @@ -2128,7 +2146,7 @@ For the semantics of this pragma, see the entry for aspect @code{Async_Writers} the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Attribute_Definition,Pragma C_Pass_By_Copy,Pragma Async_Writers,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-attribute-definition}@anchor{34} +@anchor{gnat_rm/implementation_defined_pragmas pragma-attribute-definition}@anchor{35} @section Pragma Attribute_Definition @@ -2154,7 +2172,7 @@ code to be written that takes advantage of some new attribute, while remaining compilable with earlier compilers. @node Pragma C_Pass_By_Copy,Pragma Check,Pragma Attribute_Definition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-c-pass-by-copy}@anchor{35} +@anchor{gnat_rm/implementation_defined_pragmas pragma-c-pass-by-copy}@anchor{36} @section Pragma C_Pass_By_Copy @@ -2198,7 +2216,7 @@ You can also pass records by copy by specifying the convention passing mechanisms on a parameter by parameter basis. @node Pragma Check,Pragma Check_Float_Overflow,Pragma C_Pass_By_Copy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check}@anchor{36} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check}@anchor{37} @section Pragma Check @@ -2237,7 +2255,7 @@ of these identifiers in @code{Assertion_Policy} and @code{Check_Policy} pragmas, where they are used to refer to sets of assertions. @node Pragma Check_Float_Overflow,Pragma Check_Name,Pragma Check,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-float-overflow}@anchor{37} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-float-overflow}@anchor{38} @section Pragma Check_Float_Overflow @@ -2293,7 +2311,7 @@ This mode can also be set by use of the compiler switch @emph{-gnateF}. @node Pragma Check_Name,Pragma Check_Policy,Pragma Check_Float_Overflow,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-name}@anchor{38} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-name}@anchor{39} @section Pragma Check_Name @@ -2329,7 +2347,7 @@ Check names introduced by this pragma are subject to control by compiler switches (in particular -gnatp) in the usual manner. @node Pragma Check_Policy,Pragma Comment,Pragma Check_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-policy}@anchor{39} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-policy}@anchor{3a} @section Pragma Check_Policy @@ -2409,7 +2427,7 @@ policy setting @code{DISABLE} causes the second argument of a corresponding @code{Check} pragma to be completely ignored and not analyzed. @node Pragma Comment,Pragma Common_Object,Pragma Check_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-comment}@anchor{3a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-comment}@anchor{3b} @section Pragma Comment @@ -2428,7 +2446,7 @@ anywhere in the main source unit), and if more than one pragma is used, all comments are retained. @node Pragma Common_Object,Pragma Compile_Time_Error,Pragma Comment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-common-object}@anchor{3b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-common-object}@anchor{3c} @section Pragma Common_Object @@ -2460,7 +2478,7 @@ indicating that the necessary attribute for implementation of this pragma is not available. @node Pragma Compile_Time_Error,Pragma Compile_Time_Warning,Pragma Common_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-error}@anchor{3c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-error}@anchor{3d} @section Pragma Compile_Time_Error @@ -2487,7 +2505,7 @@ the value given as the second argument. This string value may contain embedded ASCII.LF characters to break the message into multiple lines. @node Pragma Compile_Time_Warning,Pragma Compiler_Unit,Pragma Compile_Time_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-warning}@anchor{3d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-warning}@anchor{3e} @section Pragma Compile_Time_Warning @@ -2510,7 +2528,7 @@ with a first parameter of True is to warn a client about use of a package, for example that it is not fully implemented. @node Pragma Compiler_Unit,Pragma Compiler_Unit_Warning,Pragma Compile_Time_Warning,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit}@anchor{3e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit}@anchor{3f} @section Pragma Compiler_Unit @@ -2525,7 +2543,7 @@ retained so that old versions of the GNAT run-time that use this pragma can be compiled with newer versions of the compiler. @node Pragma Compiler_Unit_Warning,Pragma Complete_Representation,Pragma Compiler_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit-warning}@anchor{3f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit-warning}@anchor{40} @section Pragma Compiler_Unit_Warning @@ -2543,7 +2561,7 @@ version of GNAT. For the exact list of restrictions, see the compiler sources and references to Check_Compiler_Unit. @node Pragma Complete_Representation,Pragma Complex_Representation,Pragma Compiler_Unit_Warning,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-complete-representation}@anchor{40} +@anchor{gnat_rm/implementation_defined_pragmas pragma-complete-representation}@anchor{41} @section Pragma Complete_Representation @@ -2562,7 +2580,7 @@ complete, and that this invariant is maintained if fields are added to the record in the future. @node Pragma Complex_Representation,Pragma Component_Alignment,Pragma Complete_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-complex-representation}@anchor{41} +@anchor{gnat_rm/implementation_defined_pragmas pragma-complex-representation}@anchor{42} @section Pragma Complex_Representation @@ -2584,7 +2602,7 @@ records by pointer, and the use of this pragma may result in passing this type in floating-point registers. @node Pragma Component_Alignment,Pragma Constant_After_Elaboration,Pragma Complex_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-component-alignment}@anchor{42} +@anchor{gnat_rm/implementation_defined_pragmas pragma-component-alignment}@anchor{43} @section Pragma Component_Alignment @@ -2675,7 +2693,7 @@ pragma @code{Pack}, pragma @code{Component_Alignment}, or a record rep clause), the GNAT uses the default alignment as described previously. @node Pragma Constant_After_Elaboration,Pragma Contract_Cases,Pragma Component_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id6}@anchor{43}@anchor{gnat_rm/implementation_defined_pragmas pragma-constant-after-elaboration}@anchor{44} +@anchor{gnat_rm/implementation_defined_pragmas id6}@anchor{44}@anchor{gnat_rm/implementation_defined_pragmas pragma-constant-after-elaboration}@anchor{45} @section Pragma Constant_After_Elaboration @@ -2689,7 +2707,7 @@ For the semantics of this pragma, see the entry for aspect @code{Constant_After_Elaboration} in the SPARK 2014 Reference Manual, section 3.3.1. @node Pragma Contract_Cases,Pragma Convention_Identifier,Pragma Constant_After_Elaboration,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id7}@anchor{45}@anchor{gnat_rm/implementation_defined_pragmas pragma-contract-cases}@anchor{46} +@anchor{gnat_rm/implementation_defined_pragmas id7}@anchor{46}@anchor{gnat_rm/implementation_defined_pragmas pragma-contract-cases}@anchor{47} @section Pragma Contract_Cases @@ -2774,7 +2792,7 @@ and that the consequence for this case should hold when the subprogram returns. @node Pragma Convention_Identifier,Pragma CPP_Class,Pragma Contract_Cases,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-convention-identifier}@anchor{47} +@anchor{gnat_rm/implementation_defined_pragmas pragma-convention-identifier}@anchor{48} @section Pragma Convention_Identifier @@ -2810,7 +2828,7 @@ define a convention identifier @code{Library} and use a single would be used system-wide. @node Pragma CPP_Class,Pragma CPP_Constructor,Pragma Convention_Identifier,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-class}@anchor{48} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-class}@anchor{49} @section Pragma CPP_Class @@ -2835,14 +2853,14 @@ functions (see pragma @code{CPP_Constructor}). Such types are implicitly limited if not explicitly declared as limited or derived from a limited type, and an error is issued in that case. -See @ref{49,,Interfacing to C++} for related information. +See @ref{4a,,Interfacing to C++} for related information. Note: Pragma @code{CPP_Class} is currently obsolete. It is supported for backward compatibility but its functionality is available using pragma @code{Import} with @code{Convention} = @code{CPP}. @node Pragma CPP_Constructor,Pragma CPP_Virtual,Pragma CPP_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-constructor}@anchor{4a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-constructor}@anchor{4b} @section Pragma CPP_Constructor @@ -2893,7 +2911,7 @@ on the Ada side and the type is implicitly declared abstract. Pragma @code{CPP_Constructor} is intended primarily for automatic generation using an automatic binding generator tool (such as the @code{-fdump-ada-spec} GCC switch). -See @ref{49,,Interfacing to C++} for more related information. +See @ref{4a,,Interfacing to C++} for more related information. Note: The use of functions returning class-wide types for constructors is currently obsolete. They are supported for backward compatibility. The @@ -2902,7 +2920,7 @@ because the imported C++ constructors always return an object of type T; that is, they never return an object whose type is a descendant of type T. @node Pragma CPP_Virtual,Pragma CPP_Vtable,Pragma CPP_Constructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-virtual}@anchor{4b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-virtual}@anchor{4c} @section Pragma CPP_Virtual @@ -2915,10 +2933,10 @@ purposes. It used to be required to ensure compoatibility with C++, but is no longer required for that purpose because GNAT generates the same object layout as the G++ compiler by default. -See @ref{49,,Interfacing to C++} for related information. +See @ref{4a,,Interfacing to C++} for related information. @node Pragma CPP_Vtable,Pragma CPU,Pragma CPP_Virtual,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-vtable}@anchor{4c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-vtable}@anchor{4d} @section Pragma CPP_Vtable @@ -2930,10 +2948,10 @@ It used to be required to ensure compatibility with C++, but is no longer required for that purpose because GNAT generates the same object layout as the G++ compiler by default. -See @ref{49,,Interfacing to C++} for related information. +See @ref{4a,,Interfacing to C++} for related information. @node Pragma CPU,Pragma Deadline_Floor,Pragma CPP_Vtable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpu}@anchor{4d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpu}@anchor{4e} @section Pragma CPU @@ -2948,7 +2966,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Deadline_Floor,Pragma Default_Initial_Condition,Pragma CPU,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-deadline-floor}@anchor{4e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-deadline-floor}@anchor{4f} @section Pragma Deadline_Floor @@ -2963,7 +2981,7 @@ deadline inherited by a task when the task enters a protected object. It is effective only when the EDF scheduling policy is used. @node Pragma Default_Initial_Condition,Pragma Debug,Pragma Deadline_Floor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id8}@anchor{4f}@anchor{gnat_rm/implementation_defined_pragmas pragma-default-initial-condition}@anchor{50} +@anchor{gnat_rm/implementation_defined_pragmas id8}@anchor{50}@anchor{gnat_rm/implementation_defined_pragmas pragma-default-initial-condition}@anchor{51} @section Pragma Default_Initial_Condition @@ -2977,7 +2995,7 @@ For the semantics of this pragma, see the entry for aspect @code{Default_Initial_Condition} in the SPARK 2014 Reference Manual, section 7.3.3. @node Pragma Debug,Pragma Debug_Policy,Pragma Default_Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-debug}@anchor{51} +@anchor{gnat_rm/implementation_defined_pragmas pragma-debug}@anchor{52} @section Pragma Debug @@ -3005,7 +3023,7 @@ or by use of the pragma @code{Check_Policy} with a first argument of @code{Debug}. @node Pragma Debug_Policy,Pragma Default_Scalar_Storage_Order,Pragma Debug,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-debug-policy}@anchor{52} +@anchor{gnat_rm/implementation_defined_pragmas pragma-debug-policy}@anchor{53} @section Pragma Debug_Policy @@ -3020,7 +3038,7 @@ with a first argument of @code{Debug}. It is retained for historical compatibility reasons. @node Pragma Default_Scalar_Storage_Order,Pragma Default_Storage_Pool,Pragma Debug_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-default-scalar-storage-order}@anchor{53} +@anchor{gnat_rm/implementation_defined_pragmas pragma-default-scalar-storage-order}@anchor{54} @section Pragma Default_Scalar_Storage_Order @@ -3093,7 +3111,7 @@ it may significantly degrade the run-time performance of the software, instead the default scalar storage order ought to be changed only on a local basis. @node Pragma Default_Storage_Pool,Pragma Depends,Pragma Default_Scalar_Storage_Order,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-default-storage-pool}@anchor{54} +@anchor{gnat_rm/implementation_defined_pragmas pragma-default-storage-pool}@anchor{55} @section Pragma Default_Storage_Pool @@ -3110,7 +3128,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Depends,Pragma Detect_Blocking,Pragma Default_Storage_Pool,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-depends}@anchor{55}@anchor{gnat_rm/implementation_defined_pragmas id9}@anchor{56} +@anchor{gnat_rm/implementation_defined_pragmas pragma-depends}@anchor{56}@anchor{gnat_rm/implementation_defined_pragmas id9}@anchor{57} @section Pragma Depends @@ -3143,7 +3161,7 @@ For the semantics of this pragma, see the entry for aspect @code{Depends} in the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Detect_Blocking,Pragma Disable_Atomic_Synchronization,Pragma Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-detect-blocking}@anchor{57} +@anchor{gnat_rm/implementation_defined_pragmas pragma-detect-blocking}@anchor{58} @section Pragma Detect_Blocking @@ -3161,7 +3179,7 @@ blocking operations within a protected operation, and to raise Program_Error if that happens. @node Pragma Disable_Atomic_Synchronization,Pragma Dispatching_Domain,Pragma Detect_Blocking,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-disable-atomic-synchronization}@anchor{58} +@anchor{gnat_rm/implementation_defined_pragmas pragma-disable-atomic-synchronization}@anchor{59} @section Pragma Disable_Atomic_Synchronization @@ -3187,7 +3205,7 @@ till the end of the scope. If an @code{Entity} argument is present, the action applies only to that entity. @node Pragma Dispatching_Domain,Pragma Effective_Reads,Pragma Disable_Atomic_Synchronization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-dispatching-domain}@anchor{59} +@anchor{gnat_rm/implementation_defined_pragmas pragma-dispatching-domain}@anchor{5a} @section Pragma Dispatching_Domain @@ -3202,7 +3220,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Effective_Reads,Pragma Effective_Writes,Pragma Dispatching_Domain,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id10}@anchor{5a}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-reads}@anchor{5b} +@anchor{gnat_rm/implementation_defined_pragmas id10}@anchor{5b}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-reads}@anchor{5c} @section Pragma Effective_Reads @@ -3216,7 +3234,7 @@ For the semantics of this pragma, see the entry for aspect @code{Effective_Reads the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Effective_Writes,Pragma Elaboration_Checks,Pragma Effective_Reads,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id11}@anchor{5c}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-writes}@anchor{5d} +@anchor{gnat_rm/implementation_defined_pragmas id11}@anchor{5d}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-writes}@anchor{5e} @section Pragma Effective_Writes @@ -3230,7 +3248,7 @@ For the semantics of this pragma, see the entry for aspect @code{Effective_Write in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Elaboration_Checks,Pragma Eliminate,Pragma Effective_Writes,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-elaboration-checks}@anchor{5e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-elaboration-checks}@anchor{5f} @section Pragma Elaboration_Checks @@ -3267,7 +3285,7 @@ effect. If the pragma argument is @code{Static}, then the static elaboration mod is in effect. @node Pragma Eliminate,Pragma Enable_Atomic_Synchronization,Pragma Elaboration_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-eliminate}@anchor{5f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-eliminate}@anchor{60} @section Pragma Eliminate @@ -3427,7 +3445,7 @@ pragma Eliminate (Q, Proc, @end quotation @node Pragma Enable_Atomic_Synchronization,Pragma Export_Function,Pragma Eliminate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-enable-atomic-synchronization}@anchor{60} +@anchor{gnat_rm/implementation_defined_pragmas pragma-enable-atomic-synchronization}@anchor{61} @section Pragma Enable_Atomic_Synchronization @@ -3455,7 +3473,7 @@ till the end of the scope. If an @code{Entity} argument is present, the action applies only to that entity. @node Pragma Export_Function,Pragma Export_Object,Pragma Enable_Atomic_Synchronization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-function}@anchor{61} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-function}@anchor{62} @section Pragma Export_Function @@ -3527,7 +3545,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Export_Object,Pragma Export_Procedure,Pragma Export_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-object}@anchor{62} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-object}@anchor{63} @section Pragma Export_Object @@ -3552,7 +3570,7 @@ of portability), but it is not required. @code{Size} is syntax checked, but otherwise ignored by GNAT. @node Pragma Export_Procedure,Pragma Export_Value,Pragma Export_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{63} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{64} @section Pragma Export_Procedure @@ -3605,7 +3623,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Export_Value,Pragma Export_Valued_Procedure,Pragma Export_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-value}@anchor{64} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-value}@anchor{65} @section Pragma Export_Value @@ -3626,7 +3644,7 @@ the application. This pragma is currently supported only for the AAMP target and is ignored for other targets. @node Pragma Export_Valued_Procedure,Pragma Extend_System,Pragma Export_Value,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{65} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{66} @section Pragma Export_Valued_Procedure @@ -3684,7 +3702,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Extend_System,Pragma Extensions_Allowed,Pragma Export_Valued_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{66} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{67} @section Pragma Extend_System @@ -3735,7 +3753,7 @@ for compiling System units, as explained in the GNAT User's Guide. @node Pragma Extensions_Allowed,Pragma Extensions_Visible,Pragma Extend_System,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{67} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{68} @section Pragma Extensions_Allowed @@ -3768,7 +3786,7 @@ is constrained. @end table @node Pragma Extensions_Visible,Pragma External,Pragma Extensions_Allowed,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{68}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{69} +@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{69}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{6a} @section Pragma Extensions_Visible @@ -3782,7 +3800,7 @@ For the semantics of this pragma, see the entry for aspect @code{Extensions_Visi in the SPARK 2014 Reference Manual, section 6.1.7. @node Pragma External,Pragma External_Name_Casing,Pragma Extensions_Visible,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{6a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{6b} @section Pragma External @@ -3803,7 +3821,7 @@ used this pragma for exactly the same purposes as pragma @code{Export} before the latter was standardized. @node Pragma External_Name_Casing,Pragma Fast_Math,Pragma External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{6b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{6c} @section Pragma External_Name_Casing @@ -3892,7 +3910,7 @@ pragma External_Name_Casing (Uppercase, Uppercase); to enforce the upper casing of all external symbols. @node Pragma Fast_Math,Pragma Favor_Top_Level,Pragma External_Name_Casing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{6c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{6d} @section Pragma Fast_Math @@ -3921,7 +3939,7 @@ under control of the pragma, rather than use the preinstantiated versions. @end table @node Pragma Favor_Top_Level,Pragma Finalize_Storage_Only,Pragma Fast_Math,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{6d}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{6e} +@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{6e}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{6f} @section Pragma Favor_Top_Level @@ -3940,7 +3958,7 @@ When this pragma is used, dynamically generated trampolines may be used on some targets for nested subprograms. See restriction @code{No_Implicit_Dynamic_Code}. @node Pragma Finalize_Storage_Only,Pragma Float_Representation,Pragma Favor_Top_Level,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{6f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{70} @section Pragma Finalize_Storage_Only @@ -3960,7 +3978,7 @@ name. Note that this pragma does not suppress Finalize calls for library-level heap-allocated objects (see pragma @code{No_Heap_Finalization}). @node Pragma Float_Representation,Pragma Ghost,Pragma Finalize_Storage_Only,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{70} +@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{71} @section Pragma Float_Representation @@ -3995,7 +4013,7 @@ No other value of digits is permitted. @end itemize @node Pragma Ghost,Pragma Global,Pragma Float_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{71}@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{72} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{72}@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{73} @section Pragma Ghost @@ -4009,7 +4027,7 @@ For the semantics of this pragma, see the entry for aspect @code{Ghost} in the S 2014 Reference Manual, section 6.9. @node Pragma Global,Pragma Ident,Pragma Ghost,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{73}@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{74} +@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{74}@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{75} @section Pragma Global @@ -4034,7 +4052,7 @@ For the semantics of this pragma, see the entry for aspect @code{Global} in the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Ident,Pragma Ignore_Pragma,Pragma Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{75} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{76} @section Pragma Ident @@ -4048,7 +4066,7 @@ This pragma is identical in effect to pragma @code{Comment}. It is provided for compatibility with other Ada compilers providing this pragma. @node Pragma Ignore_Pragma,Pragma Implementation_Defined,Pragma Ident,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{76} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{77} @section Pragma Ignore_Pragma @@ -4068,7 +4086,7 @@ pragma allows such pragmas to be ignored, which may be useful in CodePeer mode, or during porting of legacy code. @node Pragma Implementation_Defined,Pragma Implemented,Pragma Ignore_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{77} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{78} @section Pragma Implementation_Defined @@ -4095,7 +4113,7 @@ for the purpose of implementing the No_Implementation_Identifiers restriction. @node Pragma Implemented,Pragma Implicit_Packing,Pragma Implementation_Defined,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{78} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{79} @section Pragma Implemented @@ -4141,7 +4159,7 @@ By_Any shares the behavior of By_Entry and By_Protected_Procedure depending on the target's overriding subprogram kind. @node Pragma Implicit_Packing,Pragma Import_Function,Pragma Implemented,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{79} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{7a} @section Pragma Implicit_Packing @@ -4195,7 +4213,7 @@ sufficient. The use of pragma Implicit_Packing allows this record declaration to compile without an explicit pragma Pack. @node Pragma Import_Function,Pragma Import_Object,Pragma Implicit_Packing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{7a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{7b} @section Pragma Import_Function @@ -4260,7 +4278,7 @@ notation. If the mechanism is not specified, the default mechanism is used. @node Pragma Import_Object,Pragma Import_Procedure,Pragma Import_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{7b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{7c} @section Pragma Import_Object @@ -4286,7 +4304,7 @@ point of view). @code{size} is syntax checked, but otherwise ignored by GNAT. @node Pragma Import_Procedure,Pragma Import_Valued_Procedure,Pragma Import_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{7c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{7d} @section Pragma Import_Procedure @@ -4326,7 +4344,7 @@ applies to a procedure rather than a function and the parameters @code{Result_Type} and @code{Result_Mechanism} are not permitted. @node Pragma Import_Valued_Procedure,Pragma Independent,Pragma Import_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{7d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{7e} @section Pragma Import_Valued_Procedure @@ -4379,7 +4397,7 @@ pragma Import that specifies the desired convention, since otherwise the default convention is Ada, which is almost certainly not what is required. @node Pragma Independent,Pragma Independent_Components,Pragma Import_Valued_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{7e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{7f} @section Pragma Independent @@ -4401,7 +4419,7 @@ constraints on the representation of the object (for instance prohibiting tight packing). @node Pragma Independent_Components,Pragma Initial_Condition,Pragma Independent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{7f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{80} @section Pragma Independent_Components @@ -4422,7 +4440,7 @@ constraints on the representation of the object (for instance prohibiting tight packing). @node Pragma Initial_Condition,Pragma Initialize_Scalars,Pragma Independent_Components,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{80}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{81} +@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{81}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{82} @section Pragma Initial_Condition @@ -4436,7 +4454,7 @@ For the semantics of this pragma, see the entry for aspect @code{Initial_Conditi in the SPARK 2014 Reference Manual, section 7.1.6. @node Pragma Initialize_Scalars,Pragma Initializes,Pragma Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{82} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{83} @section Pragma Initialize_Scalars @@ -4543,7 +4561,7 @@ good idea to turn on stack checking (see description of stack checking in the GNAT User's Guide) when using this pragma. @node Pragma Initializes,Pragma Inline_Always,Pragma Initialize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{83}@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{84} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{84}@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{85} @section Pragma Initializes @@ -4570,7 +4588,7 @@ For the semantics of this pragma, see the entry for aspect @code{Initializes} in SPARK 2014 Reference Manual, section 7.1.5. @node Pragma Inline_Always,Pragma Inline_Generic,Pragma Initializes,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{85}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{86} +@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{86}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{87} @section Pragma Inline_Always @@ -4589,7 +4607,7 @@ apply this pragma to a primitive operation of a tagged type. Thanks to such restrictions, the compiler is allowed to remove the out-of-line body of @code{NAME}. @node Pragma Inline_Generic,Pragma Interface,Pragma Inline_Always,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{87} +@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{88} @section Pragma Inline_Generic @@ -4607,7 +4625,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Interface,Pragma Interface_Name,Pragma Inline_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{88} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{89} @section Pragma Interface @@ -4634,7 +4652,7 @@ maintaining Ada 83/Ada 95 compatibility and is compatible with other Ada 83 compilers. @node Pragma Interface_Name,Pragma Interrupt_Handler,Pragma Interface,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{89} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{8a} @section Pragma Interface_Name @@ -4653,7 +4671,7 @@ for an interfaced subprogram, and is provided for compatibility with Ada least one of @code{External_Name} or @code{Link_Name}. @node Pragma Interrupt_Handler,Pragma Interrupt_State,Pragma Interface_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{8a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{8b} @section Pragma Interrupt_Handler @@ -4673,7 +4691,7 @@ when this pragma is applied to a nonprotected procedure, the instruction maskable interrupts, in place of the normal return instruction. @node Pragma Interrupt_State,Pragma Invariant,Pragma Interrupt_Handler,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{8b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{8c} @section Pragma Interrupt_State @@ -4759,7 +4777,7 @@ with an application's runtime behavior in the cases of the synchronous signals, and in the case of the signal used to implement the @code{abort} statement. @node Pragma Invariant,Pragma Keep_Names,Pragma Interrupt_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{8c}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{8d} +@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{8d}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{8e} @section Pragma Invariant @@ -4798,7 +4816,7 @@ For further details on the use of this pragma, see the Ada 2012 documentation of the Type_Invariant aspect. @node Pragma Keep_Names,Pragma License,Pragma Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{8e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{8f} @section Pragma Keep_Names @@ -4818,7 +4836,7 @@ use a @code{Discard_Names} pragma in the @code{gnat.adc} file, but you want to retain the names for specific enumeration types. @node Pragma License,Pragma Link_With,Pragma Keep_Names,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{8f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{90} @section Pragma License @@ -4913,7 +4931,7 @@ GPL, but no warning for @code{GNAT.Sockets} which is part of the GNAT run time, and is therefore licensed under the modified GPL. @node Pragma Link_With,Pragma Linker_Alias,Pragma License,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{90} +@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{91} @section Pragma Link_With @@ -4937,7 +4955,7 @@ separate arguments to the linker. In addition pragma Link_With allows multiple arguments, with the same effect as successive pragmas. @node Pragma Linker_Alias,Pragma Linker_Constructor,Pragma Link_With,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{91} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{92} @section Pragma Linker_Alias @@ -4978,7 +4996,7 @@ end p; @end example @node Pragma Linker_Constructor,Pragma Linker_Destructor,Pragma Linker_Alias,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{92} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{93} @section Pragma Linker_Constructor @@ -5008,7 +5026,7 @@ listed above. Where possible, the use of Stand Alone Libraries is preferable to the use of this pragma. @node Pragma Linker_Destructor,Pragma Linker_Section,Pragma Linker_Constructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{93} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{94} @section Pragma Linker_Destructor @@ -5031,7 +5049,7 @@ See @code{pragma Linker_Constructor} for the set of restrictions that apply because of these specific contexts. @node Pragma Linker_Section,Pragma Lock_Free,Pragma Linker_Destructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{94}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{95} +@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{95}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{96} @section Pragma Linker_Section @@ -5105,7 +5123,7 @@ end IO_Card; @end example @node Pragma Lock_Free,Pragma Loop_Invariant,Pragma Linker_Section,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{96}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{97} +@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{97}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{98} @section Pragma Lock_Free @@ -5115,8 +5133,49 @@ the implementation of protected operations must be implemented without locks. Compilation fails if the compiler cannot generate lock-free code for the operations. +The current conditions required to support this pragma are: + + +@itemize * + +@item +Protected type declarations may not contain entries + +@item +Protected subprogram declarations may not have nonelementary parameters +@end itemize + +In addition, each protected subprogram body must satisfy: + + +@itemize * + +@item +May reference only one protected component + +@item +May not reference nonconstant entities outside the protected subprogram +scope. + +@item +May not contain address representation items, allocators, or quantified +expressions. + +@item +May not contain delay, goto, loop, or procedure-call statements. + +@item +May not contain exported and imported entities + +@item +May not dereferenced access values + +@item +Function calls and attribute references must be static +@end itemize + @node Pragma Loop_Invariant,Pragma Loop_Optimize,Pragma Lock_Free,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{98} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{99} @section Pragma Loop_Invariant @@ -5149,7 +5208,7 @@ attribute can only be used within the expression of a @code{Loop_Invariant} pragma. For full details, see documentation of attribute @code{Loop_Entry}. @node Pragma Loop_Optimize,Pragma Loop_Variant,Pragma Loop_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{99} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{9a} @section Pragma Loop_Optimize @@ -5211,7 +5270,7 @@ compiler in order to enable the relevant optimizations, that is to say vectorization. @node Pragma Loop_Variant,Pragma Machine_Attribute,Pragma Loop_Optimize,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{9a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{9b} @section Pragma Loop_Variant @@ -5258,7 +5317,7 @@ The @code{Loop_Entry} attribute may be used within the expressions of the @code{Loop_Variant} pragma to refer to values on entry to the loop. @node Pragma Machine_Attribute,Pragma Main,Pragma Loop_Variant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{9b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{9c} @section Pragma Machine_Attribute @@ -5284,7 +5343,7 @@ which may make this pragma unusable for some attributes. For further information see @cite{GNU Compiler Collection (GCC) Internals}. @node Pragma Main,Pragma Main_Storage,Pragma Machine_Attribute,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{9c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{9d} @section Pragma Main @@ -5304,7 +5363,7 @@ This pragma is provided for compatibility with OpenVMS VAX Systems. It has no effect in GNAT, other than being syntax checked. @node Pragma Main_Storage,Pragma Max_Queue_Length,Pragma Main,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{9d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{9e} @section Pragma Main_Storage @@ -5323,7 +5382,7 @@ This pragma is provided for compatibility with OpenVMS VAX Systems. It has no effect in GNAT, other than being syntax checked. @node Pragma Max_Queue_Length,Pragma No_Body,Pragma Main_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{9e}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{9f} +@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{9f}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{a0} @section Pragma Max_Queue_Length @@ -5335,11 +5394,13 @@ pragma Max_Entry_Queue (static_integer_EXPRESSION); This pragma is used to specify the maximum callers per entry queue for individual protected entries and entry families. It accepts a single -positive integer as a parameter and must appear after the declaration -of an entry. +integer (-1 or more) as a parameter and must appear after the declaration of an +entry. + +A value of -1 represents no additional restriction on queue length. @node Pragma No_Body,Pragma No_Caching,Pragma Max_Queue_Length,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{a0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{a1} @section Pragma No_Body @@ -5362,7 +5423,7 @@ dummy body with a No_Body pragma ensures that there is no interference from earlier versions of the package body. @node Pragma No_Caching,Pragma No_Component_Reordering,Pragma No_Body,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-caching}@anchor{a1}@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{a2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-caching}@anchor{a2}@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{a3} @section Pragma No_Caching @@ -5376,7 +5437,7 @@ For the semantics of this pragma, see the entry for aspect @code{No_Caching} in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma No_Component_Reordering,Pragma No_Elaboration_Code_All,Pragma No_Caching,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{a3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{a4} @section Pragma No_Component_Reordering @@ -5395,7 +5456,7 @@ declared in units to which the pragma applies and there is a requirement that this pragma be used consistently within a partition. @node Pragma No_Elaboration_Code_All,Pragma No_Heap_Finalization,Pragma No_Component_Reordering,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a4}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{a5} +@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a5}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{a6} @section Pragma No_Elaboration_Code_All @@ -5414,7 +5475,7 @@ current unit, it must also have the No_Elaboration_Code_All aspect set. It may be applied to package or subprogram specs or their generic versions. @node Pragma No_Heap_Finalization,Pragma No_Inline,Pragma No_Elaboration_Code_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{a6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{a7} @section Pragma No_Heap_Finalization @@ -5446,7 +5507,7 @@ lose its @code{No_Heap_Finalization} pragma when the corresponding instance does appear at the library level. @node Pragma No_Inline,Pragma No_Return,Pragma No_Heap_Finalization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a7}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{a8} +@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a8}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{a9} @section Pragma No_Inline @@ -5464,7 +5525,7 @@ in particular it is not subject to the use of option @emph{-gnatn} or pragma @code{Inline_Always} for the same @code{NAME}. @node Pragma No_Return,Pragma No_Run_Time,Pragma No_Inline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{a9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{aa} @section Pragma No_Return @@ -5491,7 +5552,7 @@ available in all earlier versions of Ada as an implementation-defined pragma. @node Pragma No_Run_Time,Pragma No_Strict_Aliasing,Pragma No_Return,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-run-time}@anchor{aa} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-run-time}@anchor{ab} @section Pragma No_Run_Time @@ -5507,7 +5568,7 @@ internal testing. The pragma has been superseded by the reconfigurable runtime capability of GNAT. @node Pragma No_Strict_Aliasing,Pragma No_Tagged_Streams,Pragma No_Run_Time,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{ab} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{ac} @section Pragma No_Strict_Aliasing @@ -5529,7 +5590,7 @@ in the @cite{GNAT User's Guide}. This pragma currently has no effects on access to unconstrained array types. @node Pragma No_Tagged_Streams,Pragma Normalize_Scalars,Pragma No_Strict_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{ac}@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{ad} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{ad}@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{ae} @section Pragma No_Tagged_Streams @@ -5568,7 +5629,7 @@ with empty strings. This is useful to avoid exposing entity names at binary level but has a negative impact on the debuggability of tagged types. @node Pragma Normalize_Scalars,Pragma Obsolescent,Pragma No_Tagged_Streams,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{ae} +@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{af} @section Pragma Normalize_Scalars @@ -5650,7 +5711,7 @@ will always generate an invalid value if one exists. @end table @node Pragma Obsolescent,Pragma Optimize_Alignment,Pragma Normalize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{af}@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{b0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{b0}@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{b1} @section Pragma Obsolescent @@ -5746,7 +5807,7 @@ So if you specify @code{Entity =>} for the @code{Entity} argument, and a @code{M argument is present, it must be preceded by @code{Message =>}. @node Pragma Optimize_Alignment,Pragma Ordered,Pragma Obsolescent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{b1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{b2} @section Pragma Optimize_Alignment @@ -5832,7 +5893,7 @@ latter are compiled by default in pragma Optimize_Alignment (Off) mode if no pragma appears at the start of the file. @node Pragma Ordered,Pragma Overflow_Mode,Pragma Optimize_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b3} @section Pragma Ordered @@ -5924,7 +5985,7 @@ For additional information please refer to the description of the @emph{-gnatw.u} switch in the GNAT User's Guide. @node Pragma Overflow_Mode,Pragma Overriding_Renamings,Pragma Ordered,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{b3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{b4} @section Pragma Overflow_Mode @@ -5963,7 +6024,7 @@ The pragma @code{Unsuppress (Overflow_Check)} unsuppresses (enables) overflow checking, but does not affect the overflow mode. @node Pragma Overriding_Renamings,Pragma Partition_Elaboration_Policy,Pragma Overflow_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b5} @section Pragma Overriding_Renamings @@ -5998,7 +6059,7 @@ RM 8.3 (15) stipulates that an overridden operation is not visible within the declaration of the overriding operation. @node Pragma Partition_Elaboration_Policy,Pragma Part_Of,Pragma Overriding_Renamings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{b5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{b6} @section Pragma Partition_Elaboration_Policy @@ -6015,7 +6076,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Part_Of,Pragma Passive,Pragma Partition_Elaboration_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{b6}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b7} +@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{b7}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b8} @section Pragma Part_Of @@ -6031,7 +6092,7 @@ For the semantics of this pragma, see the entry for aspect @code{Part_Of} in the SPARK 2014 Reference Manual, section 7.2.6. @node Pragma Passive,Pragma Persistent_BSS,Pragma Part_Of,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{b8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{b9} @section Pragma Passive @@ -6055,7 +6116,7 @@ For more information on the subject of passive tasks, see the section 'Passive Task Optimization' in the GNAT Users Guide. @node Pragma Persistent_BSS,Pragma Polling,Pragma Passive,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{b9}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{ba} +@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{ba}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{bb} @section Pragma Persistent_BSS @@ -6086,7 +6147,7 @@ If this pragma is used on a target where this feature is not supported, then the pragma will be ignored. See also @code{pragma Linker_Section}. @node Pragma Polling,Pragma Post,Pragma Persistent_BSS,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-polling}@anchor{bb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-polling}@anchor{bc} @section Pragma Polling @@ -6128,7 +6189,7 @@ Note that polling can also be enabled by use of the @emph{-gnatP} switch. See the section on switches for gcc in the @cite{GNAT User's Guide}. @node Pragma Post,Pragma Postcondition,Pragma Polling,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{bc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{bd} @section Pragma Post @@ -6153,7 +6214,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Postcondition,Pragma Post_Class,Pragma Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{bd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{be} @section Pragma Postcondition @@ -6318,7 +6379,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Post_Class,Pragma Rename_Pragma,Pragma Postcondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{be} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{bf} @section Pragma Post_Class @@ -6353,7 +6414,7 @@ policy that controls this pragma is @code{Post'Class}, not @code{Post_Class}. @node Pragma Rename_Pragma,Pragma Pre,Pragma Post_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{bf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{c0} @section Pragma Rename_Pragma @@ -6392,7 +6453,7 @@ Pragma Inline_Only will not necessarily mean the same thing as the other Ada compiler; it's up to you to make sure the semantics are close enough. @node Pragma Pre,Pragma Precondition,Pragma Rename_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{c0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{c1} @section Pragma Pre @@ -6417,7 +6478,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Precondition,Pragma Predicate,Pragma Pre,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{c1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{c2} @section Pragma Precondition @@ -6476,7 +6537,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Predicate,Pragma Predicate_Failure,Pragma Precondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c2}@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{c3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c3}@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{c4} @section Pragma Predicate @@ -6530,7 +6591,7 @@ defined for subtype B). When following this approach, the use of predicates should be avoided. @node Pragma Predicate_Failure,Pragma Preelaborable_Initialization,Pragma Predicate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c5} @section Pragma Predicate_Failure @@ -6547,7 +6608,7 @@ the language-defined @code{Predicate_Failure} aspect, and shares its restrictions and semantics. @node Pragma Preelaborable_Initialization,Pragma Prefix_Exception_Messages,Pragma Predicate_Failure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c6} @section Pragma Preelaborable_Initialization @@ -6562,7 +6623,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Prefix_Exception_Messages,Pragma Pre_Class,Pragma Preelaborable_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c7} @section Pragma Prefix_Exception_Messages @@ -6593,7 +6654,7 @@ prefixing in this case, you can always call @code{GNAT.Source_Info.Enclosing_Entity} and prepend the string manually. @node Pragma Pre_Class,Pragma Priority_Specific_Dispatching,Pragma Prefix_Exception_Messages,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{c7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{c8} @section Pragma Pre_Class @@ -6628,7 +6689,7 @@ policy that controls this pragma is @code{Pre'Class}, not @code{Pre_Class}. @node Pragma Priority_Specific_Dispatching,Pragma Profile,Pragma Pre_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c9} @section Pragma Priority_Specific_Dispatching @@ -6652,7 +6713,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Profile,Pragma Profile_Warnings,Pragma Priority_Specific_Dispatching,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{c9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{ca} @section Pragma Profile @@ -6926,7 +6987,7 @@ conforming Ada constructs. The profile enables the following three pragmas: @end itemize @node Pragma Profile_Warnings,Pragma Propagate_Exceptions,Pragma Profile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{ca} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{cb} @section Pragma Profile_Warnings @@ -6944,7 +7005,7 @@ violations of the profile generate warning messages instead of error messages. @node Pragma Propagate_Exceptions,Pragma Provide_Shift_Operators,Pragma Profile_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{cb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{cc} @section Pragma Propagate_Exceptions @@ -6963,7 +7024,7 @@ purposes. It used to be used in connection with optimization of a now-obsolete mechanism for implementation of exceptions. @node Pragma Provide_Shift_Operators,Pragma Psect_Object,Pragma Propagate_Exceptions,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{cc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{cd} @section Pragma Provide_Shift_Operators @@ -6983,7 +7044,7 @@ including the function declarations for these five operators, together with the pragma Import (Intrinsic, ...) statements. @node Pragma Psect_Object,Pragma Pure_Function,Pragma Provide_Shift_Operators,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{cd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{ce} @section Pragma Psect_Object @@ -7003,7 +7064,7 @@ EXTERNAL_SYMBOL ::= This pragma is identical in effect to pragma @code{Common_Object}. @node Pragma Pure_Function,Pragma Rational,Pragma Psect_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{ce}@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{cf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{cf}@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{d0} @section Pragma Pure_Function @@ -7065,7 +7126,7 @@ unit is not a Pure unit in the categorization sense. So for example, a function thus marked is free to @code{with} non-pure units. @node Pragma Rational,Pragma Ravenscar,Pragma Pure_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{d0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{d1} @section Pragma Rational @@ -7083,7 +7144,7 @@ pragma Profile (Rational); @end example @node Pragma Ravenscar,Pragma Refined_Depends,Pragma Rational,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{d1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{d2} @section Pragma Ravenscar @@ -7103,7 +7164,7 @@ pragma Profile (Ravenscar); which is the preferred method of setting the @code{Ravenscar} profile. @node Pragma Refined_Depends,Pragma Refined_Global,Pragma Ravenscar,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{d2}@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{d3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{d3}@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{d4} @section Pragma Refined_Depends @@ -7136,7 +7197,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Depends the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Refined_Global,Pragma Refined_Post,Pragma Refined_Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{d4}@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{d5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{d5}@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{d6} @section Pragma Refined_Global @@ -7161,7 +7222,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Global} the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Refined_Post,Pragma Refined_State,Pragma Refined_Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{d6}@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{d7}@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d8} @section Pragma Refined_Post @@ -7175,7 +7236,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Post} i the SPARK 2014 Reference Manual, section 7.2.7. @node Pragma Refined_State,Pragma Relative_Deadline,Pragma Refined_Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{d8}@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{d9}@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{da} @section Pragma Refined_State @@ -7201,7 +7262,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_State} the SPARK 2014 Reference Manual, section 7.2.2. @node Pragma Relative_Deadline,Pragma Remote_Access_Type,Pragma Refined_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{da} +@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{db} @section Pragma Relative_Deadline @@ -7216,7 +7277,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Remote_Access_Type,Pragma Restricted_Run_Time,Pragma Relative_Deadline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{db}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{dc} +@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{dc}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{dd} @section Pragma Remote_Access_Type @@ -7242,7 +7303,7 @@ pertaining to remote access to class-wide types. At instantiation, the actual type must be a remote access to class-wide type. @node Pragma Restricted_Run_Time,Pragma Restriction_Warnings,Pragma Remote_Access_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{dd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{de} @section Pragma Restricted_Run_Time @@ -7263,7 +7324,7 @@ which is the preferred method of setting the restricted run time profile. @node Pragma Restriction_Warnings,Pragma Reviewable,Pragma Restricted_Run_Time,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{de} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{df} @section Pragma Restriction_Warnings @@ -7301,7 +7362,7 @@ generating a warning, but any other use of implementation defined pragmas will cause a warning to be generated. @node Pragma Reviewable,Pragma Secondary_Stack_Size,Pragma Restriction_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{df} +@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{e0} @section Pragma Reviewable @@ -7405,7 +7466,7 @@ comprehensive messages identifying possible problems based on this information. @node Pragma Secondary_Stack_Size,Pragma Share_Generic,Pragma Reviewable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{e0}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{e1} +@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{e1}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{e2} @section Pragma Secondary_Stack_Size @@ -7441,7 +7502,7 @@ Note the pragma cannot appear when the restriction @code{No_Secondary_Stack} is in effect. @node Pragma Share_Generic,Pragma Shared,Pragma Secondary_Stack_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{e2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{e3} @section Pragma Share_Generic @@ -7459,7 +7520,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Shared,Pragma Short_Circuit_And_Or,Pragma Share_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{e3}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{e4} +@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{e4}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{e5} @section Pragma Shared @@ -7467,7 +7528,7 @@ This pragma is provided for compatibility with Ada 83. The syntax and semantics are identical to pragma Atomic. @node Pragma Short_Circuit_And_Or,Pragma Short_Descriptors,Pragma Shared,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{e5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{e6} @section Pragma Short_Circuit_And_Or @@ -7486,7 +7547,7 @@ within the file being compiled, it applies only to the file being compiled. There is no requirement that all units in a partition use this option. @node Pragma Short_Descriptors,Pragma Simple_Storage_Pool_Type,Pragma Short_Circuit_And_Or,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e7} @section Pragma Short_Descriptors @@ -7500,7 +7561,7 @@ This pragma is provided for compatibility with other Ada implementations. It is recognized but ignored by all current versions of GNAT. @node Pragma Simple_Storage_Pool_Type,Pragma Source_File_Name,Pragma Short_Descriptors,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{e7}@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{e8}@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e9} @section Pragma Simple_Storage_Pool_Type @@ -7554,7 +7615,7 @@ storage-management discipline). An object of a simple storage pool type can be associated with an access type by specifying the attribute -@ref{e9,,Simple_Storage_Pool}. For example: +@ref{ea,,Simple_Storage_Pool}. For example: @example My_Pool : My_Simple_Storage_Pool_Type; @@ -7564,11 +7625,11 @@ type Acc is access My_Data_Type; for Acc'Simple_Storage_Pool use My_Pool; @end example -See attribute @ref{e9,,Simple_Storage_Pool} +See attribute @ref{ea,,Simple_Storage_Pool} for further details. @node Pragma Source_File_Name,Pragma Source_File_Name_Project,Pragma Simple_Storage_Pool_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{ea}@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{eb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{eb}@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{ec} @section Pragma Source_File_Name @@ -7660,19 +7721,19 @@ aware of these pragmas, and so other tools that use the projet file would not be aware of the intended naming conventions. If you are using project files, file naming is controlled by Source_File_Name_Project pragmas, which are usually supplied automatically by the project manager. A pragma -Source_File_Name cannot appear after a @ref{ec,,Pragma Source_File_Name_Project}. +Source_File_Name cannot appear after a @ref{ed,,Pragma Source_File_Name_Project}. For more details on the use of the @code{Source_File_Name} pragma, see the sections on @code{Using Other File Names} and @cite{Alternative File Naming Schemes' in the :title:`GNAT User's Guide}. @node Pragma Source_File_Name_Project,Pragma Source_Reference,Pragma Source_File_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{ec}@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{ed} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{ed}@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{ee} @section Pragma Source_File_Name_Project This pragma has the same syntax and semantics as pragma Source_File_Name. It is only allowed as a stand-alone configuration pragma. -It cannot appear after a @ref{ea,,Pragma Source_File_Name}, and +It cannot appear after a @ref{eb,,Pragma Source_File_Name}, and most importantly, once pragma Source_File_Name_Project appears, no further Source_File_Name pragmas are allowed. @@ -7684,7 +7745,7 @@ Source_File_Name or Source_File_Name_Project pragmas (which would not be known to the project manager). @node Pragma Source_Reference,Pragma SPARK_Mode,Pragma Source_File_Name_Project,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{ee} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{ef} @section Pragma Source_Reference @@ -7708,7 +7769,7 @@ string expression other than a string literal. This is because its value is needed for error messages issued by all phases of the compiler. @node Pragma SPARK_Mode,Pragma Static_Elaboration_Desired,Pragma Source_Reference,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{ef}@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{f0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{f0}@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{f1} @section Pragma SPARK_Mode @@ -7790,7 +7851,7 @@ SPARK_Mode (@code{Off}), then that pragma will need to be repeated in the package body. @node Pragma Static_Elaboration_Desired,Pragma Stream_Convert,Pragma SPARK_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{f1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{f2} @section Pragma Static_Elaboration_Desired @@ -7814,7 +7875,7 @@ construction of larger aggregates with static components that include an others choice.) @node Pragma Stream_Convert,Pragma Style_Checks,Pragma Static_Elaboration_Desired,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{f2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{f3} @section Pragma Stream_Convert @@ -7891,7 +7952,7 @@ the pragma is silently ignored, and the default implementation of the stream attributes is used instead. @node Pragma Style_Checks,Pragma Subtitle,Pragma Stream_Convert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{f3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{f4} @section Pragma Style_Checks @@ -7964,7 +8025,7 @@ Rf2 : Integer := ARG; -- OK, no error @end example @node Pragma Subtitle,Pragma Suppress,Pragma Style_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{f4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{f5} @section Pragma Subtitle @@ -7978,7 +8039,7 @@ This pragma is recognized for compatibility with other Ada compilers but is ignored by GNAT. @node Pragma Suppress,Pragma Suppress_All,Pragma Subtitle,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{f5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{f6} @section Pragma Suppress @@ -8051,7 +8112,7 @@ Of course, run-time checks are omitted whenever the compiler can prove that they will not fail, whether or not checks are suppressed. @node Pragma Suppress_All,Pragma Suppress_Debug_Info,Pragma Suppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{f6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{f7} @section Pragma Suppress_All @@ -8070,7 +8131,7 @@ The use of the standard Ada pragma @code{Suppress (All_Checks)} as a normal configuration pragma is the preferred usage in GNAT. @node Pragma Suppress_Debug_Info,Pragma Suppress_Exception_Locations,Pragma Suppress_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{f7}@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{f8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{f8}@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{f9} @section Pragma Suppress_Debug_Info @@ -8085,7 +8146,7 @@ for the specified entity. It is intended primarily for use in debugging the debugger, and navigating around debugger problems. @node Pragma Suppress_Exception_Locations,Pragma Suppress_Initialization,Pragma Suppress_Debug_Info,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{f9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{fa} @section Pragma Suppress_Exception_Locations @@ -8108,7 +8169,7 @@ a partition, so it is fine to have some units within a partition compiled with this pragma and others compiled in normal mode without it. @node Pragma Suppress_Initialization,Pragma Task_Name,Pragma Suppress_Exception_Locations,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{fa}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{fb} +@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{fb}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{fc} @section Pragma Suppress_Initialization @@ -8153,7 +8214,7 @@ is suppressed, just as though its subtype had been given in a pragma Suppress_Initialization, as described above. @node Pragma Task_Name,Pragma Task_Storage,Pragma Suppress_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{fc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{fd} @section Pragma Task_Name @@ -8209,7 +8270,7 @@ end; @end example @node Pragma Task_Storage,Pragma Test_Case,Pragma Task_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{fd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{fe} @section Pragma Task_Storage @@ -8229,7 +8290,7 @@ created, depending on the target. This pragma can appear anywhere a type. @node Pragma Test_Case,Pragma Thread_Local_Storage,Pragma Task_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{fe}@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{ff} +@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{ff}@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{100} @section Pragma Test_Case @@ -8285,7 +8346,7 @@ postcondition. Mode @code{Robustness} indicates that the precondition and postcondition of the subprogram should be ignored for this test case. @node Pragma Thread_Local_Storage,Pragma Time_Slice,Pragma Test_Case,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{100}@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{101} +@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{101}@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{102} @section Pragma Thread_Local_Storage @@ -8323,7 +8384,7 @@ If this pragma is used on a system where @code{TLS} is not supported, then an error message will be generated and the program will be rejected. @node Pragma Time_Slice,Pragma Title,Pragma Thread_Local_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{102} +@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{103} @section Pragma Time_Slice @@ -8339,7 +8400,7 @@ It is ignored if it is used in a system that does not allow this control, or if it appears in other than the main program unit. @node Pragma Title,Pragma Type_Invariant,Pragma Time_Slice,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{103} +@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{104} @section Pragma Title @@ -8364,7 +8425,7 @@ notation is used, and named and positional notation can be mixed following the normal rules for procedure calls in Ada. @node Pragma Type_Invariant,Pragma Type_Invariant_Class,Pragma Title,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{104} +@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{105} @section Pragma Type_Invariant @@ -8385,7 +8446,7 @@ controlled by the assertion identifier @code{Type_Invariant} rather than @code{Invariant}. @node Pragma Type_Invariant_Class,Pragma Unchecked_Union,Pragma Type_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{105}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{106} +@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{106}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{107} @section Pragma Type_Invariant_Class @@ -8412,7 +8473,7 @@ policy that controls this pragma is @code{Type_Invariant'Class}, not @code{Type_Invariant_Class}. @node Pragma Unchecked_Union,Pragma Unevaluated_Use_Of_Old,Pragma Type_Invariant_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{107} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{108} @section Pragma Unchecked_Union @@ -8432,7 +8493,7 @@ version in all language modes (Ada 83, Ada 95, and Ada 2005). For full details, consult the Ada 2012 Reference Manual, section B.3.3. @node Pragma Unevaluated_Use_Of_Old,Pragma Unimplemented_Unit,Pragma Unchecked_Union,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{108} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{109} @section Pragma Unevaluated_Use_Of_Old @@ -8487,7 +8548,7 @@ uses up to the end of the corresponding statement sequence or sequence of package declarations. @node Pragma Unimplemented_Unit,Pragma Universal_Aliasing,Pragma Unevaluated_Use_Of_Old,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{109} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{10a} @section Pragma Unimplemented_Unit @@ -8507,7 +8568,7 @@ The abort only happens if code is being generated. Thus you can use specs of unimplemented packages in syntax or semantic checking mode. @node Pragma Universal_Aliasing,Pragma Universal_Data,Pragma Unimplemented_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{10a}@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{10b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{10b}@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{10c} @section Pragma Universal_Aliasing @@ -8526,7 +8587,7 @@ situations in which it must be suppressed, see the section on @code{Optimization and Strict Aliasing} in the @cite{GNAT User's Guide}. @node Pragma Universal_Data,Pragma Unmodified,Pragma Universal_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-data}@anchor{10c}@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{10d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-data}@anchor{10d}@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{10e} @section Pragma Universal_Data @@ -8550,7 +8611,7 @@ of this pragma is also available by applying the -univ switch on the compilations of units where universal addressing of the data is desired. @node Pragma Unmodified,Pragma Unreferenced,Pragma Universal_Data,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10e}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{10f} +@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10f}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{110} @section Pragma Unmodified @@ -8584,7 +8645,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Unreferenced,Pragma Unreferenced_Objects,Pragma Unmodified,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{110}@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{111} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{111}@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{112} @section Pragma Unreferenced @@ -8628,7 +8689,7 @@ Note that if a warning is desired for all calls to a given subprogram, regardless of whether they occur in the same unit as the subprogram declaration, then this pragma should not be used (calls from another unit would not be flagged); pragma Obsolescent can be used instead -for this purpose, see @ref{af,,Pragma Obsolescent}. +for this purpose, see @ref{b0,,Pragma Obsolescent}. The second form of pragma @code{Unreferenced} is used within a context clause. In this case the arguments must be unit names of units previously @@ -8644,7 +8705,7 @@ Thus it is never necessary to use @code{pragma Unreferenced} for such variables, though it is harmless to do so. @node Pragma Unreferenced_Objects,Pragma Unreserve_All_Interrupts,Pragma Unreferenced,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{112}@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{113} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{113}@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{114} @section Pragma Unreferenced_Objects @@ -8669,7 +8730,7 @@ compiler will automatically suppress unwanted warnings about these variables not being referenced. @node Pragma Unreserve_All_Interrupts,Pragma Unsuppress,Pragma Unreferenced_Objects,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{114} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{115} @section Pragma Unreserve_All_Interrupts @@ -8705,7 +8766,7 @@ handled, see pragma @code{Interrupt_State}, which subsumes the functionality of the @code{Unreserve_All_Interrupts} pragma. @node Pragma Unsuppress,Pragma Use_VADS_Size,Pragma Unreserve_All_Interrupts,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{115} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{116} @section Pragma Unsuppress @@ -8741,7 +8802,7 @@ number of implementation-defined check names. See the description of pragma @code{Suppress} for full details. @node Pragma Use_VADS_Size,Pragma Unused,Pragma Unsuppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{116} +@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{117} @section Pragma Use_VADS_Size @@ -8765,7 +8826,7 @@ as implemented in the VADS compiler. See description of the VADS_Size attribute for further details. @node Pragma Unused,Pragma Validity_Checks,Pragma Use_VADS_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{117}@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{118} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{118}@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{119} @section Pragma Unused @@ -8799,7 +8860,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Validity_Checks,Pragma Volatile,Pragma Unused,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{119} +@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{11a} @section Pragma Validity_Checks @@ -8855,7 +8916,7 @@ A := C; -- C will be validity checked @end example @node Pragma Volatile,Pragma Volatile_Full_Access,Pragma Validity_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{11a}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{11b} +@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{11b}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{11c} @section Pragma Volatile @@ -8873,7 +8934,7 @@ implementation of pragma Volatile is upwards compatible with the implementation in DEC Ada 83. @node Pragma Volatile_Full_Access,Pragma Volatile_Function,Pragma Volatile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{11c}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{11d} +@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{11d}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{11e} @section Pragma Volatile_Full_Access @@ -8905,7 +8966,7 @@ It is not permissible to specify @code{Volatile_Full_Access} for a composite (record or array) type or object that has at least one @code{Aliased} component. @node Pragma Volatile_Function,Pragma Warning_As_Error,Pragma Volatile_Full_Access,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11e}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{11f} +@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11f}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{120} @section Pragma Volatile_Function @@ -8919,7 +8980,7 @@ For the semantics of this pragma, see the entry for aspect @code{Volatile_Functi in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Warning_As_Error,Pragma Warnings,Pragma Volatile_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{120} +@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{121} @section Pragma Warning_As_Error @@ -8930,18 +8991,21 @@ pragma Warning_As_Error (static_string_EXPRESSION); @end example This configuration pragma allows the programmer to specify a set -of warnings that will be treated as errors. Any warning which +of warnings that will be treated as errors. Any warning that matches the pattern given by the pragma argument will be treated -as an error. This gives much more precise control that -gnatwe -which treats all warnings as errors. +as an error. This gives more precise control than -gnatwe, +which treats warnings as errors. -The pattern may contain asterisks, which match zero or more characters in -the message. For example, you can use -@code{pragma Warning_As_Error ("bits of*unused")} to treat the warning -message @code{warning: 960 bits of "a" unused} as an error. No other regular -expression notations are permitted. All characters other than asterisk in -these three specific cases are treated as literal characters in the match. -The match is case insensitive, for example XYZ matches xyz. +This pragma can apply to regular warnings (messages enabled by -gnatw) +and to style warnings (messages that start with "(style)", +enabled by -gnaty). + +The pattern may contain asterisks, which match zero or more characters +in the message. For example, you can use @code{pragma Warning_As_Error +("bits of*unused")} to treat the warning message @code{warning: 960 bits of +"a" unused} as an error. All characters other than asterisk are treated +as literal characters in the match. The match is case insensitive; for +example XYZ matches xyz. Note that the pattern matches if it occurs anywhere within the warning message string (it is not necessary to put an asterisk at the start and @@ -8954,7 +9018,7 @@ as shown in the example below, to treat a class of warnings as errors. The above use of patterns to match the message applies only to warning messages generated by the front end. This pragma can also be applied to -warnings provided by the back end and mentioned in @ref{121,,Pragma Warnings}. +warnings provided by the back end and mentioned in @ref{122,,Pragma Warnings}. By using a single full @emph{-Wxxx} switch in the pragma, such warnings can also be treated as errors. @@ -9004,7 +9068,7 @@ the tag is changed from "warning:" to "error:" and the string "[warning-as-error]" is appended to the end of the message. @node Pragma Warnings,Pragma Weak_External,Pragma Warning_As_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id57}@anchor{122}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{121} +@anchor{gnat_rm/implementation_defined_pragmas id57}@anchor{123}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{122} @section Pragma Warnings @@ -9160,7 +9224,7 @@ selectively for each tool, and as a consequence to detect useless pragma Warnings with switch @code{-gnatw.w}. @node Pragma Weak_External,Pragma Wide_Character_Encoding,Pragma Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{123} +@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{124} @section Pragma Weak_External @@ -9211,7 +9275,7 @@ end External_Module; @end example @node Pragma Wide_Character_Encoding,,Pragma Weak_External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{124} +@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{125} @section Pragma Wide_Character_Encoding @@ -9242,7 +9306,7 @@ encoding within that file, and does not affect withed units, specs, or subunits. @node Implementation Defined Aspects,Implementation Defined Attributes,Implementation Defined Pragmas,Top -@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{125}@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{126}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{127} +@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{126}@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{127}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{128} @chapter Implementation Defined Aspects @@ -9361,7 +9425,7 @@ or attribute definition clause. @end menu @node Aspect Abstract_State,Aspect Annotate,,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{128} +@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{129} @section Aspect Abstract_State @@ -9370,7 +9434,7 @@ or attribute definition clause. This aspect is equivalent to @ref{1c,,pragma Abstract_State}. @node Aspect Annotate,Aspect Async_Readers,Aspect Abstract_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{129} +@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{12a} @section Aspect Annotate @@ -9378,7 +9442,7 @@ This aspect is equivalent to @ref{1c,,pragma Abstract_State}. There are three forms of this aspect (where ID is an identifier, and ARG is a general expression), -corresponding to @ref{29,,pragma Annotate}. +corresponding to @ref{2a,,pragma Annotate}. @table @asis @@ -9397,63 +9461,63 @@ Equivalent to @code{pragma Annotate (ID, ID @{, ARG@}, Entity => Name);} @end table @node Aspect Async_Readers,Aspect Async_Writers,Aspect Annotate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{12a} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{12b} @section Aspect Async_Readers @geindex Async_Readers -This boolean aspect is equivalent to @ref{30,,pragma Async_Readers}. +This boolean aspect is equivalent to @ref{31,,pragma Async_Readers}. @node Aspect Async_Writers,Aspect Constant_After_Elaboration,Aspect Async_Readers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{12b} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{12c} @section Aspect Async_Writers @geindex Async_Writers -This boolean aspect is equivalent to @ref{33,,pragma Async_Writers}. +This boolean aspect is equivalent to @ref{34,,pragma Async_Writers}. @node Aspect Constant_After_Elaboration,Aspect Contract_Cases,Aspect Async_Writers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{12c} +@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{12d} @section Aspect Constant_After_Elaboration @geindex Constant_After_Elaboration -This aspect is equivalent to @ref{44,,pragma Constant_After_Elaboration}. +This aspect is equivalent to @ref{45,,pragma Constant_After_Elaboration}. @node Aspect Contract_Cases,Aspect Depends,Aspect Constant_After_Elaboration,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{12d} +@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{12e} @section Aspect Contract_Cases @geindex Contract_Cases -This aspect is equivalent to @ref{46,,pragma Contract_Cases}, the sequence +This aspect is equivalent to @ref{47,,pragma Contract_Cases}, the sequence of clauses being enclosed in parentheses so that syntactically it is an aggregate. @node Aspect Depends,Aspect Default_Initial_Condition,Aspect Contract_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{12e} +@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{12f} @section Aspect Depends @geindex Depends -This aspect is equivalent to @ref{55,,pragma Depends}. +This aspect is equivalent to @ref{56,,pragma Depends}. @node Aspect Default_Initial_Condition,Aspect Dimension,Aspect Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{12f} +@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{130} @section Aspect Default_Initial_Condition @geindex Default_Initial_Condition -This aspect is equivalent to @ref{50,,pragma Default_Initial_Condition}. +This aspect is equivalent to @ref{51,,pragma Default_Initial_Condition}. @node Aspect Dimension,Aspect Dimension_System,Aspect Default_Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{130} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{131} @section Aspect Dimension @@ -9489,7 +9553,7 @@ Note that when the dimensioned type is an integer type, then any dimension value must be an integer literal. @node Aspect Dimension_System,Aspect Disable_Controlled,Aspect Dimension,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{131} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{132} @section Aspect Dimension_System @@ -9549,7 +9613,7 @@ See section 'Performing Dimensionality Analysis in GNAT' in the GNAT Users Guide for detailed examples of use of the dimension system. @node Aspect Disable_Controlled,Aspect Effective_Reads,Aspect Dimension_System,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{132} +@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{133} @section Aspect Disable_Controlled @@ -9562,110 +9626,110 @@ where for example you might want a record to be controlled or not depending on whether some run-time check is enabled or suppressed. @node Aspect Effective_Reads,Aspect Effective_Writes,Aspect Disable_Controlled,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{133} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{134} @section Aspect Effective_Reads @geindex Effective_Reads -This aspect is equivalent to @ref{5b,,pragma Effective_Reads}. +This aspect is equivalent to @ref{5c,,pragma Effective_Reads}. @node Aspect Effective_Writes,Aspect Extensions_Visible,Aspect Effective_Reads,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{134} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{135} @section Aspect Effective_Writes @geindex Effective_Writes -This aspect is equivalent to @ref{5d,,pragma Effective_Writes}. +This aspect is equivalent to @ref{5e,,pragma Effective_Writes}. @node Aspect Extensions_Visible,Aspect Favor_Top_Level,Aspect Effective_Writes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{135} +@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{136} @section Aspect Extensions_Visible @geindex Extensions_Visible -This aspect is equivalent to @ref{69,,pragma Extensions_Visible}. +This aspect is equivalent to @ref{6a,,pragma Extensions_Visible}. @node Aspect Favor_Top_Level,Aspect Ghost,Aspect Extensions_Visible,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{136} +@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{137} @section Aspect Favor_Top_Level @geindex Favor_Top_Level -This boolean aspect is equivalent to @ref{6e,,pragma Favor_Top_Level}. +This boolean aspect is equivalent to @ref{6f,,pragma Favor_Top_Level}. @node Aspect Ghost,Aspect Global,Aspect Favor_Top_Level,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{137} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{138} @section Aspect Ghost @geindex Ghost -This aspect is equivalent to @ref{71,,pragma Ghost}. +This aspect is equivalent to @ref{72,,pragma Ghost}. @node Aspect Global,Aspect Initial_Condition,Aspect Ghost,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{138} +@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{139} @section Aspect Global @geindex Global -This aspect is equivalent to @ref{73,,pragma Global}. +This aspect is equivalent to @ref{74,,pragma Global}. @node Aspect Initial_Condition,Aspect Initializes,Aspect Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{139} +@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{13a} @section Aspect Initial_Condition @geindex Initial_Condition -This aspect is equivalent to @ref{81,,pragma Initial_Condition}. +This aspect is equivalent to @ref{82,,pragma Initial_Condition}. @node Aspect Initializes,Aspect Inline_Always,Aspect Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{13a} +@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{13b} @section Aspect Initializes @geindex Initializes -This aspect is equivalent to @ref{83,,pragma Initializes}. +This aspect is equivalent to @ref{84,,pragma Initializes}. @node Aspect Inline_Always,Aspect Invariant,Aspect Initializes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{13b} +@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{13c} @section Aspect Inline_Always @geindex Inline_Always -This boolean aspect is equivalent to @ref{86,,pragma Inline_Always}. +This boolean aspect is equivalent to @ref{87,,pragma Inline_Always}. @node Aspect Invariant,Aspect Invariant'Class,Aspect Inline_Always,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{13c} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{13d} @section Aspect Invariant @geindex Invariant -This aspect is equivalent to @ref{8d,,pragma Invariant}. It is a +This aspect is equivalent to @ref{8e,,pragma Invariant}. It is a synonym for the language defined aspect @code{Type_Invariant} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Invariant'Class,Aspect Iterable,Aspect Invariant,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{13d} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{13e} @section Aspect Invariant'Class @geindex Invariant'Class -This aspect is equivalent to @ref{106,,pragma Type_Invariant_Class}. It is a +This aspect is equivalent to @ref{107,,pragma Type_Invariant_Class}. It is a synonym for the language defined aspect @code{Type_Invariant'Class} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Iterable,Aspect Linker_Section,Aspect Invariant'Class,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{13e} +@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{13f} @section Aspect Iterable @@ -9745,117 +9809,117 @@ function Get_Element (Cont : Container; Position : Cursor) return Element_Type; This aspect is used in the GNAT-defined formal container packages. @node Aspect Linker_Section,Aspect Lock_Free,Aspect Iterable,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{13f} +@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{140} @section Aspect Linker_Section @geindex Linker_Section -This aspect is equivalent to @ref{95,,pragma Linker_Section}. +This aspect is equivalent to @ref{96,,pragma Linker_Section}. @node Aspect Lock_Free,Aspect Max_Queue_Length,Aspect Linker_Section,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{140} +@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{141} @section Aspect Lock_Free @geindex Lock_Free -This boolean aspect is equivalent to @ref{97,,pragma Lock_Free}. +This boolean aspect is equivalent to @ref{98,,pragma Lock_Free}. @node Aspect Max_Queue_Length,Aspect No_Caching,Aspect Lock_Free,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{141} +@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{142} @section Aspect Max_Queue_Length @geindex Max_Queue_Length -This aspect is equivalent to @ref{9f,,pragma Max_Queue_Length}. +This aspect is equivalent to @ref{a0,,pragma Max_Queue_Length}. @node Aspect No_Caching,Aspect No_Elaboration_Code_All,Aspect Max_Queue_Length,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{142} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{143} @section Aspect No_Caching @geindex No_Caching -This boolean aspect is equivalent to @ref{a1,,pragma No_Caching}. +This boolean aspect is equivalent to @ref{a2,,pragma No_Caching}. @node Aspect No_Elaboration_Code_All,Aspect No_Inline,Aspect No_Caching,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{143} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{144} @section Aspect No_Elaboration_Code_All @geindex No_Elaboration_Code_All -This aspect is equivalent to @ref{a5,,pragma No_Elaboration_Code_All} +This aspect is equivalent to @ref{a6,,pragma No_Elaboration_Code_All} for a program unit. @node Aspect No_Inline,Aspect No_Tagged_Streams,Aspect No_Elaboration_Code_All,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{144} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{145} @section Aspect No_Inline @geindex No_Inline -This boolean aspect is equivalent to @ref{a8,,pragma No_Inline}. +This boolean aspect is equivalent to @ref{a9,,pragma No_Inline}. @node Aspect No_Tagged_Streams,Aspect Object_Size,Aspect No_Inline,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{145} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{146} @section Aspect No_Tagged_Streams @geindex No_Tagged_Streams -This aspect is equivalent to @ref{ac,,pragma No_Tagged_Streams} with an +This aspect is equivalent to @ref{ad,,pragma No_Tagged_Streams} with an argument specifying a root tagged type (thus this aspect can only be applied to such a type). @node Aspect Object_Size,Aspect Obsolescent,Aspect No_Tagged_Streams,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{146} +@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{147} @section Aspect Object_Size @geindex Object_Size -This aspect is equivalent to @ref{147,,attribute Object_Size}. +This aspect is equivalent to @ref{148,,attribute Object_Size}. @node Aspect Obsolescent,Aspect Part_Of,Aspect Object_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{148} +@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{149} @section Aspect Obsolescent @geindex Obsolsecent -This aspect is equivalent to @ref{af,,pragma Obsolescent}. Note that the +This aspect is equivalent to @ref{b0,,pragma Obsolescent}. Note that the evaluation of this aspect happens at the point of occurrence, it is not delayed until the freeze point. @node Aspect Part_Of,Aspect Persistent_BSS,Aspect Obsolescent,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{149} +@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{14a} @section Aspect Part_Of @geindex Part_Of -This aspect is equivalent to @ref{b7,,pragma Part_Of}. +This aspect is equivalent to @ref{b8,,pragma Part_Of}. @node Aspect Persistent_BSS,Aspect Predicate,Aspect Part_Of,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{14a} +@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{14b} @section Aspect Persistent_BSS @geindex Persistent_BSS -This boolean aspect is equivalent to @ref{ba,,pragma Persistent_BSS}. +This boolean aspect is equivalent to @ref{bb,,pragma Persistent_BSS}. @node Aspect Predicate,Aspect Pure_Function,Aspect Persistent_BSS,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{14b} +@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{14c} @section Aspect Predicate @geindex Predicate -This aspect is equivalent to @ref{c2,,pragma Predicate}. It is thus +This aspect is equivalent to @ref{c3,,pragma Predicate}. It is thus similar to the language defined aspects @code{Dynamic_Predicate} and @code{Static_Predicate} except that whether the resulting predicate is static or dynamic is controlled by the form of the @@ -9863,239 +9927,239 @@ expression. It is also separately controllable using pragma @code{Assertion_Policy}. @node Aspect Pure_Function,Aspect Refined_Depends,Aspect Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{14c} +@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{14d} @section Aspect Pure_Function @geindex Pure_Function -This boolean aspect is equivalent to @ref{ce,,pragma Pure_Function}. +This boolean aspect is equivalent to @ref{cf,,pragma Pure_Function}. @node Aspect Refined_Depends,Aspect Refined_Global,Aspect Pure_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{14d} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{14e} @section Aspect Refined_Depends @geindex Refined_Depends -This aspect is equivalent to @ref{d2,,pragma Refined_Depends}. +This aspect is equivalent to @ref{d3,,pragma Refined_Depends}. @node Aspect Refined_Global,Aspect Refined_Post,Aspect Refined_Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{14e} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{14f} @section Aspect Refined_Global @geindex Refined_Global -This aspect is equivalent to @ref{d4,,pragma Refined_Global}. +This aspect is equivalent to @ref{d5,,pragma Refined_Global}. @node Aspect Refined_Post,Aspect Refined_State,Aspect Refined_Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{14f} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{150} @section Aspect Refined_Post @geindex Refined_Post -This aspect is equivalent to @ref{d6,,pragma Refined_Post}. +This aspect is equivalent to @ref{d7,,pragma Refined_Post}. @node Aspect Refined_State,Aspect Remote_Access_Type,Aspect Refined_Post,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{150} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{151} @section Aspect Refined_State @geindex Refined_State -This aspect is equivalent to @ref{d8,,pragma Refined_State}. +This aspect is equivalent to @ref{d9,,pragma Refined_State}. @node Aspect Remote_Access_Type,Aspect Secondary_Stack_Size,Aspect Refined_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{151} +@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{152} @section Aspect Remote_Access_Type @geindex Remote_Access_Type -This aspect is equivalent to @ref{dc,,pragma Remote_Access_Type}. +This aspect is equivalent to @ref{dd,,pragma Remote_Access_Type}. @node Aspect Secondary_Stack_Size,Aspect Scalar_Storage_Order,Aspect Remote_Access_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{152} +@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{153} @section Aspect Secondary_Stack_Size @geindex Secondary_Stack_Size -This aspect is equivalent to @ref{e1,,pragma Secondary_Stack_Size}. +This aspect is equivalent to @ref{e2,,pragma Secondary_Stack_Size}. @node Aspect Scalar_Storage_Order,Aspect Shared,Aspect Secondary_Stack_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{153} +@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{154} @section Aspect Scalar_Storage_Order @geindex Scalar_Storage_Order -This aspect is equivalent to a @ref{154,,attribute Scalar_Storage_Order}. +This aspect is equivalent to a @ref{155,,attribute Scalar_Storage_Order}. @node Aspect Shared,Aspect Simple_Storage_Pool,Aspect Scalar_Storage_Order,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{155} +@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{156} @section Aspect Shared @geindex Shared -This boolean aspect is equivalent to @ref{e4,,pragma Shared} +This boolean aspect is equivalent to @ref{e5,,pragma Shared} and is thus a synonym for aspect @code{Atomic}. @node Aspect Simple_Storage_Pool,Aspect Simple_Storage_Pool_Type,Aspect Shared,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{156} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{157} @section Aspect Simple_Storage_Pool @geindex Simple_Storage_Pool -This aspect is equivalent to @ref{e9,,attribute Simple_Storage_Pool}. +This aspect is equivalent to @ref{ea,,attribute Simple_Storage_Pool}. @node Aspect Simple_Storage_Pool_Type,Aspect SPARK_Mode,Aspect Simple_Storage_Pool,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{157} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{158} @section Aspect Simple_Storage_Pool_Type @geindex Simple_Storage_Pool_Type -This boolean aspect is equivalent to @ref{e7,,pragma Simple_Storage_Pool_Type}. +This boolean aspect is equivalent to @ref{e8,,pragma Simple_Storage_Pool_Type}. @node Aspect SPARK_Mode,Aspect Suppress_Debug_Info,Aspect Simple_Storage_Pool_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{158} +@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{159} @section Aspect SPARK_Mode @geindex SPARK_Mode -This aspect is equivalent to @ref{ef,,pragma SPARK_Mode} and +This aspect is equivalent to @ref{f0,,pragma SPARK_Mode} and may be specified for either or both of the specification and body of a subprogram or package. @node Aspect Suppress_Debug_Info,Aspect Suppress_Initialization,Aspect SPARK_Mode,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{159} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{15a} @section Aspect Suppress_Debug_Info @geindex Suppress_Debug_Info -This boolean aspect is equivalent to @ref{f7,,pragma Suppress_Debug_Info}. +This boolean aspect is equivalent to @ref{f8,,pragma Suppress_Debug_Info}. @node Aspect Suppress_Initialization,Aspect Test_Case,Aspect Suppress_Debug_Info,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{15a} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{15b} @section Aspect Suppress_Initialization @geindex Suppress_Initialization -This boolean aspect is equivalent to @ref{fb,,pragma Suppress_Initialization}. +This boolean aspect is equivalent to @ref{fc,,pragma Suppress_Initialization}. @node Aspect Test_Case,Aspect Thread_Local_Storage,Aspect Suppress_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{15b} +@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{15c} @section Aspect Test_Case @geindex Test_Case -This aspect is equivalent to @ref{fe,,pragma Test_Case}. +This aspect is equivalent to @ref{ff,,pragma Test_Case}. @node Aspect Thread_Local_Storage,Aspect Universal_Aliasing,Aspect Test_Case,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{15c} +@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{15d} @section Aspect Thread_Local_Storage @geindex Thread_Local_Storage -This boolean aspect is equivalent to @ref{100,,pragma Thread_Local_Storage}. +This boolean aspect is equivalent to @ref{101,,pragma Thread_Local_Storage}. @node Aspect Universal_Aliasing,Aspect Universal_Data,Aspect Thread_Local_Storage,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{15d} +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{15e} @section Aspect Universal_Aliasing @geindex Universal_Aliasing -This boolean aspect is equivalent to @ref{10a,,pragma Universal_Aliasing}. +This boolean aspect is equivalent to @ref{10b,,pragma Universal_Aliasing}. @node Aspect Universal_Data,Aspect Unmodified,Aspect Universal_Aliasing,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-data}@anchor{15e} +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-data}@anchor{15f} @section Aspect Universal_Data @geindex Universal_Data -This aspect is equivalent to @ref{10c,,pragma Universal_Data}. +This aspect is equivalent to @ref{10d,,pragma Universal_Data}. @node Aspect Unmodified,Aspect Unreferenced,Aspect Universal_Data,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{15f} +@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{160} @section Aspect Unmodified @geindex Unmodified -This boolean aspect is equivalent to @ref{10f,,pragma Unmodified}. +This boolean aspect is equivalent to @ref{110,,pragma Unmodified}. @node Aspect Unreferenced,Aspect Unreferenced_Objects,Aspect Unmodified,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{160} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{161} @section Aspect Unreferenced @geindex Unreferenced -This boolean aspect is equivalent to @ref{110,,pragma Unreferenced}. Note that +This boolean aspect is equivalent to @ref{111,,pragma Unreferenced}. Note that in the case of formal parameters, it is not permitted to have aspects for a formal parameter, so in this case the pragma form must be used. @node Aspect Unreferenced_Objects,Aspect Value_Size,Aspect Unreferenced,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{161} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{162} @section Aspect Unreferenced_Objects @geindex Unreferenced_Objects -This boolean aspect is equivalent to @ref{112,,pragma Unreferenced_Objects}. +This boolean aspect is equivalent to @ref{113,,pragma Unreferenced_Objects}. @node Aspect Value_Size,Aspect Volatile_Full_Access,Aspect Unreferenced_Objects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{162} +@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{163} @section Aspect Value_Size @geindex Value_Size -This aspect is equivalent to @ref{163,,attribute Value_Size}. +This aspect is equivalent to @ref{164,,attribute Value_Size}. @node Aspect Volatile_Full_Access,Aspect Volatile_Function,Aspect Value_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{164} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{165} @section Aspect Volatile_Full_Access @geindex Volatile_Full_Access -This boolean aspect is equivalent to @ref{11d,,pragma Volatile_Full_Access}. +This boolean aspect is equivalent to @ref{11e,,pragma Volatile_Full_Access}. @node Aspect Volatile_Function,Aspect Warnings,Aspect Volatile_Full_Access,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{165} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{166} @section Aspect Volatile_Function @geindex Volatile_Function -This boolean aspect is equivalent to @ref{11f,,pragma Volatile_Function}. +This boolean aspect is equivalent to @ref{120,,pragma Volatile_Function}. @node Aspect Warnings,,Aspect Volatile_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{166} +@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{167} @section Aspect Warnings @geindex Warnings -This aspect is equivalent to the two argument form of @ref{121,,pragma Warnings}, +This aspect is equivalent to the two argument form of @ref{122,,pragma Warnings}, where the first argument is @code{ON} or @code{OFF} and the second argument is the entity. @node Implementation Defined Attributes,Standard and Implementation Defined Restrictions,Implementation Defined Aspects,Top -@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{167}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{168} +@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{168}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{169} @chapter Implementation Defined Attributes @@ -10196,7 +10260,7 @@ consideration, you should minimize the use of these attributes. @end menu @node Attribute Abort_Signal,Attribute Address_Size,,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{169} +@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{16a} @section Attribute Abort_Signal @@ -10210,7 +10274,7 @@ completely outside the normal semantics of Ada, for a user program to intercept the abort exception). @node Attribute Address_Size,Attribute Asm_Input,Attribute Abort_Signal,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{16a} +@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{16b} @section Attribute Address_Size @@ -10226,7 +10290,7 @@ reference to System.Address'Size is nonstatic because Address is a private type. @node Attribute Asm_Input,Attribute Asm_Output,Attribute Address_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{16b} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{16c} @section Attribute Asm_Input @@ -10240,10 +10304,10 @@ to be a static expression, and is the constraint for the parameter, value to be used as the input argument. The possible values for the constant are the same as those used in the RTL, and are dependent on the configuration file used to built the GCC back end. -@ref{16c,,Machine Code Insertions} +@ref{16d,,Machine Code Insertions} @node Attribute Asm_Output,Attribute Atomic_Always_Lock_Free,Attribute Asm_Input,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{16d} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{16e} @section Attribute Asm_Output @@ -10259,10 +10323,10 @@ result. The possible values for constraint are the same as those used in the RTL, and are dependent on the configuration file used to build the GCC back end. If there are no output operands, then this argument may either be omitted, or explicitly given as @code{No_Output_Operands}. -@ref{16c,,Machine Code Insertions} +@ref{16d,,Machine Code Insertions} @node Attribute Atomic_Always_Lock_Free,Attribute Bit,Attribute Asm_Output,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{16e} +@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{16f} @section Attribute Atomic_Always_Lock_Free @@ -10274,7 +10338,7 @@ and False otherwise. The result indicate whether atomic operations are supported by the target for the given type. @node Attribute Bit,Attribute Bit_Position,Attribute Atomic_Always_Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{16f} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{170} @section Attribute Bit @@ -10305,7 +10369,7 @@ This attribute is designed to be compatible with the DEC Ada 83 definition and implementation of the @code{Bit} attribute. @node Attribute Bit_Position,Attribute Code_Address,Attribute Bit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{170} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{171} @section Attribute Bit_Position @@ -10320,7 +10384,7 @@ type @emph{universal_integer}. The value depends only on the field the containing record @code{R}. @node Attribute Code_Address,Attribute Compiler_Version,Attribute Bit_Position,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{171} +@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{172} @section Attribute Code_Address @@ -10363,7 +10427,7 @@ the same value as is returned by the corresponding @code{'Address} attribute. @node Attribute Compiler_Version,Attribute Constrained,Attribute Code_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{172} +@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{173} @section Attribute Compiler_Version @@ -10374,7 +10438,7 @@ prefix) yields a static string identifying the version of the compiler being used to compile the unit containing the attribute reference. @node Attribute Constrained,Attribute Default_Bit_Order,Attribute Compiler_Version,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{173} +@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{174} @section Attribute Constrained @@ -10389,7 +10453,7 @@ record type without discriminants is always @code{True}. This usage is compatible with older Ada compilers, including notably DEC Ada. @node Attribute Default_Bit_Order,Attribute Default_Scalar_Storage_Order,Attribute Constrained,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{174} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{175} @section Attribute Default_Bit_Order @@ -10406,7 +10470,7 @@ as a @code{Pos} value (0 for @code{High_Order_First}, 1 for @code{Default_Bit_Order} in package @code{System}. @node Attribute Default_Scalar_Storage_Order,Attribute Deref,Attribute Default_Bit_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{175} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{176} @section Attribute Default_Scalar_Storage_Order @@ -10423,7 +10487,7 @@ equal to @code{Default_Bit_Order} if unspecified) as a @code{System.Bit_Order} value. This is a static attribute. @node Attribute Deref,Attribute Descriptor_Size,Attribute Default_Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{176} +@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{177} @section Attribute Deref @@ -10436,7 +10500,7 @@ a named access-to-@cite{typ} type, except that it yields a variable, so it can b used on the left side of an assignment. @node Attribute Descriptor_Size,Attribute Elaborated,Attribute Deref,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{177} +@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{178} @section Attribute Descriptor_Size @@ -10463,7 +10527,7 @@ In the example above, the descriptor contains two values of type a size of 31 bits and an alignment of 4, the descriptor size is @code{2 * Positive'Size + 2} or 64 bits. @node Attribute Elaborated,Attribute Elab_Body,Attribute Descriptor_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{178} +@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{179} @section Attribute Elaborated @@ -10478,7 +10542,7 @@ units has been completed. An exception is for units which need no elaboration, the value is always False for such units. @node Attribute Elab_Body,Attribute Elab_Spec,Attribute Elaborated,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{179} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{17a} @section Attribute Elab_Body @@ -10494,7 +10558,7 @@ e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Spec,Attribute Elab_Subp_Body,Attribute Elab_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{17a} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{17b} @section Attribute Elab_Spec @@ -10510,7 +10574,7 @@ Ada code, e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Subp_Body,Attribute Emax,Attribute Elab_Spec,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{17b} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{17c} @section Attribute Elab_Subp_Body @@ -10524,7 +10588,7 @@ elaboration procedure by the binder in CodePeer mode only and is unrecognized otherwise. @node Attribute Emax,Attribute Enabled,Attribute Elab_Subp_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{17c} +@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{17d} @section Attribute Emax @@ -10537,7 +10601,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Enabled,Attribute Enum_Rep,Attribute Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{17d} +@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{17e} @section Attribute Enabled @@ -10561,7 +10625,7 @@ a @code{pragma Suppress} or @code{pragma Unsuppress} before instantiating the package or subprogram, controlling whether the check will be present. @node Attribute Enum_Rep,Attribute Enum_Val,Attribute Enabled,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{17e} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{17f} @section Attribute Enum_Rep @@ -10598,7 +10662,7 @@ integer calculation is done at run time, then the call to @code{Enum_Rep} may raise @code{Constraint_Error}. @node Attribute Enum_Val,Attribute Epsilon,Attribute Enum_Rep,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{17f} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{180} @section Attribute Enum_Val @@ -10621,7 +10685,7 @@ absence of an enumeration representation clause. This is a static attribute (i.e., the result is static if the argument is static). @node Attribute Epsilon,Attribute Fast_Math,Attribute Enum_Val,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{180} +@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{181} @section Attribute Epsilon @@ -10634,7 +10698,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Fast_Math,Attribute Finalization_Size,Attribute Epsilon,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{181} +@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{182} @section Attribute Fast_Math @@ -10645,7 +10709,7 @@ prefix) yields a static Boolean value that is True if pragma @code{Fast_Math} is active, and False otherwise. @node Attribute Finalization_Size,Attribute Fixed_Value,Attribute Fast_Math,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{182} +@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{183} @section Attribute Finalization_Size @@ -10663,7 +10727,7 @@ class-wide type whose tag denotes a type with no controlled parts. Note that only heap-allocated objects contain finalization data. @node Attribute Fixed_Value,Attribute From_Any,Attribute Finalization_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{183} +@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{184} @section Attribute Fixed_Value @@ -10690,7 +10754,7 @@ This attribute is primarily intended for use in implementation of the input-output functions for fixed-point values. @node Attribute From_Any,Attribute Has_Access_Values,Attribute Fixed_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{184} +@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{185} @section Attribute From_Any @@ -10700,7 +10764,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Has_Access_Values,Attribute Has_Discriminants,Attribute From_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{185} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{186} @section Attribute Has_Access_Values @@ -10718,7 +10782,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has access values. @node Attribute Has_Discriminants,Attribute Img,Attribute Has_Access_Values,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{186} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{187} @section Attribute Has_Discriminants @@ -10734,7 +10798,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has discriminants. @node Attribute Img,Attribute Integer_Value,Attribute Has_Discriminants,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{187} +@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{188} @section Attribute Img @@ -10764,7 +10828,7 @@ that returns the appropriate string when called. This means that in an instantiation as a function parameter. @node Attribute Integer_Value,Attribute Invalid_Value,Attribute Img,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{188} +@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{189} @section Attribute Integer_Value @@ -10792,7 +10856,7 @@ This attribute is primarily intended for use in implementation of the standard input-output functions for fixed-point values. @node Attribute Invalid_Value,Attribute Iterable,Attribute Integer_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{189} +@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{18a} @section Attribute Invalid_Value @@ -10806,7 +10870,7 @@ including the ability to modify the value with the binder -Sxx flag and relevant environment variables at run time. @node Attribute Iterable,Attribute Large,Attribute Invalid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-iterable}@anchor{18a} +@anchor{gnat_rm/implementation_defined_attributes attribute-iterable}@anchor{18b} @section Attribute Iterable @@ -10815,7 +10879,7 @@ relevant environment variables at run time. Equivalent to Aspect Iterable. @node Attribute Large,Attribute Library_Level,Attribute Iterable,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{18b} +@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{18c} @section Attribute Large @@ -10828,7 +10892,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Library_Level,Attribute Lock_Free,Attribute Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{18c} +@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{18d} @section Attribute Library_Level @@ -10854,7 +10918,7 @@ end Gen; @end example @node Attribute Lock_Free,Attribute Loop_Entry,Attribute Library_Level,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-lock-free}@anchor{18d} +@anchor{gnat_rm/implementation_defined_attributes attribute-lock-free}@anchor{18e} @section Attribute Lock_Free @@ -10864,7 +10928,7 @@ end Gen; pragma @code{Lock_Free} applies to P. @node Attribute Loop_Entry,Attribute Machine_Size,Attribute Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{18e} +@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{18f} @section Attribute Loop_Entry @@ -10894,7 +10958,7 @@ entry. This copy is not performed if the loop is not entered, or if the corresponding pragmas are ignored or disabled. @node Attribute Machine_Size,Attribute Mantissa,Attribute Loop_Entry,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{18f} +@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{190} @section Attribute Machine_Size @@ -10904,7 +10968,7 @@ This attribute is identical to the @code{Object_Size} attribute. It is provided for compatibility with the DEC Ada 83 attribute of this name. @node Attribute Mantissa,Attribute Maximum_Alignment,Attribute Machine_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{190} +@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{191} @section Attribute Mantissa @@ -10917,7 +10981,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Maximum_Alignment,Attribute Mechanism_Code,Attribute Mantissa,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{191}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{192} +@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{192}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{193} @section Attribute Maximum_Alignment @@ -10933,7 +10997,7 @@ for an object, guaranteeing that it is properly aligned in all cases. @node Attribute Mechanism_Code,Attribute Null_Parameter,Attribute Maximum_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{193} +@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{194} @section Attribute Mechanism_Code @@ -10964,7 +11028,7 @@ by reference @end table @node Attribute Null_Parameter,Attribute Object_Size,Attribute Mechanism_Code,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{194} +@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{195} @section Attribute Null_Parameter @@ -10989,7 +11053,7 @@ There is no way of indicating this without the @code{Null_Parameter} attribute. @node Attribute Object_Size,Attribute Old,Attribute Null_Parameter,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{147}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{195} +@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{148}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{196} @section Attribute Object_Size @@ -11059,7 +11123,7 @@ Similar additional checks are performed in other contexts requiring statically matching subtypes. @node Attribute Old,Attribute Passed_By_Reference,Attribute Object_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{196} +@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{197} @section Attribute Old @@ -11074,7 +11138,7 @@ definition are allowed under control of implementation defined pragma @code{Unevaluated_Use_Of_Old}. @node Attribute Passed_By_Reference,Attribute Pool_Address,Attribute Old,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{197} +@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{198} @section Attribute Passed_By_Reference @@ -11090,7 +11154,7 @@ passed by copy in calls. For scalar types, the result is always @code{False} and is static. For non-scalar types, the result is nonstatic. @node Attribute Pool_Address,Attribute Range_Length,Attribute Passed_By_Reference,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{198} +@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{199} @section Attribute Pool_Address @@ -11115,7 +11179,7 @@ For an object created by @code{new}, @code{Ptr.all'Pool_Address} is what is passed to @code{Allocate} and returned from @code{Deallocate}. @node Attribute Range_Length,Attribute Restriction_Set,Attribute Pool_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{199} +@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{19a} @section Attribute Range_Length @@ -11128,7 +11192,7 @@ applied to the index subtype of a one dimensional array always gives the same result as @code{Length} applied to the array itself. @node Attribute Restriction_Set,Attribute Result,Attribute Range_Length,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{19a} +@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{19b} @section Attribute Restriction_Set @@ -11198,7 +11262,7 @@ Restrictions pragma, they are not analyzed semantically, so they do not have a type. @node Attribute Result,Attribute Safe_Emax,Attribute Restriction_Set,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{19b} +@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{19c} @section Attribute Result @@ -11211,7 +11275,7 @@ For a further discussion of the use of this attribute and examples of its use, see the description of pragma Postcondition. @node Attribute Safe_Emax,Attribute Safe_Large,Attribute Result,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{19c} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{19d} @section Attribute Safe_Emax @@ -11224,7 +11288,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Large,Attribute Safe_Small,Attribute Safe_Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{19d} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{19e} @section Attribute Safe_Large @@ -11237,7 +11301,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Small,Attribute Scalar_Storage_Order,Attribute Safe_Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{19e} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{19f} @section Attribute Safe_Small @@ -11250,7 +11314,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Scalar_Storage_Order,Attribute Simple_Storage_Pool,Attribute Safe_Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{19f}@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{154} +@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1a0}@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{155} @section Attribute Scalar_Storage_Order @@ -11373,7 +11437,7 @@ Note that debuggers may be unable to display the correct value of scalar components of a type for which the opposite storage order is specified. @node Attribute Simple_Storage_Pool,Attribute Small,Attribute Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{e9}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1a0} +@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{ea}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1a1} @section Attribute Simple_Storage_Pool @@ -11436,7 +11500,7 @@ as defined in section 13.11.2 of the Ada Reference Manual, except that the term @emph{simple storage pool} is substituted for @emph{storage pool}. @node Attribute Small,Attribute Storage_Unit,Attribute Simple_Storage_Pool,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1a1} +@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1a2} @section Attribute Small @@ -11452,7 +11516,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute when applied to floating-point types. @node Attribute Storage_Unit,Attribute Stub_Type,Attribute Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1a2} +@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1a3} @section Attribute Storage_Unit @@ -11462,7 +11526,7 @@ this attribute when applied to floating-point types. prefix) provides the same value as @code{System.Storage_Unit}. @node Attribute Stub_Type,Attribute System_Allocator_Alignment,Attribute Storage_Unit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1a3} +@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1a4} @section Attribute Stub_Type @@ -11486,7 +11550,7 @@ unit @code{System.Partition_Interface}. Use of this attribute will create an implicit dependency on this unit. @node Attribute System_Allocator_Alignment,Attribute Target_Name,Attribute Stub_Type,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1a4} +@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1a5} @section Attribute System_Allocator_Alignment @@ -11503,7 +11567,7 @@ with alignment too large or to enable a realignment circuitry if the alignment request is larger than this value. @node Attribute Target_Name,Attribute To_Address,Attribute System_Allocator_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1a5} +@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1a6} @section Attribute Target_Name @@ -11516,7 +11580,7 @@ standard gcc target name without the terminating slash (for example, GNAT 5.0 on windows yields "i586-pc-mingw32msv"). @node Attribute To_Address,Attribute To_Any,Attribute Target_Name,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1a6} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1a7} @section Attribute To_Address @@ -11539,7 +11603,7 @@ modular manner (e.g., -1 means the same as 16#FFFF_FFFF# on a 32 bits machine). @node Attribute To_Any,Attribute Type_Class,Attribute To_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1a7} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1a8} @section Attribute To_Any @@ -11549,7 +11613,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Type_Class,Attribute Type_Key,Attribute To_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1a8} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1a9} @section Attribute Type_Class @@ -11579,7 +11643,7 @@ applies to all concurrent types. This attribute is designed to be compatible with the DEC Ada 83 attribute of the same name. @node Attribute Type_Key,Attribute TypeCode,Attribute Type_Class,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1a9} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1aa} @section Attribute Type_Key @@ -11591,7 +11655,7 @@ about the type or subtype. This provides improved compatibility with other implementations that support this attribute. @node Attribute TypeCode,Attribute Unconstrained_Array,Attribute Type_Key,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1aa} +@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1ab} @section Attribute TypeCode @@ -11601,7 +11665,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Unconstrained_Array,Attribute Universal_Literal_String,Attribute TypeCode,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1ab} +@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1ac} @section Attribute Unconstrained_Array @@ -11615,7 +11679,7 @@ still static, and yields the result of applying this test to the generic actual. @node Attribute Universal_Literal_String,Attribute Unrestricted_Access,Attribute Unconstrained_Array,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1ac} +@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1ad} @section Attribute Universal_Literal_String @@ -11643,7 +11707,7 @@ end; @end example @node Attribute Unrestricted_Access,Attribute Update,Attribute Universal_Literal_String,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1ad} +@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1ae} @section Attribute Unrestricted_Access @@ -11830,7 +11894,7 @@ In general this is a risky approach. It may appear to "work" but such uses of of GNAT to another, so are best avoided if possible. @node Attribute Update,Attribute Valid_Scalars,Attribute Unrestricted_Access,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1ae} +@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1af} @section Attribute Update @@ -11911,7 +11975,7 @@ A := A'Update ((1, 2) => 20, (3, 4) => 30); which changes element (1,2) to 20 and (3,4) to 30. @node Attribute Valid_Scalars,Attribute VADS_Size,Attribute Update,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1af} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1b0} @section Attribute Valid_Scalars @@ -11945,7 +12009,7 @@ write a function with a single use of the attribute, and then call that function from multiple places. @node Attribute VADS_Size,Attribute Value_Size,Attribute Valid_Scalars,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1b0} +@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1b1} @section Attribute VADS_Size @@ -11965,7 +12029,7 @@ gives the result that would be obtained by applying the attribute to the corresponding type. @node Attribute Value_Size,Attribute Wchar_T_Size,Attribute VADS_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1b1}@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{163} +@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1b2}@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{164} @section Attribute Value_Size @@ -11979,7 +12043,7 @@ a value of the given subtype. It is the same as @code{type'Size}, but, unlike @code{Size}, may be set for non-first subtypes. @node Attribute Wchar_T_Size,Attribute Word_Size,Attribute Value_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1b2} +@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1b3} @section Attribute Wchar_T_Size @@ -11991,7 +12055,7 @@ primarily for constructing the definition of this type in package @code{Interfaces.C}. The result is a static constant. @node Attribute Word_Size,,Attribute Wchar_T_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1b3} +@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1b4} @section Attribute Word_Size @@ -12002,7 +12066,7 @@ prefix) provides the value @code{System.Word_Size}. The result is a static constant. @node Standard and Implementation Defined Restrictions,Implementation Advice,Implementation Defined Attributes,Top -@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1b4}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1b5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1b5}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1b6} @chapter Standard and Implementation Defined Restrictions @@ -12031,7 +12095,7 @@ language defined or GNAT-specific, are listed in the following. @end menu @node Partition-Wide Restrictions,Program Unit Level Restrictions,,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1b6}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1b7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1b7}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1b8} @section Partition-Wide Restrictions @@ -12120,7 +12184,7 @@ then all compilation units in the partition must obey the restriction). @end menu @node Immediate_Reclamation,Max_Asynchronous_Select_Nesting,,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1b8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1b9} @subsection Immediate_Reclamation @@ -12132,7 +12196,7 @@ deallocation, any storage reserved at run time for an object is immediately reclaimed when the object no longer exists. @node Max_Asynchronous_Select_Nesting,Max_Entry_Queue_Length,Immediate_Reclamation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1b9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1ba} @subsection Max_Asynchronous_Select_Nesting @@ -12144,7 +12208,7 @@ detected at compile time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node Max_Entry_Queue_Length,Max_Protected_Entries,Max_Asynchronous_Select_Nesting,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1ba} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1bb} @subsection Max_Entry_Queue_Length @@ -12165,7 +12229,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Max_Protected_Entries,Max_Select_Alternatives,Max_Entry_Queue_Length,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1bb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1bc} @subsection Max_Protected_Entries @@ -12176,7 +12240,7 @@ bounds of every entry family of a protected unit shall be static, or shall be defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Select_Alternatives,Max_Storage_At_Blocking,Max_Protected_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1bc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1bd} @subsection Max_Select_Alternatives @@ -12185,7 +12249,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. [RM D.7] Specifies the maximum number of alternatives in a selective accept. @node Max_Storage_At_Blocking,Max_Task_Entries,Max_Select_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1bd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1be} @subsection Max_Storage_At_Blocking @@ -12196,7 +12260,7 @@ Storage_Size that can be retained by a blocked task. A violation of this restriction causes Storage_Error to be raised. @node Max_Task_Entries,Max_Tasks,Max_Storage_At_Blocking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1be} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1bf} @subsection Max_Task_Entries @@ -12209,7 +12273,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Tasks,No_Abort_Statements,Max_Task_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1bf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1c0} @subsection Max_Tasks @@ -12222,7 +12286,7 @@ time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node No_Abort_Statements,No_Access_Parameter_Allocators,Max_Tasks,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1c0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1c1} @subsection No_Abort_Statements @@ -12232,7 +12296,7 @@ Storage_Error to be raised. no calls to Task_Identification.Abort_Task. @node No_Access_Parameter_Allocators,No_Access_Subprograms,No_Abort_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1c1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1c2} @subsection No_Access_Parameter_Allocators @@ -12243,7 +12307,7 @@ occurrences of an allocator as the actual parameter to an access parameter. @node No_Access_Subprograms,No_Allocators,No_Access_Parameter_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1c2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1c3} @subsection No_Access_Subprograms @@ -12253,7 +12317,7 @@ parameter. declarations of access-to-subprogram types. @node No_Allocators,No_Anonymous_Allocators,No_Access_Subprograms,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1c3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1c4} @subsection No_Allocators @@ -12263,7 +12327,7 @@ declarations of access-to-subprogram types. occurrences of an allocator. @node No_Anonymous_Allocators,No_Asynchronous_Control,No_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1c4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1c5} @subsection No_Anonymous_Allocators @@ -12273,7 +12337,7 @@ occurrences of an allocator. occurrences of an allocator of anonymous access type. @node No_Asynchronous_Control,No_Calendar,No_Anonymous_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1c5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1c6} @subsection No_Asynchronous_Control @@ -12283,7 +12347,7 @@ occurrences of an allocator of anonymous access type. dependences on the predefined package Asynchronous_Task_Control. @node No_Calendar,No_Coextensions,No_Asynchronous_Control,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1c6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1c7} @subsection No_Calendar @@ -12293,7 +12357,7 @@ dependences on the predefined package Asynchronous_Task_Control. dependences on package Calendar. @node No_Coextensions,No_Default_Initialization,No_Calendar,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1c7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1c8} @subsection No_Coextensions @@ -12303,7 +12367,7 @@ dependences on package Calendar. coextensions. See 3.10.2. @node No_Default_Initialization,No_Delay,No_Coextensions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1c8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1c9} @subsection No_Default_Initialization @@ -12320,7 +12384,7 @@ is to prohibit all cases of variables declared without a specific initializer (including the case of OUT scalar parameters). @node No_Delay,No_Dependence,No_Default_Initialization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1c9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1ca} @subsection No_Delay @@ -12330,7 +12394,7 @@ initializer (including the case of OUT scalar parameters). delay statements and no semantic dependences on package Calendar. @node No_Dependence,No_Direct_Boolean_Operators,No_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1ca} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1cb} @subsection No_Dependence @@ -12340,7 +12404,7 @@ delay statements and no semantic dependences on package Calendar. dependences on a library unit. @node No_Direct_Boolean_Operators,No_Dispatch,No_Dependence,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1cb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1cc} @subsection No_Direct_Boolean_Operators @@ -12353,7 +12417,7 @@ protocol requires the use of short-circuit (and then, or else) forms for all composite boolean operations. @node No_Dispatch,No_Dispatching_Calls,No_Direct_Boolean_Operators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1cc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1cd} @subsection No_Dispatch @@ -12363,7 +12427,7 @@ composite boolean operations. occurrences of @code{T'Class}, for any (tagged) subtype @code{T}. @node No_Dispatching_Calls,No_Dynamic_Attachment,No_Dispatch,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1cd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1ce} @subsection No_Dispatching_Calls @@ -12424,7 +12488,7 @@ end Example; @end example @node No_Dynamic_Attachment,No_Dynamic_Priorities,No_Dispatching_Calls,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1ce} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1cf} @subsection No_Dynamic_Attachment @@ -12443,7 +12507,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Dynamic_Priorities,No_Entry_Calls_In_Elaboration_Code,No_Dynamic_Attachment,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1cf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1d0} @subsection No_Dynamic_Priorities @@ -12452,7 +12516,7 @@ warnings on obsolescent features are activated). [RM D.7] There are no semantic dependencies on the package Dynamic_Priorities. @node No_Entry_Calls_In_Elaboration_Code,No_Enumeration_Maps,No_Dynamic_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1d0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1d1} @subsection No_Entry_Calls_In_Elaboration_Code @@ -12464,7 +12528,7 @@ restriction, the compiler can assume that no code past an accept statement in a task can be executed at elaboration time. @node No_Enumeration_Maps,No_Exception_Handlers,No_Entry_Calls_In_Elaboration_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1d1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1d2} @subsection No_Enumeration_Maps @@ -12475,7 +12539,7 @@ enumeration maps are used (that is Image and Value attributes applied to enumeration types). @node No_Exception_Handlers,No_Exception_Propagation,No_Enumeration_Maps,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1d2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1d3} @subsection No_Exception_Handlers @@ -12500,7 +12564,7 @@ statement generated by the compiler). The Line parameter when nonzero represents the line number in the source program where the raise occurs. @node No_Exception_Propagation,No_Exception_Registration,No_Exception_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1d3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1d4} @subsection No_Exception_Propagation @@ -12517,7 +12581,7 @@ the package GNAT.Current_Exception is not permitted, and reraise statements (raise with no operand) are not permitted. @node No_Exception_Registration,No_Exceptions,No_Exception_Propagation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1d4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1d5} @subsection No_Exception_Registration @@ -12531,7 +12595,7 @@ code is simplified by omitting the otherwise-required global registration of exceptions when they are declared. @node No_Exceptions,No_Finalization,No_Exception_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1d5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1d6} @subsection No_Exceptions @@ -12542,7 +12606,7 @@ raise statements and no exception handlers and also suppresses the generation of language-defined run-time checks. @node No_Finalization,No_Fixed_Point,No_Exceptions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1d6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1d7} @subsection No_Finalization @@ -12583,7 +12647,7 @@ object or a nested component, either declared on the stack or on the heap. The deallocation of a controlled object no longer finalizes its contents. @node No_Fixed_Point,No_Floating_Point,No_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1d7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1d8} @subsection No_Fixed_Point @@ -12593,7 +12657,7 @@ deallocation of a controlled object no longer finalizes its contents. occurrences of fixed point types and operations. @node No_Floating_Point,No_Implicit_Conditionals,No_Fixed_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1d8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1d9} @subsection No_Floating_Point @@ -12603,7 +12667,7 @@ occurrences of fixed point types and operations. occurrences of floating point types and operations. @node No_Implicit_Conditionals,No_Implicit_Dynamic_Code,No_Floating_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1d9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1da} @subsection No_Implicit_Conditionals @@ -12619,7 +12683,7 @@ normal manner. Constructs generating implicit conditionals include comparisons of composite objects and the Max/Min attributes. @node No_Implicit_Dynamic_Code,No_Implicit_Heap_Allocations,No_Implicit_Conditionals,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1da} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1db} @subsection No_Implicit_Dynamic_Code @@ -12649,7 +12713,7 @@ foreign-language convention; primitive operations of nested tagged types. @node No_Implicit_Heap_Allocations,No_Implicit_Protected_Object_Allocations,No_Implicit_Dynamic_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1db} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1dc} @subsection No_Implicit_Heap_Allocations @@ -12658,7 +12722,7 @@ types. [RM D.7] No constructs are allowed to cause implicit heap allocation. @node No_Implicit_Protected_Object_Allocations,No_Implicit_Task_Allocations,No_Implicit_Heap_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1dc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1dd} @subsection No_Implicit_Protected_Object_Allocations @@ -12668,7 +12732,7 @@ types. protected object. @node No_Implicit_Task_Allocations,No_Initialize_Scalars,No_Implicit_Protected_Object_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1dd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1de} @subsection No_Implicit_Task_Allocations @@ -12677,7 +12741,7 @@ protected object. [GNAT] No constructs are allowed to cause implicit heap allocation of a task. @node No_Initialize_Scalars,No_IO,No_Implicit_Task_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1de} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1df} @subsection No_Initialize_Scalars @@ -12689,7 +12753,7 @@ code, and in particular eliminates dummy null initialization routines that are otherwise generated for some record and array types. @node No_IO,No_Local_Allocators,No_Initialize_Scalars,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1df} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1e0} @subsection No_IO @@ -12700,7 +12764,7 @@ dependences on any of the library units Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO, Wide_Wide_Text_IO, or Stream_IO. @node No_Local_Allocators,No_Local_Protected_Objects,No_IO,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1e0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1e1} @subsection No_Local_Allocators @@ -12711,7 +12775,7 @@ occurrences of an allocator in subprograms, generic subprograms, tasks, and entry bodies. @node No_Local_Protected_Objects,No_Local_Timing_Events,No_Local_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1e1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1e2} @subsection No_Local_Protected_Objects @@ -12721,7 +12785,7 @@ and entry bodies. only declared at the library level. @node No_Local_Timing_Events,No_Long_Long_Integers,No_Local_Protected_Objects,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1e2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1e3} @subsection No_Local_Timing_Events @@ -12731,7 +12795,7 @@ only declared at the library level. declared at the library level. @node No_Long_Long_Integers,No_Multiple_Elaboration,No_Local_Timing_Events,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1e3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1e4} @subsection No_Long_Long_Integers @@ -12743,7 +12807,7 @@ implicit base type is Long_Long_Integer, and modular types whose size exceeds Long_Integer'Size. @node No_Multiple_Elaboration,No_Nested_Finalization,No_Long_Long_Integers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1e4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1e5} @subsection No_Multiple_Elaboration @@ -12759,7 +12823,7 @@ possible, including non-Ada main programs and Stand Alone libraries, are not permitted and will be diagnosed by the binder. @node No_Nested_Finalization,No_Protected_Type_Allocators,No_Multiple_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1e5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1e6} @subsection No_Nested_Finalization @@ -12768,7 +12832,7 @@ permitted and will be diagnosed by the binder. [RM D.7] All objects requiring finalization are declared at the library level. @node No_Protected_Type_Allocators,No_Protected_Types,No_Nested_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1e6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1e7} @subsection No_Protected_Type_Allocators @@ -12778,7 +12842,7 @@ permitted and will be diagnosed by the binder. expressions that attempt to allocate protected objects. @node No_Protected_Types,No_Recursion,No_Protected_Type_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1e7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1e8} @subsection No_Protected_Types @@ -12788,7 +12852,7 @@ expressions that attempt to allocate protected objects. declarations of protected types or protected objects. @node No_Recursion,No_Reentrancy,No_Protected_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1e8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1e9} @subsection No_Recursion @@ -12798,7 +12862,7 @@ declarations of protected types or protected objects. part of its execution. @node No_Reentrancy,No_Relative_Delay,No_Recursion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1e9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1ea} @subsection No_Reentrancy @@ -12808,7 +12872,7 @@ part of its execution. two tasks at the same time. @node No_Relative_Delay,No_Requeue_Statements,No_Reentrancy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1ea} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1eb} @subsection No_Relative_Delay @@ -12819,7 +12883,7 @@ relative statements and prevents expressions such as @code{delay 1.23;} from appearing in source code. @node No_Requeue_Statements,No_Secondary_Stack,No_Relative_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{1eb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{1ec} @subsection No_Requeue_Statements @@ -12837,7 +12901,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on oNobsolescent features are activated). @node No_Secondary_Stack,No_Select_Statements,No_Requeue_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{1ec} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{1ed} @subsection No_Secondary_Stack @@ -12850,7 +12914,7 @@ stack is used to implement functions returning unconstrained objects secondary stacks for tasks (excluding the environment task) at run time. @node No_Select_Statements,No_Specific_Termination_Handlers,No_Secondary_Stack,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{1ed} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{1ee} @subsection No_Select_Statements @@ -12860,7 +12924,7 @@ secondary stacks for tasks (excluding the environment task) at run time. kind are permitted, that is the keyword @code{select} may not appear. @node No_Specific_Termination_Handlers,No_Specification_of_Aspect,No_Select_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{1ee} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{1ef} @subsection No_Specific_Termination_Handlers @@ -12870,7 +12934,7 @@ kind are permitted, that is the keyword @code{select} may not appear. or to Ada.Task_Termination.Specific_Handler. @node No_Specification_of_Aspect,No_Standard_Allocators_After_Elaboration,No_Specific_Termination_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{1ef} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{1f0} @subsection No_Specification_of_Aspect @@ -12881,7 +12945,7 @@ specification, attribute definition clause, or pragma is given for a given aspect. @node No_Standard_Allocators_After_Elaboration,No_Standard_Storage_Pools,No_Specification_of_Aspect,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{1f0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{1f1} @subsection No_Standard_Allocators_After_Elaboration @@ -12893,7 +12957,7 @@ library items of the partition has completed. Otherwise, Storage_Error is raised. @node No_Standard_Storage_Pools,No_Stream_Optimizations,No_Standard_Allocators_After_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{1f1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{1f2} @subsection No_Standard_Storage_Pools @@ -12905,7 +12969,7 @@ have an explicit Storage_Pool attribute defined specifying a user-defined storage pool. @node No_Stream_Optimizations,No_Streams,No_Standard_Storage_Pools,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{1f2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{1f3} @subsection No_Stream_Optimizations @@ -12918,7 +12982,7 @@ due to their superior performance. When this restriction is in effect, the compiler performs all IO operations on a per-character basis. @node No_Streams,No_Task_Allocators,No_Stream_Optimizations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{1f3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{1f4} @subsection No_Streams @@ -12939,7 +13003,7 @@ unit declaring a tagged type should be compiled with the restriction, though this is not required. @node No_Task_Allocators,No_Task_At_Interrupt_Priority,No_Streams,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{1f4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{1f5} @subsection No_Task_Allocators @@ -12949,7 +13013,7 @@ though this is not required. or types containing task subcomponents. @node No_Task_At_Interrupt_Priority,No_Task_Attributes_Package,No_Task_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{1f5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{1f6} @subsection No_Task_At_Interrupt_Priority @@ -12961,7 +13025,7 @@ a consequence, the tasks are always created with a priority below that an interrupt priority. @node No_Task_Attributes_Package,No_Task_Hierarchy,No_Task_At_Interrupt_Priority,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{1f6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{1f7} @subsection No_Task_Attributes_Package @@ -12978,7 +13042,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Task_Hierarchy,No_Task_Termination,No_Task_Attributes_Package,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{1f7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{1f8} @subsection No_Task_Hierarchy @@ -12988,7 +13052,7 @@ warnings on obsolescent features are activated). directly on the environment task of the partition. @node No_Task_Termination,No_Tasking,No_Task_Hierarchy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{1f8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{1f9} @subsection No_Task_Termination @@ -12997,7 +13061,7 @@ directly on the environment task of the partition. [RM D.7] Tasks that terminate are erroneous. @node No_Tasking,No_Terminate_Alternatives,No_Task_Termination,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{1f9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{1fa} @subsection No_Tasking @@ -13010,7 +13074,7 @@ and cause an error message to be output either by the compiler or binder. @node No_Terminate_Alternatives,No_Unchecked_Access,No_Tasking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{1fa} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{1fb} @subsection No_Terminate_Alternatives @@ -13019,7 +13083,7 @@ binder. [RM D.7] There are no selective accepts with terminate alternatives. @node No_Unchecked_Access,No_Unchecked_Conversion,No_Terminate_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{1fb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{1fc} @subsection No_Unchecked_Access @@ -13029,7 +13093,7 @@ binder. occurrences of the Unchecked_Access attribute. @node No_Unchecked_Conversion,No_Unchecked_Deallocation,No_Unchecked_Access,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{1fc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{1fd} @subsection No_Unchecked_Conversion @@ -13039,7 +13103,7 @@ occurrences of the Unchecked_Access attribute. dependences on the predefined generic function Unchecked_Conversion. @node No_Unchecked_Deallocation,No_Use_Of_Entity,No_Unchecked_Conversion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{1fd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{1fe} @subsection No_Unchecked_Deallocation @@ -13049,7 +13113,7 @@ dependences on the predefined generic function Unchecked_Conversion. dependences on the predefined generic procedure Unchecked_Deallocation. @node No_Use_Of_Entity,Pure_Barriers,No_Unchecked_Deallocation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{1fe} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{1ff} @subsection No_Use_Of_Entity @@ -13069,7 +13133,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line @end example @node Pure_Barriers,Simple_Barriers,No_Use_Of_Entity,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{1ff} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{200} @subsection Pure_Barriers @@ -13120,7 +13184,7 @@ but still ensures absence of side effects, exceptions, and recursion during the evaluation of the barriers. @node Simple_Barriers,Static_Priorities,Pure_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{200} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{201} @subsection Simple_Barriers @@ -13139,7 +13203,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Static_Priorities,Static_Storage_Size,Simple_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{201} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{202} @subsection Static_Priorities @@ -13150,7 +13214,7 @@ are static, and that there are no dependences on the package @code{Ada.Dynamic_Priorities}. @node Static_Storage_Size,,Static_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{202} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{203} @subsection Static_Storage_Size @@ -13160,7 +13224,7 @@ are static, and that there are no dependences on the package in a Storage_Size pragma or attribute definition clause is static. @node Program Unit Level Restrictions,,Partition-Wide Restrictions,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{203}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{204} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{204}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{205} @section Program Unit Level Restrictions @@ -13190,7 +13254,7 @@ other compilation units in the partition. @end menu @node No_Elaboration_Code,No_Dynamic_Sized_Objects,,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{205} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{206} @subsection No_Elaboration_Code @@ -13246,7 +13310,7 @@ associated with the unit. This counter is typically used to check for access before elaboration and to control multiple elaboration attempts. @node No_Dynamic_Sized_Objects,No_Entry_Queue,No_Elaboration_Code,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{206} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{207} @subsection No_Dynamic_Sized_Objects @@ -13264,7 +13328,7 @@ access discriminants. It is often a good idea to combine this restriction with No_Secondary_Stack. @node No_Entry_Queue,No_Implementation_Aspect_Specifications,No_Dynamic_Sized_Objects,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{207} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{208} @subsection No_Entry_Queue @@ -13277,7 +13341,7 @@ checked at compile time. A program execution is erroneous if an attempt is made to queue a second task on such an entry. @node No_Implementation_Aspect_Specifications,No_Implementation_Attributes,No_Entry_Queue,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{208} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{209} @subsection No_Implementation_Aspect_Specifications @@ -13288,7 +13352,7 @@ GNAT-defined aspects are present. With this restriction, the only aspects that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Attributes,No_Implementation_Identifiers,No_Implementation_Aspect_Specifications,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{209} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{20a} @subsection No_Implementation_Attributes @@ -13300,7 +13364,7 @@ attributes that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Identifiers,No_Implementation_Pragmas,No_Implementation_Attributes,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{20a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{20b} @subsection No_Implementation_Identifiers @@ -13311,7 +13375,7 @@ implementation-defined identifiers (marked with pragma Implementation_Defined) occur within language-defined packages. @node No_Implementation_Pragmas,No_Implementation_Restrictions,No_Implementation_Identifiers,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{20b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{20c} @subsection No_Implementation_Pragmas @@ -13322,7 +13386,7 @@ GNAT-defined pragmas are present. With this restriction, the only pragmas that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Restrictions,No_Implementation_Units,No_Implementation_Pragmas,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{20c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{20d} @subsection No_Implementation_Restrictions @@ -13334,7 +13398,7 @@ are present. With this restriction, the only other restriction identifiers that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Units,No_Implicit_Aliasing,No_Implementation_Restrictions,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{20d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{20e} @subsection No_Implementation_Units @@ -13345,7 +13409,7 @@ mention in the context clause of any implementation-defined descendants of packages Ada, Interfaces, or System. @node No_Implicit_Aliasing,No_Implicit_Loops,No_Implementation_Units,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{20e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{20f} @subsection No_Implicit_Aliasing @@ -13360,7 +13424,7 @@ to be aliased, and in such cases, it can always be replaced by the standard attribute Unchecked_Access which is preferable. @node No_Implicit_Loops,No_Obsolescent_Features,No_Implicit_Aliasing,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{20f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{210} @subsection No_Implicit_Loops @@ -13377,7 +13441,7 @@ arrays larger than about 5000 scalar components. Note that if this restriction is set in the spec of a package, it will not apply to its body. @node No_Obsolescent_Features,No_Wide_Characters,No_Implicit_Loops,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{210} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{211} @subsection No_Obsolescent_Features @@ -13387,7 +13451,7 @@ is set in the spec of a package, it will not apply to its body. features are used, as defined in Annex J of the Ada Reference Manual. @node No_Wide_Characters,Static_Dispatch_Tables,No_Obsolescent_Features,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{211} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{212} @subsection No_Wide_Characters @@ -13401,7 +13465,7 @@ appear in the program (that is literals representing characters not in type @code{Character}). @node Static_Dispatch_Tables,SPARK_05,No_Wide_Characters,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{212} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{213} @subsection Static_Dispatch_Tables @@ -13411,7 +13475,7 @@ type @code{Character}). associated with dispatch tables can be placed in read-only memory. @node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{213} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{214} @subsection SPARK_05 @@ -13785,7 +13849,7 @@ violations will be reported for constructs forbidden in SPARK 95, instead of SPARK 2005. @node Implementation Advice,Implementation Defined Characteristics,Standard and Implementation Defined Restrictions,Top -@anchor{gnat_rm/implementation_advice doc}@anchor{214}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a}@anchor{gnat_rm/implementation_advice id1}@anchor{215} +@anchor{gnat_rm/implementation_advice doc}@anchor{215}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a}@anchor{gnat_rm/implementation_advice id1}@anchor{216} @chapter Implementation Advice @@ -13882,7 +13946,7 @@ case the text describes what GNAT does and why. @end menu @node RM 1 1 3 20 Error Detection,RM 1 1 3 31 Child Units,,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{216} +@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{217} @section RM 1.1.3(20): Error Detection @@ -13899,7 +13963,7 @@ or diagnosed at compile time. @geindex Child Units @node RM 1 1 3 31 Child Units,RM 1 1 5 12 Bounded Errors,RM 1 1 3 20 Error Detection,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{217} +@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{218} @section RM 1.1.3(31): Child Units @@ -13915,7 +13979,7 @@ Followed. @geindex Bounded errors @node RM 1 1 5 12 Bounded Errors,RM 2 8 16 Pragmas,RM 1 1 3 31 Child Units,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{218} +@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{219} @section RM 1.1.5(12): Bounded Errors @@ -13932,7 +13996,7 @@ runtime. @geindex Pragmas @node RM 2 8 16 Pragmas,RM 2 8 17-19 Pragmas,RM 1 1 5 12 Bounded Errors,Implementation Advice -@anchor{gnat_rm/implementation_advice id2}@anchor{219}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{21a} +@anchor{gnat_rm/implementation_advice id2}@anchor{21a}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{21b} @section RM 2.8(16): Pragmas @@ -14045,7 +14109,7 @@ that this advice not be followed. For details see @ref{7,,Implementation Defined Pragmas}. @node RM 2 8 17-19 Pragmas,RM 3 5 2 5 Alternative Character Sets,RM 2 8 16 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{21b} +@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{21c} @section RM 2.8(17-19): Pragmas @@ -14066,14 +14130,14 @@ replacing @code{library_items}." @end itemize @end quotation -See @ref{21a,,RM 2.8(16); Pragmas}. +See @ref{21b,,RM 2.8(16); Pragmas}. @geindex Character Sets @geindex Alternative Character Sets @node RM 3 5 2 5 Alternative Character Sets,RM 3 5 4 28 Integer Types,RM 2 8 17-19 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{21c} +@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{21d} @section RM 3.5.2(5): Alternative Character Sets @@ -14101,7 +14165,7 @@ there is no such restriction. @geindex Integer types @node RM 3 5 4 28 Integer Types,RM 3 5 4 29 Integer Types,RM 3 5 2 5 Alternative Character Sets,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{21d} +@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{21e} @section RM 3.5.4(28): Integer Types @@ -14120,7 +14184,7 @@ are supported for convenient interface to C, and so that all hardware types of the machine are easily available. @node RM 3 5 4 29 Integer Types,RM 3 5 5 8 Enumeration Values,RM 3 5 4 28 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{21e} +@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{21f} @section RM 3.5.4(29): Integer Types @@ -14136,7 +14200,7 @@ Followed. @geindex Enumeration values @node RM 3 5 5 8 Enumeration Values,RM 3 5 7 17 Float Types,RM 3 5 4 29 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{21f} +@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{220} @section RM 3.5.5(8): Enumeration Values @@ -14156,7 +14220,7 @@ Followed. @geindex Float types @node RM 3 5 7 17 Float Types,RM 3 6 2 11 Multidimensional Arrays,RM 3 5 5 8 Enumeration Values,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{220} +@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{221} @section RM 3.5.7(17): Float Types @@ -14186,7 +14250,7 @@ since this is a software rather than a hardware format. @geindex multidimensional @node RM 3 6 2 11 Multidimensional Arrays,RM 9 6 30-31 Duration'Small,RM 3 5 7 17 Float Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{221} +@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{222} @section RM 3.6.2(11): Multidimensional Arrays @@ -14204,7 +14268,7 @@ Followed. @geindex Duration'Small @node RM 9 6 30-31 Duration'Small,RM 10 2 1 12 Consistent Representation,RM 3 6 2 11 Multidimensional Arrays,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{222} +@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{223} @section RM 9.6(30-31): Duration'Small @@ -14225,7 +14289,7 @@ it need not be the same time base as used for @code{Calendar.Clock}." Followed. @node RM 10 2 1 12 Consistent Representation,RM 11 4 1 19 Exception Information,RM 9 6 30-31 Duration'Small,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{223} +@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{224} @section RM 10.2.1(12): Consistent Representation @@ -14247,7 +14311,7 @@ advice without severely impacting efficiency of execution. @geindex Exception information @node RM 11 4 1 19 Exception Information,RM 11 5 28 Suppression of Checks,RM 10 2 1 12 Consistent Representation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{224} +@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{225} @section RM 11.4.1(19): Exception Information @@ -14278,7 +14342,7 @@ Pragma @code{Discard_Names}. @geindex suppression of @node RM 11 5 28 Suppression of Checks,RM 13 1 21-24 Representation Clauses,RM 11 4 1 19 Exception Information,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{225} +@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{226} @section RM 11.5(28): Suppression of Checks @@ -14293,7 +14357,7 @@ Followed. @geindex Representation clauses @node RM 13 1 21-24 Representation Clauses,RM 13 2 6-8 Packed Types,RM 11 5 28 Suppression of Checks,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{226} +@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{227} @section RM 13.1 (21-24): Representation Clauses @@ -14342,7 +14406,7 @@ Followed. @geindex Packed types @node RM 13 2 6-8 Packed Types,RM 13 3 14-19 Address Clauses,RM 13 1 21-24 Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{227} +@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{228} @section RM 13.2(6-8): Packed Types @@ -14381,7 +14445,7 @@ Followed. @geindex Address clauses @node RM 13 3 14-19 Address Clauses,RM 13 3 29-35 Alignment Clauses,RM 13 2 6-8 Packed Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{228} +@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{229} @section RM 13.3(14-19): Address Clauses @@ -14434,7 +14498,7 @@ Followed. @geindex Alignment clauses @node RM 13 3 29-35 Alignment Clauses,RM 13 3 42-43 Size Clauses,RM 13 3 14-19 Address Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{229} +@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{22a} @section RM 13.3(29-35): Alignment Clauses @@ -14491,7 +14555,7 @@ Followed. @geindex Size clauses @node RM 13 3 42-43 Size Clauses,RM 13 3 50-56 Size Clauses,RM 13 3 29-35 Alignment Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{22a} +@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{22b} @section RM 13.3(42-43): Size Clauses @@ -14509,7 +14573,7 @@ object's @code{Alignment} (if the @code{Alignment} is nonzero)." Followed. @node RM 13 3 50-56 Size Clauses,RM 13 3 71-73 Component Size Clauses,RM 13 3 42-43 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{22b} +@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{22c} @section RM 13.3(50-56): Size Clauses @@ -14560,7 +14624,7 @@ Followed. @geindex Component_Size clauses @node RM 13 3 71-73 Component Size Clauses,RM 13 4 9-10 Enumeration Representation Clauses,RM 13 3 50-56 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{22c} +@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{22d} @section RM 13.3(71-73): Component Size Clauses @@ -14594,7 +14658,7 @@ Followed. @geindex enumeration @node RM 13 4 9-10 Enumeration Representation Clauses,RM 13 5 1 17-22 Record Representation Clauses,RM 13 3 71-73 Component Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{22d} +@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{22e} @section RM 13.4(9-10): Enumeration Representation Clauses @@ -14616,7 +14680,7 @@ Followed. @geindex records @node RM 13 5 1 17-22 Record Representation Clauses,RM 13 5 2 5 Storage Place Attributes,RM 13 4 9-10 Enumeration Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{22e} +@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{22f} @section RM 13.5.1(17-22): Record Representation Clauses @@ -14676,7 +14740,7 @@ and all mentioned features are implemented. @geindex Storage place attributes @node RM 13 5 2 5 Storage Place Attributes,RM 13 5 3 7-8 Bit Ordering,RM 13 5 1 17-22 Record Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{22f} +@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{230} @section RM 13.5.2(5): Storage Place Attributes @@ -14696,7 +14760,7 @@ Followed. There are no such components in GNAT. @geindex Bit ordering @node RM 13 5 3 7-8 Bit Ordering,RM 13 7 37 Address as Private,RM 13 5 2 5 Storage Place Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{230} +@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{231} @section RM 13.5.3(7-8): Bit Ordering @@ -14716,7 +14780,7 @@ Thus non-default bit ordering is not supported. @geindex as private type @node RM 13 7 37 Address as Private,RM 13 7 1 16 Address Operations,RM 13 5 3 7-8 Bit Ordering,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{231} +@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{232} @section RM 13.7(37): Address as Private @@ -14734,7 +14798,7 @@ Followed. @geindex operations of @node RM 13 7 1 16 Address Operations,RM 13 9 14-17 Unchecked Conversion,RM 13 7 37 Address as Private,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{232} +@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{233} @section RM 13.7.1(16): Address Operations @@ -14752,7 +14816,7 @@ operation raises @code{Program_Error}, since all operations make sense. @geindex Unchecked conversion @node RM 13 9 14-17 Unchecked Conversion,RM 13 11 23-25 Implicit Heap Usage,RM 13 7 1 16 Address Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{233} +@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{234} @section RM 13.9(14-17): Unchecked Conversion @@ -14796,7 +14860,7 @@ Followed. @geindex implicit @node RM 13 11 23-25 Implicit Heap Usage,RM 13 11 2 17 Unchecked Deallocation,RM 13 9 14-17 Unchecked Conversion,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{234} +@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{235} @section RM 13.11(23-25): Implicit Heap Usage @@ -14847,7 +14911,7 @@ Followed. @geindex Unchecked deallocation @node RM 13 11 2 17 Unchecked Deallocation,RM 13 13 2 1 6 Stream Oriented Attributes,RM 13 11 23-25 Implicit Heap Usage,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{235} +@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{236} @section RM 13.11.2(17): Unchecked Deallocation @@ -14862,7 +14926,7 @@ Followed. @geindex Stream oriented attributes @node RM 13 13 2 1 6 Stream Oriented Attributes,RM A 1 52 Names of Predefined Numeric Types,RM 13 11 2 17 Unchecked Deallocation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{236} +@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{237} @section RM 13.13.2(1.6): Stream Oriented Attributes @@ -14917,7 +14981,7 @@ the @emph{GNAT and Libraries} section of the @cite{GNAT User's Guide}. @end itemize @node RM A 1 52 Names of Predefined Numeric Types,RM A 3 2 49 Ada Characters Handling,RM 13 13 2 1 6 Stream Oriented Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{237} +@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{238} @section RM A.1(52): Names of Predefined Numeric Types @@ -14935,7 +14999,7 @@ Followed. @geindex Ada.Characters.Handling @node RM A 3 2 49 Ada Characters Handling,RM A 4 4 106 Bounded-Length String Handling,RM A 1 52 Names of Predefined Numeric Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{238} +@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{239} @section RM A.3.2(49): @code{Ada.Characters.Handling} @@ -14952,7 +15016,7 @@ Followed. GNAT provides no such localized definitions. @geindex Bounded-length strings @node RM A 4 4 106 Bounded-Length String Handling,RM A 5 2 46-47 Random Number Generation,RM A 3 2 49 Ada Characters Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{239} +@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{23a} @section RM A.4.4(106): Bounded-Length String Handling @@ -14967,7 +15031,7 @@ Followed. No implicit pointers or dynamic allocation are used. @geindex Random number generation @node RM A 5 2 46-47 Random Number Generation,RM A 10 7 23 Get_Immediate,RM A 4 4 106 Bounded-Length String Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{23a} +@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{23b} @section RM A.5.2(46-47): Random Number Generation @@ -14996,7 +15060,7 @@ condition here to hold true. @geindex Get_Immediate @node RM A 10 7 23 Get_Immediate,RM B 1 39-41 Pragma Export,RM A 5 2 46-47 Random Number Generation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{23b} +@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{23c} @section RM A.10.7(23): @code{Get_Immediate} @@ -15020,7 +15084,7 @@ this functionality. @geindex Export @node RM B 1 39-41 Pragma Export,RM B 2 12-13 Package Interfaces,RM A 10 7 23 Get_Immediate,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{23c} +@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{23d} @section RM B.1(39-41): Pragma @code{Export} @@ -15068,7 +15132,7 @@ Followed. @geindex Interfaces @node RM B 2 12-13 Package Interfaces,RM B 3 63-71 Interfacing with C,RM B 1 39-41 Pragma Export,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{23d} +@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{23e} @section RM B.2(12-13): Package @code{Interfaces} @@ -15098,7 +15162,7 @@ Followed. GNAT provides all the packages described in this section. @geindex interfacing with @node RM B 3 63-71 Interfacing with C,RM B 4 95-98 Interfacing with COBOL,RM B 2 12-13 Package Interfaces,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{23e} +@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{23f} @section RM B.3(63-71): Interfacing with C @@ -15186,7 +15250,7 @@ Followed. @geindex interfacing with @node RM B 4 95-98 Interfacing with COBOL,RM B 5 22-26 Interfacing with Fortran,RM B 3 63-71 Interfacing with C,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{23f} +@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{240} @section RM B.4(95-98): Interfacing with COBOL @@ -15227,7 +15291,7 @@ Followed. @geindex interfacing with @node RM B 5 22-26 Interfacing with Fortran,RM C 1 3-5 Access to Machine Operations,RM B 4 95-98 Interfacing with COBOL,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{240} +@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{241} @section RM B.5(22-26): Interfacing with Fortran @@ -15278,7 +15342,7 @@ Followed. @geindex Machine operations @node RM C 1 3-5 Access to Machine Operations,RM C 1 10-16 Access to Machine Operations,RM B 5 22-26 Interfacing with Fortran,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{241} +@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{242} @section RM C.1(3-5): Access to Machine Operations @@ -15313,7 +15377,7 @@ object that is specified as exported." Followed. @node RM C 1 10-16 Access to Machine Operations,RM C 3 28 Interrupt Support,RM C 1 3-5 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{242} +@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{243} @section RM C.1(10-16): Access to Machine Operations @@ -15374,7 +15438,7 @@ Followed on any target supporting such operations. @geindex Interrupt support @node RM C 3 28 Interrupt Support,RM C 3 1 20-21 Protected Procedure Handlers,RM C 1 10-16 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{243} +@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{244} @section RM C.3(28): Interrupt Support @@ -15392,7 +15456,7 @@ of interrupt blocking. @geindex Protected procedure handlers @node RM C 3 1 20-21 Protected Procedure Handlers,RM C 3 2 25 Package Interrupts,RM C 3 28 Interrupt Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{244} +@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{245} @section RM C.3.1(20-21): Protected Procedure Handlers @@ -15418,7 +15482,7 @@ Followed. Compile time warnings are given when possible. @geindex Interrupts @node RM C 3 2 25 Package Interrupts,RM C 4 14 Pre-elaboration Requirements,RM C 3 1 20-21 Protected Procedure Handlers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{245} +@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{246} @section RM C.3.2(25): Package @code{Interrupts} @@ -15436,7 +15500,7 @@ Followed. @geindex Pre-elaboration requirements @node RM C 4 14 Pre-elaboration Requirements,RM C 5 8 Pragma Discard_Names,RM C 3 2 25 Package Interrupts,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{246} +@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{247} @section RM C.4(14): Pre-elaboration Requirements @@ -15452,7 +15516,7 @@ Followed. Executable code is generated in some cases, e.g., loops to initialize large arrays. @node RM C 5 8 Pragma Discard_Names,RM C 7 2 30 The Package Task_Attributes,RM C 4 14 Pre-elaboration Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{247} +@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{248} @section RM C.5(8): Pragma @code{Discard_Names} @@ -15470,7 +15534,7 @@ Followed. @geindex Task_Attributes @node RM C 7 2 30 The Package Task_Attributes,RM D 3 17 Locking Policies,RM C 5 8 Pragma Discard_Names,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{248} +@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{249} @section RM C.7.2(30): The Package Task_Attributes @@ -15491,7 +15555,7 @@ Not followed. This implementation is not targeted to such a domain. @geindex Locking Policies @node RM D 3 17 Locking Policies,RM D 4 16 Entry Queuing Policies,RM C 7 2 30 The Package Task_Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{249} +@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{24a} @section RM D.3(17): Locking Policies @@ -15508,7 +15572,7 @@ whose names (@code{Inheritance_Locking} and @geindex Entry queuing policies @node RM D 4 16 Entry Queuing Policies,RM D 6 9-10 Preemptive Abort,RM D 3 17 Locking Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{24a} +@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{24b} @section RM D.4(16): Entry Queuing Policies @@ -15523,7 +15587,7 @@ Followed. No such implementation-defined queuing policies exist. @geindex Preemptive abort @node RM D 6 9-10 Preemptive Abort,RM D 7 21 Tasking Restrictions,RM D 4 16 Entry Queuing Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{24b} +@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{24c} @section RM D.6(9-10): Preemptive Abort @@ -15549,7 +15613,7 @@ Followed. @geindex Tasking restrictions @node RM D 7 21 Tasking Restrictions,RM D 8 47-49 Monotonic Time,RM D 6 9-10 Preemptive Abort,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{24c} +@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{24d} @section RM D.7(21): Tasking Restrictions @@ -15568,7 +15632,7 @@ pragma @code{Profile (Restricted)} for more details. @geindex monotonic @node RM D 8 47-49 Monotonic Time,RM E 5 28-29 Partition Communication Subsystem,RM D 7 21 Tasking Restrictions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{24d} +@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{24e} @section RM D.8(47-49): Monotonic Time @@ -15603,7 +15667,7 @@ Followed. @geindex PCS @node RM E 5 28-29 Partition Communication Subsystem,RM F 7 COBOL Support,RM D 8 47-49 Monotonic Time,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{24e} +@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{24f} @section RM E.5(28-29): Partition Communication Subsystem @@ -15631,7 +15695,7 @@ GNAT. @geindex COBOL support @node RM F 7 COBOL Support,RM F 1 2 Decimal Radix Support,RM E 5 28-29 Partition Communication Subsystem,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{24f} +@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{250} @section RM F(7): COBOL Support @@ -15651,7 +15715,7 @@ Followed. @geindex Decimal radix support @node RM F 1 2 Decimal Radix Support,RM G Numerics,RM F 7 COBOL Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{250} +@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{251} @section RM F.1(2): Decimal Radix Support @@ -15667,7 +15731,7 @@ representations. @geindex Numerics @node RM G Numerics,RM G 1 1 56-58 Complex Types,RM F 1 2 Decimal Radix Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{251} +@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{252} @section RM G: Numerics @@ -15687,7 +15751,7 @@ Followed. @geindex Complex types @node RM G 1 1 56-58 Complex Types,RM G 1 2 49 Complex Elementary Functions,RM G Numerics,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{252} +@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{253} @section RM G.1.1(56-58): Complex Types @@ -15749,7 +15813,7 @@ Followed. @geindex Complex elementary functions @node RM G 1 2 49 Complex Elementary Functions,RM G 2 4 19 Accuracy Requirements,RM G 1 1 56-58 Complex Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{253} +@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{254} @section RM G.1.2(49): Complex Elementary Functions @@ -15771,7 +15835,7 @@ Followed. @geindex Accuracy requirements @node RM G 2 4 19 Accuracy Requirements,RM G 2 6 15 Complex Arithmetic Accuracy,RM G 1 2 49 Complex Elementary Functions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{254} +@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{255} @section RM G.2.4(19): Accuracy Requirements @@ -15795,7 +15859,7 @@ Followed. @geindex complex arithmetic @node RM G 2 6 15 Complex Arithmetic Accuracy,RM H 6 15/2 Pragma Partition_Elaboration_Policy,RM G 2 4 19 Accuracy Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{255} +@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{256} @section RM G.2.6(15): Complex Arithmetic Accuracy @@ -15813,7 +15877,7 @@ Followed. @geindex Sequential elaboration policy @node RM H 6 15/2 Pragma Partition_Elaboration_Policy,,RM G 2 6 15 Complex Arithmetic Accuracy,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{256} +@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{257} @section RM H.6(15/2): Pragma Partition_Elaboration_Policy @@ -15828,7 +15892,7 @@ immediately terminated." Not followed. @node Implementation Defined Characteristics,Intrinsic Subprograms,Implementation Advice,Top -@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b}@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{257}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{258} +@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b}@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{258}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{259} @chapter Implementation Defined Characteristics @@ -17024,7 +17088,7 @@ When the @code{Pattern} parameter is not the null string, it is interpreted according to the syntax of regular expressions as defined in the @code{GNAT.Regexp} package. -See @ref{259,,GNAT.Regexp (g-regexp.ads)}. +See @ref{25a,,GNAT.Regexp (g-regexp.ads)}. @itemize * @@ -18073,7 +18137,7 @@ H.4(27)." There are no restrictions on pragma @code{Restrictions}. @node Intrinsic Subprograms,Representation Clauses and Pragmas,Implementation Defined Characteristics,Top -@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{25a}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{25b} +@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{25b}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{25c} @chapter Intrinsic Subprograms @@ -18111,7 +18175,7 @@ Ada standard does not require Ada compilers to implement this feature. @end menu @node Intrinsic Operators,Compilation_ISO_Date,,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{25c}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{25d} +@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{25d}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{25e} @section Intrinsic Operators @@ -18142,7 +18206,7 @@ It is also possible to specify such operators for private types, if the full views are appropriate arithmetic types. @node Compilation_ISO_Date,Compilation_Date,Intrinsic Operators,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{25e}@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{25f} +@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{25f}@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{260} @section Compilation_ISO_Date @@ -18156,7 +18220,7 @@ application program should simply call the function the current compilation (in local time format YYYY-MM-DD). @node Compilation_Date,Compilation_Time,Compilation_ISO_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{260}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{261} +@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{261}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{262} @section Compilation_Date @@ -18166,7 +18230,7 @@ Same as Compilation_ISO_Date, except the string is in the form MMM DD YYYY. @node Compilation_Time,Enclosing_Entity,Compilation_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{262}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{263} +@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{263}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{264} @section Compilation_Time @@ -18180,7 +18244,7 @@ application program should simply call the function the current compilation (in local time format HH:MM:SS). @node Enclosing_Entity,Exception_Information,Compilation_Time,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{264}@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{265} +@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{265}@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{266} @section Enclosing_Entity @@ -18194,7 +18258,7 @@ application program should simply call the function the current subprogram, package, task, entry, or protected subprogram. @node Exception_Information,Exception_Message,Enclosing_Entity,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{266}@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{267} +@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{267}@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{268} @section Exception_Information @@ -18208,7 +18272,7 @@ so an application program should simply call the function the exception information associated with the current exception. @node Exception_Message,Exception_Name,Exception_Information,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{268}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{269} +@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{269}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{26a} @section Exception_Message @@ -18222,7 +18286,7 @@ so an application program should simply call the function the message associated with the current exception. @node Exception_Name,File,Exception_Message,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{26a}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{26b} +@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{26b}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{26c} @section Exception_Name @@ -18236,7 +18300,7 @@ so an application program should simply call the function the name of the current exception. @node File,Line,Exception_Name,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{26c}@anchor{gnat_rm/intrinsic_subprograms file}@anchor{26d} +@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{26d}@anchor{gnat_rm/intrinsic_subprograms file}@anchor{26e} @section File @@ -18250,7 +18314,7 @@ application program should simply call the function file. @node Line,Shifts and Rotates,File,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{26e}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{26f} +@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{26f}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{270} @section Line @@ -18264,7 +18328,7 @@ application program should simply call the function source line. @node Shifts and Rotates,Source_Location,Line,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{270}@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{271} +@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{271}@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{272} @section Shifts and Rotates @@ -18303,7 +18367,7 @@ the Provide_Shift_Operators pragma, which provides the function declarations and corresponding pragma Import's for all five shift functions. @node Source_Location,,Shifts and Rotates,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{272}@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{273} +@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{273}@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{274} @section Source_Location @@ -18317,7 +18381,7 @@ application program should simply call the function source file location. @node Representation Clauses and Pragmas,Standard Library Routines,Intrinsic Subprograms,Top -@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d}@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{274}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{275} +@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d}@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{275}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{276} @chapter Representation Clauses and Pragmas @@ -18363,7 +18427,7 @@ and this section describes the additional capabilities provided. @end menu @node Alignment Clauses,Size Clauses,,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{276}@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{277} +@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{277}@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{278} @section Alignment Clauses @@ -18385,7 +18449,7 @@ For elementary types, the alignment is the minimum of the actual size of objects of the type divided by @code{Storage_Unit}, and the maximum alignment supported by the target. (This maximum alignment is given by the GNAT-specific attribute -@code{Standard'Maximum_Alignment}; see @ref{191,,Attribute Maximum_Alignment}.) +@code{Standard'Maximum_Alignment}; see @ref{192,,Attribute Maximum_Alignment}.) @geindex Maximum_Alignment attribute @@ -18494,7 +18558,7 @@ assumption is non-portable, and other compilers may choose different alignments for the subtype @code{RS}. @node Size Clauses,Storage_Size Clauses,Alignment Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{278}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{279} +@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{279}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{27a} @section Size Clauses @@ -18571,7 +18635,7 @@ if it is known that a Size value can be accommodated in an object of type Integer. @node Storage_Size Clauses,Size of Variant Record Objects,Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{27a}@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{27b} +@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{27b}@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{27c} @section Storage_Size Clauses @@ -18644,7 +18708,7 @@ Of course in practice, there will not be any explicit allocators in the case of such an access declaration. @node Size of Variant Record Objects,Biased Representation,Storage_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{27c}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{27d} +@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{27d}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{27e} @section Size of Variant Record Objects @@ -18754,7 +18818,7 @@ the maximum size, regardless of the current variant value, the variant value. @node Biased Representation,Value_Size and Object_Size Clauses,Size of Variant Record Objects,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{27e}@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{27f} +@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{27f}@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{280} @section Biased Representation @@ -18792,7 +18856,7 @@ biased representation can be used for all discrete types except for enumeration types for which a representation clause is given. @node Value_Size and Object_Size Clauses,Component_Size Clauses,Biased Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{280}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{281} +@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{281}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{282} @section Value_Size and Object_Size Clauses @@ -19108,7 +19172,7 @@ definition clause forces biased representation. This warning can be turned off using @code{-gnatw.B}. @node Component_Size Clauses,Bit_Order Clauses,Value_Size and Object_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{282}@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{283} +@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{283}@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{284} @section Component_Size Clauses @@ -19155,7 +19219,7 @@ and a pragma Pack for the same array type. if such duplicate clauses are given, the pragma Pack will be ignored. @node Bit_Order Clauses,Effect of Bit_Order on Byte Ordering,Component_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{284}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{285} +@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{285}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{286} @section Bit_Order Clauses @@ -19261,7 +19325,7 @@ if desired. The following section contains additional details regarding the issue of byte ordering. @node Effect of Bit_Order on Byte Ordering,Pragma Pack for Arrays,Bit_Order Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{286}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{287} +@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{287}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{288} @section Effect of Bit_Order on Byte Ordering @@ -19518,7 +19582,7 @@ to set the boolean constant @code{Master_Byte_First} in an appropriate manner. @node Pragma Pack for Arrays,Pragma Pack for Records,Effect of Bit_Order on Byte Ordering,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{288}@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{289} +@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{289}@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{28a} @section Pragma Pack for Arrays @@ -19635,7 +19699,7 @@ Here 31-bit packing is achieved as required, and no warning is generated, since in this case the programmer intention is clear. @node Pragma Pack for Records,Record Representation Clauses,Pragma Pack for Arrays,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{28a}@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{28b} +@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{28b}@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{28c} @section Pragma Pack for Records @@ -19720,7 +19784,7 @@ the @code{L6} field is aligned to the next byte boundary, and takes an integral number of bytes, i.e., 72 bits. @node Record Representation Clauses,Handling of Records with Holes,Pragma Pack for Records,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{28c}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{28d} +@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{28d}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{28e} @section Record Representation Clauses @@ -19798,7 +19862,7 @@ end record; @end example @node Handling of Records with Holes,Enumeration Clauses,Record Representation Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{28e}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{28f} +@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{28f}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{290} @section Handling of Records with Holes @@ -19875,7 +19939,7 @@ for Hrec'Size use 64; @end example @node Enumeration Clauses,Address Clauses,Handling of Records with Holes,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{290}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{291} +@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{291}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{292} @section Enumeration Clauses @@ -19918,7 +19982,7 @@ the overhead of converting representation values to the corresponding positional values, (i.e., the value delivered by the @code{Pos} attribute). @node Address Clauses,Use of Address Clauses for Memory-Mapped I/O,Enumeration Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{292}@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{293} +@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{293}@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{294} @section Address Clauses @@ -20247,7 +20311,7 @@ then the program compiles without the warning and when run will generate the output @code{X was not clobbered}. @node Use of Address Clauses for Memory-Mapped I/O,Effect of Convention on Representation,Address Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{294}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{295} +@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{295}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{296} @section Use of Address Clauses for Memory-Mapped I/O @@ -20305,7 +20369,7 @@ provides the pragma @code{Volatile_Full_Access} which can be used in lieu of pragma @code{Atomic} and will give the additional guarantee. @node Effect of Convention on Representation,Conventions and Anonymous Access Types,Use of Address Clauses for Memory-Mapped I/O,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{296}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{297} +@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{297}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{298} @section Effect of Convention on Representation @@ -20383,7 +20447,7 @@ when one of these values is read, any nonzero value is treated as True. @end itemize @node Conventions and Anonymous Access Types,Determining the Representations chosen by GNAT,Effect of Convention on Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{298}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{299} +@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{299}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{29a} @section Conventions and Anonymous Access Types @@ -20459,7 +20523,7 @@ package ConvComp is @end example @node Determining the Representations chosen by GNAT,,Conventions and Anonymous Access Types,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{29a}@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{29b} +@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{29b}@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{29c} @section Determining the Representations chosen by GNAT @@ -20611,7 +20675,7 @@ generated by the compiler into the original source to fix and guarantee the actual representation to be used. @node Standard Library Routines,The Implementation of Standard I/O,Representation Clauses and Pragmas,Top -@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e}@anchor{gnat_rm/standard_library_routines doc}@anchor{29c}@anchor{gnat_rm/standard_library_routines id1}@anchor{29d} +@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e}@anchor{gnat_rm/standard_library_routines doc}@anchor{29d}@anchor{gnat_rm/standard_library_routines id1}@anchor{29e} @chapter Standard Library Routines @@ -21435,7 +21499,7 @@ For packages in Interfaces and System, all the RM defined packages are available in GNAT, see the Ada 2012 RM for full details. @node The Implementation of Standard I/O,The GNAT Library,Standard Library Routines,Top -@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f}@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{29e}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{29f} +@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f}@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{29f}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2a0} @chapter The Implementation of Standard I/O @@ -21487,7 +21551,7 @@ these additional facilities are also described in this chapter. @end menu @node Standard I/O Packages,FORM Strings,,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2a0}@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2a1} +@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2a1}@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2a2} @section Standard I/O Packages @@ -21558,7 +21622,7 @@ flush the common I/O streams and in particular Standard_Output before elaborating the Ada code. @node FORM Strings,Direct_IO,Standard I/O Packages,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2a2}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2a3} +@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2a3}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2a4} @section FORM Strings @@ -21584,7 +21648,7 @@ unrecognized keyword appears in a form string, it is silently ignored and not considered invalid. @node Direct_IO,Sequential_IO,FORM Strings,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2a4}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2a5} +@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2a5}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2a6} @section Direct_IO @@ -21604,7 +21668,7 @@ There is no limit on the size of Direct_IO files, they are expanded as necessary to accommodate whatever records are written to the file. @node Sequential_IO,Text_IO,Direct_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2a6}@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2a7} +@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2a7}@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2a8} @section Sequential_IO @@ -21651,7 +21715,7 @@ using Stream_IO, and this is the preferred mechanism. In particular, the above program fragment rewritten to use Stream_IO will work correctly. @node Text_IO,Wide_Text_IO,Sequential_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2a8}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2a9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2a9}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2aa} @section Text_IO @@ -21734,7 +21798,7 @@ the file. @end menu @node Stream Pointer Positioning,Reading and Writing Non-Regular Files,,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2aa}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2ab} +@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2ab}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2ac} @subsection Stream Pointer Positioning @@ -21770,7 +21834,7 @@ between two Ada files, then the difference may be observable in some situations. @node Reading and Writing Non-Regular Files,Get_Immediate,Stream Pointer Positioning,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2ac}@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2ad} +@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2ad}@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2ae} @subsection Reading and Writing Non-Regular Files @@ -21821,7 +21885,7 @@ to read data past that end of file indication, until another end of file indication is entered. @node Get_Immediate,Treating Text_IO Files as Streams,Reading and Writing Non-Regular Files,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2ae}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2af} +@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2af}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2b0} @subsection Get_Immediate @@ -21839,7 +21903,7 @@ possible), it is undefined whether the FF character will be treated as a page mark. @node Treating Text_IO Files as Streams,Text_IO Extensions,Get_Immediate,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2b0}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2b1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2b1}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2b2} @subsection Treating Text_IO Files as Streams @@ -21855,7 +21919,7 @@ skipped and the effect is similar to that described above for @code{Get_Immediate}. @node Text_IO Extensions,Text_IO Facilities for Unbounded Strings,Treating Text_IO Files as Streams,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2b2}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2b3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2b3}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2b4} @subsection Text_IO Extensions @@ -21883,7 +21947,7 @@ the string is to be read. @end itemize @node Text_IO Facilities for Unbounded Strings,,Text_IO Extensions,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2b4}@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2b5} +@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2b5}@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2b6} @subsection Text_IO Facilities for Unbounded Strings @@ -21931,7 +21995,7 @@ files @code{a-szuzti.ads} and @code{a-szuzti.adb} provides similar extended @code{Wide_Wide_Text_IO} functionality for unbounded wide wide strings. @node Wide_Text_IO,Wide_Wide_Text_IO,Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2b6}@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2b7} +@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2b7}@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2b8} @section Wide_Text_IO @@ -22178,12 +22242,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<2>,Reading and Writing Non-Regular Files<2>,,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2b8}@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2b9} +@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2b9}@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2ba} @subsection Stream Pointer Positioning @code{Ada.Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2a9,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2aa,,Text_IO}). There is one additional case: If @code{Ada.Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22202,7 +22266,7 @@ to a normal program using @code{Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<2>,,Stream Pointer Positioning<2>,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2ba}@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2bb} +@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2bb}@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2bc} @subsection Reading and Writing Non-Regular Files @@ -22213,7 +22277,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Wide_Wide_Text_IO,Stream_IO,Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2bc}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2bd} +@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2bd}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2be} @section Wide_Wide_Text_IO @@ -22382,12 +22446,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<3>,Reading and Writing Non-Regular Files<3>,,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2bf} +@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2bf}@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2c0} @subsection Stream Pointer Positioning @code{Ada.Wide_Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2a9,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2aa,,Text_IO}). There is one additional case: If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22406,7 +22470,7 @@ to a normal program using @code{Wide_Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<3>,,Stream Pointer Positioning<3>,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2c1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2c1}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2c2} @subsection Reading and Writing Non-Regular Files @@ -22417,7 +22481,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Stream_IO,Text Translation,Wide_Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2c3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2c3}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2c4} @section Stream_IO @@ -22439,7 +22503,7 @@ manner described for stream attributes. @end itemize @node Text Translation,Shared Files,Stream_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2c5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2c5}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2c6} @section Text Translation @@ -22473,7 +22537,7 @@ mode. (corresponds to_O_U16TEXT). @end itemize @node Shared Files,Filenames encoding,Text Translation,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2c7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2c7}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2c8} @section Shared Files @@ -22536,7 +22600,7 @@ heterogeneous input-output. Although this approach will work in GNAT if for this purpose (using the stream attributes) @node Filenames encoding,File content encoding,Shared Files,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2c9} +@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2c9}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2ca} @section Filenames encoding @@ -22576,7 +22640,7 @@ platform. On the other Operating Systems the run-time is supporting UTF-8 natively. @node File content encoding,Open Modes,Filenames encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2ca}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2cb} +@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2cb}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2cc} @section File content encoding @@ -22609,7 +22673,7 @@ Unicode 8-bit encoding This encoding is only supported on the Windows platform. @node Open Modes,Operations on C Streams,File content encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2cd} +@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2cd}@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2ce} @section Open Modes @@ -22712,7 +22776,7 @@ subsequently requires switching from reading to writing or vice-versa, then the file is reopened in @code{r+} mode to permit the required operation. @node Operations on C Streams,Interfacing to C Streams,Open Modes,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2cf} +@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2cf}@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2d0} @section Operations on C Streams @@ -22872,7 +22936,7 @@ end Interfaces.C_Streams; @end example @node Interfacing to C Streams,,Operations on C Streams,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2d0}@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2d1} +@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2d1}@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2d2} @section Interfacing to C Streams @@ -22965,7 +23029,7 @@ imported from a C program, allowing an Ada file to operate on an existing C file. @node The GNAT Library,Interfacing to Other Languages,The Implementation of Standard I/O,Top -@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10}@anchor{gnat_rm/the_gnat_library doc}@anchor{2d2}@anchor{gnat_rm/the_gnat_library id1}@anchor{2d3} +@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10}@anchor{gnat_rm/the_gnat_library doc}@anchor{2d3}@anchor{gnat_rm/the_gnat_library id1}@anchor{2d4} @chapter The GNAT Library @@ -23158,7 +23222,7 @@ of GNAT, and will generate a warning message. @end menu @node Ada Characters Latin_9 a-chlat9 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,,The GNAT Library -@anchor{gnat_rm/the_gnat_library id2}@anchor{2d4}@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2d5} +@anchor{gnat_rm/the_gnat_library id2}@anchor{2d5}@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2d6} @section @code{Ada.Characters.Latin_9} (@code{a-chlat9.ads}) @@ -23175,7 +23239,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_1 a-cwila1 ads,Ada Characters Wide_Latin_9 a-cwila1 ads,Ada Characters Latin_9 a-chlat9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2d6}@anchor{gnat_rm/the_gnat_library id3}@anchor{2d7} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2d7}@anchor{gnat_rm/the_gnat_library id3}@anchor{2d8} @section @code{Ada.Characters.Wide_Latin_1} (@code{a-cwila1.ads}) @@ -23192,7 +23256,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_9 a-cwila1 ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id4}@anchor{2d8}@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila1-ads}@anchor{2d9} +@anchor{gnat_rm/the_gnat_library id4}@anchor{2d9}@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila1-ads}@anchor{2da} @section @code{Ada.Characters.Wide_Latin_9} (@code{a-cwila1.ads}) @@ -23209,7 +23273,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Characters Wide_Latin_9 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2da}@anchor{gnat_rm/the_gnat_library id5}@anchor{2db} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2db}@anchor{gnat_rm/the_gnat_library id5}@anchor{2dc} @section @code{Ada.Characters.Wide_Wide_Latin_1} (@code{a-chzla1.ads}) @@ -23226,7 +23290,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2dc}@anchor{gnat_rm/the_gnat_library id6}@anchor{2dd} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2dd}@anchor{gnat_rm/the_gnat_library id6}@anchor{2de} @section @code{Ada.Characters.Wide_Wide_Latin_9} (@code{a-chzla9.ads}) @@ -23243,7 +23307,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,Ada Containers Formal_Hashed_Maps a-cfhama ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id7}@anchor{2de}@anchor{gnat_rm/the_gnat_library ada-containers-formal-doubly-linked-lists-a-cfdlli-ads}@anchor{2df} +@anchor{gnat_rm/the_gnat_library id7}@anchor{2df}@anchor{gnat_rm/the_gnat_library ada-containers-formal-doubly-linked-lists-a-cfdlli-ads}@anchor{2e0} @section @code{Ada.Containers.Formal_Doubly_Linked_Lists} (@code{a-cfdlli.ads}) @@ -23262,7 +23326,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Hashed_Maps a-cfhama ads,Ada Containers Formal_Hashed_Sets a-cfhase ads,Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id8}@anchor{2e0}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-maps-a-cfhama-ads}@anchor{2e1} +@anchor{gnat_rm/the_gnat_library id8}@anchor{2e1}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-maps-a-cfhama-ads}@anchor{2e2} @section @code{Ada.Containers.Formal_Hashed_Maps} (@code{a-cfhama.ads}) @@ -23281,7 +23345,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Hashed_Sets a-cfhase ads,Ada Containers Formal_Ordered_Maps a-cforma ads,Ada Containers Formal_Hashed_Maps a-cfhama ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id9}@anchor{2e2}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-sets-a-cfhase-ads}@anchor{2e3} +@anchor{gnat_rm/the_gnat_library id9}@anchor{2e3}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-sets-a-cfhase-ads}@anchor{2e4} @section @code{Ada.Containers.Formal_Hashed_Sets} (@code{a-cfhase.ads}) @@ -23300,7 +23364,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Ordered_Maps a-cforma ads,Ada Containers Formal_Ordered_Sets a-cforse ads,Ada Containers Formal_Hashed_Sets a-cfhase ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id10}@anchor{2e4}@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-maps-a-cforma-ads}@anchor{2e5} +@anchor{gnat_rm/the_gnat_library id10}@anchor{2e5}@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-maps-a-cforma-ads}@anchor{2e6} @section @code{Ada.Containers.Formal_Ordered_Maps} (@code{a-cforma.ads}) @@ -23319,7 +23383,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Ordered_Sets a-cforse ads,Ada Containers Formal_Vectors a-cofove ads,Ada Containers Formal_Ordered_Maps a-cforma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-sets-a-cforse-ads}@anchor{2e6}@anchor{gnat_rm/the_gnat_library id11}@anchor{2e7} +@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-sets-a-cforse-ads}@anchor{2e7}@anchor{gnat_rm/the_gnat_library id11}@anchor{2e8} @section @code{Ada.Containers.Formal_Ordered_Sets} (@code{a-cforse.ads}) @@ -23338,7 +23402,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Vectors a-cofove ads,Ada Containers Formal_Indefinite_Vectors a-cfinve ads,Ada Containers Formal_Ordered_Sets a-cforse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id12}@anchor{2e8}@anchor{gnat_rm/the_gnat_library ada-containers-formal-vectors-a-cofove-ads}@anchor{2e9} +@anchor{gnat_rm/the_gnat_library id12}@anchor{2e9}@anchor{gnat_rm/the_gnat_library ada-containers-formal-vectors-a-cofove-ads}@anchor{2ea} @section @code{Ada.Containers.Formal_Vectors} (@code{a-cofove.ads}) @@ -23357,7 +23421,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Indefinite_Vectors a-cfinve ads,Ada Containers Functional_Vectors a-cofuve ads,Ada Containers Formal_Vectors a-cofove ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id13}@anchor{2ea}@anchor{gnat_rm/the_gnat_library ada-containers-formal-indefinite-vectors-a-cfinve-ads}@anchor{2eb} +@anchor{gnat_rm/the_gnat_library id13}@anchor{2eb}@anchor{gnat_rm/the_gnat_library ada-containers-formal-indefinite-vectors-a-cfinve-ads}@anchor{2ec} @section @code{Ada.Containers.Formal_Indefinite_Vectors} (@code{a-cfinve.ads}) @@ -23376,7 +23440,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Functional_Vectors a-cofuve ads,Ada Containers Functional_Sets a-cofuse ads,Ada Containers Formal_Indefinite_Vectors a-cfinve ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id14}@anchor{2ec}@anchor{gnat_rm/the_gnat_library ada-containers-functional-vectors-a-cofuve-ads}@anchor{2ed} +@anchor{gnat_rm/the_gnat_library id14}@anchor{2ed}@anchor{gnat_rm/the_gnat_library ada-containers-functional-vectors-a-cofuve-ads}@anchor{2ee} @section @code{Ada.Containers.Functional_Vectors} (@code{a-cofuve.ads}) @@ -23398,7 +23462,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Functional_Sets a-cofuse ads,Ada Containers Functional_Maps a-cofuma ads,Ada Containers Functional_Vectors a-cofuve ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-functional-sets-a-cofuse-ads}@anchor{2ee}@anchor{gnat_rm/the_gnat_library id15}@anchor{2ef} +@anchor{gnat_rm/the_gnat_library ada-containers-functional-sets-a-cofuse-ads}@anchor{2ef}@anchor{gnat_rm/the_gnat_library id15}@anchor{2f0} @section @code{Ada.Containers.Functional_Sets} (@code{a-cofuse.ads}) @@ -23420,7 +23484,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Functional_Maps a-cofuma ads,Ada Containers Bounded_Holders a-coboho ads,Ada Containers Functional_Sets a-cofuse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id16}@anchor{2f0}@anchor{gnat_rm/the_gnat_library ada-containers-functional-maps-a-cofuma-ads}@anchor{2f1} +@anchor{gnat_rm/the_gnat_library id16}@anchor{2f1}@anchor{gnat_rm/the_gnat_library ada-containers-functional-maps-a-cofuma-ads}@anchor{2f2} @section @code{Ada.Containers.Functional_Maps} (@code{a-cofuma.ads}) @@ -23442,7 +23506,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Bounded_Holders a-coboho ads,Ada Command_Line Environment a-colien ads,Ada Containers Functional_Maps a-cofuma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2f2}@anchor{gnat_rm/the_gnat_library id17}@anchor{2f3} +@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2f3}@anchor{gnat_rm/the_gnat_library id17}@anchor{2f4} @section @code{Ada.Containers.Bounded_Holders} (@code{a-coboho.ads}) @@ -23454,7 +23518,7 @@ This child of @code{Ada.Containers} defines a modified version of Indefinite_Holders that avoids heap allocation. @node Ada Command_Line Environment a-colien ads,Ada Command_Line Remove a-colire ads,Ada Containers Bounded_Holders a-coboho ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2f4}@anchor{gnat_rm/the_gnat_library id18}@anchor{2f5} +@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2f5}@anchor{gnat_rm/the_gnat_library id18}@anchor{2f6} @section @code{Ada.Command_Line.Environment} (@code{a-colien.ads}) @@ -23467,7 +23531,7 @@ provides a mechanism for obtaining environment values on systems where this concept makes sense. @node Ada Command_Line Remove a-colire ads,Ada Command_Line Response_File a-clrefi ads,Ada Command_Line Environment a-colien ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id19}@anchor{2f6}@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2f7} +@anchor{gnat_rm/the_gnat_library id19}@anchor{2f7}@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2f8} @section @code{Ada.Command_Line.Remove} (@code{a-colire.ads}) @@ -23485,7 +23549,7 @@ to further calls on the subprograms in @code{Ada.Command_Line} will not see the removed argument. @node Ada Command_Line Response_File a-clrefi ads,Ada Direct_IO C_Streams a-diocst ads,Ada Command_Line Remove a-colire ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id20}@anchor{2f8}@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2f9} +@anchor{gnat_rm/the_gnat_library id20}@anchor{2f9}@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2fa} @section @code{Ada.Command_Line.Response_File} (@code{a-clrefi.ads}) @@ -23505,7 +23569,7 @@ Using a response file allow passing a set of arguments to an executable longer than the maximum allowed by the system on the command line. @node Ada Direct_IO C_Streams a-diocst ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Command_Line Response_File a-clrefi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id21}@anchor{2fa}@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2fb} +@anchor{gnat_rm/the_gnat_library id21}@anchor{2fb}@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2fc} @section @code{Ada.Direct_IO.C_Streams} (@code{a-diocst.ads}) @@ -23520,7 +23584,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Direct_IO C_Streams a-diocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id22}@anchor{2fc}@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{2fd} +@anchor{gnat_rm/the_gnat_library id22}@anchor{2fd}@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{2fe} @section @code{Ada.Exceptions.Is_Null_Occurrence} (@code{a-einuoc.ads}) @@ -23534,7 +23598,7 @@ exception occurrence (@code{Null_Occurrence}) without raising an exception. @node Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Exceptions Traceback a-exctra ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id23}@anchor{2fe}@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{2ff} +@anchor{gnat_rm/the_gnat_library id23}@anchor{2ff}@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{300} @section @code{Ada.Exceptions.Last_Chance_Handler} (@code{a-elchha.ads}) @@ -23548,7 +23612,7 @@ exceptions (hence the name last chance), and perform clean ups before terminating the program. Note that this subprogram never returns. @node Ada Exceptions Traceback a-exctra ads,Ada Sequential_IO C_Streams a-siocst ads,Ada Exceptions Last_Chance_Handler a-elchha ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{300}@anchor{gnat_rm/the_gnat_library id24}@anchor{301} +@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{301}@anchor{gnat_rm/the_gnat_library id24}@anchor{302} @section @code{Ada.Exceptions.Traceback} (@code{a-exctra.ads}) @@ -23561,7 +23625,7 @@ give a traceback array of addresses based on an exception occurrence. @node Ada Sequential_IO C_Streams a-siocst ads,Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Exceptions Traceback a-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{302}@anchor{gnat_rm/the_gnat_library id25}@anchor{303} +@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{303}@anchor{gnat_rm/the_gnat_library id25}@anchor{304} @section @code{Ada.Sequential_IO.C_Streams} (@code{a-siocst.ads}) @@ -23576,7 +23640,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Strings Unbounded Text_IO a-suteio ads,Ada Sequential_IO C_Streams a-siocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id26}@anchor{304}@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{305} +@anchor{gnat_rm/the_gnat_library id26}@anchor{305}@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{306} @section @code{Ada.Streams.Stream_IO.C_Streams} (@code{a-ssicst.ads}) @@ -23591,7 +23655,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Strings Unbounded Text_IO a-suteio ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Streams Stream_IO C_Streams a-ssicst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{306}@anchor{gnat_rm/the_gnat_library id27}@anchor{307} +@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{307}@anchor{gnat_rm/the_gnat_library id27}@anchor{308} @section @code{Ada.Strings.Unbounded.Text_IO} (@code{a-suteio.ads}) @@ -23608,7 +23672,7 @@ strings, avoiding the necessity for an intermediate operation with ordinary strings. @node Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Strings Unbounded Text_IO a-suteio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id28}@anchor{308}@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{309} +@anchor{gnat_rm/the_gnat_library id28}@anchor{309}@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{30a} @section @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} (@code{a-swuwti.ads}) @@ -23625,7 +23689,7 @@ wide strings, avoiding the necessity for an intermediate operation with ordinary wide strings. @node Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Text_IO C_Streams a-tiocst ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id29}@anchor{30a}@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{30b} +@anchor{gnat_rm/the_gnat_library id29}@anchor{30b}@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{30c} @section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@code{a-szuzti.ads}) @@ -23642,7 +23706,7 @@ wide wide strings, avoiding the necessity for an intermediate operation with ordinary wide wide strings. @node Ada Text_IO C_Streams a-tiocst ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{30c}@anchor{gnat_rm/the_gnat_library id30}@anchor{30d} +@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{30d}@anchor{gnat_rm/the_gnat_library id30}@anchor{30e} @section @code{Ada.Text_IO.C_Streams} (@code{a-tiocst.ads}) @@ -23657,7 +23721,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Wide_Characters Unicode a-wichun ads,Ada Text_IO C_Streams a-tiocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{30e}@anchor{gnat_rm/the_gnat_library id31}@anchor{30f} +@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{30f}@anchor{gnat_rm/the_gnat_library id31}@anchor{310} @section @code{Ada.Text_IO.Reset_Standard_Files} (@code{a-tirsfi.ads}) @@ -23672,7 +23736,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Characters Unicode a-wichun ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id32}@anchor{310}@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{311} +@anchor{gnat_rm/the_gnat_library id32}@anchor{311}@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{312} @section @code{Ada.Wide_Characters.Unicode} (@code{a-wichun.ads}) @@ -23685,7 +23749,7 @@ This package provides subprograms that allow categorization of Wide_Character values according to Unicode categories. @node Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Characters Unicode a-wichun ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{312}@anchor{gnat_rm/the_gnat_library id33}@anchor{313} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{313}@anchor{gnat_rm/the_gnat_library id33}@anchor{314} @section @code{Ada.Wide_Text_IO.C_Streams} (@code{a-wtcstr.ads}) @@ -23700,7 +23764,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{314}@anchor{gnat_rm/the_gnat_library id34}@anchor{315} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{315}@anchor{gnat_rm/the_gnat_library id34}@anchor{316} @section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@code{a-wrstfi.ads}) @@ -23715,7 +23779,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id35}@anchor{316}@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{317} +@anchor{gnat_rm/the_gnat_library id35}@anchor{317}@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{318} @section @code{Ada.Wide_Wide_Characters.Unicode} (@code{a-zchuni.ads}) @@ -23728,7 +23792,7 @@ This package provides subprograms that allow categorization of Wide_Wide_Character values according to Unicode categories. @node Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id36}@anchor{318}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{319} +@anchor{gnat_rm/the_gnat_library id36}@anchor{319}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{31a} @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@code{a-ztcstr.ads}) @@ -23743,7 +23807,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,GNAT Altivec g-altive ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id37}@anchor{31a}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{31b} +@anchor{gnat_rm/the_gnat_library id37}@anchor{31b}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{31c} @section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@code{a-zrstfi.ads}) @@ -23758,7 +23822,7 @@ change during execution (for example a standard input file may be redefined to be interactive). @node GNAT Altivec g-altive ads,GNAT Altivec Conversions g-altcon ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id38}@anchor{31d} +@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{31d}@anchor{gnat_rm/the_gnat_library id38}@anchor{31e} @section @code{GNAT.Altivec} (@code{g-altive.ads}) @@ -23771,7 +23835,7 @@ definitions of constants and types common to all the versions of the binding. @node GNAT Altivec Conversions g-altcon ads,GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec g-altive ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id39}@anchor{31f} +@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{31f}@anchor{gnat_rm/the_gnat_library id39}@anchor{320} @section @code{GNAT.Altivec.Conversions} (@code{g-altcon.ads}) @@ -23782,7 +23846,7 @@ binding. This package provides the Vector/View conversion routines. @node GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Conversions g-altcon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{320}@anchor{gnat_rm/the_gnat_library id40}@anchor{321} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{321}@anchor{gnat_rm/the_gnat_library id40}@anchor{322} @section @code{GNAT.Altivec.Vector_Operations} (@code{g-alveop.ads}) @@ -23796,7 +23860,7 @@ library. The hard binding is provided as a separate package. This unit is common to both bindings. @node GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Vector_Views g-alvevi ads,GNAT Altivec Vector_Operations g-alveop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{322}@anchor{gnat_rm/the_gnat_library id41}@anchor{323} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{323}@anchor{gnat_rm/the_gnat_library id41}@anchor{324} @section @code{GNAT.Altivec.Vector_Types} (@code{g-alvety.ads}) @@ -23808,7 +23872,7 @@ This package exposes the various vector types part of the Ada binding to AltiVec facilities. @node GNAT Altivec Vector_Views g-alvevi ads,GNAT Array_Split g-arrspl ads,GNAT Altivec Vector_Types g-alvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{324}@anchor{gnat_rm/the_gnat_library id42}@anchor{325} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{325}@anchor{gnat_rm/the_gnat_library id42}@anchor{326} @section @code{GNAT.Altivec.Vector_Views} (@code{g-alvevi.ads}) @@ -23823,7 +23887,7 @@ vector elements and provides a simple way to initialize vector objects. @node GNAT Array_Split g-arrspl ads,GNAT AWK g-awk ads,GNAT Altivec Vector_Views g-alvevi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{326}@anchor{gnat_rm/the_gnat_library id43}@anchor{327} +@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{327}@anchor{gnat_rm/the_gnat_library id43}@anchor{328} @section @code{GNAT.Array_Split} (@code{g-arrspl.ads}) @@ -23836,7 +23900,7 @@ an array wherever the separators appear, and provide direct access to the resulting slices. @node GNAT AWK g-awk ads,GNAT Bind_Environment g-binenv ads,GNAT Array_Split g-arrspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id44}@anchor{328}@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{329} +@anchor{gnat_rm/the_gnat_library id44}@anchor{329}@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{32a} @section @code{GNAT.AWK} (@code{g-awk.ads}) @@ -23851,7 +23915,7 @@ or more files containing formatted data. The file is viewed as a database where each record is a line and a field is a data element in this line. @node GNAT Bind_Environment g-binenv ads,GNAT Branch_Prediction g-brapre ads,GNAT AWK g-awk ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{32a}@anchor{gnat_rm/the_gnat_library id45}@anchor{32b} +@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{32b}@anchor{gnat_rm/the_gnat_library id45}@anchor{32c} @section @code{GNAT.Bind_Environment} (@code{g-binenv.ads}) @@ -23864,7 +23928,7 @@ These associations can be specified using the @code{-V} binder command line switch. @node GNAT Branch_Prediction g-brapre ads,GNAT Bounded_Buffers g-boubuf ads,GNAT Bind_Environment g-binenv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id46}@anchor{32c}@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{32d} +@anchor{gnat_rm/the_gnat_library id46}@anchor{32d}@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{32e} @section @code{GNAT.Branch_Prediction} (@code{g-brapre.ads}) @@ -23875,7 +23939,7 @@ line switch. Provides routines giving hints to the branch predictor of the code generator. @node GNAT Bounded_Buffers g-boubuf ads,GNAT Bounded_Mailboxes g-boumai ads,GNAT Branch_Prediction g-brapre ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id47}@anchor{32e}@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{32f} +@anchor{gnat_rm/the_gnat_library id47}@anchor{32f}@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{330} @section @code{GNAT.Bounded_Buffers} (@code{g-boubuf.ads}) @@ -23890,7 +23954,7 @@ useful directly or as parts of the implementations of other abstractions, such as mailboxes. @node GNAT Bounded_Mailboxes g-boumai ads,GNAT Bubble_Sort g-bubsor ads,GNAT Bounded_Buffers g-boubuf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id48}@anchor{331} +@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{331}@anchor{gnat_rm/the_gnat_library id48}@anchor{332} @section @code{GNAT.Bounded_Mailboxes} (@code{g-boumai.ads}) @@ -23903,7 +23967,7 @@ such as mailboxes. Provides a thread-safe asynchronous intertask mailbox communication facility. @node GNAT Bubble_Sort g-bubsor ads,GNAT Bubble_Sort_A g-busora ads,GNAT Bounded_Mailboxes g-boumai ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id49}@anchor{333} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{333}@anchor{gnat_rm/the_gnat_library id49}@anchor{334} @section @code{GNAT.Bubble_Sort} (@code{g-bubsor.ads}) @@ -23918,7 +23982,7 @@ data items. Exchange and comparison procedures are provided by passing access-to-procedure values. @node GNAT Bubble_Sort_A g-busora ads,GNAT Bubble_Sort_G g-busorg ads,GNAT Bubble_Sort g-bubsor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id50}@anchor{334}@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{335} +@anchor{gnat_rm/the_gnat_library id50}@anchor{335}@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{336} @section @code{GNAT.Bubble_Sort_A} (@code{g-busora.ads}) @@ -23934,7 +23998,7 @@ access-to-procedure values. This is an older version, retained for compatibility. Usually @code{GNAT.Bubble_Sort} will be preferable. @node GNAT Bubble_Sort_G g-busorg ads,GNAT Byte_Order_Mark g-byorma ads,GNAT Bubble_Sort_A g-busora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{336}@anchor{gnat_rm/the_gnat_library id51}@anchor{337} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{337}@anchor{gnat_rm/the_gnat_library id51}@anchor{338} @section @code{GNAT.Bubble_Sort_G} (@code{g-busorg.ads}) @@ -23950,7 +24014,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT Byte_Order_Mark g-byorma ads,GNAT Byte_Swapping g-bytswa ads,GNAT Bubble_Sort_G g-busorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{338}@anchor{gnat_rm/the_gnat_library id52}@anchor{339} +@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{339}@anchor{gnat_rm/the_gnat_library id52}@anchor{33a} @section @code{GNAT.Byte_Order_Mark} (@code{g-byorma.ads}) @@ -23966,7 +24030,7 @@ the encoding of the string. The routine includes detection of special XML sequences for various UCS input formats. @node GNAT Byte_Swapping g-bytswa ads,GNAT Calendar g-calend ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{33a}@anchor{gnat_rm/the_gnat_library id53}@anchor{33b} +@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{33b}@anchor{gnat_rm/the_gnat_library id53}@anchor{33c} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -23980,7 +24044,7 @@ General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. @node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id54}@anchor{33c}@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{33d} +@anchor{gnat_rm/the_gnat_library id54}@anchor{33d}@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{33e} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -23994,7 +24058,7 @@ Also provides conversion of @code{Ada.Calendar.Time} values to and from the C @code{timeval} format. @node GNAT Calendar Time_IO g-catiio ads,GNAT CRC32 g-crc32 ads,GNAT Calendar g-calend ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id55}@anchor{33e}@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{33f} +@anchor{gnat_rm/the_gnat_library id55}@anchor{33f}@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{340} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -24005,7 +24069,7 @@ C @code{timeval} format. @geindex GNAT.Calendar.Time_IO (g-catiio.ads) @node GNAT CRC32 g-crc32 ads,GNAT Case_Util g-casuti ads,GNAT Calendar Time_IO g-catiio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id56}@anchor{340}@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{341} +@anchor{gnat_rm/the_gnat_library id56}@anchor{341}@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{342} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -24022,7 +24086,7 @@ of this algorithm see Aug. 1988. Sarwate, D.V. @node GNAT Case_Util g-casuti ads,GNAT CGI g-cgi ads,GNAT CRC32 g-crc32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id57}@anchor{342}@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{343} +@anchor{gnat_rm/the_gnat_library id57}@anchor{343}@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{344} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -24037,7 +24101,7 @@ without the overhead of the full casing tables in @code{Ada.Characters.Handling}. @node GNAT CGI g-cgi ads,GNAT CGI Cookie g-cgicoo ads,GNAT Case_Util g-casuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id58}@anchor{344}@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{345} +@anchor{gnat_rm/the_gnat_library id58}@anchor{345}@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{346} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -24052,7 +24116,7 @@ builds a table whose index is the key and provides some services to deal with this table. @node GNAT CGI Cookie g-cgicoo ads,GNAT CGI Debug g-cgideb ads,GNAT CGI g-cgi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{346}@anchor{gnat_rm/the_gnat_library id59}@anchor{347} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{347}@anchor{gnat_rm/the_gnat_library id59}@anchor{348} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -24067,7 +24131,7 @@ Common Gateway Interface (CGI). It exports services to deal with Web cookies (piece of information kept in the Web client software). @node GNAT CGI Debug g-cgideb ads,GNAT Command_Line g-comlin ads,GNAT CGI Cookie g-cgicoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id60}@anchor{349} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{349}@anchor{gnat_rm/the_gnat_library id60}@anchor{34a} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -24079,7 +24143,7 @@ This is a package to help debugging CGI (Common Gateway Interface) programs written in Ada. @node GNAT Command_Line g-comlin ads,GNAT Compiler_Version g-comver ads,GNAT CGI Debug g-cgideb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id61}@anchor{34a}@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{34b} +@anchor{gnat_rm/the_gnat_library id61}@anchor{34b}@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{34c} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -24092,7 +24156,7 @@ including the ability to scan for named switches with optional parameters and expand file names using wildcard notations. @node GNAT Compiler_Version g-comver ads,GNAT Ctrl_C g-ctrl_c ads,GNAT Command_Line g-comlin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id62}@anchor{34d} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{34d}@anchor{gnat_rm/the_gnat_library id62}@anchor{34e} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -24110,7 +24174,7 @@ of the compiler if a consistent tool set is used to compile all units of a partition). @node GNAT Ctrl_C g-ctrl_c ads,GNAT Current_Exception g-curexc ads,GNAT Compiler_Version g-comver ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id63}@anchor{34f} +@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{34f}@anchor{gnat_rm/the_gnat_library id63}@anchor{350} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -24121,7 +24185,7 @@ of a partition). Provides a simple interface to handle Ctrl-C keyboard events. @node GNAT Current_Exception g-curexc ads,GNAT Debug_Pools g-debpoo ads,GNAT Ctrl_C g-ctrl_c ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id64}@anchor{350}@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{351} +@anchor{gnat_rm/the_gnat_library id64}@anchor{351}@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{352} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -24138,7 +24202,7 @@ This is particularly useful in simulating typical facilities for obtaining information about exceptions provided by Ada 83 compilers. @node GNAT Debug_Pools g-debpoo ads,GNAT Debug_Utilities g-debuti ads,GNAT Current_Exception g-curexc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id65}@anchor{353} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{353}@anchor{gnat_rm/the_gnat_library id65}@anchor{354} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -24155,7 +24219,7 @@ problems. See @code{The GNAT Debug_Pool Facility} section in the @cite{GNAT User's Guide}. @node GNAT Debug_Utilities g-debuti ads,GNAT Decode_String g-decstr ads,GNAT Debug_Pools g-debpoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id66}@anchor{355} +@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{355}@anchor{gnat_rm/the_gnat_library id66}@anchor{356} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -24168,7 +24232,7 @@ to and from string images of address values. Supports both C and Ada formats for hexadecimal literals. @node GNAT Decode_String g-decstr ads,GNAT Decode_UTF8_String g-deutst ads,GNAT Debug_Utilities g-debuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id67}@anchor{356}@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{357} +@anchor{gnat_rm/the_gnat_library id67}@anchor{357}@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{358} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -24192,7 +24256,7 @@ Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Decode_UTF8_String g-deutst ads,GNAT Directory_Operations g-dirope ads,GNAT Decode_String g-decstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id68}@anchor{359} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{359}@anchor{gnat_rm/the_gnat_library id68}@anchor{35a} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -24213,7 +24277,7 @@ preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding. @node GNAT Directory_Operations g-dirope ads,GNAT Directory_Operations Iteration g-diopit ads,GNAT Decode_UTF8_String g-deutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id69}@anchor{35a}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{35b} +@anchor{gnat_rm/the_gnat_library id69}@anchor{35b}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{35c} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -24226,7 +24290,7 @@ the current directory, making new directories, and scanning the files in a directory. @node GNAT Directory_Operations Iteration g-diopit ads,GNAT Dynamic_HTables g-dynhta ads,GNAT Directory_Operations g-dirope ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id70}@anchor{35c}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{35d} +@anchor{gnat_rm/the_gnat_library id70}@anchor{35d}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{35e} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -24238,7 +24302,7 @@ A child unit of GNAT.Directory_Operations providing additional operations for iterating through directories. @node GNAT Dynamic_HTables g-dynhta ads,GNAT Dynamic_Tables g-dyntab ads,GNAT Directory_Operations Iteration g-diopit ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id71}@anchor{35e}@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{35f} +@anchor{gnat_rm/the_gnat_library id71}@anchor{35f}@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{360} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -24256,7 +24320,7 @@ dynamic instances of the hash table, while an instantiation of @code{GNAT.HTable} creates a single instance of the hash table. @node GNAT Dynamic_Tables g-dyntab ads,GNAT Encode_String g-encstr ads,GNAT Dynamic_HTables g-dynhta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id72}@anchor{361} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{361}@anchor{gnat_rm/the_gnat_library id72}@anchor{362} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -24276,7 +24340,7 @@ dynamic instances of the table, while an instantiation of @code{GNAT.Table} creates a single instance of the table type. @node GNAT Encode_String g-encstr ads,GNAT Encode_UTF8_String g-enutst ads,GNAT Dynamic_Tables g-dyntab ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id73}@anchor{362}@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{363} +@anchor{gnat_rm/the_gnat_library id73}@anchor{363}@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{364} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -24298,7 +24362,7 @@ encoding method. Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Encode_UTF8_String g-enutst ads,GNAT Exception_Actions g-excact ads,GNAT Encode_String g-encstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{364}@anchor{gnat_rm/the_gnat_library id74}@anchor{365} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{365}@anchor{gnat_rm/the_gnat_library id74}@anchor{366} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -24319,7 +24383,7 @@ Note there is a preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding. @node GNAT Exception_Actions g-excact ads,GNAT Exception_Traces g-exctra ads,GNAT Encode_UTF8_String g-enutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id75}@anchor{367} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{367}@anchor{gnat_rm/the_gnat_library id75}@anchor{368} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -24332,7 +24396,7 @@ for specific exceptions, or when any exception is raised. This can be used for instance to force a core dump to ease debugging. @node GNAT Exception_Traces g-exctra ads,GNAT Exceptions g-except ads,GNAT Exception_Actions g-excact ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id76}@anchor{369} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{369}@anchor{gnat_rm/the_gnat_library id76}@anchor{36a} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -24346,7 +24410,7 @@ Provides an interface allowing to control automatic output upon exception occurrences. @node GNAT Exceptions g-except ads,GNAT Expect g-expect ads,GNAT Exception_Traces g-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id77}@anchor{36a}@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{36b} +@anchor{gnat_rm/the_gnat_library id77}@anchor{36b}@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{36c} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -24367,7 +24431,7 @@ predefined exceptions, and for example allow raising @code{Constraint_Error} with a message from a pure subprogram. @node GNAT Expect g-expect ads,GNAT Expect TTY g-exptty ads,GNAT Exceptions g-except ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id78}@anchor{36c}@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{36d} +@anchor{gnat_rm/the_gnat_library id78}@anchor{36d}@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{36e} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -24383,7 +24447,7 @@ It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Expect TTY g-exptty ads,GNAT Float_Control g-flocon ads,GNAT Expect g-expect ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id79}@anchor{36e}@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{36f} +@anchor{gnat_rm/the_gnat_library id79}@anchor{36f}@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{370} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -24395,7 +24459,7 @@ ports. It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Float_Control g-flocon ads,GNAT Formatted_String g-forstr ads,GNAT Expect TTY g-exptty ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id80}@anchor{370}@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{371} +@anchor{gnat_rm/the_gnat_library id80}@anchor{371}@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{372} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -24409,7 +24473,7 @@ library calls may cause this mode to be modified, and the Reset procedure in this package can be used to reestablish the required mode. @node GNAT Formatted_String g-forstr ads,GNAT Heap_Sort g-heasor ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id81}@anchor{372}@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{373} +@anchor{gnat_rm/the_gnat_library id81}@anchor{373}@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{374} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -24424,7 +24488,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id82}@anchor{375} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{375}@anchor{gnat_rm/the_gnat_library id82}@anchor{376} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -24438,7 +24502,7 @@ access-to-procedure values. The algorithm used is a modified heap sort that performs approximately N*log(N) comparisons in the worst case. @node GNAT Heap_Sort_A g-hesora ads,GNAT Heap_Sort_G g-hesorg ads,GNAT Heap_Sort g-heasor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id83}@anchor{376}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{377} +@anchor{gnat_rm/the_gnat_library id83}@anchor{377}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{378} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -24454,7 +24518,7 @@ This differs from @code{GNAT.Heap_Sort} in having a less convenient interface, but may be slightly more efficient. @node GNAT Heap_Sort_G g-hesorg ads,GNAT HTable g-htable ads,GNAT Heap_Sort_A g-hesora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id84}@anchor{378}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{379} +@anchor{gnat_rm/the_gnat_library id84}@anchor{379}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{37a} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -24468,7 +24532,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT HTable g-htable ads,GNAT IO g-io ads,GNAT Heap_Sort_G g-hesorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id85}@anchor{37a}@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{37b} +@anchor{gnat_rm/the_gnat_library id85}@anchor{37b}@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{37c} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -24481,7 +24545,7 @@ data. Provides two approaches, one a simple static approach, and the other allowing arbitrary dynamic hash tables. @node GNAT IO g-io ads,GNAT IO_Aux g-io_aux ads,GNAT HTable g-htable ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id86}@anchor{37c}@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{37d} +@anchor{gnat_rm/the_gnat_library id86}@anchor{37d}@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{37e} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -24497,7 +24561,7 @@ Standard_Input, and writing characters, strings and integers to either Standard_Output or Standard_Error. @node GNAT IO_Aux g-io_aux ads,GNAT Lock_Files g-locfil ads,GNAT IO g-io ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id87}@anchor{37e}@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{37f} +@anchor{gnat_rm/the_gnat_library id87}@anchor{37f}@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{380} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -24511,7 +24575,7 @@ Provides some auxiliary functions for use with Text_IO, including a test for whether a file exists, and functions for reading a line of text. @node GNAT Lock_Files g-locfil ads,GNAT MBBS_Discrete_Random g-mbdira ads,GNAT IO_Aux g-io_aux ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id88}@anchor{380}@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{381} +@anchor{gnat_rm/the_gnat_library id88}@anchor{381}@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{382} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -24525,7 +24589,7 @@ Provides a general interface for using files as locks. Can be used for providing program level synchronization. @node GNAT MBBS_Discrete_Random g-mbdira ads,GNAT MBBS_Float_Random g-mbflra ads,GNAT Lock_Files g-locfil ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id89}@anchor{382}@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{383} +@anchor{gnat_rm/the_gnat_library id89}@anchor{383}@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{384} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -24537,7 +24601,7 @@ The original implementation of @code{Ada.Numerics.Discrete_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MBBS_Float_Random g-mbflra ads,GNAT MD5 g-md5 ads,GNAT MBBS_Discrete_Random g-mbdira ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id90}@anchor{384}@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{385} +@anchor{gnat_rm/the_gnat_library id90}@anchor{385}@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{386} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -24549,7 +24613,7 @@ The original implementation of @code{Ada.Numerics.Float_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MD5 g-md5 ads,GNAT Memory_Dump g-memdum ads,GNAT MBBS_Float_Random g-mbflra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id91}@anchor{386}@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{387} +@anchor{gnat_rm/the_gnat_library id91}@anchor{387}@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{388} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -24562,7 +24626,7 @@ the HMAC-MD5 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Memory_Dump g-memdum ads,GNAT Most_Recent_Exception g-moreex ads,GNAT MD5 g-md5 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id92}@anchor{388}@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{389} +@anchor{gnat_rm/the_gnat_library id92}@anchor{389}@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{38a} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -24575,7 +24639,7 @@ standard output or standard error files. Uses GNAT.IO for actual output. @node GNAT Most_Recent_Exception g-moreex ads,GNAT OS_Lib g-os_lib ads,GNAT Memory_Dump g-memdum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id93}@anchor{38b} +@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{38b}@anchor{gnat_rm/the_gnat_library id93}@anchor{38c} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -24589,7 +24653,7 @@ various logging purposes, including duplicating functionality of some Ada 83 implementation dependent extensions. @node GNAT OS_Lib g-os_lib ads,GNAT Perfect_Hash_Generators g-pehage ads,GNAT Most_Recent_Exception g-moreex ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id94}@anchor{38d} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{38d}@anchor{gnat_rm/the_gnat_library id94}@anchor{38e} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -24605,7 +24669,7 @@ including a portable spawn procedure, and access to environment variables and error return codes. @node GNAT Perfect_Hash_Generators g-pehage ads,GNAT Random_Numbers g-rannum ads,GNAT OS_Lib g-os_lib ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id95}@anchor{38f} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{38f}@anchor{gnat_rm/the_gnat_library id95}@anchor{390} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -24623,7 +24687,7 @@ hashcode are in the same order. These hashing functions are very convenient for use with realtime applications. @node GNAT Random_Numbers g-rannum ads,GNAT Regexp g-regexp ads,GNAT Perfect_Hash_Generators g-pehage ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id96}@anchor{391} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{391}@anchor{gnat_rm/the_gnat_library id96}@anchor{392} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -24635,7 +24699,7 @@ Provides random number capabilities which extend those available in the standard Ada library and are more convenient to use. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{259}@anchor{gnat_rm/the_gnat_library id97}@anchor{392} +@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{25a}@anchor{gnat_rm/the_gnat_library id97}@anchor{393} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -24651,7 +24715,7 @@ simplest of the three pattern matching packages provided, and is particularly suitable for 'file globbing' applications. @node GNAT Registry g-regist ads,GNAT Regpat g-regpat ads,GNAT Regexp g-regexp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id98}@anchor{393}@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{394} +@anchor{gnat_rm/the_gnat_library id98}@anchor{394}@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{395} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -24665,7 +24729,7 @@ registry API, but at a lower level of abstraction, refer to the Win32.Winreg package provided with the Win32Ada binding @node GNAT Regpat g-regpat ads,GNAT Rewrite_Data g-rewdat ads,GNAT Registry g-regist ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id99}@anchor{395}@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{396} +@anchor{gnat_rm/the_gnat_library id99}@anchor{396}@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{397} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -24680,7 +24744,7 @@ from the original V7 style regular expression library written in C by Henry Spencer (and binary compatible with this C library). @node GNAT Rewrite_Data g-rewdat ads,GNAT Secondary_Stack_Info g-sestin ads,GNAT Regpat g-regpat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id100}@anchor{397}@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{398} +@anchor{gnat_rm/the_gnat_library id100}@anchor{398}@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{399} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -24694,7 +24758,7 @@ full content to be processed is not loaded into memory all at once. This makes this interface usable for large files or socket streams. @node GNAT Secondary_Stack_Info g-sestin ads,GNAT Semaphores g-semaph ads,GNAT Rewrite_Data g-rewdat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id101}@anchor{399}@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{39a} +@anchor{gnat_rm/the_gnat_library id101}@anchor{39a}@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{39b} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -24706,7 +24770,7 @@ Provide the capability to query the high water mark of the current task's secondary stack. @node GNAT Semaphores g-semaph ads,GNAT Serial_Communications g-sercom ads,GNAT Secondary_Stack_Info g-sestin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id102}@anchor{39b}@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{39c} +@anchor{gnat_rm/the_gnat_library id102}@anchor{39c}@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{39d} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -24717,7 +24781,7 @@ secondary stack. Provides classic counting and binary semaphores using protected types. @node GNAT Serial_Communications g-sercom ads,GNAT SHA1 g-sha1 ads,GNAT Semaphores g-semaph ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{39d}@anchor{gnat_rm/the_gnat_library id103}@anchor{39e} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{39e}@anchor{gnat_rm/the_gnat_library id103}@anchor{39f} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -24729,7 +24793,7 @@ Provides a simple interface to send and receive data over a serial port. This is only supported on GNU/Linux and Windows. @node GNAT SHA1 g-sha1 ads,GNAT SHA224 g-sha224 ads,GNAT Serial_Communications g-sercom ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id104}@anchor{3a0} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3a0}@anchor{gnat_rm/the_gnat_library id104}@anchor{3a1} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -24742,7 +24806,7 @@ and RFC 3174, and the HMAC-SHA1 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA224 g-sha224 ads,GNAT SHA256 g-sha256 ads,GNAT SHA1 g-sha1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3a1}@anchor{gnat_rm/the_gnat_library id105}@anchor{3a2} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3a2}@anchor{gnat_rm/the_gnat_library id105}@anchor{3a3} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -24755,7 +24819,7 @@ and the HMAC-SHA224 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA256 g-sha256 ads,GNAT SHA384 g-sha384 ads,GNAT SHA224 g-sha224 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id106}@anchor{3a4} +@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3a4}@anchor{gnat_rm/the_gnat_library id106}@anchor{3a5} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -24768,7 +24832,7 @@ and the HMAC-SHA256 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA384 g-sha384 ads,GNAT SHA512 g-sha512 ads,GNAT SHA256 g-sha256 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id107}@anchor{3a6} +@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3a6}@anchor{gnat_rm/the_gnat_library id107}@anchor{3a7} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -24781,7 +24845,7 @@ and the HMAC-SHA384 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA512 g-sha512 ads,GNAT Signals g-signal ads,GNAT SHA384 g-sha384 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id108}@anchor{3a7}@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3a8} +@anchor{gnat_rm/the_gnat_library id108}@anchor{3a8}@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3a9} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -24794,7 +24858,7 @@ and the HMAC-SHA512 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Signals g-signal ads,GNAT Sockets g-socket ads,GNAT SHA512 g-sha512 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id109}@anchor{3a9}@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3aa} +@anchor{gnat_rm/the_gnat_library id109}@anchor{3aa}@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3ab} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -24806,7 +24870,7 @@ Provides the ability to manipulate the blocked status of signals on supported targets. @node GNAT Sockets g-socket ads,GNAT Source_Info g-souinf ads,GNAT Signals g-signal ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id110}@anchor{3ac} +@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3ac}@anchor{gnat_rm/the_gnat_library id110}@anchor{3ad} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -24821,7 +24885,7 @@ on all native GNAT ports and on VxWorks cross prots. It is not implemented for the LynxOS cross port. @node GNAT Source_Info g-souinf ads,GNAT Spelling_Checker g-speche ads,GNAT Sockets g-socket ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id111}@anchor{3ae} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3ae}@anchor{gnat_rm/the_gnat_library id111}@anchor{3af} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -24835,7 +24899,7 @@ subprograms yielding the date and time of the current compilation (like the C macros @code{__DATE__} and @code{__TIME__}) @node GNAT Spelling_Checker g-speche ads,GNAT Spelling_Checker_Generic g-spchge ads,GNAT Source_Info g-souinf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id112}@anchor{3af}@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3b0} +@anchor{gnat_rm/the_gnat_library id112}@anchor{3b0}@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3b1} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -24847,7 +24911,7 @@ Provides a function for determining whether one string is a plausible near misspelling of another string. @node GNAT Spelling_Checker_Generic g-spchge ads,GNAT Spitbol Patterns g-spipat ads,GNAT Spelling_Checker g-speche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id113}@anchor{3b2} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3b2}@anchor{gnat_rm/the_gnat_library id113}@anchor{3b3} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -24860,7 +24924,7 @@ determining whether one string is a plausible near misspelling of another string. @node GNAT Spitbol Patterns g-spipat ads,GNAT Spitbol g-spitbo ads,GNAT Spelling_Checker_Generic g-spchge ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id114}@anchor{3b4} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3b4}@anchor{gnat_rm/the_gnat_library id114}@anchor{3b5} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -24876,7 +24940,7 @@ the SNOBOL4 dynamic pattern construction and matching capabilities, using the efficient algorithm developed by Robert Dewar for the SPITBOL system. @node GNAT Spitbol g-spitbo ads,GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Patterns g-spipat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id115}@anchor{3b6} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3b6}@anchor{gnat_rm/the_gnat_library id115}@anchor{3b7} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -24891,7 +24955,7 @@ useful for constructing arbitrary mappings from strings in the style of the SNOBOL4 TABLE function. @node GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol g-spitbo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id116}@anchor{3b7}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3b8} +@anchor{gnat_rm/the_gnat_library id116}@anchor{3b8}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3b9} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -24906,7 +24970,7 @@ for type @code{Standard.Boolean}, giving an implementation of sets of string values. @node GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol Table_VString g-sptavs ads,GNAT Spitbol Table_Boolean g-sptabo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id117}@anchor{3ba} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3ba}@anchor{gnat_rm/the_gnat_library id117}@anchor{3bb} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -24923,7 +24987,7 @@ for type @code{Standard.Integer}, giving an implementation of maps from string to integer values. @node GNAT Spitbol Table_VString g-sptavs ads,GNAT SSE g-sse ads,GNAT Spitbol Table_Integer g-sptain ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id118}@anchor{3bb}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3bc} +@anchor{gnat_rm/the_gnat_library id118}@anchor{3bc}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3bd} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -24940,7 +25004,7 @@ a variable length string type, giving an implementation of general maps from strings to strings. @node GNAT SSE g-sse ads,GNAT SSE Vector_Types g-ssvety ads,GNAT Spitbol Table_VString g-sptavs ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id119}@anchor{3bd}@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3be} +@anchor{gnat_rm/the_gnat_library id119}@anchor{3be}@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3bf} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -24952,7 +25016,7 @@ targets. It exposes vector component types together with a general introduction to the binding contents and use. @node GNAT SSE Vector_Types g-ssvety ads,GNAT String_Hash g-strhas ads,GNAT SSE g-sse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id120}@anchor{3c0} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3c0}@anchor{gnat_rm/the_gnat_library id120}@anchor{3c1} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -24961,7 +25025,7 @@ introduction to the binding contents and use. SSE vector types for use with SSE related intrinsics. @node GNAT String_Hash g-strhas ads,GNAT Strings g-string ads,GNAT SSE Vector_Types g-ssvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id121}@anchor{3c2} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3c2}@anchor{gnat_rm/the_gnat_library id121}@anchor{3c3} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -24973,7 +25037,7 @@ Provides a generic hash function working on arrays of scalars. Both the scalar type and the hash result type are parameters. @node GNAT Strings g-string ads,GNAT String_Split g-strspl ads,GNAT String_Hash g-strhas ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id122}@anchor{3c4} +@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3c4}@anchor{gnat_rm/the_gnat_library id122}@anchor{3c5} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -24983,7 +25047,7 @@ Common String access types and related subprograms. Basically it defines a string access and an array of string access types. @node GNAT String_Split g-strspl ads,GNAT Table g-table ads,GNAT Strings g-string ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3c5}@anchor{gnat_rm/the_gnat_library id123}@anchor{3c6} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3c6}@anchor{gnat_rm/the_gnat_library id123}@anchor{3c7} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -24997,7 +25061,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Table g-table ads,GNAT Task_Lock g-tasloc ads,GNAT String_Split g-strspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id124}@anchor{3c7}@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3c8} +@anchor{gnat_rm/the_gnat_library id124}@anchor{3c8}@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3c9} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -25017,7 +25081,7 @@ while an instantiation of @code{GNAT.Dynamic_Tables} creates a type that can be used to define dynamic instances of the table. @node GNAT Task_Lock g-tasloc ads,GNAT Time_Stamp g-timsta ads,GNAT Table g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id125}@anchor{3c9}@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3ca} +@anchor{gnat_rm/the_gnat_library id125}@anchor{3ca}@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3cb} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -25034,7 +25098,7 @@ single global task lock. Appropriate for use in situations where contention between tasks is very rarely expected. @node GNAT Time_Stamp g-timsta ads,GNAT Threads g-thread ads,GNAT Task_Lock g-tasloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id126}@anchor{3cb}@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3cc} +@anchor{gnat_rm/the_gnat_library id126}@anchor{3cc}@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3cd} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -25049,7 +25113,7 @@ represents the current date and time in ISO 8601 format. This is a very simple routine with minimal code and there are no dependencies on any other unit. @node GNAT Threads g-thread ads,GNAT Traceback g-traceb ads,GNAT Time_Stamp g-timsta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id127}@anchor{3cd}@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3ce} +@anchor{gnat_rm/the_gnat_library id127}@anchor{3ce}@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3cf} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -25066,7 +25130,7 @@ further details if your program has threads that are created by a non-Ada environment which then accesses Ada code. @node GNAT Traceback g-traceb ads,GNAT Traceback Symbolic g-trasym ads,GNAT Threads g-thread ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id128}@anchor{3cf}@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3d0} +@anchor{gnat_rm/the_gnat_library id128}@anchor{3d0}@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3d1} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -25078,7 +25142,7 @@ Provides a facility for obtaining non-symbolic traceback information, useful in various debugging situations. @node GNAT Traceback Symbolic g-trasym ads,GNAT UTF_32 g-table ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id129}@anchor{3d2} +@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3d2}@anchor{gnat_rm/the_gnat_library id129}@anchor{3d3} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -25087,7 +25151,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-table ads,GNAT Wide_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id130}@anchor{3d3}@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-table-ads}@anchor{3d4} +@anchor{gnat_rm/the_gnat_library id130}@anchor{3d4}@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-table-ads}@anchor{3d5} @section @code{GNAT.UTF_32} (@code{g-table.ads}) @@ -25106,7 +25170,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT Wide_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-u3spch-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id131}@anchor{3d6} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-u3spch-ads}@anchor{3d6}@anchor{gnat_rm/the_gnat_library id131}@anchor{3d7} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-u3spch.ads}) @@ -25119,7 +25183,7 @@ near misspelling of another wide wide string, where the strings are represented using the UTF_32_String type defined in System.Wch_Cnv. @node GNAT Wide_Spelling_Checker g-wispch ads,GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id132}@anchor{3d8} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3d8}@anchor{gnat_rm/the_gnat_library id132}@anchor{3d9} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -25131,7 +25195,7 @@ Provides a function for determining whether one wide string is a plausible near misspelling of another wide string. @node GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Spelling_Checker g-wispch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id133}@anchor{3d9}@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3da} +@anchor{gnat_rm/the_gnat_library id133}@anchor{3da}@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3db} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -25145,7 +25209,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Wide_String_Split g-zistsp ads,GNAT Wide_String_Split g-wistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id134}@anchor{3dc} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3dc}@anchor{gnat_rm/the_gnat_library id134}@anchor{3dd} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -25157,7 +25221,7 @@ Provides a function for determining whether one wide wide string is a plausible near misspelling of another wide wide string. @node GNAT Wide_Wide_String_Split g-zistsp ads,Interfaces C Extensions i-cexten ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id135}@anchor{3de} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3de}@anchor{gnat_rm/the_gnat_library id135}@anchor{3df} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -25171,7 +25235,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node Interfaces C Extensions i-cexten ads,Interfaces C Streams i-cstrea ads,GNAT Wide_Wide_String_Split g-zistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id136}@anchor{3e0} +@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3e0}@anchor{gnat_rm/the_gnat_library id136}@anchor{3e1} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -25182,7 +25246,7 @@ for use with either manually or automatically generated bindings to C libraries. @node Interfaces C Streams i-cstrea ads,Interfaces Packed_Decimal i-pacdec ads,Interfaces C Extensions i-cexten ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id137}@anchor{3e2} +@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3e2}@anchor{gnat_rm/the_gnat_library id137}@anchor{3e3} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -25195,7 +25259,7 @@ This package is a binding for the most commonly used operations on C streams. @node Interfaces Packed_Decimal i-pacdec ads,Interfaces VxWorks i-vxwork ads,Interfaces C Streams i-cstrea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id138}@anchor{3e3}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3e4} +@anchor{gnat_rm/the_gnat_library id138}@anchor{3e4}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3e5} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -25210,7 +25274,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks Int_Connection i-vxinco ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id139}@anchor{3e5}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3e6} +@anchor{gnat_rm/the_gnat_library id139}@anchor{3e6}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3e7} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -25226,7 +25290,7 @@ In particular, it interfaces with the VxWorks hardware interrupt facilities. @node Interfaces VxWorks Int_Connection i-vxinco ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-int-connection-i-vxinco-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id140}@anchor{3e8} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-int-connection-i-vxinco-ads}@anchor{3e8}@anchor{gnat_rm/the_gnat_library id140}@anchor{3e9} @section @code{Interfaces.VxWorks.Int_Connection} (@code{i-vxinco.ads}) @@ -25242,7 +25306,7 @@ intConnect() with a custom routine for installing interrupt handlers. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks Int_Connection i-vxinco ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id141}@anchor{3ea} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3ea}@anchor{gnat_rm/the_gnat_library id141}@anchor{3eb} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -25265,7 +25329,7 @@ function codes. A particular use of this package is to enable the use of Get_Immediate under VxWorks. @node System Address_Image s-addima ads,System Assertions s-assert ads,Interfaces VxWorks IO i-vxwoio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id142}@anchor{3ec} +@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3ec}@anchor{gnat_rm/the_gnat_library id142}@anchor{3ed} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -25281,7 +25345,7 @@ function that gives an (implementation dependent) string which identifies an address. @node System Assertions s-assert ads,System Atomic_Counters s-atocou ads,System Address_Image s-addima ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id143}@anchor{3ee} +@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3ee}@anchor{gnat_rm/the_gnat_library id143}@anchor{3ef} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -25297,7 +25361,7 @@ by an run-time assertion failure, as well as the routine that is used internally to raise this assertion. @node System Atomic_Counters s-atocou ads,System Memory s-memory ads,System Assertions s-assert ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id144}@anchor{3ef}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3f0} +@anchor{gnat_rm/the_gnat_library id144}@anchor{3f0}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3f1} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -25311,7 +25375,7 @@ on most targets, including all Alpha, ia64, PowerPC, SPARC V9, x86, and x86_64 platforms. @node System Memory s-memory ads,System Multiprocessors s-multip ads,System Atomic_Counters s-atocou ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3f1}@anchor{gnat_rm/the_gnat_library id145}@anchor{3f2} +@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3f2}@anchor{gnat_rm/the_gnat_library id145}@anchor{3f3} @section @code{System.Memory} (@code{s-memory.ads}) @@ -25329,7 +25393,7 @@ calls to this unit may be made for low level allocation uses (for example see the body of @code{GNAT.Tables}). @node System Multiprocessors s-multip ads,System Multiprocessors Dispatching_Domains s-mudido ads,System Memory s-memory ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id146}@anchor{3f3}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3f4} +@anchor{gnat_rm/the_gnat_library id146}@anchor{3f4}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3f5} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -25342,7 +25406,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Multiprocessors Dispatching_Domains s-mudido ads,System Partition_Interface s-parint ads,System Multiprocessors s-multip ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3f5}@anchor{gnat_rm/the_gnat_library id147}@anchor{3f6} +@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3f6}@anchor{gnat_rm/the_gnat_library id147}@anchor{3f7} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -25355,7 +25419,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Partition_Interface s-parint ads,System Pool_Global s-pooglo ads,System Multiprocessors Dispatching_Domains s-mudido ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id148}@anchor{3f7}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3f8} +@anchor{gnat_rm/the_gnat_library id148}@anchor{3f8}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3f9} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -25368,7 +25432,7 @@ is used primarily in a distribution context when using Annex E with @code{GLADE}. @node System Pool_Global s-pooglo ads,System Pool_Local s-pooloc ads,System Partition_Interface s-parint ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id149}@anchor{3f9}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{3fa} +@anchor{gnat_rm/the_gnat_library id149}@anchor{3fa}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{3fb} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -25385,7 +25449,7 @@ declared. It uses malloc/free to allocate/free and does not attempt to do any automatic reclamation. @node System Pool_Local s-pooloc ads,System Restrictions s-restri ads,System Pool_Global s-pooglo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{3fb}@anchor{gnat_rm/the_gnat_library id150}@anchor{3fc} +@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{3fc}@anchor{gnat_rm/the_gnat_library id150}@anchor{3fd} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -25402,7 +25466,7 @@ a list of allocated blocks, so that all storage allocated for the pool can be freed automatically when the pool is finalized. @node System Restrictions s-restri ads,System Rident s-rident ads,System Pool_Local s-pooloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{3fd}@anchor{gnat_rm/the_gnat_library id151}@anchor{3fe} +@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{3fe}@anchor{gnat_rm/the_gnat_library id151}@anchor{3ff} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -25418,7 +25482,7 @@ compiler determined information on which restrictions are violated by one or more packages in the partition. @node System Rident s-rident ads,System Strings Stream_Ops s-ststop ads,System Restrictions s-restri ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{3ff}@anchor{gnat_rm/the_gnat_library id152}@anchor{400} +@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{400}@anchor{gnat_rm/the_gnat_library id152}@anchor{401} @section @code{System.Rident} (@code{s-rident.ads}) @@ -25434,7 +25498,7 @@ since the necessary instantiation is included in package System.Restrictions. @node System Strings Stream_Ops s-ststop ads,System Unsigned_Types s-unstyp ads,System Rident s-rident ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id153}@anchor{401}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{402} +@anchor{gnat_rm/the_gnat_library id153}@anchor{402}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{403} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -25450,7 +25514,7 @@ stream attributes are applied to string types, but the subprograms in this package can be used directly by application programs. @node System Unsigned_Types s-unstyp ads,System Wch_Cnv s-wchcnv ads,System Strings Stream_Ops s-ststop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{403}@anchor{gnat_rm/the_gnat_library id154}@anchor{404} +@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{404}@anchor{gnat_rm/the_gnat_library id154}@anchor{405} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -25463,7 +25527,7 @@ also contains some related definitions for other specialized types used by the compiler in connection with packed array types. @node System Wch_Cnv s-wchcnv ads,System Wch_Con s-wchcon ads,System Unsigned_Types s-unstyp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{405}@anchor{gnat_rm/the_gnat_library id155}@anchor{406} +@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{406}@anchor{gnat_rm/the_gnat_library id155}@anchor{407} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -25484,7 +25548,7 @@ encoding method. It uses definitions in package @code{System.Wch_Con}. @node System Wch_Con s-wchcon ads,,System Wch_Cnv s-wchcnv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id156}@anchor{407}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{408} +@anchor{gnat_rm/the_gnat_library id156}@anchor{408}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{409} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -25496,7 +25560,7 @@ in ordinary strings. These definitions are used by the package @code{System.Wch_Cnv}. @node Interfacing to Other Languages,Specialized Needs Annexes,The GNAT Library,Top -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11}@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{409}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{40a} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11}@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{40a}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{40b} @chapter Interfacing to Other Languages @@ -25514,7 +25578,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{40b}@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{40c} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{40c}@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{40d} @section Interfacing to C @@ -25654,7 +25718,7 @@ of the length corresponding to the @code{type'Size} value in Ada. @end itemize @node Interfacing to C++,Interfacing to COBOL,Interfacing to C,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{40d}@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49} +@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{40e}@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{4a} @section Interfacing to C++ @@ -25711,7 +25775,7 @@ The @code{External_Name} is the name of the C++ RTTI symbol. You can then cover a specific C++ exception in an exception handler. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{40e}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{40f} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{40f}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{410} @section Interfacing to COBOL @@ -25719,7 +25783,7 @@ Interfacing to COBOL is achieved as described in section B.4 of the Ada Reference Manual. @node Interfacing to Fortran,Interfacing to non-GNAT Ada code,Interfacing to COBOL,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{410}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{411} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{411}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{412} @section Interfacing to Fortran @@ -25729,7 +25793,7 @@ multi-dimensional array causes the array to be stored in column-major order as required for convenient interface to Fortran. @node Interfacing to non-GNAT Ada code,,Interfacing to Fortran,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{412}@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{413} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{413}@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{414} @section Interfacing to non-GNAT Ada code @@ -25753,7 +25817,7 @@ values or simple record types without variants, or simple array types with fixed bounds. @node Specialized Needs Annexes,Implementation of Specific Ada Features,Interfacing to Other Languages,Top -@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12}@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{414}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{415} +@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12}@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{415}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{416} @chapter Specialized Needs Annexes @@ -25794,7 +25858,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2012 Features,Specialized Needs Annexes,Top -@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13}@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{416}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{417} +@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13}@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{417}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{418} @chapter Implementation of Specific Ada Features @@ -25812,7 +25876,7 @@ facilities. @end menu @node Machine Code Insertions,GNAT Implementation of Tasking,,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{16c}@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{418} +@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{16d}@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{419} @section Machine Code Insertions @@ -25980,7 +26044,7 @@ according to normal visibility rules. In particular if there is no qualification is required. @node GNAT Implementation of Tasking,GNAT Implementation of Shared Passive Packages,Machine Code Insertions,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{419}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{41a} +@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{41a}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{41b} @section GNAT Implementation of Tasking @@ -25996,7 +26060,7 @@ to compliance with the Real-Time Systems Annex. @end menu @node Mapping Ada Tasks onto the Underlying Kernel Threads,Ensuring Compliance with the Real-Time Annex,,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{41b}@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{41c} +@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{41c}@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{41d} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -26065,7 +26129,7 @@ support this functionality when the parent contains more than one task. @geindex Forking a new process @node Ensuring Compliance with the Real-Time Annex,Support for Locking Policies,Mapping Ada Tasks onto the Underlying Kernel Threads,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{41d}@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{41e} +@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{41e}@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{41f} @subsection Ensuring Compliance with the Real-Time Annex @@ -26116,7 +26180,7 @@ placed at the end. @c Support_for_Locking_Policies @node Support for Locking Policies,,Ensuring Compliance with the Real-Time Annex,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{41f} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{420} @subsection Support for Locking Policies @@ -26150,7 +26214,7 @@ then ceiling locking is used. Otherwise, the @code{Ceiling_Locking} policy is ignored. @node GNAT Implementation of Shared Passive Packages,Code Generation for Array Aggregates,GNAT Implementation of Tasking,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{420}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{421} +@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{421}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{422} @section GNAT Implementation of Shared Passive Packages @@ -26251,7 +26315,7 @@ GNAT supports shared passive packages on all platforms except for OpenVMS. @node Code Generation for Array Aggregates,The Size of Discriminated Records with Default Discriminants,GNAT Implementation of Shared Passive Packages,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{422}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{423} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{423}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{424} @section Code Generation for Array Aggregates @@ -26282,7 +26346,7 @@ component values and static subtypes also lead to simpler code. @end menu @node Static constant aggregates with static bounds,Constant aggregates with unconstrained nominal types,,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{424}@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{425} +@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{425}@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{426} @subsection Static constant aggregates with static bounds @@ -26329,7 +26393,7 @@ Zero2: constant two_dim := (others => (others => 0)); @end example @node Constant aggregates with unconstrained nominal types,Aggregates with static bounds,Static constant aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{427} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{427}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{428} @subsection Constant aggregates with unconstrained nominal types @@ -26344,7 +26408,7 @@ Cr_Unc : constant One_Unc := (12,24,36); @end example @node Aggregates with static bounds,Aggregates with nonstatic bounds,Constant aggregates with unconstrained nominal types,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{428}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{429} +@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{429}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{42a} @subsection Aggregates with static bounds @@ -26372,7 +26436,7 @@ end loop; @end example @node Aggregates with nonstatic bounds,Aggregates in assignment statements,Aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{42a}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{42b} +@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{42b}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{42c} @subsection Aggregates with nonstatic bounds @@ -26383,7 +26447,7 @@ have to be applied to sub-arrays individually, if they do not have statically compatible subtypes. @node Aggregates in assignment statements,,Aggregates with nonstatic bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{42c}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{42d} +@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{42d}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{42e} @subsection Aggregates in assignment statements @@ -26425,7 +26489,7 @@ a temporary (created either by the front-end or the code generator) and then that temporary will be copied onto the target. @node The Size of Discriminated Records with Default Discriminants,Strict Conformance to the Ada Reference Manual,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{42e}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{42f} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{42f}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{430} @section The Size of Discriminated Records with Default Discriminants @@ -26505,7 +26569,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node Strict Conformance to the Ada Reference Manual,,The Size of Discriminated Records with Default Discriminants,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{431} +@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{431}@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{432} @section Strict Conformance to the Ada Reference Manual @@ -26532,7 +26596,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2012 Features,Obsolescent Features,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{432}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{433} +@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{433}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{434} @chapter Implementation of Ada 2012 Features @@ -28698,7 +28762,7 @@ RM References: H.04 (8/1) @end itemize @node Obsolescent Features,Compatibility and Porting Guide,Implementation of Ada 2012 Features,Top -@anchor{gnat_rm/obsolescent_features id1}@anchor{434}@anchor{gnat_rm/obsolescent_features doc}@anchor{435}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{15} +@anchor{gnat_rm/obsolescent_features id1}@anchor{435}@anchor{gnat_rm/obsolescent_features doc}@anchor{436}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{15} @chapter Obsolescent Features @@ -28717,7 +28781,7 @@ compatibility purposes. @end menu @node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{436}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{437} +@anchor{gnat_rm/obsolescent_features id2}@anchor{437}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{438} @section pragma No_Run_Time @@ -28730,7 +28794,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{438}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{439} +@anchor{gnat_rm/obsolescent_features id3}@anchor{439}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{43a} @section pragma Ravenscar @@ -28739,7 +28803,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{43a}@anchor{gnat_rm/obsolescent_features id4}@anchor{43b} +@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{43b}@anchor{gnat_rm/obsolescent_features id4}@anchor{43c} @section pragma Restricted_Run_Time @@ -28749,7 +28813,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{43c}@anchor{gnat_rm/obsolescent_features id5}@anchor{43d} +@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{43d}@anchor{gnat_rm/obsolescent_features id5}@anchor{43e} @section pragma Task_Info @@ -28775,7 +28839,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{43e}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{43f} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{43f}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{440} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -28785,7 +28849,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT's @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{16}@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{440}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{441} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{16}@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{441}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{442} @chapter Compatibility and Porting Guide @@ -28807,7 +28871,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{442}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{443} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{443}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{444} @section Writing Portable Fixed-Point Declarations @@ -28929,7 +28993,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{444}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{445} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{445}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{446} @section Compatibility with Ada 83 @@ -28957,7 +29021,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{446}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{447} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{447}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{448} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -29057,7 +29121,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{448}@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{449} +@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{449}@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{44a} @subsection More deterministic semantics @@ -29085,7 +29149,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{44a}@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{44b} +@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{44b}@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{44c} @subsection Changed semantics @@ -29127,7 +29191,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{44c}@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{44d} +@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{44d}@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{44e} @subsection Other language compatibility issues @@ -29160,7 +29224,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{44e}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{44f} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{44f}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{450} @section Compatibility between Ada 95 and Ada 2005 @@ -29232,7 +29296,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{450}@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{451} +@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{451}@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{452} @section Implementation-dependent characteristics @@ -29255,7 +29319,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{452}@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{453} +@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{453}@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{454} @subsection Implementation-defined pragmas @@ -29277,7 +29341,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{454}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{455} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{455}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{456} @subsection Implementation-defined attributes @@ -29291,7 +29355,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{456}@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{457} +@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{457}@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{458} @subsection Libraries @@ -29320,7 +29384,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{458}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{459} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{459}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{45a} @subsection Elaboration order @@ -29356,7 +29420,7 @@ pragmas either globally (as an effect of the @emph{-gnatE} switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{45a}@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{45b} +@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{45b}@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{45c} @subsection Target-specific aspects @@ -29369,10 +29433,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005 and Ada 2012) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT's approach to these issues is described in @ref{45c,,Representation Clauses}. +GNAT's approach to these issues is described in @ref{45d,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{45d}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{45e} +@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{45e}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{45f} @section Compatibility with Other Ada Systems @@ -29415,7 +29479,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{45c}@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{45f} +@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{45d}@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{460} @section Representation Clauses @@ -29508,7 +29572,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{460}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{461} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{461}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{462} @section Compatibility with HP Ada 83 @@ -29538,7 +29602,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license doc}@anchor{462}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{463} +@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license doc}@anchor{463}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{464} @chapter GNU Free Documentation License diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 3e0c857..c2dd053 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -10925,7 +10925,7 @@ of the pragma in the @cite{GNAT_Reference_manual}). @emph{Activate most optional warnings.} -This switch activates most optional warning messages. See the remaining list +This switch activates most optional warning messages. See the remaining list in this section for details on optional warning messages that can be individually controlled. The warnings that are not turned on by this switch are: @@ -10970,6 +10970,9 @@ switch are: @code{-gnatw.q} (questionable layout of record types) @item +@code{-gnatw_r} (out-of-order record representation clauses) + +@item @code{-gnatw.s} (overridden size clause) @item @@ -12225,7 +12228,7 @@ opposed to renaming the function itself). The default is that these warnings are given. @end table -@geindex -gnatwT (gcc) +@geindex -gnatw.R (gcc) @table @asis @@ -12237,6 +12240,31 @@ warnings are given. This switch suppresses warnings for object renaming function. @end table +@geindex -gnatw_r (gcc) + + +@table @asis + +@item @code{-gnatw_r} + +@emph{Activate warnings for out-of-order record representation clauses.} + +This switch activates warnings for record representation clauses, +if the order of component declarations, component clauses, +and bit-level layout do not all agree. +The default is that these warnings are not given. +@end table + +@geindex -gnatw_R (gcc) + + +@table @asis + +@item @code{-gnatw_R} + +@emph{Suppress warnings for out-of-order record representation clauses.} +@end table + @geindex -gnatws (gcc) diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index 4cf8535..7e67569 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -692,19 +692,10 @@ package body Impunit is return Not_Predefined_Unit; end if; - -- To be considered predefined, the file name must end in .ads or .adb. - -- File names with other extensions (coming from the use of non-standard - -- file naming schemes) can never be predefined. - - -- Note that in the context of a compiler, the .adb case will never - -- arise. However it can arise for other tools, e.g. gnatprove uses - -- this routine to detect when a construct comes from an instance of - -- a generic defined in a predefined unit. - - if File (File'Last - 3 .. File'Last) /= ".ads" - and then - File (File'Last - 3 .. File'Last) /= ".adb" - then + -- Not predefined if file name does not end in .ads. This can happen + -- when non-standard file names are being used. + + if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then return Not_Predefined_Unit; end if; diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 46daa48..e5ecb55 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -635,8 +635,8 @@ package body Inline is -- declares the type, and that body is visible to the back end. -- Do not inline it either if it is in the main unit. -- Extend the -gnatn2 processing to -gnatn1 for Inline_Always - -- calls if the back-end takes care of inlining the call. - -- Note that Level is in Inline_Call | Inline_Packag here. + -- calls if the back end takes care of inlining the call. + -- Note that Level is in Inline_Call | Inline_Package here. elsif ((Level = Inline_Call and then Has_Pragma_Inline_Always (E) diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb index 4b7b995..25c8794 100644 --- a/gcc/ada/lib-load.adb +++ b/gcc/ada/lib-load.adb @@ -245,6 +245,8 @@ package body Lib.Load is Version => 0, OA_Setting => 'O'); + Init_Unit_Name (Unum, Spec_Name); + Set_Comes_From_Source_Default (Save_CS); Set_Error_Posted (Cunit_Entity); Set_Error_Posted (Cunit); @@ -607,11 +609,10 @@ package body Lib.Load is -- See if we already have an entry for this unit - Unum := Main_Unit; - while Unum <= Units.Last loop - exit when Uname_Actual = Units.Table (Unum).Unit_Name; - Unum := Unum + 1; - end loop; + Unum := Unit_Names.Get (Uname_Actual); + if Unum = No_Unit then + Unum := Units.Last + 1; + end if; -- Whether or not the entry was found, Unum is now the right value, -- since it is one more than Units.Last (i.e. the index of the new @@ -727,7 +728,7 @@ package body Lib.Load is -- found case to print the dependency chain including the last entry Units.Increment_Last; - Units.Table (Unum).Unit_Name := Uname_Actual; + Init_Unit_Name (Unum, Uname_Actual); -- File was found @@ -893,14 +894,14 @@ package body Lib.Load is -- subsequent missing files. Load_Stack.Decrement_Last; - Units.Decrement_Last; + Remove_Unit (Unum); -- If unit not required, remove load stack entry and the junk -- file table entry, and return No_Unit to indicate not found, else Load_Stack.Decrement_Last; - Units.Decrement_Last; + Remove_Unit (Unum); end if; Unum := No_Unit; @@ -921,17 +922,17 @@ package body Lib.Load is -------------------------- procedure Make_Child_Decl_Unit (N : Node_Id) is - Unit_Decl : constant Node_Id := Library_Unit (N); + Unit_Decl : constant Node_Id := Library_Unit (N); + Unit_Num : constant Unit_Number_Type := Get_Cunit_Unit_Number (N); begin Units.Increment_Last; - Units.Table (Units.Last) := Units.Table (Get_Cunit_Unit_Number (N)); - Units.Table (Units.Last).Unit_Name := - Get_Spec_Name (Unit_Name (Get_Cunit_Unit_Number (N))); + Units.Table (Units.Last) := Units.Table (Unit_Num); Units.Table (Units.Last).Cunit := Unit_Decl; Units.Table (Units.Last).Cunit_Entity := Defining_Identifier (Defining_Unit_Name (Specification (Unit (Unit_Decl)))); + Init_Unit_Name (Units.Last, Get_Spec_Name (Unit_Name (Unit_Num))); -- The library unit created for of a child subprogram unit plays no -- role in code generation and binding, so label it accordingly. @@ -963,11 +964,13 @@ package body Lib.Load is Units.Table (Units.Last) := Units.Table (Main_Unit); Units.Table (Units.Last).Cunit := Library_Unit (N); Units.Table (Units.Last).Generate_Code := True; + Init_Unit_Name (Units.Last, Unit_Name (Main_Unit)); + Units.Table (Main_Unit).Cunit := N; - Units.Table (Main_Unit).Unit_Name := - Get_Body_Name - (Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N)))); Units.Table (Main_Unit).Version := Source_Checksum (Sind); + Init_Unit_Name (Main_Unit, + Get_Body_Name + (Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N))))); else -- Duplicate information from instance unit, for the body. The unit diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index 987afcb..d877e7b 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -189,6 +189,7 @@ package body Lib.Writ is Version => 0, Error_Location => No_Location, OA_Setting => 'O'); + Init_Unit_Name (Units.Last, System_Uname); -- Parse system.ads so that the checksum is set right. Style checks are -- not applied. The Ekind is set to ensure that this reference is always diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb index 901ca3b..d04f0a4 100644 --- a/gcc/ada/lib.adb +++ b/gcc/ada/lib.adb @@ -277,8 +277,24 @@ package body Lib is end Set_OA_Setting; procedure Set_Unit_Name (U : Unit_Number_Type; N : Unit_Name_Type) is + Old_N : constant Unit_Name_Type := Units.Table (U).Unit_Name; + begin + -- First unregister the old name, if any + + if Old_N /= No_Unit_Name and then Unit_Names.Get (Old_N) = U then + Unit_Names.Set (Old_N, No_Unit); + end if; + + -- Then set the new name + Units.Table (U).Unit_Name := N; + + -- Finally register the new name + + if Unit_Names.Get (N) = No_Unit then + Unit_Names.Set (N, U); + end if; end Set_Unit_Name; ------------------------------ @@ -1068,6 +1084,16 @@ package body Lib is return TSN; end Increment_Serial_Number; + ---------------------- + -- Init_Unit_Name -- + ---------------------- + + procedure Init_Unit_Name (U : Unit_Number_Type; N : Unit_Name_Type) is + begin + Units.Table (U).Unit_Name := N; + Unit_Names.Set (N, U); + end Init_Unit_Name; + ---------------- -- Initialize -- ---------------- @@ -1087,13 +1113,7 @@ package body Lib is function Is_Loaded (Uname : Unit_Name_Type) return Boolean is begin - for Unum in Units.First .. Units.Last loop - if Uname = Unit_Name (Unum) then - return True; - end if; - end loop; - - return False; + return Unit_Names.Get (Uname) /= No_Unit; end Is_Loaded; --------------- @@ -1141,6 +1161,7 @@ package body Lib is procedure Remove_Unit (U : Unit_Number_Type) is begin if U = Units.Last then + Unit_Names.Set (Unit_Name (U), No_Unit); Units.Decrement_Last; end if; end Remove_Unit; @@ -1277,6 +1298,15 @@ package body Lib is end loop; end Tree_Write; + -------------------- + -- Unit_Name_Hash -- + -------------------- + + function Unit_Name_Hash (Id : Unit_Name_Type) return Unit_Name_Header_Num is + begin + return Unit_Name_Header_Num (Id mod Unit_Name_Table_Size); + end Unit_Name_Hash; + ------------ -- Unlock -- ------------ diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads index 504120e..7665f86 100644 --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -37,6 +37,8 @@ with Namet; use Namet; with Table; with Types; use Types; +with GNAT.HTable; + package Lib is type Unit_Ref_Table is array (Pos range <>) of Unit_Number_Type; @@ -823,21 +825,22 @@ private pragma Inline (Increment_Primary_Stack_Count); pragma Inline (Increment_Sec_Stack_Count); pragma Inline (Increment_Serial_Number); + pragma Inline (Is_Internal_Unit); + pragma Inline (Is_Loaded); + pragma Inline (Is_Predefined_Renaming); + pragma Inline (Is_Predefined_Unit); pragma Inline (Loading); pragma Inline (Main_CPU); pragma Inline (Main_Priority); pragma Inline (Munit_Index); pragma Inline (No_Elab_Code_All); pragma Inline (OA_Setting); + pragma Inline (Primary_Stack_Count); pragma Inline (Set_Cunit); pragma Inline (Set_Cunit_Entity); pragma Inline (Set_Fatal_Error); pragma Inline (Set_Generate_Code); pragma Inline (Set_Has_RACW); - pragma Inline (Is_Predefined_Renaming); - pragma Inline (Is_Internal_Unit); - pragma Inline (Is_Predefined_Unit); - pragma Inline (Primary_Stack_Count); pragma Inline (Sec_Stack_Count); pragma Inline (Set_Loading); pragma Inline (Set_Main_CPU); @@ -930,6 +933,36 @@ private Table_Increment => Alloc.Units_Increment, Table_Name => "Units"); + -- The following table records a mapping between a name and the entry in + -- the units table whose Unit_Name is this name. It is used to speed up + -- the Is_Loaded function, whose original implementation (linear search) + -- could account for 2% of the time spent in the front end. Note that, in + -- the case of source files containing multiple units, the units table may + -- temporarily contain two entries with the same Unit_Name during parsing, + -- which means that the mapping must be to the first entry in the table. + + Unit_Name_Table_Size : constant := 257; + -- Number of headers in hash table + + subtype Unit_Name_Header_Num is Integer range 0 .. Unit_Name_Table_Size - 1; + -- Range of headers in hash table + + function Unit_Name_Hash (Id : Unit_Name_Type) return Unit_Name_Header_Num; + -- Simple hash function for Unit_Name_Types + + package Unit_Names is new GNAT.Htable.Simple_HTable + (Header_Num => Unit_Name_Header_Num, + Element => Unit_Number_Type, + No_Element => No_Unit, + Key => Unit_Name_Type, + Hash => Unit_Name_Hash, + Equal => "="); + + procedure Init_Unit_Name (U : Unit_Number_Type; N : Unit_Name_Type); + pragma Inline (Init_Unit_Name); + -- Both set the Unit_Name for the given units table entry and register a + -- mapping between this name and the entry. + -- The following table stores strings from pragma Linker_Option lines type Linker_Option_Entry is record diff --git a/gcc/ada/libgnat/a-cborma.adb b/gcc/ada/libgnat/a-cborma.adb index a7969fe..55be7ad 100644 --- a/gcc/ada/libgnat/a-cborma.adb +++ b/gcc/ada/libgnat/a-cborma.adb @@ -374,7 +374,9 @@ package body Ada.Containers.Bounded_Ordered_Maps is procedure Clear (Container : in out Map) is begin - Tree_Operations.Clear_Tree (Container); + while not Container.Is_Empty loop + Container.Delete_Last; + end loop; end Clear; ----------- diff --git a/gcc/ada/libgnat/a-cborse.adb b/gcc/ada/libgnat/a-cborse.adb index 363351a4..9fdba26 100644 --- a/gcc/ada/libgnat/a-cborse.adb +++ b/gcc/ada/libgnat/a-cborse.adb @@ -374,7 +374,9 @@ package body Ada.Containers.Bounded_Ordered_Sets is procedure Clear (Container : in out Set) is begin - Tree_Operations.Clear_Tree (Container); + while not Container.Is_Empty loop + Container.Delete_Last; + end loop; end Clear; ----------- diff --git a/gcc/ada/libgnat/a-cofove.ads b/gcc/ada/libgnat/a-cofove.ads index b23c661..5fb3bc9 100644 --- a/gcc/ada/libgnat/a-cofove.ads +++ b/gcc/ada/libgnat/a-cofove.ads @@ -70,7 +70,11 @@ is subtype Capacity_Range is Count_Type range 0 .. Last_Count; type Vector (Capacity : Capacity_Range) is private with - Default_Initial_Condition => Is_Empty (Vector); + Default_Initial_Condition => Is_Empty (Vector), + Iterable => (First => Iter_First, + Has_Element => Iter_Has_Element, + Next => Iter_Next, + Element => Element); function Length (Container : Vector) return Capacity_Range with Global => null, @@ -173,6 +177,7 @@ is Ghost, Global => null, Post => M.Length (Model'Result) = Length (Container); + pragma Annotate (GNATprove, Iterable_For_Proof, "Model", Model); function Element (S : M.Sequence; @@ -859,6 +864,30 @@ is Model (Target)'Old); end Generic_Sorting; + --------------------------- + -- Iteration Primitives -- + --------------------------- + + function Iter_First (Container : Vector) return Extended_Index with + Global => null; + + function Iter_Has_Element + (Container : Vector; + Position : Extended_Index) return Boolean + with + Global => null, + Post => + Iter_Has_Element'Result = + (Position in Index_Type'First .. Last_Index (Container)); + pragma Annotate (GNATprove, Inline_For_Proof, Iter_Has_Element); + + function Iter_Next + (Container : Vector; + Position : Extended_Index) return Extended_Index + with + Global => null, + Pre => Iter_Has_Element (Container, Position); + private pragma SPARK_Mode (Off); @@ -882,4 +911,22 @@ private function Empty_Vector return Vector is ((Capacity => 0, others => <>)); + function Iter_First (Container : Vector) return Extended_Index is + (Index_Type'First); + + function Iter_Next + (Container : Vector; + Position : Extended_Index) return Extended_Index + is + (if Position = Extended_Index'Last then + Extended_Index'First + else + Extended_Index'Succ (Position)); + + function Iter_Has_Element + (Container : Vector; + Position : Extended_Index) return Boolean + is + (Position in Index_Type'First .. Container.Last); + end Ada.Containers.Formal_Vectors; diff --git a/gcc/ada/libgnat/a-locale.ads b/gcc/ada/libgnat/a-locale.ads index 314001a..418c41e 100644 --- a/gcc/ada/libgnat/a-locale.ads +++ b/gcc/ada/libgnat/a-locale.ads @@ -20,9 +20,9 @@ package Ada.Locales is pragma Remote_Types (Locales); -- A locale identifies a geopolitical place or region and its associated - -- language, which can be used to determine other - -- internationalization-related characteristics. The active locale is the - -- locale associated with the partition of the current task. + -- language, which can be used to determine other internationalization- + -- related characteristics. The active locale is the locale associated with + -- the partition of the current task. type Language_Code is new String (1 .. 3) with Dynamic_Predicate => diff --git a/gcc/ada/libgnat/g-comlin.ads b/gcc/ada/libgnat/g-comlin.ads index 3708c37..188b035 100644 --- a/gcc/ada/libgnat/g-comlin.ads +++ b/gcc/ada/libgnat/g-comlin.ads @@ -731,8 +731,8 @@ package GNAT.Command_Line is -- Full_Switch omits the first leading '-'. Exit_From_Command_Line : exception; - -- Emitted when the program should exit. This is called when Getopt below - -- has seen -h, --help or an invalid switch. + -- Raised when the program should exit because Getopt below has seen + -- a -h or --help switch. procedure Getopt (Config : Command_Line_Configuration; diff --git a/gcc/ada/libgnat/g-expect.adb b/gcc/ada/libgnat/g-expect.adb index 8601f6b..21c7913 100644 --- a/gcc/ada/libgnat/g-expect.adb +++ b/gcc/ada/libgnat/g-expect.adb @@ -692,15 +692,21 @@ package body GNAT.Expect is Buffer_Size := 4096; end if; - N := Read (Descriptors (D).Output_Fd, Buffer'Address, - Buffer_Size); + -- Read may be interrupted on Linux by a signal and + -- need to be repeated. We don't want to check for + -- errno = EINTER, so just attempt to read a few + -- times. + + for J in 1 .. 3 loop + N := Read (Descriptors (D).Output_Fd, + Buffer'Address, Buffer_Size); + + exit when N > 0; + end loop; -- Error or End of file if N <= 0 then - -- ??? Note that ddd tries again up to three times - -- in that case. See LiterateA.C:174 - Close (Descriptors (D).Input_Fd); Descriptors (D).Input_Fd := Invalid_FD; Result := Expect_Process_Died; diff --git a/gcc/ada/libgnat/s-bitfie.ads b/gcc/ada/libgnat/s-bitfie.ads new file mode 100644 index 0000000..1b62b9d --- /dev/null +++ b/gcc/ada/libgnat/s-bitfie.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . B I T F I E L D _ U T I L S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2019, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- <http://www.gnu.org/licenses/>. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +with System.Bitfield_Utils; + +package System.Bitfields is + + -- Instances of the generic package in System.Bitfield_Utils. So far + -- we have just one, which defaults to the natural endianness of the + -- machine. We might someday want to support Scalar_Storage_Order. + + Val_Bytes : constant := 4; + Val_Bits : constant := Val_Bytes * System.Storage_Unit; + type Val_2 is mod 2**(Val_Bits * 2) with Alignment => Val_Bytes; + pragma Provide_Shift_Operators (Val_2); + type Val is mod 2**Val_Bits with Alignment => Val_Bytes; + + package Utils is new System.Bitfield_Utils.G (Val, Val_2); + + procedure Copy_Bitfield + (Src_Address : Address; + Src_Offset : Utils.Bit_Offset_In_Byte; + Dest_Address : Address; + Dest_Offset : Utils.Bit_Offset_In_Byte; + Size : Utils.Bit_Size) + renames Utils.Copy_Bitfield; + +end System.Bitfields; diff --git a/gcc/ada/libgnat/s-bituti.adb b/gcc/ada/libgnat/s-bituti.adb new file mode 100644 index 0000000..78e391b --- /dev/null +++ b/gcc/ada/libgnat/s-bituti.adb @@ -0,0 +1,320 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . B I T F I E L D _ U T I L S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2019, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- <http://www.gnu.org/licenses/>. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body System.Bitfield_Utils is + + -- ??? + -- + -- This code does not yet work for overlapping bit fields. We need to copy + -- backwards in some cases (i.e. from higher to lower bit addresses). + -- Alternatively, we could avoid calling this if Forwards_OK is False. + -- + -- ??? + + package body G is + + Val_Bytes : constant Address := Address (Val'Size / Storage_Unit); + + -- Get_Bitfield and Set_Bitfield are helper functions that get/set small + -- bit fields -- the value fits in Val, and the bit field is placed + -- starting at some offset within the first half of a Val_2. + -- Copy_Bitfield, on the other hand, supports arbitrarily large bit + -- fields. All operations require bit offsets to point within the first + -- Val pointed to by the address. + + function Get_Bitfield + (Src : Val_2; Src_Offset : Bit_Offset; Size : Small_Size) + return Val; + -- Returns the bit field in Src starting at Src_Offset, of the given + -- Size. If Size < Small_Size'Last, then high order bits are zero. + + function Get_Full_Bitfield + (Src : Val_2; Src_Offset : Bit_Offset) return Val; + -- Same as Get_Bitfield, except the Size is hardwired to the maximum + -- allowed. + + function Set_Bitfield + (Src_Value : Val; + Dest : Val_2; + Dest_Offset : Bit_Offset; + Size : Small_Size) + return Val_2; + -- The bit field in Dest starting at Dest_Offset, of the given Size, is + -- set to Src_Value. Src_Value must have high order bits (Size and + -- above) zero. The result is returned as the function result. + + function Get_Bitfield + (Src : Val_2; Src_Offset : Bit_Offset; Size : Small_Size) + return Val + is + L_Shift_Amount : constant Natural := + (case Endian is + when Little => Val_2'Size - (Src_Offset + Size), + when Big => Src_Offset); + Temp1 : constant Val_2 := + Shift_Left (Src, L_Shift_Amount); + Temp2 : constant Val_2 := + Shift_Right (Temp1, Val_2'Size - Size); + begin + return Val (Temp2); + end Get_Bitfield; + + function Get_Full_Bitfield + (Src : Val_2; Src_Offset : Bit_Offset) return Val is + begin + return Get_Bitfield (Src, Src_Offset, Size => Val'Size); + end Get_Full_Bitfield; + + function Set_Bitfield + (Src_Value : Val; + Dest : Val_2; + Dest_Offset : Bit_Offset; + Size : Small_Size) + return Val_2 + is + pragma Assert (Size = Val'Size or else Src_Value < 2**Size); + L_Shift_Amount : constant Natural := + (case Endian is + when Little => Dest_Offset, + when Big => Val_2'Size - (Dest_Offset + Size)); + Mask : constant Val_2 := + Shift_Left (Shift_Left (1, Size) - 1, L_Shift_Amount); + Temp1 : constant Val_2 := Dest and not Mask; + Temp2 : constant Val_2 := + Shift_Left (Val_2 (Src_Value), L_Shift_Amount); + Result : constant Val_2 := Temp1 or Temp2; + begin + return Result; + end Set_Bitfield; + + procedure Copy_Small_Bitfield + (Src_Address : Address; + Src_Offset : Bit_Offset; + Dest_Address : Address; + Dest_Offset : Bit_Offset; + Size : Small_Size); + -- Copy_Bitfield in the case where Size <= Val'Size. + -- The Address values must be aligned as for Val and Val_2. + -- This works for overlapping bit fields. + + procedure Copy_Large_Bitfield + (Src_Address : Address; + Src_Offset : Bit_Offset; + Dest_Address : Address; + Dest_Offset : Bit_Offset; + Size : Bit_Size); + -- Copy_Bitfield in the case where Size > Val'Size. + -- The Address values must be aligned as for Val and Val_2. + -- This works for overlapping bit fields only if the source + -- bit address is greater than or equal to the destination + -- bit address, because it copies forward (from lower to higher + -- bit addresses). + + procedure Copy_Small_Bitfield + (Src_Address : Address; + Src_Offset : Bit_Offset; + Dest_Address : Address; + Dest_Offset : Bit_Offset; + Size : Small_Size) + is + Src : constant Val_2 with Import, Address => Src_Address; + V : constant Val := Get_Bitfield (Src, Src_Offset, Size); + Dest : Val_2 with Import, Address => Dest_Address; + begin + Dest := Set_Bitfield (V, Dest, Dest_Offset, Size); + end Copy_Small_Bitfield; + + -- Copy_Large_Bitfield does the main work. Copying aligned Vals is more + -- efficient than fiddling with shifting and whatnot. But we can't align + -- both source and destination. We choose to align the destination, + -- because that's more efficient -- Set_Bitfield needs to read, then + -- modify, then write, whereas Get_Bitfield does not. + -- + -- So the method is: + -- + -- Step 1: + -- If the destination is not already aligned, copy Initial_Size + -- bits, and increment the bit addresses. Initial_Size is chosen to + -- be the smallest size that will cause the destination bit address + -- to be aligned (i.e. have zero bit offset from the already-aligned + -- Address). Get_Bitfield and Set_Bitfield are used here. + -- + -- Step 2: + -- Loop, copying Vals. Get_Full_Bitfield is used to fetch a + -- Val-sized bit field, but Set_Bitfield is not needed -- we can set + -- the aligned Val with an array indexing. + -- + -- Step 3: + -- Copy remaining smaller-than-Val bits, if any + + procedure Copy_Large_Bitfield + (Src_Address : Address; + Src_Offset : Bit_Offset; + Dest_Address : Address; + Dest_Offset : Bit_Offset; + Size : Bit_Size) + is + Sz : Bit_Size := Size; + S_Addr : Address := Src_Address; + S_Off : Bit_Offset := Src_Offset; + D_Addr : Address := Dest_Address; + D_Off : Bit_Offset := Dest_Offset; + begin + if S_Addr < D_Addr or else (S_Addr = D_Addr and then S_Off < D_Off) + then + -- Here, the source bit address is less than the destination bit + -- address. Assert that there is no overlap. + + declare + Temp_Off : constant Bit_Offset'Base := S_Off + Size; + After_S_Addr : constant Address := + S_Addr + Address (Temp_Off / Storage_Unit); + After_S_Off : constant Bit_Offset_In_Byte := + Temp_Off mod Storage_Unit; + -- (After_S_Addr, After_S_Off) is the bit address of the bit + -- just after the source bit field. Assert that it's less than + -- or equal to the destination bit address. + Overlap_OK : constant Boolean := + After_S_Addr < D_Addr + or else + (After_S_Addr = D_Addr and then After_S_Off <= D_Off); + begin + pragma Assert (Overlap_OK); + end; + end if; + + if D_Off /= 0 then + -- Step 1: + + declare + Initial_Size : constant Small_Size := Val'Size - D_Off; + Initial_Val_2 : constant Val_2 with Import, Address => S_Addr; + Initial_Val : constant Val := + Get_Bitfield (Initial_Val_2, S_Off, Initial_Size); + Initial_Dest : Val_2 with Import, Address => D_Addr; + begin + Initial_Dest := Set_Bitfield + (Initial_Val, Initial_Dest, D_Off, Initial_Size); + + Sz := Sz - Initial_Size; + declare + New_S_Off : constant Bit_Offset'Base := S_Off + Initial_Size; + begin + if New_S_Off > Bit_Offset'Last then + S_Addr := S_Addr + Val_Bytes; + S_Off := New_S_Off - Small_Size'Last; + else + S_Off := New_S_Off; + end if; + end; + D_Addr := D_Addr + Val_Bytes; + pragma Assert (D_Off + Initial_Size = Val'Size); + D_Off := 0; + end; + end if; + + -- Step 2: + + declare + Dest_Arr : Val_Array (1 .. Sz / Val'Size) with Import, + Address => D_Addr; + begin + for Dest_Comp of Dest_Arr loop + declare + pragma Warnings (Off); + pragma Assert (Dest_Comp in Val); + pragma Warnings (On); + pragma Assert (Dest_Comp'Valid); + Src_V_2 : constant Val_2 with Import, Address => S_Addr; + Full_V : constant Val := Get_Full_Bitfield (Src_V_2, S_Off); + begin + Dest_Comp := Full_V; + S_Addr := S_Addr + Val_Bytes; + -- S_Off remains the same + end; + end loop; + + if Sz mod Val'Size /= 0 then + -- Step 3: + + declare + Final_Val_2 : constant Val_2 with Import, Address => S_Addr; + Final_Val : constant Val := + Get_Bitfield (Final_Val_2, S_Off, Sz mod Val'Size); + Final_Dest : Val_2 with Import, + Address => D_Addr + Dest_Arr'Length * Val_Bytes; + begin + Final_Dest := Set_Bitfield + (Final_Val, Final_Dest, 0, Sz mod Val'Size); + end; + end if; + end; + end Copy_Large_Bitfield; + + procedure Copy_Bitfield + (Src_Address : Address; + Src_Offset : Bit_Offset_In_Byte; + Dest_Address : Address; + Dest_Offset : Bit_Offset_In_Byte; + Size : Bit_Size) + is + -- Align the Address values as for Val and Val_2, and adjust the + -- Bit_Offsets accordingly. + + Src_Adjust : constant Address := Src_Address mod Val_Bytes; + Al_Src_Address : constant Address := Src_Address - Src_Adjust; + Al_Src_Offset : constant Bit_Offset := + Src_Offset + Bit_Offset (Src_Adjust * Storage_Unit); + + Dest_Adjust : constant Address := Dest_Address mod Val_Bytes; + Al_Dest_Address : constant Address := Dest_Address - Dest_Adjust; + Al_Dest_Offset : constant Bit_Offset := + Dest_Offset + Bit_Offset (Dest_Adjust * Storage_Unit); + + pragma Assert (Al_Src_Address mod Val'Alignment = 0); + pragma Assert (Al_Dest_Address mod Val'Alignment = 0); + begin + if Size in Small_Size then + Copy_Small_Bitfield + (Al_Src_Address, Al_Src_Offset, + Al_Dest_Address, Al_Dest_Offset, + Size); + else + Copy_Large_Bitfield + (Al_Src_Address, Al_Src_Offset, + Al_Dest_Address, Al_Dest_Offset, + Size); + end if; + end Copy_Bitfield; + + end G; + +end System.Bitfield_Utils; diff --git a/gcc/ada/libgnat/s-bituti.ads b/gcc/ada/libgnat/s-bituti.ads new file mode 100644 index 0000000..1e446c1 --- /dev/null +++ b/gcc/ada/libgnat/s-bituti.ads @@ -0,0 +1,132 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . B I T F I E L D _ U T I L S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2019, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- <http://www.gnu.org/licenses/>. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package System.Bitfield_Utils is + + -- This package provides a procedure for copying arbitrarily large and + -- arbitrarily bit-aligned bit fields. + + -- Type Val is used to represent small bit fields. Val_2 represents a + -- contiguous pair of Vals. Val_2'Alignment is half of its size in bytes, + -- which is likely not the natural alignment. This is done to ensure that + -- any bit field that fits in a Val can fit in an aligned Val_2, starting + -- somewhere in the first half, and possibly crossing over into the second + -- half. This allows us to isolate a Val value by shifting and masking the + -- Val_2. + -- + -- Val can be 8, 16, or 32 bits; larger values are more efficient. It can't + -- be 64 bits, because we need Val_2 to be a double-wide shiftable type, + -- and 128 bits is not supported. Instantiating with an 8-bit Val is useful + -- for testing and debugging; 32 bits should be used for production. + -- + -- We use modular types here, not because we want modular arithmetic, but + -- so we can do shifting and masking. The actual for Val_2 should have + -- pragma Provide_Shift_Operators, so that the Shift_Left and Shift_Right + -- intrinsics can be passed in. It is impossible to put that pragma on a + -- generic formal, or on a type derived from a generic formal, so they have + -- to be passed in. + -- + -- Endian indicates whether we're on little-endian or big-endian machine. + + pragma Elaborate_Body; + + Little : constant Bit_Order := Low_Order_First; + Big : constant Bit_Order := High_Order_First; + + generic + type Val is mod <>; + type Val_2 is mod <>; + + with function Shift_Left + (Value : Val_2; + Amount : Natural) return Val_2 is <>; + + with function Shift_Right + (Value : Val_2; + Amount : Natural) return Val_2 is <>; + + Endian : Bit_Order := Default_Bit_Order; + + package G is + -- Assert that Val has one of the allowed sizes, and that Val_2 is twice + -- that. + + pragma Assert (Val'Size in 8 | 16 | 32); + pragma Assert (Val_2'Size = Val'Size * 2); + + -- Assert that both are aligned the same, to the size in bytes of Val + -- (not Val_2). + + pragma Assert (Val'Alignment = Val'Size / Storage_Unit); + pragma Assert (Val_2'Alignment = Val'Alignment); + + type Val_Array is array (Positive range <>) of Val; + + -- It might make more sense to have: + -- subtype Val is Val_2 range 0 .. 2**Val'Size - 1; + -- But then GNAT gets the component size of Val_Array wrong. + + pragma Assert (Val_Array'Alignment = Val'Alignment); + pragma Assert (Val_Array'Component_Size = Val'Size); + + subtype Bit_Size is Natural; -- Size in bits of a bit field + subtype Small_Size is Bit_Size range 0 .. Val'Size; + -- Size of a small one + subtype Bit_Offset is Small_Size range 0 .. Val'Size - 1; + -- Starting offset + subtype Bit_Offset_In_Byte is Bit_Offset range 0 .. Storage_Unit - 1; + + procedure Copy_Bitfield + (Src_Address : Address; + Src_Offset : Bit_Offset_In_Byte; + Dest_Address : Address; + Dest_Offset : Bit_Offset_In_Byte; + Size : Bit_Size); + -- An Address and a Bit_Offset together form a "bit address". This + -- copies the source bit field to the destination. Size is the size in + -- bits of the bit field. The bit fields can be arbitrarily large, but + -- the starting offsets must be within the first byte that the Addresses + -- point to. The Address values need not be aligned. + -- + -- For example, a slice assignment of a packed bit field: + -- + -- D (D_First .. D_Last) := S (S_First .. S_Last); + -- + -- can be implemented using: + -- + -- Copy_Bitfield + -- (S (S_First)'Address, S (S_First)'Bit, + -- D (D_First)'Address, D (D_First)'Bit, + -- Size); + + end G; + +end System.Bitfield_Utils; diff --git a/gcc/ada/libgnat/s-soflin.ads b/gcc/ada/libgnat/s-soflin.ads index ff095b6..2125d59 100644 --- a/gcc/ada/libgnat/s-soflin.ads +++ b/gcc/ada/libgnat/s-soflin.ads @@ -302,15 +302,16 @@ package System.Soft_Links is -- Wrapper to the possible user specified traceback decorator to be -- called during automatic output of exception data. - -- The null value of this wrapper correspond sto the null value of the + -- The null value of this wrapper corresponds to the null value of the -- current actual decorator. This is ensured first by the null initial -- value of the corresponding variables, and then by Set_Trace_Decorator -- in g-exctra.adb. pragma Atomic (Traceback_Decorator_Wrapper); -- Since concurrent read/write operations may occur on this variable. - -- See the body of Tailored_Exception_Traceback in Ada.Exceptions for - -- a more detailed description of the potential problems. + -- See the body of Tailored_Exception_Traceback in + -- Ada.Exceptions.Exception_Data for a more detailed description of the + -- potential problems. procedure Save_Library_Occurrence (E : EOA); -- When invoked, this routine saves an exception occurrence into a hidden diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 3158899..a07db75 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -191,6 +191,11 @@ package Opt is -- GNAT, GNATBIND -- Set True if package System has the line "type Address is private;" + Aggregate_Individually_Assign : Boolean := False; + -- GNAT + -- Set True if record aggregates are to be always converted into assignment + -- statements. Set through the corresponding pragma. + All_Errors_Mode : Boolean := False; -- GNAT -- Flag set to force display of multiple errors on a single line and @@ -1944,10 +1949,6 @@ package Opt is -- which requires pragma Warnings to be stored for the formal verification -- backend. - Warnings_As_Errors_Count : Natural; - -- GNAT - -- Number of entries stored in Warnings_As_Errors table - Wide_Character_Encoding_Method : WC_Encoding_Method := WCEM_Brackets; -- GNAT, GNATBIND -- Method used for encoding wide characters in the source program. See @@ -2158,10 +2159,6 @@ package Opt is -- is ignored for internal and predefined units (which are always compiled -- with the standard Size semantics). - Warnings_As_Errors_Count_Config : Natural; - -- GNAT - -- Count of pattern strings stored from Warning_As_Error pragmas - type Config_Switches_Type is private; -- Type used to save values of the switches set from Config values @@ -2268,16 +2265,24 @@ package Opt is --------------------------- -- The following array would more reasonably be located in Err_Vars or - -- Errour, but we put them here to deal with licensing issues (we need + -- Errout, but we put them here to deal with licensing issues (we need -- this to have the GPL exception licensing, since these variables and -- subprograms are accessed from units with this licensing). Warnings_As_Errors : array (1 .. 10_000) of String_Ptr; - -- Table for recording Warning_As_Error pragmas as they are processed. - -- It would be nicer to use Table, but there are circular elaboration - -- problems if we try to do this, and an attempt to find some other - -- appropriately licensed unit to declare this as a Table failed with - -- various elaboration circularities. Memory is getting cheap these days! + -- Table for recording Warning_As_Error pragmas as they are processed. It + -- would be nicer to use Table, but there are circular elaboration problems + -- if we try to do this, and an attempt to find some other appropriately + -- licensed unit to declare this as a Table failed with various elaboration + -- circularities. + + Warnings_As_Errors_Count : Natural; + -- GNAT + -- Number of entries stored in Warnings_As_Errors table + + Warnings_As_Errors_Count_Config : Natural; + -- GNAT + -- Count of pattern strings stored from Warning_As_Error pragmas --------------- -- GNAT_Mode -- diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index b9b0214..986d128 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -2850,7 +2850,7 @@ package body Ch4 is when Tok_At_Sign => -- AI12-0125 : target_name if Ada_Version < Ada_2020 then - Error_Msg_SC ("target name is an Ada 2020 extension"); + Error_Msg_SC ("target name is an Ada 202x feature"); Error_Msg_SC ("\compile with -gnatX"); end if; @@ -3325,7 +3325,7 @@ package body Ch4 is Set_Expression (Assoc_Node, P_Expression); if Ada_Version < Ada_2020 then - Error_Msg_SC ("iterated component is an Ada 2020 extension"); + Error_Msg_SC ("iterated component is an Ada 202x feature"); Error_Msg_SC ("\compile with -gnatX"); end if; diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index bed22e1..65ee035 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1088,6 +1088,21 @@ begin when Pragma_Suppress_All => Set_Has_Pragma_Suppress_All (Cunit (Current_Source_Unit)); + ---------------------- + -- Warning_As_Error -- + ---------------------- + + -- pragma Warning_As_Error (static_string_EXPRESSION); + + -- Further processing is done in Sem_Prag + + when Pragma_Warning_As_Error => + Check_Arg_Count (1); + Check_Arg_Is_String_Literal (Arg1); + Warnings_As_Errors_Count := Warnings_As_Errors_Count + 1; + Warnings_As_Errors (Warnings_As_Errors_Count) := + new String'(Acquire_Warning_Match_String (Get_Pragma_Arg (Arg1))); + --------------------- -- Warnings (GNAT) -- --------------------- @@ -1304,6 +1319,7 @@ begin | Pragma_Acc_Kernels | Pragma_Acc_Loop | Pragma_Acc_Parallel + | Pragma_Aggregate_Individually_Assign | Pragma_Async_Readers | Pragma_Async_Writers | Pragma_Assertion_Policy @@ -1519,7 +1535,6 @@ begin | Pragma_Volatile_Components | Pragma_Volatile_Full_Access | Pragma_Volatile_Function - | Pragma_Warning_As_Error | Pragma_Weak_External | Pragma_Validity_Checks => diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 4a7c286..0fe248c 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -92,8 +92,8 @@ package body Par_SCO is -- writing out the SCO information to the ALI file, we can fill in the -- proper dependency numbers and file names. - -- Note that the zero'th entry is here for convenience in sorting the - -- table, the real lower bound is 1. + -- Note that the zeroth entry is here for convenience in sorting the table; + -- the real lower bound is 1. package SCO_Unit_Number_Table is new Table.Table (Table_Component_Type => Unit_Number_Type, diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index 6f531b2..219fa3b 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -357,6 +357,14 @@ package body Repinfo is Write_Eol; Write_Line ("}"); end if; + + -- The component type is relevant for an array + + if List_Representation_Info = 4 + and then Is_Itype (Component_Type (Base_Type (Ent))) + then + Relevant_Entities.Set (Component_Type (Base_Type (Ent)), True); + end if; end List_Array_Info; --------------------------- @@ -539,20 +547,17 @@ package body Repinfo is List_Record_Info (E, Bytes_Big_Endian); end if; + -- Recurse into entities local to a record type + + if List_Representation_Info = 4 then + List_Entities (E, Bytes_Big_Endian, False); + end if; + elsif Is_Array_Type (E) then if List_Representation_Info >= 1 then List_Array_Info (E, Bytes_Big_Endian); end if; - -- The component type is relevant for an array - - if List_Representation_Info = 4 - and then Is_Itype (Component_Type (Base_Type (E))) - then - Relevant_Entities.Set - (Component_Type (Base_Type (E)), True); - end if; - elsif Is_Type (E) then if List_Representation_Info >= 2 then List_Type_Info (E); @@ -564,13 +569,6 @@ package body Repinfo is E_Loop_Parameter, E_Variable) then - -- The type is relevant for an object - - if List_Representation_Info = 4 and then Is_Itype (Etype (E)) - then - Relevant_Entities.Set (Etype (E), True); - end if; - if List_Representation_Info >= 2 then List_Object_Info (E); end if; @@ -975,6 +973,12 @@ package body Repinfo is List_Linker_Section (Ent); end if; + + -- The type is relevant for an object + + if List_Representation_Info = 4 and then Is_Itype (Etype (Ent)) then + Relevant_Entities.Set (Etype (Ent), True); + end if; end List_Object_Info; ---------------------- @@ -1283,6 +1287,12 @@ package body Repinfo is else Write_Line (";"); end if; + + -- The type is relevant for a component + + if List_Representation_Info = 4 and then Is_Itype (Etype (Ent)) then + Relevant_Entities.Set (Etype (Ent), True); + end if; end List_Component_Layout; ------------------------ @@ -1681,6 +1691,15 @@ package body Repinfo is Write_Eol; Write_Line ("}"); end if; + + -- The type is relevant for a record subtype + + if List_Representation_Info = 4 + and then not Is_Base_Type (Ent) + and then Is_Itype (Etype (Ent)) + then + Relevant_Entities.Set (Etype (Ent), True); + end if; end List_Record_Info; ------------------- @@ -1809,8 +1828,8 @@ package body Repinfo is Has_Rep_Item (Ent, Name_Scalar_Storage_Order) or else SSO_Set_Low_By_Default (Ent) or else SSO_Set_High_By_Default (Ent); - -- Scalar_Storage_Order is displayed if specified explicitly - -- or set by Default_Scalar_Storage_Order. + -- Scalar_Storage_Order is displayed if specified explicitly or set by + -- Default_Scalar_Storage_Order. -- Start of processing for List_Scalar_Storage_Order diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index eab6f4f..9d5a86c 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -220,6 +220,7 @@ package Rtsfind is System_Atomic_Primitives, System_Aux_DEC, System_Bignums, + System_Bitfields, System_Bit_Ops, System_Boolean_Array_Operations, System_Byte_Swapping, @@ -809,6 +810,8 @@ package Rtsfind is RE_To_Bignum, -- System.Bignums RE_From_Bignum, -- System.Bignums + RE_Copy_Bitfield, -- System.Bitfields + RE_Bit_And, -- System.Bit_Ops RE_Bit_Eq, -- System.Bit_Ops RE_Bit_Not, -- System.Bit_Ops @@ -2051,6 +2054,8 @@ package Rtsfind is RE_To_Bignum => System_Bignums, RE_From_Bignum => System_Bignums, + RE_Copy_Bitfield => System_Bitfields, + RE_Bit_And => System_Bit_Ops, RE_Bit_Eq => System_Bit_Ops, RE_Bit_Not => System_Bit_Ops, diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 7aacc5f..bc80121 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2799,6 +2799,11 @@ package body Sem_Aggr is Base : constant Node_Id := Expression (N); begin + if Ada_Version < Ada_2020 then + Error_Msg_N ("delta_aggregate is an Ada 202x feature", N); + Error_Msg_N ("\compile with -gnatX", N); + end if; + if not Is_Composite_Type (Typ) then Error_Msg_N ("not a composite type", N); end if; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index a3a7be7..2538c1d 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -5812,6 +5812,9 @@ package body Sem_Ch13 is if ASIS_Mode then null; + elsif Size <= 0 then + Error_Msg_N ("Object_Size must be positive", Expr); + elsif Is_Scalar_Type (U_Ent) then if Size /= 8 and then Size /= 16 and then Size /= 32 and then UI_Mod (Size, 64) /= 0 @@ -10130,6 +10133,11 @@ package body Sem_Ch13 is -- recursively to compute After_Last for the parent type; in this case -- Warn is False and the warnings are suppressed. + procedure Component_Order_Check (Rectype : Entity_Id); + -- Check that the order of component clauses agrees with the order of + -- component declarations, and that the component clauses are given in + -- increasing order of bit offset. + ----------------------------- -- Check_Component_Overlap -- ----------------------------- @@ -10172,6 +10180,53 @@ package body Sem_Ch13 is end if; end Check_Component_Overlap; + --------------------------- + -- Component_Order_Check -- + --------------------------- + + procedure Component_Order_Check (Rectype : Entity_Id) is + Comp : Entity_Id := First_Component (Rectype); + Clause : Node_Id := First (Component_Clauses (N)); + Prev_Bit_Offset : Uint := Uint_0; + OOO : constant String := + "?component clause out of order with respect to declaration"; + + begin + -- Step Comp through components and Clause through component clauses, + -- skipping pragmas. We ignore discriminants and variant parts, + -- because we get most of the benefit from the plain vanilla + -- component cases, without the extra complexity. If we find a Comp + -- and Clause that don't match, give a warning on both and quit. If + -- we find two subsequent clauses out of order by bit layout, give + -- warning and quit. On each iteration, Prev_Bit_Offset is the one + -- from the previous iteration (or 0 to start). + + while Present (Comp) and then Present (Clause) loop + if Nkind (Clause) = N_Component_Clause + and then Ekind (Entity (Component_Name (Clause))) = E_Component + then + if Entity (Component_Name (Clause)) /= Comp then + Error_Msg_N (OOO, Comp); + Error_Msg_N (OOO, Clause); + exit; + end if; + + if not Reverse_Bit_Order (Rectype) + and then not Reverse_Storage_Order (Rectype) + and then Component_Bit_Offset (Comp) < Prev_Bit_Offset + then + Error_Msg_N ("?memory layout out of order", Clause); + exit; + end if; + + Prev_Bit_Offset := Component_Bit_Offset (Comp); + Comp := Next_Component (Comp); + end if; + + Next (Clause); + end loop; + end Component_Order_Check; + -------------------- -- Find_Component -- -------------------- @@ -10438,6 +10493,8 @@ package body Sem_Ch13 is Sbit := Uint_0; end if; + After_Last := Uint_0; + if Nkind (Decl) = N_Full_Type_Declaration then Record_Definition := Type_Definition (Decl); @@ -10816,16 +10873,25 @@ package body Sem_Ch13 is end Overlap_Check2; end if; - -- Check for record holes (gaps). We skip this check if overlap was - -- detected, since it makes sense for the programmer to fix this - -- error before worrying about warnings. + -- Skip the following warnings if overlap was detected; programmer + -- should fix the errors first. - if Warn_On_Record_Holes and not Overlap_Detected then - declare - Ignore : Uint; - begin - Record_Hole_Check (Rectype, After_Last => Ignore, Warn => True); - end; + if not Overlap_Detected then + -- Check for record holes (gaps) + + if Warn_On_Record_Holes then + declare + Ignore : Uint; + begin + Record_Hole_Check (Rectype, After_Last => Ignore, Warn => True); + end; + end if; + + -- Check for out-of-order component clauses + + if Warn_On_Component_Order then + Component_Order_Check (Rectype); + end if; end if; -- For records that have component clauses for all components, and whose @@ -14559,6 +14625,39 @@ package body Sem_Ch13 is ------------------------------------ procedure Validate_Unchecked_Conversions is + function Is_Null_Array (T : Entity_Id) return Boolean; + -- We want to warn in the case of converting to a wrong-sized array of + -- bytes, including the zero-size case. This returns True in that case, + -- which is necessary because a size of 0 is used to indicate both an + -- unknown size and a size of 0. It's OK for this to return True in + -- other zero-size cases, but we don't go out of our way; for example, + -- we don't bother with multidimensional arrays. + + function Is_Null_Array (T : Entity_Id) return Boolean is + begin + if Is_Array_Type (T) and then Is_Constrained (T) then + declare + Index : constant Node_Id := First_Index (T); + R : Node_Id; -- N_Range + begin + case Nkind (Index) is + when N_Range => + R := Index; + when N_Subtype_Indication => + R := Range_Expression (Constraint (Index)); + when N_Identifier | N_Expanded_Name => + R := Scalar_Range (Entity (Index)); + when others => + raise Program_Error; + end case; + + return Is_Null_Range (Low_Bound (R), High_Bound (R)); + end; + end if; + + return False; + end Is_Null_Array; + begin for N in Unchecked_Conversions.First .. Unchecked_Conversions.Last loop declare @@ -14575,28 +14674,28 @@ package body Sem_Ch13 is begin -- Skip if function marked as warnings off - if Warnings_Off (Act_Unit) then + if Warnings_Off (Act_Unit) or else Serious_Errors_Detected > 0 then goto Continue; end if; - -- This validation check, which warns if we have unequal sizes for - -- unchecked conversion, and thus potentially implementation - -- dependent semantics, is one of the few occasions on which we - -- use the official RM size instead of Esize. See description in - -- Einfo "Handling of Type'Size Values" for details. - - if Serious_Errors_Detected = 0 - and then Known_Static_RM_Size (Source) - and then Known_Static_RM_Size (Target) + -- Don't do the check if warnings off for either type, note the + -- deliberate use of OR here instead of OR ELSE to get the flag + -- Warnings_Off_Used set for both types if appropriate. - -- Don't do the check if warnings off for either type, note the - -- deliberate use of OR here instead of OR ELSE to get the flag - -- Warnings_Off_Used set for both types if appropriate. + if Has_Warnings_Off (Source) or Has_Warnings_Off (Target) then + goto Continue; + end if; - and then not (Has_Warnings_Off (Source) - or - Has_Warnings_Off (Target)) + if (Known_Static_RM_Size (Source) + and then Known_Static_RM_Size (Target)) + or else Is_Null_Array (Target) then + -- This validation check, which warns if we have unequal sizes + -- for unchecked conversion, and thus implementation dependent + -- semantics, is one of the few occasions on which we use the + -- official RM size instead of Esize. See description in Einfo + -- "Handling of Type'Size Values" for details. + Source_Siz := RM_Size (Source); Target_Siz := RM_Size (Target); diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 1b4c42d..6af9419 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3923,6 +3923,7 @@ package body Sem_Ch3 is -- Save the Ghost-related attributes to restore on exit Related_Id : Entity_Id; + Full_View_Present : Boolean := False; -- Start of processing for Analyze_Object_Declaration @@ -4645,10 +4646,25 @@ package body Sem_Ch3 is Act_T := Find_Type_Of_Object (Object_Definition (N), N); end if; + -- Propagate attributes to full view when needed. + Set_Is_Constr_Subt_For_U_Nominal (Act_T); + if Is_Private_Type (Act_T) and then Present (Full_View (Act_T)) + then + Full_View_Present := True; + end if; + + if Full_View_Present then + Set_Is_Constr_Subt_For_U_Nominal (Full_View (Act_T)); + end if; + if Aliased_Present (N) then Set_Is_Constr_Subt_For_UN_Aliased (Act_T); + + if Full_View_Present then + Set_Is_Constr_Subt_For_UN_Aliased (Full_View (Act_T)); + end if; end if; Freeze_Before (N, Act_T); @@ -5539,6 +5555,14 @@ package body Sem_Ch3 is => Set_Ekind (Id, E_Record_Subtype); + -- Subtype declarations introduced for formal type parameters + -- in generic instantiations should inherit the Size value of + -- the type they rename. + + if Present (Generic_Parent_Type (N)) then + Set_RM_Size (Id, RM_Size (T)); + end if; + if Ekind (T) = E_Record_Subtype and then Present (Cloned_Subtype (T)) then @@ -8794,7 +8818,7 @@ package body Sem_Ch3 is -- Indic can either be an N_Identifier if the subtype indication -- contains no constraint or an N_Subtype_Indication if the subtype - -- indecation has a constraint. In either case it can include an + -- indication has a constraint. In either case it can include an -- interface list. Indic := Subtype_Indication (Type_Def); @@ -11870,10 +11894,14 @@ package body Sem_Ch3 is else -- Specialize error message according to kind of illegal - -- initial expression. + -- initial expression. We check the Original_Node to cover + -- cases where the initialization expression of an object + -- declaration generated by the compiler has been rewritten + -- (such as for dispatching calls). - if Nkind (Exp) = N_Type_Conversion - and then Nkind (Expression (Exp)) = N_Function_Call + if Nkind (Original_Node (Exp)) = N_Type_Conversion + and then + Nkind (Expression (Original_Node (Exp))) = N_Function_Call then -- No error for internally-generated object declarations, -- which can come from build-in-place assignment statements. @@ -19648,8 +19676,20 @@ package body Sem_Ch3 is => return not Comes_From_Source (Exp) and then - OK_For_Limited_Init_In_05 - (Typ, Expression (Original_Node (Exp))); + -- If the conversion has been rewritten, check Original_Node + + ((Original_Node (Exp) /= Exp + and then + OK_For_Limited_Init_In_05 (Typ, Original_Node (Exp))) + + -- Otherwise, check the expression of the compiler-generated + -- conversion (which is a conversion that we want to ignore + -- for purposes of the limited-initialization restrictions). + + or else + (Original_Node (Exp) = Exp + and then + OK_For_Limited_Init_In_05 (Typ, Expression (Exp)))); when N_Explicit_Dereference | N_Indexed_Component diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 16614ed..0dccd33 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -796,25 +796,47 @@ package body Sem_Ch4 is ("\constraint with discriminant values required", N); end if; - -- Limited Ada 2005 and general nonlimited case + -- Limited Ada 2005 and general nonlimited case. + -- This is an error, except in the case of an + -- uninitialized allocator that is generated + -- for a build-in-place function return of a + -- discriminated but compile-time-known-size + -- type. else - Error_Msg_N - ("uninitialized unconstrained allocation not " - & "allowed", N); + if Original_Node (N) /= N + and then Nkind (Original_Node (N)) = N_Allocator + then + declare + Qual : constant Node_Id := + Expression (Original_Node (N)); + pragma Assert + (Nkind (Qual) = N_Qualified_Expression); + Call : constant Node_Id := Expression (Qual); + pragma Assert + (Is_Expanded_Build_In_Place_Call (Call)); + begin + null; + end; - if Is_Array_Type (Type_Id) then + else Error_Msg_N - ("\qualified expression or constraint with " - & "array bounds required", N); + ("uninitialized unconstrained allocation not " + & "allowed", N); - elsif Has_Unknown_Discriminants (Type_Id) then - Error_Msg_N ("\qualified expression required", N); + if Is_Array_Type (Type_Id) then + Error_Msg_N + ("\qualified expression or constraint with " + & "array bounds required", N); - else pragma Assert (Has_Discriminants (Type_Id)); - Error_Msg_N - ("\qualified expression or constraint with " - & "discriminant values required", N); + elsif Has_Unknown_Discriminants (Type_Id) then + Error_Msg_N ("\qualified expression required", N); + + else pragma Assert (Has_Discriminants (Type_Id)); + Error_Msg_N + ("\qualified expression or constraint with " + & "discriminant values required", N); + end if; end if; end if; end if; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 963819e..3abaa8d 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2234,15 +2234,14 @@ package body Sem_Ch5 is It : Interp; begin - -- THe domain of iteralion must implement either the RM + -- The domain of iteration must implement either the RM -- iterator interface, or the SPARK Iterable aspect. if No (Iterator) then - if No - (Find_Aspect (Etype (Iter_Name), Aspect_Iterable)) - then - Error_Msg_NE ("cannot iterate over&", - N, Base_Type (Etype (Iter_Name))); + if No (Find_Aspect (Etype (Iter_Name), Aspect_Iterable)) then + Error_Msg_NE + ("cannot iterate over&", + N, Base_Type (Etype (Iter_Name))); return; end if; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 38c3980..a7918da 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -1696,7 +1696,7 @@ package body Sem_Ch8 is -- AI05-0225: If the renamed entity is a procedure or entry of a -- protected object, the target object must be a variable. - if Ekind (Scope (Old_S)) in Protected_Kind + if Is_Protected_Type (Scope (Old_S)) and then Ekind (New_S) = E_Procedure and then not Is_Variable (Prefix (Nam)) then diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 0696f92..bc8ab36 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -2350,8 +2350,7 @@ package body Sem_Ch9 is for S in reverse 0 .. Scope_Stack.Last loop Req_Scope := Scope_Stack.Table (S).Entity; - exit when Ekind (Req_Scope) in Task_Kind - or else Ekind (Req_Scope) in Protected_Kind; + exit when Is_Concurrent_Type (Req_Scope); if Is_Entry (Req_Scope) then Outer_Ent := Req_Scope; diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index ee8f443..b04b863 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -1144,12 +1144,12 @@ package body Sem_Disp is -- 3. Subprograms associated with stream attributes (built by -- New_Stream_Subprogram) - -- 4. Wrapper built for inherited operations with inherited class- + -- 4. Wrappers built for inherited operations with inherited class- -- wide conditions, where the conditions include calls to other -- overridden primitives. The wrappers include checks on these -- modified conditions. (AI12-113). - -- 5. Declarations built for subprograms without separate spec which + -- 5. Declarations built for subprograms without separate specs that -- are eligible for inlining in GNATprove (inside -- Sem_Ch6.Analyze_Subprogram_Body_Helper). diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 714a9f7..2dbf54d 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -15234,8 +15234,8 @@ package body Sem_Elab is begin -- Nothing to do for predefined primitives because they are -- artifacts of tagged type expansion and cannot override source - -- primitives. Nothing to do as well for inherited primitives as - -- the check concerns overridding ones. + -- primitives. Nothing to do as well for inherited primitives, as + -- the check concerns overriding ones. if Is_Predefined_Dispatching_Operation (Prim) or else not Is_Overriding_Subprogram (Prim) diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 78740b9..5c41642 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -562,9 +562,9 @@ package body Sem_Eval is elsif Is_Out_Of_Range (N, Base_Type (T), Assume_Valid => True) then Out_Of_Range (N); - -- Give a warning or error on the value outside the subtype. A - -- warning is omitted if the expression appears in a range that could - -- be null (warnings are handled elsewhere for this case). + -- Give a warning or error on the value outside the subtype. A warning + -- is omitted if the expression appears in a range that could be null + -- (warnings are handled elsewhere for this case). elsif T /= Base_Type (T) and then Nkind (Parent (N)) /= N_Range then if Is_In_Range (N, T, Assume_Valid => True) then @@ -578,8 +578,8 @@ package body Sem_Eval is if CodePeer_Mode and then T = RTE (RE_Priority) then Set_Do_Range_Check (N, False); - -- Determine if the out of range violation constitutes a warning - -- or an error based on context according to RM 4.9 (34/3). + -- Determine if the out-of-range violation constitutes a warning + -- or an error based on context, according to RM 4.9 (34/3). elsif Nkind_In (Original_Node (N), N_Type_Conversion, N_Qualified_Expression) @@ -4281,10 +4281,9 @@ package body Sem_Eval is pragma Assert (Is_Access_Type (Underlying_Type (Etype (N)))); Val := Uint_0; - -- Otherwise must be character literal + -- Character literal - else - pragma Assert (Kind = N_Character_Literal); + elsif Kind = N_Character_Literal then Ent := Entity (N); -- Since Character literals of type Standard.Character don't @@ -4298,6 +4297,15 @@ package body Sem_Eval is else Val := Enumeration_Pos (Ent); end if; + + -- Unchecked conversion, which can come from System'To_Address (X) + -- where X is a static integer expression. Recursively evaluate X. + + elsif Kind = N_Unchecked_Type_Conversion then + Val := Expr_Value (Expression (N)); + + else + raise Program_Error; end if; -- Come here with Val set to value to be returned, set cache @@ -5523,8 +5531,8 @@ package body Sem_Eval is -- CodePeer mode where the target runtime may have more priorities. elsif not CodePeer_Mode or else Etype (N) /= RTE (RE_Priority) then - -- Determine if the out of range violation constitutes a warning - -- or an error based on context according to RM 4.9 (34/3). + -- Determine if the out-of-range violation constitutes a warning + -- or an error based on context, according to RM 4.9 (34/3). if Nkind (Original_Node (N)) = N_Type_Conversion and then not Comes_From_Source (Original_Node (N)) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 993a419d..5a561ea 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3768,12 +3768,6 @@ package body Sem_Prag is function Acc_Next (N : Node_Id) return Node_Id; -- Helper function to iterate over arguments given to OpenAcc pragmas - procedure Acquire_Warning_Match_String (Arg : Node_Id); - -- Used by pragma Warnings (Off, string), and Warn_As_Error (string) to - -- get the given string argument, and place it in Name_Buffer, adding - -- leading and trailing asterisks if they are not already present. The - -- caller has already checked that Arg is a static string expression. - procedure Ada_2005_Pragma; -- Called for pragmas defined in Ada 2005, that are not in Ada 95. In -- Ada 95 mode, these are implementation defined pragmas, so should be @@ -4400,32 +4394,6 @@ package body Sem_Prag is end if; end Acc_Next; - ---------------------------------- - -- Acquire_Warning_Match_String -- - ---------------------------------- - - procedure Acquire_Warning_Match_String (Arg : Node_Id) is - begin - String_To_Name_Buffer - (Strval (Expr_Value_S (Get_Pragma_Arg (Arg)))); - - -- Add asterisk at start if not already there - - if Name_Len > 0 and then Name_Buffer (1) /= '*' then - Name_Buffer (2 .. Name_Len + 1) := - Name_Buffer (1 .. Name_Len); - Name_Buffer (1) := '*'; - Name_Len := Name_Len + 1; - end if; - - -- Add asterisk at end if not already there - - if Name_Buffer (Name_Len) /= '*' then - Name_Len := Name_Len + 1; - Name_Buffer (Name_Len) := '*'; - end if; - end Acquire_Warning_Match_String; - --------------------- -- Ada_2005_Pragma -- --------------------- @@ -13011,6 +12979,18 @@ package body Sem_Prag is Ada_Version_Explicit := Ada_2020; Ada_Version_Pragma := N; + ------------------------------------- + -- Aggregate_Individually_Assign -- + ------------------------------------- + + -- pragma Aggregate_Individually_Assign; + + when Pragma_Aggregate_Individually_Assign => + GNAT_Pragma; + Check_Arg_Count (0); + Check_Valid_Configuration_Pragma; + Aggregate_Individually_Assign := True; + ---------------------- -- All_Calls_Remote -- ---------------------- @@ -19558,7 +19538,7 @@ package body Sem_Prag is | Pragma_Max_Entry_Queue_Depth | Pragma_Max_Queue_Length => - Max_Queue_Length : declare + Max_Entry_Queue_Length : declare Arg : Node_Id; Entry_Decl : Node_Id; Entry_Id : Entity_Id; @@ -19609,9 +19589,9 @@ package body Sem_Prag is Val := Expr_Value (Arg); - if Val <= 0 then + if Val < -1 then Error_Pragma_Arg - ("argument for pragma% must be positive", Arg1); + ("argument for pragma% cannot be less than -1", Arg1); elsif not UI_Is_In_Int_Range (Val) then Error_Pragma_Arg @@ -19619,17 +19599,8 @@ package body Sem_Prag is end if; - -- Manually substitute the expression value of the pragma argument - -- if it's not an integer literal because this is not taken care - -- of automatically elsewhere. - - if Nkind (Arg) /= N_Integer_Literal then - Rewrite (Arg, Make_Integer_Literal (Sloc (Arg), Val)); - Set_Etype (Arg, Etype (Original_Node (Arg))); - end if; - Record_Rep_Item (Entry_Id, N); - end Max_Queue_Length; + end Max_Entry_Queue_Length; ----------------- -- Memory_Size -- @@ -21112,8 +21083,24 @@ package body Sem_Prag is Decl := Parent (Ent); if Present (Expression (Decl)) then - Error_Pragma_Arg - ("object for pragma% cannot have initialization", Arg1); + -- Variables in Persistent_BSS cannot be initialized, so + -- turn off any initialization that might be caused by + -- pragmas Initialize_Scalars or Normalize_Scalars. + + if Kill_Range_Check (Expression (Decl)) then + Prag := + Make_Pragma (Loc, + Name_Suppress_Initialization, + Pragma_Argument_Associations => New_List ( + Make_Pragma_Argument_Association (Loc, + Expression => New_Occurrence_Of (Ent, Loc)))); + Insert_Before (N, Prag); + Analyze (Prag); + + else + Error_Pragma_Arg + ("object for pragma% cannot have initialization", Arg1); + end if; end if; if not Is_Potentially_Persistent_Type (Etype (Ent)) then @@ -21124,7 +21111,7 @@ package body Sem_Prag is Prag := Make_Linker_Section_Pragma - (Ent, Sloc (N), ".persistent.bss"); + (Ent, Loc, ".persistent.bss"); Insert_After (N, Prag); Analyze (Prag); @@ -25301,10 +25288,10 @@ package body Sem_Prag is -- OK static string expression else - Acquire_Warning_Match_String (Arg1); Warnings_As_Errors_Count := Warnings_As_Errors_Count + 1; Warnings_As_Errors (Warnings_As_Errors_Count) := - new String'(Name_Buffer (1 .. Name_Len)); + new String'(Acquire_Warning_Match_String + (Expr_Value_S (Get_Pragma_Arg (Arg1)))); end if; -------------- @@ -25609,8 +25596,6 @@ package body Sem_Prag is -- Static string expression case else - Acquire_Warning_Match_String (Arg2); - -- Note on configuration pragma case: If this is a -- configuration pragma, then for an OFF pragma, we -- just set Config True in the call, which is all @@ -25630,22 +25615,27 @@ package body Sem_Prag is -- generic unit we are inside is public, but for now -- we don't bother with that refinement. - if Chars (Argx) = Name_Off then - Set_Specific_Warning_Off - (Loc, Name_Buffer (1 .. Name_Len), Reason, - Config => Is_Configuration_Pragma, - Used => Inside_A_Generic or else In_Instance); - - elsif Chars (Argx) = Name_On then - Set_Specific_Warning_On - (Loc, Name_Buffer (1 .. Name_Len), Err); - - if Err then - Error_Msg - ("??pragma Warnings On with no matching " - & "Warnings Off", Loc); + declare + Message : constant String := + Acquire_Warning_Match_String + (Expr_Value_S (Get_Pragma_Arg (Arg2))); + begin + if Chars (Argx) = Name_Off then + Set_Specific_Warning_Off + (Loc, Message, Reason, + Config => Is_Configuration_Pragma, + Used => Inside_A_Generic or else In_Instance); + + elsif Chars (Argx) = Name_On then + Set_Specific_Warning_On (Loc, Message, Err); + + if Err then + Error_Msg + ("??pragma Warnings On with no matching " + & "Warnings Off", Loc); + end if; end if; - end if; + end; end if; end; end if; @@ -30919,6 +30909,7 @@ package body Sem_Prag is Pragma_Ada_12 => -1, Pragma_Ada_2012 => -1, Pragma_Ada_2020 => -1, + Pragma_Aggregate_Individually_Assign => 0, Pragma_All_Calls_Remote => -1, Pragma_Allow_Integer_Address => -1, Pragma_Annotate => 93, diff --git a/gcc/ada/sem_spark.adb b/gcc/ada/sem_spark.adb index 30e1426..038c7cd 100644 --- a/gcc/ada/sem_spark.adb +++ b/gcc/ada/sem_spark.adb @@ -672,7 +672,7 @@ package body Sem_SPARK is -- Main traversal procedure to check safe pointer usage procedure Check_Old_Loop_Entry (N : Node_Id); - -- Check SPARK RM 3.10(14) regarding 'Old and 'Loop_Entry + -- Check SPARK RM 3.10(13) regarding 'Old and 'Loop_Entry procedure Check_Package_Body (Pack : Node_Id); @@ -1085,7 +1085,7 @@ package body Sem_SPARK is Borrowed : constant Node_Id := Get_Observed_Or_Borrowed_Expr (Expr); begin - -- SPARK RM 3.10(8): If the type of the target is an anonymous + -- SPARK RM 3.10(7): If the type of the target is an anonymous -- access-to-variable type (an owning access type), the source shall -- be an owning access object [..] whose root object is the target -- object itself. @@ -1100,7 +1100,7 @@ package body Sem_SPARK is if Emit_Messages then Error_Msg_NE ("source of assignment must have & as root" & - " (SPARK RM 3.10(8)))", + " (SPARK RM 3.10(7)))", Expr, Var); end if; return; @@ -1132,7 +1132,7 @@ package body Sem_SPARK is if Emit_Messages then Error_Msg_NE ("source of assignment must have & as root" & - " (SPARK RM 3.10(8)))", + " (SPARK RM 3.10(7)))", Expr, Var); end if; return; @@ -1171,19 +1171,17 @@ package body Sem_SPARK is Expr_Root := Get_Root_Object (Expr); - -- SPARK RM 3.10(8): For an assignment statement where - -- the target is a stand-alone object of an anonymous - -- access-to-object type + -- SPARK RM 3.10(7): For an assignment statement where the target is + -- a stand-alone object of an anonymous access-to-object type. pragma Assert (Present (Target_Root)); - -- If the type of the target is an anonymous - -- access-to-constant type (an observing access type), the - -- source shall be an owning access object denoted by a name - -- that is not in the Moved state, and whose root object - -- is not in the Moved state and is not declared at a - -- statically deeper accessibility level than that of - -- the target object. + -- If the type of the target is an anonymous access-to-constant type + -- (an observing access type), the source shall be an owning access + -- object denoted by a name that is not in the Moved state, and whose + -- root object is not in the Moved state and is not declared at a + -- statically deeper accessibility level than that of the target + -- object. if Is_Access_Constant (Target_Typ) then Perm := Get_Perm (Expr); @@ -1206,11 +1204,10 @@ package body Sem_SPARK is -- ??? check accessibility level - -- If the type of the target is an anonymous - -- access-to-variable type (an owning access type), the - -- source shall be an owning access object denoted by a - -- name that is in the Unrestricted state, and whose root - -- object is the target object itself. + -- If the type of the target is an anonymous access-to-variable + -- type (an owning access type), the source shall be an owning + -- access object denoted by a name that is in the Unrestricted + -- state, and whose root object is the target object itself. Check_Expression (Expr, Observe); Handle_Observe (Target_Root, Expr, Is_Decl); @@ -2858,7 +2855,7 @@ package body Sem_SPARK is Error_Msg_Name_1 := Aname; Error_Msg_N ("prefix of % attribute must be a function call " - & "(SPARK RM 3.10(14))", Pref); + & "(SPARK RM 3.10(13))", Pref); end if; elsif Is_Traversal_Function_Call (Pref) then @@ -2866,7 +2863,7 @@ package body Sem_SPARK is Error_Msg_Name_1 := Aname; Error_Msg_N ("prefix of % attribute should not call a traversal " - & "function (SPARK RM 3.10(14))", Pref); + & "function (SPARK RM 3.10(13))", Pref); end if; end if; end if; @@ -3095,7 +3092,7 @@ package body Sem_SPARK is -- Postconditions are checked for correct use of 'Old, but starting -- from the corresponding declaration, in order to avoid dealing with - -- with contracts on generic subprograms, which are not handled in + -- with contracts on generic subprograms which are not handled in -- GNATprove. when Pragma_Precondition @@ -5113,6 +5110,7 @@ package body Sem_SPARK is -- in an object. if not Present (Root) + or else not Is_Object (Root) or else not Is_Deep (Etype (Root)) then return; diff --git a/gcc/ada/sem_spark.ads b/gcc/ada/sem_spark.ads index 0aaa115..ff9aa63 100644 --- a/gcc/ada/sem_spark.ads +++ b/gcc/ada/sem_spark.ads @@ -166,8 +166,7 @@ package Sem_SPARK is -- when there are violations of ownership rules. function Is_Deep (Typ : Entity_Id) return Boolean; - -- A function that can tell whether a type is deep. Returns True if the - -- type passed as argument is deep. + -- Returns True if the type passed as argument is deep function Is_Traversal_Function (E : Entity_Id) return Boolean; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index dcef852..86ae740 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -247,6 +247,39 @@ package body Sem_Util is return Interface_List (Nod); end Abstract_Interface_List; + ---------------------------------- + -- Acquire_Warning_Match_String -- + ---------------------------------- + + function Acquire_Warning_Match_String (Str_Lit : Node_Id) return String is + S : constant String := To_String (Strval (Str_Lit)); + begin + if S = "" then + return ""; + else + -- Put "*" before or after or both, if it's not already there + + declare + F : constant Boolean := S (S'First) = '*'; + L : constant Boolean := S (S'Last) = '*'; + begin + if F then + if L then + return S; + else + return S & "*"; + end if; + else + if L then + return "*" & S; + else + return "*" & S & "*"; + end if; + end if; + end; + end if; + end Acquire_Warning_Match_String; + -------------------------------- -- Add_Access_Type_To_Process -- -------------------------------- @@ -9719,16 +9752,28 @@ package body Sem_Util is function Get_Max_Queue_Length (Id : Entity_Id) return Uint is pragma Assert (Is_Entry (Id)); Prag : constant Entity_Id := Get_Pragma (Id, Pragma_Max_Queue_Length); + Max : Uint; begin - -- A value of 0 represents no maximum specified, and entries and entry - -- families with no Max_Queue_Length aspect or pragma default to it. + -- A value of 0 or -1 represents no maximum specified, and entries and + -- entry families with no Max_Queue_Length aspect or pragma default to + -- it. if not Present (Prag) then return Uint_0; end if; - return Intval (Expression (First (Pragma_Argument_Associations (Prag)))); + Max := Expr_Value + (Expression (First (Pragma_Argument_Associations (Prag)))); + + -- Since -1 and 0 are equivalent, return 0 for instances of -1 for + -- uniformity. + + if Max = -1 then + return Uint_0; + end if; + + return Max; end Get_Max_Queue_Length; ------------------------ @@ -20579,6 +20624,10 @@ package body Sem_Util is Old_Next : Node_Id; begin + if No (First_Named_Actual (Old_Call)) then + return; + end if; + -- Recreate the First/Next_Named_Actual chain of a call by traversing -- the chains of both the old and new calls in parallel. @@ -20586,15 +20635,16 @@ package body Sem_Util is Old_Act := First (Parameter_Associations (Old_Call)); while Present (Old_Act) loop if Nkind (Old_Act) = N_Parameter_Association - and then Present (Next_Named_Actual (Old_Act)) + and then Explicit_Actual_Parameter (Old_Act) + = First_Named_Actual (Old_Call) then - if First_Named_Actual (Old_Call) = - Explicit_Actual_Parameter (Old_Act) - then - Set_First_Named_Actual (New_Call, - Explicit_Actual_Parameter (New_Act)); - end if; + Set_First_Named_Actual (New_Call, + Explicit_Actual_Parameter (New_Act)); + end if; + if Nkind (Old_Act) = N_Parameter_Association + and then Present (Next_Named_Actual (Old_Act)) + then -- Scan the actual parameter list to find the next suitable -- named actual. Note that the list may be out of order. diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 4d738da..c9065e5 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -42,6 +42,12 @@ package Sem_Util is -- including the cases where there can't be any because e.g. the type is -- not tagged. + function Acquire_Warning_Match_String (Str_Lit : Node_Id) return String; + -- Used by pragma Warnings (Off, string), and Warn_As_Error (string) to get + -- the given string argument, adding leading and trailing asterisks if they + -- are not already present. Str_Lit is the static value of the pragma + -- argument. + procedure Add_Access_Type_To_Process (E : Entity_Id; A : Entity_Id); -- Add A to the list of access types to process when expanding the -- freeze node of E. diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index e3f7fd3..dc82800 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -2327,7 +2327,8 @@ package Sinfo is -- Present in N_Extended_Return_Statement. Points to a list initially -- containing a single N_Object_Declaration representing the return -- object. We use a list (instead of just a pointer to the object decl) - -- because Analyze wants to insert extra actions on this list. + -- because Analyze wants to insert extra actions on this list, before the + -- N_Object_Declaration, which always remains last on the list. -- Rounded_Result (Flag18-Sem) -- Present in N_Type_Conversion, N_Op_Divide, and N_Op_Multiply nodes. diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index d7507a2..985a19f 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -389,6 +389,7 @@ package Snames is Name_Ada_12 : constant Name_Id := N + $; -- GNAT Name_Ada_2012 : constant Name_Id := N + $; -- GNAT Name_Ada_2020 : constant Name_Id := N + $; -- GNAT + Name_Aggregate_Individually_Assign : constant Name_Id := N + $; -- GNAT Name_Allow_Integer_Address : constant Name_Id := N + $; -- GNAT Name_Annotate : constant Name_Id := N + $; -- GNAT Name_Assertion_Policy : constant Name_Id := N + $; -- Ada 05 @@ -1847,6 +1848,7 @@ package Snames is Pragma_Ada_2020, -- Note that there is no Pragma_Ada_20. Pragma_Ada_05/12 are for -- compatibility reasons only; the full year names are preferred. + Pragma_Aggregate_Individually_Assign, Pragma_Allow_Integer_Address, Pragma_Annotate, Pragma_Assertion_Policy, diff --git a/gcc/ada/stringt.adb b/gcc/ada/stringt.adb index bacb506..545705a 100644 --- a/gcc/ada/stringt.adb +++ b/gcc/ada/stringt.adb @@ -350,6 +350,17 @@ package body Stringt is end Strings_Address; --------------- + -- To_String -- + --------------- + + function To_String (S : String_Id) return String is + Buf : Bounded_String; + begin + Append (Buf, S); + return To_String (Buf); + end To_String; + + --------------- -- Tree_Read -- --------------- diff --git a/gcc/ada/stringt.ads b/gcc/ada/stringt.ads index 6d887ea..722d17f 100644 --- a/gcc/ada/stringt.ads +++ b/gcc/ada/stringt.ads @@ -127,6 +127,9 @@ package Stringt is -- out of Character range. Does not attempt to do any encoding of -- characters. + function To_String (S : String_Id) return String; + -- Return S as a String + procedure String_To_Name_Buffer (S : String_Id); -- Place characters of given string in Name_Buffer, setting Name_Len. -- Error if any characters are out of Character range. Does not attempt diff --git a/gcc/ada/warnsw.adb b/gcc/ada/warnsw.adb index a731907..a5096dc 100644 --- a/gcc/ada/warnsw.adb +++ b/gcc/ada/warnsw.adb @@ -79,6 +79,7 @@ package body Warnsw is Warn_On_Questionable_Layout := Setting; Warn_On_Questionable_Missing_Parens := Setting; Warn_On_Record_Holes := Setting; + Warn_On_Component_Order := Setting; Warn_On_Redundant_Constructs := Setting; Warn_On_Reverse_Bit_Order := Setting; Warn_On_Size_Alignment := Setting; @@ -177,6 +178,8 @@ package body Warnsw is W.Warn_On_Questionable_Missing_Parens; Warn_On_Record_Holes := W.Warn_On_Record_Holes; + Warn_On_Component_Order := + W.Warn_On_Component_Order; Warn_On_Redundant_Constructs := W.Warn_On_Redundant_Constructs; Warn_On_Reverse_Bit_Order := @@ -287,6 +290,8 @@ package body Warnsw is Warn_On_Questionable_Missing_Parens; W.Warn_On_Record_Holes := Warn_On_Record_Holes; + W.Warn_On_Component_Order := + Warn_On_Component_Order; W.Warn_On_Redundant_Constructs := Warn_On_Redundant_Constructs; W.Warn_On_Reverse_Bit_Order := @@ -500,6 +505,12 @@ package body Warnsw is when 'C' => Warn_On_Unknown_Compile_Time_Warning := False; + when 'r' => + Warn_On_Component_Order := True; + + when 'R' => + Warn_On_Component_Order := False; + when others => if Ignore_Unrecognized_VWY_Switches then Write_Line ("unrecognized switch -gnatw_" & C & " ignored"); diff --git a/gcc/ada/warnsw.ads b/gcc/ada/warnsw.ads index f96c11c..0a3253e 100644 --- a/gcc/ada/warnsw.ads +++ b/gcc/ada/warnsw.ads @@ -67,6 +67,12 @@ package Warnsw is -- Warn when explicit record component clauses leave uncovered holes (gaps) -- in a record layout. Off by default, set by -gnatw.h (but not -gnatwa). + Warn_On_Component_Order : Boolean := False; + -- Warn when record component clauses are out of order with respect to the + -- component declarations, or if the memory layout is out of order with + -- respect to component declarations and clauses. Off by default, set by + -- -gnatw_r (but not -gnatwa). + Warn_On_Size_Alignment : Boolean := True; -- Warn when explicit Size and Alignment clauses are given for a type, and -- the size is not a multiple of the alignment. Off by default, modified @@ -123,6 +129,7 @@ package Warnsw is Warn_On_Questionable_Layout : Boolean; Warn_On_Questionable_Missing_Parens : Boolean; Warn_On_Record_Holes : Boolean; + Warn_On_Component_Order : Boolean; Warn_On_Redundant_Constructs : Boolean; Warn_On_Reverse_Bit_Order : Boolean; Warn_On_Size_Alignment : Boolean; diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index a4a0bff..c872140 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2019-08-21 Eric Botcazou <ebotcazou@adacore.com> + + * c-ada-spec.c (dump_ada_function_declaration): Be prepared for broken + function declarations where arguments are missing. Rename variables. + 2019-08-15 Richard Biener <rguenther@suse.de> * c-common.c (c_stddef_cpp_builtins): When the GIMPLE FE is diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 4526850..38d65a6 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -1589,14 +1589,13 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func, bool is_method, bool is_constructor, bool is_destructor, int spc) { - tree arg; - const tree node = TREE_TYPE (func); + tree type = TREE_TYPE (func); + tree arg = TYPE_ARG_TYPES (type); + tree t; char buf[17]; - int num = 0, num_args = 0, have_args = true, have_ellipsis = false; + int num, num_args = 0, have_args = true, have_ellipsis = false; /* Compute number of arguments. */ - arg = TYPE_ARG_TYPES (node); - if (arg) { while (TREE_CHAIN (arg) && arg != error_mark_node) @@ -1627,25 +1626,29 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func, pp_left_paren (buffer); } + /* For a function, see if we have the corresponding arguments. */ if (TREE_CODE (func) == FUNCTION_DECL) - arg = DECL_ARGUMENTS (func); + { + arg = DECL_ARGUMENTS (func); + for (t = arg, num = 0; t; t = DECL_CHAIN (t)) + num++; + if (num < num_args) + arg = NULL_TREE; + } else arg = NULL_TREE; - if (arg == NULL_TREE) + /* Otherwise, only print the types. */ + if (!arg) { have_args = false; - arg = TYPE_ARG_TYPES (node); - - if (arg && TREE_CODE (TREE_VALUE (arg)) == VOID_TYPE) - arg = NULL_TREE; + arg = TYPE_ARG_TYPES (type); } if (is_constructor) arg = TREE_CHAIN (arg); - /* Print the argument names (if available) & types. */ - + /* Print the argument names (if available) and types. */ for (num = 1; num <= num_args; num++) { if (have_args) @@ -1663,13 +1666,13 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func, pp_string (buffer, buf); } - dump_ada_node (buffer, TREE_TYPE (arg), node, spc, false, true); + dump_ada_node (buffer, TREE_TYPE (arg), type, spc, false, true); } else { sprintf (buf, "arg%d : ", num); pp_string (buffer, buf); - dump_ada_node (buffer, TREE_VALUE (arg), node, spc, false, true); + dump_ada_node (buffer, TREE_VALUE (arg), type, spc, false, true); } /* If the type is a pointer to a tagged type, we need to differentiate @@ -1707,11 +1710,11 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func, if (num_args > 0) pp_right_paren (buffer); - if (is_constructor || !VOID_TYPE_P (TREE_TYPE (node))) + if (is_constructor || !VOID_TYPE_P (TREE_TYPE (type))) { pp_string (buffer, " return "); - tree type = is_constructor ? DECL_CONTEXT (func) : TREE_TYPE (node); - dump_ada_node (buffer, type, type, spc, false, true); + tree rtype = is_constructor ? DECL_CONTEXT (func) : TREE_TYPE (type); + dump_ada_node (buffer, rtype, rtype, spc, false, true); } } diff --git a/gcc/calls.c b/gcc/calls.c index 54e30e6..6eefeec 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -346,7 +346,8 @@ prepare_call_address (tree fndecl_or_type, rtx funexp, rtx static_chain_value, It is zero if this call doesn't want a structure value. NEXT_ARG_REG is the rtx that results from executing - targetm.calls.function_arg (&args_so_far, VOIDmode, void_type_node, true) + targetm.calls.function_arg (&args_so_far, + function_arg_info::end_marker ()); just after all the args have had their registers assigned. This could be whatever you like, but normally it is the first arg-register beyond those used for args in this call, @@ -897,13 +898,12 @@ call_expr_flags (const_tree t) return flags; } -/* Return true if TYPE should be passed by invisible reference. */ +/* Return true if ARG should be passed by invisible reference. */ bool -pass_by_reference (CUMULATIVE_ARGS *ca, machine_mode mode, - tree type, bool named_arg) +pass_by_reference (CUMULATIVE_ARGS *ca, function_arg_info arg) { - if (type) + if (tree type = arg.type) { /* If this type contains non-trivial constructors, then it is forbidden for the middle-end to create any new copies. */ @@ -918,26 +918,49 @@ pass_by_reference (CUMULATIVE_ARGS *ca, machine_mode mode, member, use the type and mode of that member. */ if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type)) { - type = TREE_TYPE (first_field (type)); - mode = TYPE_MODE (type); + arg.type = TREE_TYPE (first_field (type)); + arg.mode = TYPE_MODE (arg.type); } } - return targetm.calls.pass_by_reference (pack_cumulative_args (ca), mode, - type, named_arg); + return targetm.calls.pass_by_reference (pack_cumulative_args (ca), arg); } -/* Return true if TYPE, which is passed by reference, should be callee +/* Return true if TYPE should be passed by reference when passed to + the "..." arguments of a function. */ + +bool +pass_va_arg_by_reference (tree type) +{ + return pass_by_reference (NULL, function_arg_info (type, /*named=*/false)); +} + +/* Decide whether ARG, which occurs in the state described by CA, + should be passed by reference. Return true if so and update + ARG accordingly. */ + +bool +apply_pass_by_reference_rules (CUMULATIVE_ARGS *ca, function_arg_info &arg) +{ + if (pass_by_reference (ca, arg)) + { + arg.type = build_pointer_type (arg.type); + arg.mode = TYPE_MODE (arg.type); + arg.pass_by_reference = true; + return true; + } + return false; +} + +/* Return true if ARG, which is passed by reference, should be callee copied instead of caller copied. */ bool -reference_callee_copied (CUMULATIVE_ARGS *ca, machine_mode mode, - tree type, bool named_arg) +reference_callee_copied (CUMULATIVE_ARGS *ca, const function_arg_info &arg) { - if (type && TREE_ADDRESSABLE (type)) + if (arg.type && TREE_ADDRESSABLE (arg.type)) return false; - return targetm.calls.callee_copies (pack_cumulative_args (ca), mode, type, - named_arg); + return targetm.calls.callee_copies (pack_cumulative_args (ca), arg); } @@ -1960,7 +1983,6 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, { tree type = TREE_TYPE (args[i].tree_value); int unsignedp; - machine_mode mode; /* Replace erroneous argument with constant zero. */ if (type == error_mark_node || !COMPLETE_TYPE_P (type)) @@ -1988,15 +2010,13 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, with those made by function.c. */ /* See if this argument should be passed by invisible reference. */ - if (pass_by_reference (args_so_far_pnt, TYPE_MODE (type), - type, argpos < n_named_args)) + function_arg_info arg (type, argpos < n_named_args); + if (pass_by_reference (args_so_far_pnt, arg)) { bool callee_copies; tree base = NULL_TREE; - callee_copies - = reference_callee_copied (args_so_far_pnt, TYPE_MODE (type), - type, argpos < n_named_args); + callee_copies = reference_callee_copied (args_so_far_pnt, arg); /* If we're compiling a thunk, pass through invisible references instead of making a copy. */ @@ -2106,19 +2126,21 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, "argument must be passed" " by copying"); } + arg.pass_by_reference = true; } unsignedp = TYPE_UNSIGNED (type); - mode = promote_function_mode (type, TYPE_MODE (type), &unsignedp, - fndecl ? TREE_TYPE (fndecl) : fntype, 0); + arg.type = type; + arg.mode + = promote_function_mode (type, TYPE_MODE (type), &unsignedp, + fndecl ? TREE_TYPE (fndecl) : fntype, 0); args[i].unsignedp = unsignedp; - args[i].mode = mode; + args[i].mode = arg.mode; targetm.calls.warn_parameter_passing_abi (args_so_far, type); - args[i].reg = targetm.calls.function_arg (args_so_far, mode, type, - argpos < n_named_args); + args[i].reg = targetm.calls.function_arg (args_so_far, arg); if (args[i].reg && CONST_INT_P (args[i].reg)) args[i].reg = NULL; @@ -2128,17 +2150,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, arguments have to go into the incoming registers. */ if (targetm.calls.function_incoming_arg != targetm.calls.function_arg) args[i].tail_call_reg - = targetm.calls.function_incoming_arg (args_so_far, mode, type, - argpos < n_named_args); + = targetm.calls.function_incoming_arg (args_so_far, arg); else args[i].tail_call_reg = args[i].reg; if (args[i].reg) - args[i].partial - = targetm.calls.arg_partial_bytes (args_so_far, mode, type, - argpos < n_named_args); + args[i].partial = targetm.calls.arg_partial_bytes (args_so_far, arg); - args[i].pass_on_stack = targetm.calls.must_pass_in_stack (mode, type); + args[i].pass_on_stack = targetm.calls.must_pass_in_stack (arg); /* If FUNCTION_ARG returned a (parallel [(expr_list (nil) ...) ...]), it means that we are to pass this arg in the register(s) designated @@ -2160,7 +2179,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, if (args[i].reg == 0 || args[i].partial != 0 || reg_parm_stack_space > 0 || args[i].pass_on_stack) - locate_and_pad_parm (mode, type, + locate_and_pad_parm (arg.mode, type, #ifdef STACK_PARMS_IN_REG_PARM_AREA 1, #else @@ -2174,7 +2193,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, /* The argument is passed entirely in registers. See at which end it should be padded. */ args[i].locate.where_pad = - BLOCK_REG_PADDING (mode, type, + BLOCK_REG_PADDING (arg.mode, type, int_size_in_bytes (type) <= UNITS_PER_WORD); #endif @@ -2187,8 +2206,12 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, /* Increment ARGS_SO_FAR, which has info about which arg-registers have been used, etc. */ - targetm.calls.function_arg_advance (args_so_far, TYPE_MODE (type), - type, argpos < n_named_args); + /* ??? Traditionally we've passed TYPE_MODE here, instead of the + promoted_mode used for function_arg above. However, the + corresponding handling of incoming arguments in function.c + does pass the promoted mode. */ + arg.mode = TYPE_MODE (type); + targetm.calls.function_arg_advance (args_so_far, arg); /* Store argument values for functions decorated with attribute alloc_size. */ @@ -4238,14 +4261,11 @@ expand_call (tree exp, rtx target, int ignore) /* Set up next argument register. For sibling calls on machines with register windows this should be the incoming register. */ if (pass == 0) - next_arg_reg = targetm.calls.function_incoming_arg (args_so_far, - VOIDmode, - void_type_node, - true); + next_arg_reg = targetm.calls.function_incoming_arg + (args_so_far, function_arg_info::end_marker ()); else - next_arg_reg = targetm.calls.function_arg (args_so_far, - VOIDmode, void_type_node, - true); + next_arg_reg = targetm.calls.function_arg + (args_so_far, function_arg_info::end_marker ()); if (pass == 1 && (return_flags & ERF_RETURNS_ARG)) { @@ -4862,10 +4882,9 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, argvec[count].mode = Pmode; argvec[count].partial = 0; - argvec[count].reg = targetm.calls.function_arg (args_so_far, - Pmode, NULL_TREE, true); - gcc_assert (targetm.calls.arg_partial_bytes (args_so_far, Pmode, - NULL_TREE, 1) == 0); + function_arg_info ptr_arg (Pmode, /*named=*/true); + argvec[count].reg = targetm.calls.function_arg (args_so_far, ptr_arg); + gcc_assert (targetm.calls.arg_partial_bytes (args_so_far, ptr_arg) == 0); locate_and_pad_parm (Pmode, NULL_TREE, #ifdef STACK_PARMS_IN_REG_PARM_AREA @@ -4880,7 +4899,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, || reg_parm_stack_space > 0) args_size.constant += argvec[count].locate.size.constant; - targetm.calls.function_arg_advance (args_so_far, Pmode, (tree) 0, true); + targetm.calls.function_arg_advance (args_so_far, ptr_arg); count++; } @@ -4888,24 +4907,25 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, for (unsigned int i = 0; count < nargs; i++, count++) { rtx val = args[i].first; - machine_mode mode = args[i].second; + function_arg_info arg (args[i].second, /*named=*/true); int unsigned_p = 0; /* We cannot convert the arg value to the mode the library wants here; must do it earlier where we know the signedness of the arg. */ - gcc_assert (mode != BLKmode - && (GET_MODE (val) == mode || GET_MODE (val) == VOIDmode)); + gcc_assert (arg.mode != BLKmode + && (GET_MODE (val) == arg.mode + || GET_MODE (val) == VOIDmode)); /* Make sure it is a reasonable operand for a move or push insn. */ if (!REG_P (val) && !MEM_P (val) - && !(CONSTANT_P (val) && targetm.legitimate_constant_p (mode, val))) + && !(CONSTANT_P (val) + && targetm.legitimate_constant_p (arg.mode, val))) val = force_operand (val, NULL_RTX); - if (pass_by_reference (&args_so_far_v, mode, NULL_TREE, 1)) + if (pass_by_reference (&args_so_far_v, arg)) { rtx slot; - int must_copy - = !reference_callee_copied (&args_so_far_v, mode, NULL_TREE, 1); + int must_copy = !reference_callee_copied (&args_so_far_v, arg); /* If this was a CONST function, it is now PURE since it now reads memory. */ @@ -4924,7 +4944,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, } else { - slot = assign_temp (lang_hooks.types.type_for_mode (mode, 0), + slot = assign_temp (lang_hooks.types.type_for_mode (arg.mode, 0), 1, 1); emit_move_insn (slot, val); } @@ -4938,24 +4958,26 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, slot), call_fusage); - mode = Pmode; + arg.mode = Pmode; + arg.pass_by_reference = true; val = force_operand (XEXP (slot, 0), NULL_RTX); } - mode = promote_function_mode (NULL_TREE, mode, &unsigned_p, NULL_TREE, 0); - argvec[count].mode = mode; - argvec[count].value = convert_modes (mode, GET_MODE (val), val, unsigned_p); - argvec[count].reg = targetm.calls.function_arg (args_so_far, mode, - NULL_TREE, true); + arg.mode = promote_function_mode (NULL_TREE, arg.mode, &unsigned_p, + NULL_TREE, 0); + argvec[count].mode = arg.mode; + argvec[count].value = convert_modes (arg.mode, GET_MODE (val), val, + unsigned_p); + argvec[count].reg = targetm.calls.function_arg (args_so_far, arg); argvec[count].partial - = targetm.calls.arg_partial_bytes (args_so_far, mode, NULL_TREE, 1); + = targetm.calls.arg_partial_bytes (args_so_far, arg); if (argvec[count].reg == 0 || argvec[count].partial != 0 || reg_parm_stack_space > 0) { - locate_and_pad_parm (mode, NULL_TREE, + locate_and_pad_parm (arg.mode, NULL_TREE, #ifdef STACK_PARMS_IN_REG_PARM_AREA 1, #else @@ -4971,11 +4993,12 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, /* The argument is passed entirely in registers. See at which end it should be padded. */ argvec[count].locate.where_pad = - BLOCK_REG_PADDING (mode, NULL_TREE, - known_le (GET_MODE_SIZE (mode), UNITS_PER_WORD)); + BLOCK_REG_PADDING (arg.mode, NULL_TREE, + known_le (GET_MODE_SIZE (arg.mode), + UNITS_PER_WORD)); #endif - targetm.calls.function_arg_advance (args_so_far, mode, (tree) 0, true); + targetm.calls.function_arg_advance (args_so_far, arg); } for (int i = 0; i < nargs; i++) @@ -5324,7 +5347,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, original_args_size.constant, args_size.constant, struct_value_size, targetm.calls.function_arg (args_so_far, - VOIDmode, void_type_node, true), + function_arg_info::end_marker ()), valreg, old_inhibit_defer_pop + 1, call_fusage, flags, args_so_far); @@ -5837,22 +5860,21 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, return sibcall_failure; } -/* Nonzero if we do not know how to pass TYPE solely in registers. */ +/* Nonzero if we do not know how to pass ARG solely in registers. */ bool -must_pass_in_stack_var_size (machine_mode mode ATTRIBUTE_UNUSED, - const_tree type) +must_pass_in_stack_var_size (const function_arg_info &arg) { - if (!type) + if (!arg.type) return false; /* If the type has variable size... */ - if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + if (TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST) return true; /* If the type is marked as addressable (it is required to be constructed into the stack)... */ - if (TREE_ADDRESSABLE (type)) + if (TREE_ADDRESSABLE (arg.type)) return true; return false; @@ -5863,33 +5885,43 @@ must_pass_in_stack_var_size (machine_mode mode ATTRIBUTE_UNUSED, /* ??? Should be able to merge these two by examining BLOCK_REG_PADDING. */ bool -must_pass_in_stack_var_size_or_pad (machine_mode mode, const_tree type) +must_pass_in_stack_var_size_or_pad (const function_arg_info &arg) { - if (!type) + if (!arg.type) return false; /* If the type has variable size... */ - if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + if (TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST) return true; /* If the type is marked as addressable (it is required to be constructed into the stack)... */ - if (TREE_ADDRESSABLE (type)) + if (TREE_ADDRESSABLE (arg.type)) return true; - if (TYPE_EMPTY_P (type)) + if (TYPE_EMPTY_P (arg.type)) return false; /* If the padding and mode of the type is such that a copy into a register would put it into the wrong part of the register. */ - if (mode == BLKmode - && int_size_in_bytes (type) % (PARM_BOUNDARY / BITS_PER_UNIT) - && (targetm.calls.function_arg_padding (mode, type) + if (arg.mode == BLKmode + && int_size_in_bytes (arg.type) % (PARM_BOUNDARY / BITS_PER_UNIT) + && (targetm.calls.function_arg_padding (arg.mode, arg.type) == (BYTES_BIG_ENDIAN ? PAD_UPWARD : PAD_DOWNWARD))) return true; return false; } +/* Return true if TYPE must be passed on the stack when passed to + the "..." arguments of a function. */ + +bool +must_pass_va_arg_in_stack (tree type) +{ + function_arg_info arg (type, /*named=*/false); + return targetm.calls.must_pass_in_stack (arg); +} + /* Tell the garbage collector about GTY markers in this source file. */ #include "gt-calls.h" diff --git a/gcc/calls.h b/gcc/calls.h index 128bb51..a782a7d 100644 --- a/gcc/calls.h +++ b/gcc/calls.h @@ -20,23 +20,116 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_CALLS_H #define GCC_CALLS_H +/* Describes a function argument. + + Each argument conceptually has a gimple-level type. Usually this type + is available directly as a tree via the TYPE field, but when calling + libgcc support functions it might instead be inferred from a mode, + in which case the type isn't available directly. + + This gimple-level type might go through promotion before being passed to + the target function. Depending on the context, the MODE field is either + the mode of the gimple-level type (whether explicitly given or not) + or the mode after promotion has been performed. */ +class function_arg_info +{ +public: + function_arg_info () + : type (NULL_TREE), mode (VOIDmode), named (false), + pass_by_reference (false) + {} + + /* Initialize an argument of mode MODE, either before or after promotion. */ + function_arg_info (machine_mode mode, bool named) + : type (NULL_TREE), mode (mode), named (named), pass_by_reference (false) + {} + + /* Initialize an unpromoted argument of type TYPE. */ + function_arg_info (tree type, bool named) + : type (type), mode (TYPE_MODE (type)), named (named), + pass_by_reference (false) + {} + + /* Initialize an argument with explicit properties. */ + function_arg_info (tree type, machine_mode mode, bool named) + : type (type), mode (mode), named (named), pass_by_reference (false) + {} + + /* Return true if the gimple-level type is an aggregate. */ + bool aggregate_type_p () const { return type && AGGREGATE_TYPE_P (type); } + + /* Return the size of the gimple-level type, or -1 if the size is + variable or otherwise not representable as a poly_int64. + + Use this function when MODE is the mode of the type before promotion, + or in any context if the target never promotes function arguments. */ + poly_int64 type_size_in_bytes () const + { + if (type) + return int_size_in_bytes (type); + return GET_MODE_SIZE (mode); + } + + /* Return the size of the argument after promotion, or -1 if the size + is variable or otherwise not representable as a poly_int64. + + Use this function when MODE is the mode of the type after promotion. */ + poly_int64 promoted_size_in_bytes () const + { + if (mode == BLKmode) + return int_size_in_bytes (type); + return GET_MODE_SIZE (mode); + } + + /* True if the argument represents the end of the argument list, + as returned by end_marker (). */ + bool end_marker_p () const { return mode == VOIDmode; } + + /* Return a function_arg_info that represents the end of the + argument list. */ + static function_arg_info end_marker () + { + return function_arg_info (void_type_node, /*named=*/true); + } + + /* The type of the argument, or null if not known (which is true for + libgcc support functions). */ + tree type; + + /* The mode of the argument. Depending on context, this might be + the mode of the argument type or the mode after promotion. */ + machine_mode mode; + + /* True if the argument is treated as a named argument, false if it is + treated as an unnamed variadic argument (i.e. one passed through + "..."). See also TARGET_STRICT_ARGUMENT_NAMING. */ + unsigned int named : 1; + + /* True if we have decided to pass the argument by reference, in which case + the function_arg_info describes a pointer to the original argument. */ + unsigned int pass_by_reference : 1; +}; + extern int flags_from_decl_or_type (const_tree); extern int call_expr_flags (const_tree); extern int setjmp_call_p (const_tree); extern bool gimple_maybe_alloca_call_p (const gimple *); extern bool gimple_alloca_call_p (const gimple *); extern bool alloca_call_p (const_tree); -extern bool must_pass_in_stack_var_size (machine_mode, const_tree); -extern bool must_pass_in_stack_var_size_or_pad (machine_mode, const_tree); +extern bool must_pass_in_stack_var_size (const function_arg_info &); +extern bool must_pass_in_stack_var_size_or_pad (const function_arg_info &); +extern bool must_pass_va_arg_in_stack (tree); extern rtx prepare_call_address (tree, rtx, rtx, rtx *, int, int); extern bool shift_return_value (machine_mode, bool, rtx); extern rtx expand_call (tree, rtx, int); extern void fixup_tail_calls (void); -extern bool pass_by_reference (CUMULATIVE_ARGS *, machine_mode, - tree, bool); -extern bool reference_callee_copied (CUMULATIVE_ARGS *, machine_mode, - tree, bool); +extern bool pass_by_reference (CUMULATIVE_ARGS *, function_arg_info); +extern bool pass_va_arg_by_reference (tree); +extern bool apply_pass_by_reference_rules (CUMULATIVE_ARGS *, + function_arg_info &); +extern bool reference_callee_copied (CUMULATIVE_ARGS *, + const function_arg_info &); extern void maybe_warn_alloc_args_overflow (tree, tree, tree[2], int[2]); extern tree get_attr_nonstring_decl (tree, tree * = NULL); extern void maybe_warn_nonstring_arg (tree, tree); diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c index 1f77f7d..5cb1dcc 100644 --- a/gcc/common/config/i386/i386-common.c +++ b/gcc/common/config/i386/i386-common.c @@ -1566,6 +1566,8 @@ const char *const processor_names[] = "icelake-client", "icelake-server", "cascadelake", + "tigerlake", + "cooperlake", "intel", "geode", "k6", @@ -1648,6 +1650,8 @@ const pta processor_alias_table[] = PTA_ICELAKE_SERVER}, {"cascadelake", PROCESSOR_CASCADELAKE, CPU_HASWELL, PTA_CASCADELAKE}, + {"tigerlake", PROCESSOR_TIGERLAKE, CPU_HASWELL, PTA_TIGERLAKE}, + {"cooperlake", PROCESSOR_COOPERLAKE, CPU_HASWELL, PTA_COOPERLAKE}, {"bonnell", PROCESSOR_BONNELL, CPU_ATOM, PTA_BONNELL}, {"atom", PROCESSOR_BONNELL, CPU_ATOM, PTA_BONNELL}, {"silvermont", PROCESSOR_SILVERMONT, CPU_SLM, PTA_SILVERMONT}, diff --git a/gcc/config.gcc b/gcc/config.gcc index 40cbc52..11a8ac7 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -664,7 +664,8 @@ bdver3 bdver4 znver1 znver2 btver1 btver2 k8 k8-sse3 opteron \ opteron-sse3 nocona core2 corei7 corei7-avx core-avx-i core-avx2 atom \ slm nehalem westmere sandybridge ivybridge haswell broadwell bonnell \ silvermont knl knm skylake-avx512 cannonlake icelake-client icelake-server \ -skylake goldmont goldmont-plus tremont cascadelake x86-64 native" +skylake goldmont goldmont-plus tremont cascadelake tigerlake cooperlake x86-64 \ +native" # Additional x86 processors supported by --with-cpu=. Each processor # MUST be separated by exactly one space. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index be01622..146d020 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4409,35 +4409,30 @@ aarch64_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED, /* Implement TARGET_PASS_BY_REFERENCE. */ static bool -aarch64_pass_by_reference (cumulative_args_t pcum ATTRIBUTE_UNUSED, - machine_mode mode, - const_tree type, - bool named ATTRIBUTE_UNUSED) +aarch64_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { HOST_WIDE_INT size; machine_mode dummymode; int nregs; /* GET_MODE_SIZE (BLKmode) is useless since it is 0. */ - if (mode == BLKmode && type) - size = int_size_in_bytes (type); + if (arg.mode == BLKmode && arg.type) + size = int_size_in_bytes (arg.type); else /* No frontends can create types with variable-sized modes, so we shouldn't be asked to pass or return them. */ - size = GET_MODE_SIZE (mode).to_constant (); + size = GET_MODE_SIZE (arg.mode).to_constant (); /* Aggregates are passed by reference based on their size. */ - if (type && AGGREGATE_TYPE_P (type)) - { - size = int_size_in_bytes (type); - } + if (arg.aggregate_type_p ()) + size = int_size_in_bytes (arg.type); /* Variable sized arguments are always returned by reference. */ if (size < 0) return true; /* Can this be a candidate to be passed in fp/simd register(s)? */ - if (aarch64_vfp_is_call_or_return_candidate (mode, type, + if (aarch64_vfp_is_call_or_return_candidate (arg.mode, arg.type, &dummymode, &nregs, NULL)) return false; @@ -4806,16 +4801,15 @@ on_stack: /* Implement TARGET_FUNCTION_ARG. */ static rtx -aarch64_function_arg (cumulative_args_t pcum_v, machine_mode mode, - const_tree type, bool named) +aarch64_function_arg (cumulative_args_t pcum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); gcc_assert (pcum->pcs_variant == ARM_PCS_AAPCS64); - if (mode == VOIDmode) + if (arg.end_marker_p ()) return NULL_RTX; - aarch64_layout_arg (pcum_v, mode, type, named); + aarch64_layout_arg (pcum_v, arg.mode, arg.type, arg.named); return pcum->aapcs_reg; } @@ -4852,14 +4846,12 @@ aarch64_init_cumulative_args (CUMULATIVE_ARGS *pcum, static void aarch64_function_arg_advance (cumulative_args_t pcum_v, - machine_mode mode, - const_tree type, - bool named) + const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); if (pcum->pcs_variant == ARM_PCS_AAPCS64) { - aarch64_layout_arg (pcum_v, mode, type, named); + aarch64_layout_arg (pcum_v, arg.mode, arg.type, arg.named); gcc_assert ((pcum->aapcs_reg != NULL_RTX) != (pcum->aapcs_stack_words != 0)); pcum->aapcs_arg_processed = false; @@ -14271,7 +14263,7 @@ aarch64_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, HOST_WIDE_INT size, rsize, adjust, align; tree t, u, cond1, cond2; - indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect_p = pass_va_arg_by_reference (type); if (indirect_p) type = build_pointer_type (type); @@ -14516,9 +14508,9 @@ aarch64_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, /* Implement TARGET_SETUP_INCOMING_VARARGS. */ static void -aarch64_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode, - tree type, int *pretend_size ATTRIBUTE_UNUSED, - int no_rtl) +aarch64_setup_incoming_varargs (cumulative_args_t cum_v, + const function_arg_info &arg, + int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); CUMULATIVE_ARGS local_cum; @@ -14529,7 +14521,7 @@ aarch64_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode, argument. Advance a local copy of CUM past the last "real" named argument, to find out how many registers are left over. */ local_cum = *cum; - aarch64_function_arg_advance (pack_cumulative_args(&local_cum), mode, type, true); + aarch64_function_arg_advance (pack_cumulative_args(&local_cum), arg); /* Found out how many registers we need to save. Honor tree-stdvar analysis results. */ @@ -20354,7 +20346,7 @@ aarch64_run_selftests (void) #define TARGET_BUILD_BUILTIN_VA_LIST aarch64_build_builtin_va_list #undef TARGET_CALLEE_COPIES -#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_false #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE aarch64_can_eliminate diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index d551af7..fd6b5a8 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -5545,38 +5545,32 @@ alpha_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. On Alpha the first 6 words of args are normally in registers and the rest are pushed. */ static rtx -alpha_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +alpha_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int basereg; int num_args; /* Don't get confused and pass small structures in FP registers. */ - if (type && AGGREGATE_TYPE_P (type)) + if (arg.aggregate_type_p ()) basereg = 16; else { /* With alpha_split_complex_arg, we shouldn't see any raw complex values here. */ - gcc_checking_assert (!COMPLEX_MODE_P (mode)); + gcc_checking_assert (!COMPLEX_MODE_P (arg.mode)); /* Set up defaults for FP operands passed in FP registers, and integral operands passed in integer registers. */ - if (TARGET_FPREGS && GET_MODE_CLASS (mode) == MODE_FLOAT) + if (TARGET_FPREGS && GET_MODE_CLASS (arg.mode) == MODE_FLOAT) basereg = 32 + 16; else basereg = 16; @@ -5586,12 +5580,12 @@ alpha_function_arg (cumulative_args_t cum_v, machine_mode mode, the two platforms, so we can't avoid conditional compilation. */ #if TARGET_ABI_OPEN_VMS { - if (mode == VOIDmode) + if (arg.end_marker_p ()) return alpha_arg_info_reg_val (*cum); num_args = cum->num_args; if (num_args >= 6 - || targetm.calls.must_pass_in_stack (mode, type)) + || targetm.calls.must_pass_in_stack (arg)) return NULL_RTX; } #elif TARGET_ABI_OSF @@ -5600,55 +5594,49 @@ alpha_function_arg (cumulative_args_t cum_v, machine_mode mode, return NULL_RTX; num_args = *cum; - /* VOID is passed as a special flag for "last argument". */ - if (type == void_type_node) + if (arg.end_marker_p ()) basereg = 16; - else if (targetm.calls.must_pass_in_stack (mode, type)) + else if (targetm.calls.must_pass_in_stack (arg)) return NULL_RTX; } #else #error Unhandled ABI #endif - return gen_rtx_REG (mode, num_args + basereg); + return gen_rtx_REG (arg.mode, num_args + basereg); } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -alpha_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +alpha_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - bool onstack = targetm.calls.must_pass_in_stack (mode, type); - int increment = onstack ? 6 : ALPHA_ARG_SIZE (mode, type); + bool onstack = targetm.calls.must_pass_in_stack (arg); + int increment = onstack ? 6 : ALPHA_ARG_SIZE (arg.mode, arg.type); #if TARGET_ABI_OSF *cum += increment; #else if (!onstack && cum->num_args < 6) - cum->atypes[cum->num_args] = alpha_arg_type (mode); + cum->atypes[cum->num_args] = alpha_arg_type (arg.mode); cum->num_args += increment; #endif } static int -alpha_arg_partial_bytes (cumulative_args_t cum_v, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +alpha_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { int words = 0; CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED = get_cumulative_args (cum_v); #if TARGET_ABI_OPEN_VMS if (cum->num_args < 6 - && 6 < cum->num_args + ALPHA_ARG_SIZE (mode, type)) + && 6 < cum->num_args + ALPHA_ARG_SIZE (arg.mode, arg.type)) words = 6 - cum->num_args; #elif TARGET_ABI_OSF - if (*cum < 6 && 6 < *cum + ALPHA_ARG_SIZE (mode, type)) + if (*cum < 6 && 6 < *cum + ALPHA_ARG_SIZE (arg.mode, arg.type)) words = 6 - *cum; #else #error Unhandled ABI @@ -5713,13 +5701,10 @@ alpha_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED) return size > UNITS_PER_WORD; } -/* Return true if TYPE should be passed by invisible reference. */ +/* Return true if ARG should be passed by invisible reference. */ static bool -alpha_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named) +alpha_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { /* Pass float and _Complex float variable arguments by reference. This avoids 64-bit store from a FP register to a pretend args save area @@ -5739,10 +5724,10 @@ alpha_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, to worry about, and passing unpromoted _Float32 and _Complex float as a variable argument will actually work in the future. */ - if (mode == SFmode || mode == SCmode) - return !named; + if (arg.mode == SFmode || arg.mode == SCmode) + return !arg.named; - return mode == TFmode || mode == TCmode; + return arg.mode == TFmode || arg.mode == TCmode; } /* Define how to find the value returned by a function. VALTYPE is the @@ -6096,14 +6081,14 @@ escapes: variable number of arguments. */ static void -alpha_setup_incoming_varargs (cumulative_args_t pcum, machine_mode mode, - tree type, int *pretend_size, int no_rtl) +alpha_setup_incoming_varargs (cumulative_args_t pcum, + const function_arg_info &arg, + int *pretend_size, int no_rtl) { CUMULATIVE_ARGS cum = *get_cumulative_args (pcum); /* Skip the current argument. */ - targetm.calls.function_arg_advance (pack_cumulative_args (&cum), mode, type, - true); + targetm.calls.function_arg_advance (pack_cumulative_args (&cum), arg); #if TARGET_ABI_OPEN_VMS /* For VMS, we allocate space for all 6 arg registers plus a count. @@ -6243,7 +6228,7 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, /* If the type could not be passed in registers, skip the block reserved for the registers. */ - if (targetm.calls.must_pass_in_stack (TYPE_MODE (type), type)) + if (must_pass_va_arg_in_stack (type)) { t = build_int_cst (TREE_TYPE (offset), 6*8); gimplify_assign (offset, @@ -6330,7 +6315,7 @@ alpha_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, t = fold_convert (build_nonstandard_integer_type (64, 0), offset_field); offset = get_initialized_tmp_var (t, pre_p, NULL); - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect = pass_va_arg_by_reference (type); if (indirect) { diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 98fbfea..d603406 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -642,8 +642,8 @@ static bool arc_can_follow_jump (const rtx_insn *follower, const rtx_insn *followee); static rtx frame_insn (rtx); -static void arc_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static void arc_function_arg_advance (cumulative_args_t, + const function_arg_info &); static rtx arc_legitimize_address_0 (rtx, rtx, machine_mode mode); /* initialize the GCC target structure. */ @@ -2415,12 +2415,12 @@ arc_double_limm_p (rtx value) create a register parameter block, and then copy any anonymous arguments in registers to memory. - CUM has not been updated for the last named argument which has type TYPE - and mode MODE, and we rely on this fact. */ + CUM has not been updated for the last named argument (which is given + by ARG), and we rely on this fact. */ static void arc_setup_incoming_varargs (cumulative_args_t args_so_far, - machine_mode mode, tree type, + const function_arg_info &arg, int *pretend_size, int no_rtl) { int first_anon_arg; @@ -2429,8 +2429,7 @@ arc_setup_incoming_varargs (cumulative_args_t args_so_far, /* We must treat `__builtin_va_alist' as an anonymous arg. */ next_cum = *get_cumulative_args (args_so_far); - arc_function_arg_advance (pack_cumulative_args (&next_cum), - mode, type, true); + arc_function_arg_advance (pack_cumulative_args (&next_cum), arg); first_anon_arg = next_cum; if (FUNCTION_ARG_REGNO_P (first_anon_arg)) @@ -6432,17 +6431,15 @@ arc_output_pic_addr_const (FILE * file, rtx x, int code) /* Implement TARGET_ARG_PARTIAL_BYTES. */ static int -arc_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +arc_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int bytes = (mode == BLKmode - ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode)); + int bytes = arg.promoted_size_in_bytes (); int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int arg_num = *cum; int ret; - arg_num = ROUND_ADVANCE_CUM (arg_num, mode, type); + arg_num = ROUND_ADVANCE_CUM (arg_num, arg.mode, arg.type); ret = GPR_REST_ARG_REGS (arg_num); /* ICEd at function.c:2361, and ret is copied to data->partial */ @@ -6451,63 +6448,27 @@ arc_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, return ret; } -/* This function is used to control a function argument is passed in a - register, and which register. - - The arguments are CUM, of type CUMULATIVE_ARGS, which summarizes - (in a way defined by INIT_CUMULATIVE_ARGS and FUNCTION_ARG_ADVANCE) - all of the previous arguments so far passed in registers; MODE, the - machine mode of the argument; TYPE, the data type of the argument - as a tree node or 0 if that is not known (which happens for C - support library functions); and NAMED, which is 1 for an ordinary - argument and 0 for nameless arguments that correspond to `...' in - the called function's prototype. - - The returned value should either be a `reg' RTX for the hard - register in which to pass the argument, or zero to pass the - argument on the stack. - - For machines like the Vax and 68000, where normally all arguments - are pushed, zero suffices as a definition. - - The usual way to make the ANSI library `stdarg.h' work on a machine - where some arguments are usually passed in registers, is to cause - nameless arguments to be passed on the stack instead. This is done - by making the function return 0 whenever NAMED is 0. - - You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the - definition of this function to determine if this argument is of a - type that must be passed in the stack. If `REG_PARM_STACK_SPACE' - is not defined and the function returns non-zero for such an - argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is - defined, the argument will be computed in the stack and then loaded - into a register. - - The function is used to implement macro FUNCTION_ARG. */ -/* On the ARC the first MAX_ARC_PARM_REGS args are normally in registers - and the rest are pushed. */ +/* Implement TARGET_FUNCTION_ARG. On the ARC the first MAX_ARC_PARM_REGS + args are normally in registers and the rest are pushed. */ static rtx -arc_function_arg (cumulative_args_t cum_v, - machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +arc_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int arg_num = *cum; rtx ret; const char *debstr ATTRIBUTE_UNUSED; - arg_num = ROUND_ADVANCE_CUM (arg_num, mode, type); + arg_num = ROUND_ADVANCE_CUM (arg_num, arg.mode, arg.type); /* Return a marker for use in the call instruction. */ - if (mode == VOIDmode) + if (arg.end_marker_p ()) { ret = const0_rtx; debstr = "<0>"; } else if (GPR_REST_ARG_REGS (arg_num) > 0) { - ret = gen_rtx_REG (mode, arg_num); + ret = gen_rtx_REG (arg.mode, arg_num); debstr = reg_names [arg_num]; } else @@ -6518,17 +6479,7 @@ arc_function_arg (cumulative_args_t cum_v, return ret; } -/* The function to update the summarizer variable *CUM to advance past - an argument in the argument list. The values MODE, TYPE and NAMED - describe that argument. Once this is done, the variable *CUM is - suitable for analyzing the *following* argument with - `FUNCTION_ARG', etc. - - This function need not do anything if the argument in question was - passed on the stack. The compiler knows how to track the amount of - stack space used for arguments without any special help. - - The function is used to implement macro FUNCTION_ARG_ADVANCE. */ +/* Implement TARGET_FUNCTION_ARG_ADVANCE. */ /* For the ARC: the cum set here is passed on to function_arg where we look at its value and say which reg to use. Strategy: advance the regnumber here till we run out of arg regs, then set *cum to last @@ -6538,18 +6489,15 @@ arc_function_arg (cumulative_args_t cum_v, static void arc_function_arg_advance (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, - bool named ATTRIBUTE_UNUSED) + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int bytes = (mode == BLKmode - ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode)); + int bytes = arg.promoted_size_in_bytes (); int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int i; if (words) - *cum = ROUND_ADVANCE_CUM (*cum, mode, type); + *cum = ROUND_ADVANCE_CUM (*cum, arg.mode, arg.type); for (i = 0; i < words; i++) *cum = ARC_NEXT_ARG_REG (*cum); @@ -7568,14 +7516,11 @@ arc_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) } static bool -arc_pass_by_reference (cumulative_args_t ca_v ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, - bool named ATTRIBUTE_UNUSED) -{ - return (type != 0 - && (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST - || TREE_ADDRESSABLE (type))); +arc_pass_by_reference (cumulative_args_t, const function_arg_info &arg) +{ + return (arg.type != 0 + && (TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST + || TREE_ADDRESSABLE (arg.type))); } /* Implement TARGET_CAN_USE_DOLOOP_P. */ diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 81286ca..3343a7e 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -187,12 +187,11 @@ static int arm_memory_move_cost (machine_mode, reg_class_t, bool); static void emit_constant_insn (rtx cond, rtx pattern); static rtx_insn *emit_set_insn (rtx, rtx); static rtx emit_multi_reg_push (unsigned long, unsigned long); -static int arm_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static rtx arm_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static void arm_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static int arm_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +static rtx arm_function_arg (cumulative_args_t, const function_arg_info &); +static void arm_function_arg_advance (cumulative_args_t, + const function_arg_info &); static pad_direction arm_function_arg_padding (machine_mode, const_tree); static unsigned int arm_function_arg_boundary (machine_mode, const_tree); static rtx aapcs_allocate_return_reg (machine_mode, const_tree, @@ -212,15 +211,15 @@ static void arm_file_end (void); static void arm_file_start (void); static void arm_insert_attributes (tree, tree *); -static void arm_setup_incoming_varargs (cumulative_args_t, machine_mode, - tree, int *, int); +static void arm_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, int *, int); static bool arm_pass_by_reference (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static bool arm_promote_prototypes (const_tree); static bool arm_default_short_enums (void); static bool arm_align_anon_bitfield (void); static bool arm_return_in_msb (const_tree); -static bool arm_must_pass_in_stack (machine_mode, const_tree); +static bool arm_must_pass_in_stack (const function_arg_info &); static bool arm_return_in_memory (const_tree, const_tree); #if ARM_UNWIND_INFO static void arm_unwind_emit (FILE *, rtx_insn *); @@ -6658,14 +6657,9 @@ arm_needs_doubleword_align (machine_mode mode, const_tree type) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. On the ARM, normally the first 16 bytes are passed in registers r0-r3; all other arguments are passed on the stack. If (NAMED == 0) (which happens @@ -6674,31 +6668,31 @@ arm_needs_doubleword_align (machine_mode mode, const_tree type) indeed make it pass in the stack if necessary). */ static rtx -arm_function_arg (cumulative_args_t pcum_v, machine_mode mode, - const_tree type, bool named) +arm_function_arg (cumulative_args_t pcum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); int nregs; /* Handle the special case quickly. Pick an arbitrary value for op2 of a call insn (op3 of a call_value insn). */ - if (mode == VOIDmode) + if (arg.end_marker_p ()) return const0_rtx; if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL) { - aapcs_layout_arg (pcum, mode, type, named); + aapcs_layout_arg (pcum, arg.mode, arg.type, arg.named); return pcum->aapcs_reg; } /* Varargs vectors are treated the same as long long. named_count avoids having to change the way arm handles 'named' */ if (TARGET_IWMMXT_ABI - && arm_vector_mode_supported_p (mode) + && arm_vector_mode_supported_p (arg.mode) && pcum->named_count > pcum->nargs + 1) { if (pcum->iwmmxt_nregs <= 9) - return gen_rtx_REG (mode, pcum->iwmmxt_nregs + FIRST_IWMMXT_REGNUM); + return gen_rtx_REG (arg.mode, + pcum->iwmmxt_nregs + FIRST_IWMMXT_REGNUM); else { pcum->can_split = false; @@ -6709,16 +6703,16 @@ arm_function_arg (cumulative_args_t pcum_v, machine_mode mode, /* Put doubleword aligned quantities in even register pairs. */ if ((pcum->nregs & 1) && ARM_DOUBLEWORD_ALIGN) { - int res = arm_needs_doubleword_align (mode, type); + int res = arm_needs_doubleword_align (arg.mode, arg.type); if (res < 0 && warn_psabi) inform (input_location, "parameter passing for argument of type " - "%qT changed in GCC 7.1", type); + "%qT changed in GCC 7.1", arg.type); else if (res > 0) { pcum->nregs++; if (res > 1 && warn_psabi) inform (input_location, "parameter passing for argument of type " - "%qT changed in GCC 9.1", type); + "%qT changed in GCC 9.1", arg.type); } } @@ -6728,12 +6722,12 @@ arm_function_arg (cumulative_args_t pcum_v, machine_mode mode, if (pcum->can_split) nregs = 1; else - nregs = ARM_NUM_REGS2 (mode, type); + nregs = ARM_NUM_REGS2 (arg.mode, arg.type); - if (!named || pcum->nregs + nregs > NUM_ARG_REGS) + if (!arg.named || pcum->nregs + nregs > NUM_ARG_REGS) return NULL_RTX; - return gen_rtx_REG (mode, pcum->nregs); + return gen_rtx_REG (arg.mode, pcum->nregs); } static unsigned int @@ -6754,47 +6748,44 @@ arm_function_arg_boundary (machine_mode mode, const_tree type) } static int -arm_arg_partial_bytes (cumulative_args_t pcum_v, machine_mode mode, - tree type, bool named) +arm_arg_partial_bytes (cumulative_args_t pcum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); int nregs = pcum->nregs; if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL) { - aapcs_layout_arg (pcum, mode, type, named); + aapcs_layout_arg (pcum, arg.mode, arg.type, arg.named); return pcum->aapcs_partial; } - if (TARGET_IWMMXT_ABI && arm_vector_mode_supported_p (mode)) + if (TARGET_IWMMXT_ABI && arm_vector_mode_supported_p (arg.mode)) return 0; if (NUM_ARG_REGS > nregs - && (NUM_ARG_REGS < nregs + ARM_NUM_REGS2 (mode, type)) + && (NUM_ARG_REGS < nregs + ARM_NUM_REGS2 (arg.mode, arg.type)) && pcum->can_split) return (NUM_ARG_REGS - nregs) * UNITS_PER_WORD; return 0; } -/* Update the data in PCUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in PCUM to advance over argument ARG. */ static void -arm_function_arg_advance (cumulative_args_t pcum_v, machine_mode mode, - const_tree type, bool named) +arm_function_arg_advance (cumulative_args_t pcum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL) { - aapcs_layout_arg (pcum, mode, type, named); + aapcs_layout_arg (pcum, arg.mode, arg.type, arg.named); if (pcum->aapcs_cprc_slot >= 0) { - aapcs_cp_arg_layout[pcum->aapcs_cprc_slot].advance (pcum, mode, - type); + aapcs_cp_arg_layout[pcum->aapcs_cprc_slot].advance (pcum, arg.mode, + arg.type); pcum->aapcs_cprc_slot = -1; } @@ -6807,12 +6798,12 @@ arm_function_arg_advance (cumulative_args_t pcum_v, machine_mode mode, else { pcum->nargs += 1; - if (arm_vector_mode_supported_p (mode) + if (arm_vector_mode_supported_p (arg.mode) && pcum->named_count > pcum->nargs && TARGET_IWMMXT_ABI) pcum->iwmmxt_nregs += 1; else - pcum->nregs += ARM_NUM_REGS2 (mode, type); + pcum->nregs += ARM_NUM_REGS2 (arg.mode, arg.type); } } @@ -6820,11 +6811,9 @@ arm_function_arg_advance (cumulative_args_t pcum_v, machine_mode mode, extension to the ARM ABI. */ static bool -arm_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, bool named ATTRIBUTE_UNUSED) +arm_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST; + return arg.type && TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST; } /* Encode the current state of the #pragma [no_]long_calls. */ @@ -6993,17 +6982,18 @@ cmse_func_args_or_return_in_stack (tree fndecl, tree name, tree fntype) FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter) { rtx arg_rtx; - machine_mode arg_mode = TYPE_MODE (arg_type); prev_arg_type = arg_type; if (VOID_TYPE_P (arg_type)) continue; + function_arg_info arg (arg_type, /*named=*/true); if (!first_param) - arm_function_arg_advance (args_so_far, arg_mode, arg_type, true); - arg_rtx = arm_function_arg (args_so_far, arg_mode, arg_type, true); - if (!arg_rtx - || arm_arg_partial_bytes (args_so_far, arg_mode, arg_type, true)) + /* ??? We should advance after processing the argument and pass + the argument we're advancing past. */ + arm_function_arg_advance (args_so_far, arg); + arg_rtx = arm_function_arg (args_so_far, arg); + if (!arg_rtx || arm_arg_partial_bytes (args_so_far, arg)) { error ("%qE attribute not available to functions with arguments " "passed on the stack", name); @@ -7387,10 +7377,14 @@ arm_function_ok_for_sibcall (tree decl, tree exp) { tree type = TREE_VALUE (t); if (!VOID_TYPE_P (type)) - arm_function_arg_advance (cum_v, TYPE_MODE (type), type, true); + { + function_arg_info arg (type, /*named=*/true); + arm_function_arg_advance (cum_v, arg); + } } - if (!arm_function_arg (cum_v, SImode, integer_type_node, true)) + function_arg_info arg (integer_type_node, /*named=*/true); + if (!arm_function_arg (cum_v, arg)) return false; } @@ -15388,12 +15382,12 @@ arm_reload_out_hi (rtx *operands) (padded to the size of a word) should be passed in a register. */ static bool -arm_must_pass_in_stack (machine_mode mode, const_tree type) +arm_must_pass_in_stack (const function_arg_info &arg) { if (TARGET_AAPCS_BASED) - return must_pass_in_stack_var_size (mode, type); + return must_pass_in_stack_var_size (arg); else - return must_pass_in_stack_var_size_or_pad (mode, type); + return must_pass_in_stack_var_size_or_pad (arg); } @@ -17449,17 +17443,17 @@ cmse_nonsecure_call_clear_caller_saved (void) { rtx arg_rtx; uint64_t to_clear_args_mask; - machine_mode arg_mode = TYPE_MODE (arg_type); if (VOID_TYPE_P (arg_type)) continue; + function_arg_info arg (arg_type, /*named=*/true); if (!first_param) - arm_function_arg_advance (args_so_far, arg_mode, arg_type, - true); + /* ??? We should advance after processing the argument and pass + the argument we're advancing past. */ + arm_function_arg_advance (args_so_far, arg); - arg_rtx = arm_function_arg (args_so_far, arg_mode, arg_type, - true); + arg_rtx = arm_function_arg (args_so_far, arg); gcc_assert (REG_P (arg_rtx)); to_clear_args_mask = compute_not_to_clear_mask (arg_type, arg_rtx, @@ -27057,8 +27051,7 @@ arm_output_load_gr (rtx *operands) static void arm_setup_incoming_varargs (cumulative_args_t pcum_v, - machine_mode mode, - tree type, + const function_arg_info &arg, int *pretend_size, int second_time ATTRIBUTE_UNUSED) { @@ -27071,17 +27064,17 @@ arm_setup_incoming_varargs (cumulative_args_t pcum_v, nregs = pcum->aapcs_ncrn; if (nregs & 1) { - int res = arm_needs_doubleword_align (mode, type); + int res = arm_needs_doubleword_align (arg.mode, arg.type); if (res < 0 && warn_psabi) inform (input_location, "parameter passing for argument of " - "type %qT changed in GCC 7.1", type); + "type %qT changed in GCC 7.1", arg.type); else if (res > 0) { nregs++; if (res > 1 && warn_psabi) inform (input_location, "parameter passing for argument of type " - "%qT changed in GCC 9.1", type); + "%qT changed in GCC 9.1", arg.type); } } } diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index ba49e3d..6a5271d 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -3388,14 +3388,13 @@ avr_num_arg_regs (machine_mode mode, const_tree type) in a register, and which register. */ static rtx -avr_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +avr_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int bytes = avr_num_arg_regs (mode, type); + int bytes = avr_num_arg_regs (arg.mode, arg.type); if (cum->nregs && bytes <= cum->nregs) - return gen_rtx_REG (mode, cum->regno - bytes); + return gen_rtx_REG (arg.mode, cum->regno - bytes); return NULL_RTX; } @@ -3406,11 +3405,11 @@ avr_function_arg (cumulative_args_t cum_v, machine_mode mode, in the argument list. */ static void -avr_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +avr_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int bytes = avr_num_arg_regs (mode, type); + int bytes = avr_num_arg_regs (arg.mode, arg.type); cum->nregs -= bytes; cum->regno -= bytes; diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index d1a6832..80ab777 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -540,7 +540,7 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler) CUM is as above. - MODE and TYPE are the mode and type of the current parameter. + ARG is the last named argument. PRETEND_SIZE is a variable that should be set to the amount of stack that must be pushed by the prolog to pretend that our caller pushed @@ -559,8 +559,7 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler) static void setup_incoming_varargs (cumulative_args_t cum, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, int *pretend_size, + const function_arg_info &, int *pretend_size, int no_rtl) { rtx mem; @@ -1648,18 +1647,16 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, return; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -bfin_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +bfin_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int count, bytes, words; - bytes = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + bytes = arg.promoted_size_in_bytes (); words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; cum->words += words; @@ -1683,24 +1680,17 @@ bfin_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ static rtx -bfin_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +bfin_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int bytes - = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + int bytes = arg.promoted_size_in_bytes (); - if (mode == VOIDmode) + if (arg.end_marker_p ()) /* Compute operand 2 of the call insn. */ return GEN_INT (cum->call_cookie); @@ -1708,7 +1698,7 @@ bfin_function_arg (cumulative_args_t cum_v, machine_mode mode, return NULL_RTX; if (cum->nregs) - return gen_rtx_REG (mode, *(cum->arg_regs)); + return gen_rtx_REG (arg.mode, *(cum->arg_regs)); return NULL_RTX; } @@ -1723,12 +1713,9 @@ bfin_function_arg (cumulative_args_t cum_v, machine_mode mode, stack. */ static int -bfin_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, - tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +bfin_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg) { - int bytes - = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + int bytes = arg.promoted_size_in_bytes (); int bytes_left = get_cumulative_args (cum)->nregs * UNITS_PER_WORD; if (bytes == -1) @@ -1744,11 +1731,9 @@ bfin_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, /* Variable sized types are passed by reference. */ static bool -bfin_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, bool named ATTRIBUTE_UNUSED) +bfin_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST; + return arg.type && TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST; } /* Decide whether a type should be returned in memory (true) diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index 516a7c7..8477d35 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -499,16 +499,15 @@ c6x_init_cumulative_args (CUMULATIVE_ARGS *cum, const_tree fntype, rtx libname, } } -/* Implements the macro FUNCTION_ARG defined in c6x.h. */ +/* Implement TARGET_FUNCTION_ARG. */ static rtx -c6x_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +c6x_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (cum->count >= cum->nregs) return NULL_RTX; - if (type) + if (tree type = arg.type) { HOST_WIDE_INT size = int_size_in_bytes (type); if (TARGET_BIG_ENDIAN && AGGREGATE_TYPE_P (type)) @@ -519,18 +518,15 @@ c6x_function_arg (cumulative_args_t cum_v, machine_mode mode, rtx reg2 = gen_rtx_REG (SImode, argument_registers[cum->count]); rtvec vec = gen_rtvec (2, gen_rtx_EXPR_LIST (VOIDmode, reg1, const0_rtx), gen_rtx_EXPR_LIST (VOIDmode, reg2, GEN_INT (4))); - return gen_rtx_PARALLEL (mode, vec); + return gen_rtx_PARALLEL (arg.mode, vec); } } } - return gen_rtx_REG (mode, argument_registers[cum->count]); + return gen_rtx_REG (arg.mode, argument_registers[cum->count]); } static void -c6x_function_arg_advance (cumulative_args_t cum_v, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +c6x_function_arg_advance (cumulative_args_t cum_v, const function_arg_info &) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); cum->count++; @@ -639,18 +635,16 @@ c6x_function_value_regno_p (const unsigned int regno) } /* Types larger than 64 bit, and variable sized types, are passed by - reference. The callee must copy them; see c6x_callee_copies. */ + reference. The callee must copy them; see TARGET_CALLEE_COPIES. */ static bool -c6x_pass_by_reference (cumulative_args_t cum_v ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +c6x_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { int size = -1; - if (type) - size = int_size_in_bytes (type); - else if (mode != VOIDmode) - size = GET_MODE_SIZE (mode); + if (arg.type) + size = int_size_in_bytes (arg.type); + else if (arg.mode != VOIDmode) + size = GET_MODE_SIZE (arg.mode); return size > 2 * UNITS_PER_WORD || size == -1; } @@ -675,17 +669,6 @@ c6x_return_in_msb (const_tree valtype) return TARGET_BIG_ENDIAN && AGGREGATE_TYPE_P (valtype) && size == 3; } -/* Implement TARGET_CALLEE_COPIES. */ - -static bool -c6x_callee_copies (cumulative_args_t cum_v ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) -{ - return true; -} - /* Return the type to use as __builtin_va_list. */ static tree c6x_build_builtin_va_list (void) @@ -1105,8 +1088,6 @@ c6x_call_saved_register_used (tree call_expr) cumulative_args_t cum; HARD_REG_SET call_saved_regset; tree parameter; - machine_mode mode; - tree type; rtx parm_rtx; int i; @@ -1124,21 +1105,12 @@ c6x_call_saved_register_used (tree call_expr) if (TREE_CODE (parameter) == ERROR_MARK) return true; - type = TREE_TYPE (parameter); - gcc_assert (type); - - mode = TYPE_MODE (type); - gcc_assert (mode); - - if (pass_by_reference (&cum_v, mode, type, true)) - { - mode = Pmode; - type = build_pointer_type (type); - } + function_arg_info arg (TREE_TYPE (parameter), /*named=*/true); + apply_pass_by_reference_rules (&cum_v, arg); - parm_rtx = c6x_function_arg (cum, mode, type, 0); + parm_rtx = c6x_function_arg (cum, arg); - c6x_function_arg_advance (cum, mode, type, 0); + c6x_function_arg_advance (cum, arg); if (!parm_rtx) continue; @@ -6731,7 +6703,7 @@ c6x_modes_tieable_p (machine_mode mode1, machine_mode mode2) #undef TARGET_PASS_BY_REFERENCE #define TARGET_PASS_BY_REFERENCE c6x_pass_by_reference #undef TARGET_CALLEE_COPIES -#define TARGET_CALLEE_COPIES c6x_callee_copies +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_true #undef TARGET_STRUCT_VALUE_RTX #define TARGET_STRUCT_VALUE_RTX c6x_struct_value_rtx #undef TARGET_FUNCTION_OK_FOR_SIBCALL diff --git a/gcc/config/cr16/cr16.c b/gcc/config/cr16/cr16.c index 42b9e04..c95d5d1 100644 --- a/gcc/config/cr16/cr16.c +++ b/gcc/config/cr16/cr16.c @@ -592,10 +592,9 @@ enough_regs_for_param (CUMULATIVE_ARGS * cum, const_tree type, return 0; } -/* Implements the macro FUNCTION_ARG defined in cr16.h. */ +/* Implement TARGET_FUNCTION_ARG. */ static rtx -cr16_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +cr16_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); cum->last_parm_in_reg = 0; @@ -604,20 +603,20 @@ cr16_function_arg (cumulative_args_t cum_v, machine_mode mode, had their registers assigned. The rtx that function_arg returns from this type is supposed to pass to 'gen_call' but currently it is not implemented. */ - if (type == void_type_node) + if (arg.end_marker_p ()) return NULL_RTX; - if (targetm.calls.must_pass_in_stack (mode, type) || (cum->ints < 0)) + if (targetm.calls.must_pass_in_stack (arg) || (cum->ints < 0)) return NULL_RTX; - if (mode == BLKmode) + if (arg.mode == BLKmode) { /* Enable structures that need padding bytes at the end to pass to a function in registers. */ - if (enough_regs_for_param (cum, type, mode) != 0) + if (enough_regs_for_param (cum, arg.type, arg.mode) != 0) { cum->last_parm_in_reg = 1; - return gen_rtx_REG (mode, MIN_REG_FOR_PASSING_ARGS + cum->ints); + return gen_rtx_REG (arg.mode, MIN_REG_FOR_PASSING_ARGS + cum->ints); } } @@ -625,10 +624,10 @@ cr16_function_arg (cumulative_args_t cum_v, machine_mode mode, return NULL_RTX; else { - if (enough_regs_for_param (cum, type, mode) != 0) + if (enough_regs_for_param (cum, arg.type, arg.mode) != 0) { cum->last_parm_in_reg = 1; - return gen_rtx_REG (mode, MIN_REG_FOR_PASSING_ARGS + cum->ints); + return gen_rtx_REG (arg.mode, MIN_REG_FOR_PASSING_ARGS + cum->ints); } } @@ -661,34 +660,34 @@ cr16_init_cumulative_args (CUMULATIVE_ARGS * cum, tree fntype, /* Implements the macro FUNCTION_ARG_ADVANCE defined in cr16.h. */ static void -cr16_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +cr16_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS * cum = get_cumulative_args (cum_v); /* l holds the number of registers required. */ - int l = GET_MODE_BITSIZE (mode) / BITS_PER_WORD; + int l = GET_MODE_BITSIZE (arg.mode) / BITS_PER_WORD; /* If the parameter isn't passed on a register don't advance cum. */ if (!cum->last_parm_in_reg) return; - if (targetm.calls.must_pass_in_stack (mode, type) || (cum->ints < 0)) + if (targetm.calls.must_pass_in_stack (arg) || (cum->ints < 0)) return; - if ((mode == SImode) || (mode == HImode) - || (mode == QImode) || (mode == DImode)) + if ((arg.mode == SImode) || (arg.mode == HImode) + || (arg.mode == QImode) || (arg.mode == DImode)) { if (l <= 1) cum->ints += 1; else cum->ints += l; } - else if ((mode == SFmode) || (mode == DFmode)) + else if ((arg.mode == SFmode) || (arg.mode == DFmode)) cum->ints += l; - else if ((mode) == BLKmode) + else if (arg.mode == BLKmode) { - if ((l = enough_regs_for_param (cum, type, mode)) != 0) + if ((l = enough_regs_for_param (cum, arg.type, arg.mode)) != 0) cum->ints += l; } return; diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 88de088..fff641e9 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -108,8 +108,9 @@ static struct machine_function * cris_init_machine_status (void); static rtx cris_struct_value_rtx (tree, int); -static void cris_setup_incoming_varargs (cumulative_args_t, machine_mode, - tree type, int *, int); +static void cris_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, + int *, int); static int cris_initial_frame_pointer_offset (void); @@ -139,16 +140,15 @@ static int cris_register_move_cost (machine_mode, reg_class_t, reg_class_t); static int cris_memory_move_cost (machine_mode, reg_class_t, bool); static bool cris_rtx_costs (rtx, machine_mode, int, int, int *, bool); static int cris_address_cost (rtx, machine_mode, addr_space_t, bool); -static bool cris_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); -static int cris_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static rtx cris_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static bool cris_pass_by_reference (cumulative_args_t, + const function_arg_info &); +static int cris_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +static rtx cris_function_arg (cumulative_args_t, const function_arg_info &); static rtx cris_function_incoming_arg (cumulative_args_t, - machine_mode, const_tree, bool); -static void cris_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); + const function_arg_info &); +static void cris_function_arg_advance (cumulative_args_t, + const function_arg_info &); static rtx_insn *cris_md_asm_adjust (vec<rtx> &, vec<rtx> &, vec<const char *> &, vec<rtx> &, HARD_REG_SET &); @@ -4021,8 +4021,7 @@ cris_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, static void cris_setup_incoming_varargs (cumulative_args_t ca_v, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, + const function_arg_info &, int *pretend_arg_size, int second_time) { @@ -4041,16 +4040,14 @@ cris_setup_incoming_varargs (cumulative_args_t ca_v, ca->regs, *pretend_arg_size, second_time); } -/* Return true if TYPE must be passed by invisible reference. +/* Return true if ARG must be passed by invisible reference. For cris, we pass <= 8 bytes by value, others by reference. */ static bool -cris_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +cris_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return (targetm.calls.must_pass_in_stack (mode, type) - || CRIS_FUNCTION_ARG_SIZE (mode, type) > 8); + return (targetm.calls.must_pass_in_stack (arg) + || CRIS_FUNCTION_ARG_SIZE (arg.mode, arg.type) > 8); } /* A combination of defining TARGET_PROMOTE_FUNCTION_MODE, promoting arguments @@ -4111,28 +4108,25 @@ cris_function_value_regno_p (const unsigned int regno) } static int -cris_arg_partial_bytes (cumulative_args_t ca, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +cris_arg_partial_bytes (cumulative_args_t ca, const function_arg_info &arg) { if (get_cumulative_args (ca)->regs == CRIS_MAX_ARGS_IN_REGS - 1 - && !targetm.calls.must_pass_in_stack (mode, type) - && CRIS_FUNCTION_ARG_SIZE (mode, type) > 4 - && CRIS_FUNCTION_ARG_SIZE (mode, type) <= 8) + && !targetm.calls.must_pass_in_stack (arg) + && CRIS_FUNCTION_ARG_SIZE (arg.mode, arg.type) > 4 + && CRIS_FUNCTION_ARG_SIZE (arg.mode, arg.type) <= 8) return UNITS_PER_WORD; else return 0; } static rtx -cris_function_arg_1 (cumulative_args_t ca_v, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named, bool incoming) +cris_function_arg_1 (cumulative_args_t ca_v, const function_arg_info &arg, + bool incoming) { const CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v); - if ((!incoming || named) && ca->regs < CRIS_MAX_ARGS_IN_REGS) - return gen_rtx_REG (mode, CRIS_FIRST_ARG_REG + ca->regs); + if ((!incoming || arg.named) && ca->regs < CRIS_MAX_ARGS_IN_REGS) + return gen_rtx_REG (arg.mode, CRIS_FIRST_ARG_REG + ca->regs); else return NULL_RTX; } @@ -4141,10 +4135,9 @@ cris_function_arg_1 (cumulative_args_t ca_v, The void_type_node is sent as a "closing" call. */ static rtx -cris_function_arg (cumulative_args_t ca, machine_mode mode, - const_tree type, bool named) +cris_function_arg (cumulative_args_t ca, const function_arg_info &arg) { - return cris_function_arg_1 (ca, mode, type, named, false); + return cris_function_arg_1 (ca, arg, false); } /* Worker function for TARGET_FUNCTION_INCOMING_ARG. @@ -4152,24 +4145,23 @@ cris_function_arg (cumulative_args_t ca, machine_mode mode, The differences between this and the previous, is that this one checks that an argument is named, since incoming stdarg/varargs arguments are pushed onto the stack, and we don't have to check against the "closing" - void_type_node TYPE parameter. */ + function_arg_info::end_marker parameter. */ static rtx -cris_function_incoming_arg (cumulative_args_t ca, machine_mode mode, - const_tree type, bool named) +cris_function_incoming_arg (cumulative_args_t ca, const function_arg_info &arg) { - return cris_function_arg_1 (ca, mode, type, named, true); + return cris_function_arg_1 (ca, arg, true); } /* Worker function for TARGET_FUNCTION_ARG_ADVANCE. */ static void -cris_function_arg_advance (cumulative_args_t ca_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +cris_function_arg_advance (cumulative_args_t ca_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v); - ca->regs += (3 + CRIS_FUNCTION_ARG_SIZE (mode, type)) / 4; + ca->regs += (3 + CRIS_FUNCTION_ARG_SIZE (arg.mode, arg.type)) / 4; } /* Worker function for TARGET_MD_ASM_ADJUST. */ diff --git a/gcc/config/csky/csky.c b/gcc/config/csky/csky.c index 3cfa13e..309d00d 100644 --- a/gcc/config/csky/csky.c +++ b/gcc/config/csky/csky.c @@ -1784,23 +1784,16 @@ csky_initial_elimination_offset (int from, int to) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ static rtx -csky_function_arg (cumulative_args_t pcum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +csky_function_arg (cumulative_args_t pcum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); if (*pcum < CSKY_NPARM_REGS) - return gen_rtx_REG (mode, CSKY_FIRST_PARM_REGNUM + *pcum); + return gen_rtx_REG (arg.mode, CSKY_FIRST_PARM_REGNUM + *pcum); return NULL_RTX; } @@ -1826,11 +1819,11 @@ csky_num_arg_regs (machine_mode mode, const_tree type) /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void -csky_function_arg_advance (cumulative_args_t pcum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +csky_function_arg_advance (cumulative_args_t pcum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); - int param_size = csky_num_arg_regs (mode, type); + int param_size = csky_num_arg_regs (arg.mode, arg.type); if (*pcum + param_size > CSKY_NPARM_REGS) *pcum = CSKY_NPARM_REGS; @@ -1917,11 +1910,10 @@ csky_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) that are passed entirely in registers or that are entirely pushed on the stack. */ static int -csky_arg_partial_bytes (cumulative_args_t pcum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +csky_arg_partial_bytes (cumulative_args_t pcum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v); - int param_size = csky_num_arg_regs (mode, type); + int param_size = csky_num_arg_regs (arg.mode, arg.type); if (*pcum < CSKY_NPARM_REGS && *pcum + param_size > CSKY_NPARM_REGS) @@ -1938,8 +1930,7 @@ csky_arg_partial_bytes (cumulative_args_t pcum_v, machine_mode mode, static void csky_setup_incoming_varargs (cumulative_args_t pcum_v, - machine_mode mode, - tree type, + const function_arg_info &arg, int *pretend_size, int second_time ATTRIBUTE_UNUSED) { @@ -1950,7 +1941,7 @@ csky_setup_incoming_varargs (cumulative_args_t pcum_v, cfun->machine->uses_anonymous_args = 1; local_cum = *pcum; - csky_function_arg_advance (local_cum_v, mode, type, true); + csky_function_arg_advance (local_cum_v, arg); regs_to_push = CSKY_NPARM_REGS - local_cum; if (regs_to_push) *pretend_size = regs_to_push * UNITS_PER_WORD; diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c index 657a888..cc51cfa 100644 --- a/gcc/config/epiphany/epiphany.c +++ b/gcc/config/epiphany/epiphany.c @@ -71,8 +71,8 @@ static int get_epiphany_condition_code (rtx); static tree epiphany_handle_interrupt_attribute (tree *, tree, tree, int, bool *); static tree epiphany_handle_forwarder_attribute (tree *, tree, tree, int, bool *); -static bool epiphany_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); +static bool epiphany_pass_by_reference (cumulative_args_t, + const function_arg_info &); static rtx_insn *frame_insn (rtx); /* defines for the initialization of the GCC target structure. */ @@ -90,7 +90,7 @@ static rtx_insn *frame_insn (rtx); #define TARGET_RETURN_IN_MEMORY epiphany_return_in_memory #define TARGET_PASS_BY_REFERENCE epiphany_pass_by_reference -#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_true #define TARGET_FUNCTION_VALUE epiphany_function_value #define TARGET_LIBCALL_VALUE epiphany_libcall_value #define TARGET_FUNCTION_VALUE_REGNO_P epiphany_function_value_regno_p @@ -711,24 +711,25 @@ epiphany_function_arg_boundary (machine_mode mode, const_tree type) /* Do any needed setup for a variadic function. For the EPIPHANY, we actually emit the code in epiphany_expand_prologue. - CUM has not been updated for the last named argument which has type TYPE - and mode MODE, and we rely on this fact. */ + CUM has not been updated for the last named argument (which is given + by ARG), and we rely on this fact. */ static void -epiphany_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size, int no_rtl) +epiphany_setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size, int no_rtl) { int first_anon_arg; CUMULATIVE_ARGS next_cum; machine_function_t *mf = MACHINE_FUNCTION (cfun); /* All BLKmode values are passed by reference. */ - gcc_assert (mode != BLKmode); + gcc_assert (arg.mode != BLKmode); next_cum = *get_cumulative_args (cum); - next_cum - = ROUND_ADVANCE_CUM (next_cum, mode, type) + ROUND_ADVANCE_ARG (mode, type); + next_cum = (ROUND_ADVANCE_CUM (next_cum, arg.mode, arg.type) + + ROUND_ADVANCE_ARG (arg.mode, arg.type)); first_anon_arg = next_cum; if (first_anon_arg < MAX_EPIPHANY_PARM_REGS && !no_rtl) @@ -744,18 +745,19 @@ epiphany_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, } static int -epiphany_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +epiphany_arg_partial_bytes (cumulative_args_t cum, + const function_arg_info &arg) { int words = 0, rounded_cum; - gcc_assert (!epiphany_pass_by_reference (cum, mode, type, /* named */ true)); + gcc_assert (!epiphany_pass_by_reference (cum, arg)); - rounded_cum = ROUND_ADVANCE_CUM (*get_cumulative_args (cum), mode, type); + rounded_cum = ROUND_ADVANCE_CUM (*get_cumulative_args (cum), + arg.mode, arg.type); if (rounded_cum < MAX_EPIPHANY_PARM_REGS) { words = MAX_EPIPHANY_PARM_REGS - rounded_cum; - if (words >= ROUND_ADVANCE_ARG (mode, type)) + if (words >= ROUND_ADVANCE_ARG (arg.mode, arg.type)) words = 0; } return words * UNITS_PER_WORD; @@ -1485,14 +1487,12 @@ epiphany_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) passed by reference. */ static bool -epiphany_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +epiphany_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - if (type) + if (tree type = arg.type) { if (AGGREGATE_TYPE_P (type) - && (mode == BLKmode || TYPE_NEEDS_CONSTRUCTING (type))) + && (arg.mode == BLKmode || TYPE_NEEDS_CONSTRUCTING (type))) return true; } return false; @@ -2254,37 +2254,30 @@ epiphany_conditional_register_usage (void) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ /* On the EPIPHANY the first MAX_EPIPHANY_PARM_REGS args are normally in registers and the rest are pushed. */ static rtx -epiphany_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +epiphany_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS cum = *get_cumulative_args (cum_v); - if (PASS_IN_REG_P (cum, mode, type)) - return gen_rtx_REG (mode, ROUND_ADVANCE_CUM (cum, mode, type)); + if (PASS_IN_REG_P (cum, arg.mode, arg.type)) + return gen_rtx_REG (arg.mode, ROUND_ADVANCE_CUM (cum, arg.mode, arg.type)); return 0; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -epiphany_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +epiphany_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum = ROUND_ADVANCE_CUM (*cum, mode, type) + ROUND_ADVANCE_ARG (mode, type); + *cum = (ROUND_ADVANCE_CUM (*cum, arg.mode, arg.type) + + ROUND_ADVANCE_ARG (arg.mode, arg.type)); } /* Nested function support. diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index d21fc45..675198f 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -39,6 +39,7 @@ #include "output.h" #include "expr.h" #include "builtins.h" +#include "calls.h" /* This file should be included last. */ #include "target-def.h" @@ -112,15 +113,15 @@ static struct fr30_frame_info current_frame_info; /* Zero structure to initialize current_frame_info. */ static struct fr30_frame_info zero_frame_info; -static void fr30_setup_incoming_varargs (cumulative_args_t, machine_mode, - tree, int *, int); -static bool fr30_must_pass_in_stack (machine_mode, const_tree); -static int fr30_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static rtx fr30_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static void fr30_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static void fr30_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, + int *, int); +static bool fr30_must_pass_in_stack (const function_arg_info &); +static int fr30_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +static rtx fr30_function_arg (cumulative_args_t, const function_arg_info &); +static void fr30_function_arg_advance (cumulative_args_t, + const function_arg_info &); static bool fr30_frame_pointer_required (void); static rtx fr30_function_value (const_tree, const_tree, bool); static rtx fr30_libcall_value (machine_mode, const_rtx); @@ -128,7 +129,7 @@ static bool fr30_function_value_regno_p (const unsigned int); static bool fr30_can_eliminate (const int, const int); static void fr30_asm_trampoline_template (FILE *); static void fr30_trampoline_init (rtx, tree, rtx); -static int fr30_num_arg_regs (machine_mode, const_tree); +static int fr30_num_arg_regs (const function_arg_info &); #define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM)) #define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM)) @@ -458,12 +459,11 @@ fr30_expand_epilogue (void) named argument, from registers into memory. * copying actually done in fr30_expand_prologue(). - ARG_REGS_USED_SO_FAR has *not* been updated for the last named argument - which has type TYPE and mode MODE, and we rely on this fact. */ + CUM has not been updated for the last named argument which has type TYPE + and mode MODE, and we rely on this fact. */ void fr30_setup_incoming_varargs (cumulative_args_t arg_regs_used_so_far_v, - machine_mode mode, - tree type ATTRIBUTE_UNUSED, + const function_arg_info &arg, int *pretend_size, int second_time ATTRIBUTE_UNUSED) { @@ -472,7 +472,7 @@ fr30_setup_incoming_varargs (cumulative_args_t arg_regs_used_so_far_v, int size; /* All BLKmode values are passed by reference. */ - gcc_assert (mode != BLKmode); + gcc_assert (arg.mode != BLKmode); /* ??? This run-time test as well as the code inside the if statement is probably unnecessary. */ @@ -480,7 +480,7 @@ fr30_setup_incoming_varargs (cumulative_args_t arg_regs_used_so_far_v, /* If TARGET_STRICT_ARGUMENT_NAMING returns true, then the last named arg must not be treated as an anonymous arg. */ /* ??? This is a pointer increment, which makes no sense. */ - arg_regs_used_so_far += fr30_num_arg_regs (mode, type); + arg_regs_used_so_far += fr30_num_arg_regs (arg); size = FR30_NUM_ARG_REGS - (* arg_regs_used_so_far); @@ -743,50 +743,37 @@ fr30_function_value_regno_p (const unsigned int regno) in registers. */ static bool -fr30_must_pass_in_stack (machine_mode mode, const_tree type) +fr30_must_pass_in_stack (const function_arg_info &arg) { - if (mode == BLKmode) - return true; - if (type == NULL) - return false; - return AGGREGATE_TYPE_P (type); + return arg.mode == BLKmode || arg.aggregate_type_p (); } -/* Compute the number of word sized registers needed to hold a - function argument of mode INT_MODE and tree type TYPE. */ +/* Compute the number of word sized registers needed to hold function + argument ARG. */ static int -fr30_num_arg_regs (machine_mode mode, const_tree type) +fr30_num_arg_regs (const function_arg_info &arg) { - int size; - - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return 0; - if (type && mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + int size = arg.promoted_size_in_bytes (); return (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; } -/* Returns the number of bytes in which *part* of a parameter of machine - mode MODE and tree type TYPE (which may be NULL if the type is not known). - If the argument fits entirely in the argument registers, or entirely on - the stack, then 0 is returned. - CUM is the number of argument registers already used by earlier - parameters to the function. */ +/* Returns the number of bytes of argument registers required to hold *part* + of argument ARG. If the argument fits entirely in the argument registers, + or entirely on the stack, then 0 is returned. CUM is the number of + argument registers already used by earlier parameters to the function. */ static int -fr30_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named) +fr30_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); /* Unnamed arguments, i.e. those that are prototyped as ... are always passed on the stack. Also check here to see if all the argument registers are full. */ - if (named == 0 || *cum >= FR30_NUM_ARG_REGS) + if (!arg.named || *cum >= FR30_NUM_ARG_REGS) return 0; /* Work out how many argument registers would be needed if this @@ -795,39 +782,32 @@ fr30_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, are needed because the parameter must be passed on the stack) then return zero, as this parameter does not require partial register, partial stack stack space. */ - if (*cum + fr30_num_arg_regs (mode, type) <= FR30_NUM_ARG_REGS) + if (*cum + fr30_num_arg_regs (arg) <= FR30_NUM_ARG_REGS) return 0; return (FR30_NUM_ARG_REGS - *cum) * UNITS_PER_WORD; } static rtx -fr30_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +fr30_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (!named - || fr30_must_pass_in_stack (mode, type) + if (!arg.named + || fr30_must_pass_in_stack (arg) || *cum >= FR30_NUM_ARG_REGS) return NULL_RTX; else - return gen_rtx_REG (mode, *cum + FIRST_ARG_REGNUM); + return gen_rtx_REG (arg.mode, *cum + FIRST_ARG_REGNUM); } -/* A C statement (sans semicolon) to update the summarizer variable CUM to - advance past an argument in the argument list. The values MODE, TYPE and - NAMED describe that argument. Once this is done, the variable CUM is - suitable for analyzing the *following* argument with `FUNCTION_ARG', etc. - - This macro need not do anything if the argument in question was passed on - the stack. The compiler knows how to track the amount of stack space used - for arguments without any special help. */ +/* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void -fr30_function_arg_advance (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +fr30_function_arg_advance (cumulative_args_t cum, + const function_arg_info &arg) { - *get_cumulative_args (cum) += named * fr30_num_arg_regs (mode, type); + if (arg.named) + *get_cumulative_args (cum) += fr30_num_arg_regs (arg); } /*}}}*/ diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index f8a3a075..c1b3c9e 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see #include "builtins.h" #include "ifcvt.h" #include "rtl-iter.h" +#include "calls.h" /* This file should be included last. */ #include "target-def.h" @@ -358,8 +359,8 @@ static bool frv_in_small_data_p (const_tree); static void frv_asm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static void frv_setup_incoming_varargs (cumulative_args_t, - machine_mode, - tree, int *, int); + const function_arg_info &, + int *, int); static rtx frv_expand_builtin_saveregs (void); static void frv_expand_builtin_va_start (tree, rtx); static bool frv_rtx_costs (rtx, machine_mode, int, int, @@ -378,15 +379,14 @@ static void frv_output_const_unspec (FILE *, const struct frv_unspec *); static bool frv_function_ok_for_sibcall (tree, tree); static rtx frv_struct_value_rtx (tree, int); -static bool frv_must_pass_in_stack (machine_mode mode, const_tree type); -static int frv_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static rtx frv_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx frv_function_incoming_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static void frv_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static bool frv_must_pass_in_stack (const function_arg_info &); +static int frv_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +static rtx frv_function_arg (cumulative_args_t, const function_arg_info &); +static rtx frv_function_incoming_arg (cumulative_args_t, + const function_arg_info &); +static void frv_function_arg_advance (cumulative_args_t, + const function_arg_info &); static unsigned int frv_function_arg_boundary (machine_mode, const_tree); static void frv_output_dwarf_dtprel (FILE *, int, rtx) @@ -2108,17 +2108,16 @@ frv_initial_elimination_offset (int from, int to) static void frv_setup_incoming_varargs (cumulative_args_t cum_v, - machine_mode mode, - tree type ATTRIBUTE_UNUSED, - int *pretend_size, - int second_time) + const function_arg_info &arg, + int *pretend_size, + int second_time) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (TARGET_DEBUG_ARG) fprintf (stderr, "setup_vararg: words = %2d, mode = %4s, pretend_size = %d, second_time = %d\n", - *cum, GET_MODE_NAME (mode), *pretend_size, second_time); + *cum, GET_MODE_NAME (arg.mode), *pretend_size, second_time); } @@ -3078,13 +3077,9 @@ frv_init_cumulative_args (CUMULATIVE_ARGS *cum, in registers. */ static bool -frv_must_pass_in_stack (machine_mode mode, const_tree type) +frv_must_pass_in_stack (const function_arg_info &arg) { - if (mode == BLKmode) - return true; - if (type == NULL) - return false; - return AGGREGATE_TYPE_P (type); + return arg.mode == BLKmode || arg.aggregate_type_p (); } /* If defined, a C expression that gives the alignment boundary, in bits, of an @@ -3099,13 +3094,12 @@ frv_function_arg_boundary (machine_mode mode ATTRIBUTE_UNUSED, } static rtx -frv_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, bool named, +frv_function_arg_1 (cumulative_args_t cum_v, const function_arg_info &arg, bool incoming ATTRIBUTE_UNUSED) { const CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - machine_mode xmode = (mode == BLKmode) ? SImode : mode; + machine_mode xmode = (arg.mode == BLKmode) ? SImode : arg.mode; int arg_num = *cum; rtx ret; const char *debstr; @@ -3132,44 +3126,34 @@ frv_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, if (TARGET_DEBUG_ARG) fprintf (stderr, "function_arg: words = %2d, mode = %4s, named = %d, size = %3d, arg = %s\n", - arg_num, GET_MODE_NAME (mode), named, GET_MODE_SIZE (mode), debstr); + arg_num, GET_MODE_NAME (arg.mode), arg.named, + GET_MODE_SIZE (arg.mode), debstr); return ret; } static rtx -frv_function_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +frv_function_arg (cumulative_args_t cum, const function_arg_info &arg) { - return frv_function_arg_1 (cum, mode, type, named, false); + return frv_function_arg_1 (cum, arg, false); } static rtx -frv_function_incoming_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +frv_function_incoming_arg (cumulative_args_t cum, const function_arg_info &arg) { - return frv_function_arg_1 (cum, mode, type, named, true); + return frv_function_arg_1 (cum, arg, true); } -/* A C statement (sans semicolon) to update the summarizer variable CUM to - advance past an argument in the argument list. The values MODE, TYPE and - NAMED describe that argument. Once this is done, the variable CUM is - suitable for analyzing the *following* argument with `FUNCTION_ARG', etc. - - This macro need not do anything if the argument in question was passed on - the stack. The compiler knows how to track the amount of stack space used - for arguments without any special help. */ +/* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void frv_function_arg_advance (cumulative_args_t cum_v, - machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named) + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - machine_mode xmode = (mode == BLKmode) ? SImode : mode; + machine_mode xmode = (arg.mode == BLKmode) ? SImode : arg.mode; int bytes = GET_MODE_SIZE (xmode); int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int arg_num = *cum; @@ -3179,32 +3163,17 @@ frv_function_arg_advance (cumulative_args_t cum_v, if (TARGET_DEBUG_ARG) fprintf (stderr, "function_adv: words = %2d, mode = %4s, named = %d, size = %3d\n", - arg_num, GET_MODE_NAME (mode), named, words * UNITS_PER_WORD); + arg_num, GET_MODE_NAME (arg.mode), arg.named, + words * UNITS_PER_WORD); } -/* A C expression for the number of words, at the beginning of an argument, - must be put in registers. The value must be zero for arguments that are - passed entirely in registers or that are entirely pushed on the stack. - - On some machines, certain arguments must be passed partially in registers - and partially in memory. On these machines, typically the first N words of - arguments are passed in registers, and the rest on the stack. If a - multi-word argument (a `double' or a structure) crosses that boundary, its - first few words must be passed in registers and the rest must be pushed. - This macro tells the compiler when this occurs, and how many of the words - should go in registers. - - `FUNCTION_ARG' for these arguments should return the first register to be - used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for - the called function. */ +/* Implement TARGET_ARG_PARTIAL_BYTES. */ static int -frv_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, - tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) +frv_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg) { - - machine_mode xmode = (mode == BLKmode) ? SImode : mode; + machine_mode xmode = (arg.mode == BLKmode) ? SImode : arg.mode; int bytes = GET_MODE_SIZE (xmode); int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int arg_num = *get_cumulative_args (cum); diff --git a/gcc/config/ft32/ft32.c b/gcc/config/ft32/ft32.c index 64b3172..e9eb4d4 100644 --- a/gcc/config/ft32/ft32.c +++ b/gcc/config/ft32/ft32.c @@ -630,13 +630,12 @@ ft32_initial_elimination_offset (int from, int to) static void ft32_setup_incoming_varargs (cumulative_args_t cum_v, - machine_mode mode, - tree type ATTRIBUTE_UNUSED, + const function_arg_info &arg, int *pretend_size, int no_rtl ATTRIBUTE_UNUSED) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int named_size = - GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (mode); + GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (arg.mode); if (named_size < 24) *pretend_size = 24 - named_size; @@ -658,14 +657,12 @@ ft32_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) NULL_RTX if there's no more space. */ static rtx -ft32_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +ft32_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (*cum < 8) - return gen_rtx_REG (mode, *cum); + return gen_rtx_REG (arg.mode, *cum); else return NULL_RTX; } @@ -675,34 +672,25 @@ ft32_function_arg (cumulative_args_t cum_v, machine_mode mode, : (unsigned) int_size_in_bytes (TYPE)) static void -ft32_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +ft32_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); *cum = (*cum < FT32_R6 - ? *cum + ((3 + FT32_FUNCTION_ARG_SIZE (mode, type)) / 4) : *cum); + ? *cum + ((3 + FT32_FUNCTION_ARG_SIZE (arg.mode, arg.type)) / 4) + : *cum); } -/* Return non-zero if the function argument described by TYPE is to be +/* Return non-zero if the function argument described by ARG is to be passed by reference. */ static bool -ft32_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +ft32_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - unsigned HOST_WIDE_INT size; - - if (type) - { - if (AGGREGATE_TYPE_P (type)) - return true; - size = int_size_in_bytes (type); - } - else - size = GET_MODE_SIZE (mode); - + if (arg.aggregate_type_p ()) + return true; + unsigned HOST_WIDE_INT size = arg.type_size_in_bytes (); return size > 4 * 6; } @@ -711,8 +699,7 @@ ft32_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, that fit in argument passing registers. */ static int -ft32_arg_partial_bytes (cumulative_args_t cum_v, - machine_mode mode, tree type, bool named) +ft32_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int bytes_left, size; @@ -720,16 +707,16 @@ ft32_arg_partial_bytes (cumulative_args_t cum_v, if (*cum >= 8) return 0; - if (ft32_pass_by_reference (cum_v, mode, type, named)) + if (ft32_pass_by_reference (cum_v, arg)) size = 4; - else if (type) + else if (arg.type) { - if (AGGREGATE_TYPE_P (type)) + if (AGGREGATE_TYPE_P (arg.type)) return 0; - size = int_size_in_bytes (type); + size = int_size_in_bytes (arg.type); } else - size = GET_MODE_SIZE (mode); + size = GET_MODE_SIZE (arg.mode); bytes_left = (4 * 6) - ((*cum - 2) * 4); diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 2c1158f..8645ecc 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -2200,22 +2200,16 @@ gcn_function_value_regno_p (const unsigned int n) return n == RETURN_VALUE_REG; } -/* Calculate the number of registers required to hold a function argument - of MODE and TYPE. */ +/* Calculate the number of registers required to hold function argument + ARG. */ static int -num_arg_regs (machine_mode mode, const_tree type) +num_arg_regs (const function_arg_info &arg) { - int size; - - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return 0; - if (type && mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + int size = arg.promoted_size_in_bytes (); return (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; } @@ -2255,49 +2249,48 @@ gcn_pretend_outgoing_varargs_named (cumulative_args_t cum_v) and if so, which register. */ static rtx -gcn_function_arg (cumulative_args_t cum_v, machine_mode mode, const_tree type, - bool named) +gcn_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (cum->normal_function) { - if (!named || mode == VOIDmode) + if (!arg.named || arg.end_marker_p ()) return 0; - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return 0; int reg_num = FIRST_PARM_REG + cum->num; - int num_regs = num_arg_regs (mode, type); + int num_regs = num_arg_regs (arg); if (num_regs > 0) while (reg_num % num_regs != 0) reg_num++; if (reg_num + num_regs <= FIRST_PARM_REG + NUM_PARM_REGS) - return gen_rtx_REG (mode, reg_num); + return gen_rtx_REG (arg.mode, reg_num); } else { if (cum->num >= cum->args.nargs) { - cum->offset = (cum->offset + TYPE_ALIGN (type) / 8 - 1) - & -(TYPE_ALIGN (type) / 8); + cum->offset = (cum->offset + TYPE_ALIGN (arg.type) / 8 - 1) + & -(TYPE_ALIGN (arg.type) / 8); cfun->machine->kernarg_segment_alignment = MAX ((unsigned) cfun->machine->kernarg_segment_alignment, - TYPE_ALIGN (type) / 8); + TYPE_ALIGN (arg.type) / 8); rtx addr = gen_rtx_REG (DImode, cum->args.reg[KERNARG_SEGMENT_PTR_ARG]); if (cum->offset) addr = gen_rtx_PLUS (DImode, addr, gen_int_mode (cum->offset, DImode)); - rtx mem = gen_rtx_MEM (mode, addr); - set_mem_attributes (mem, const_cast<tree>(type), 1); + rtx mem = gen_rtx_MEM (arg.mode, addr); + set_mem_attributes (mem, arg.type, 1); set_mem_addr_space (mem, ADDR_SPACE_SCALAR_FLAT); MEM_READONLY_P (mem) = 1; return mem; } int a = cum->args.order[cum->num]; - if (mode != gcn_kernel_arg_types[a].mode) + if (arg.mode != gcn_kernel_arg_types[a].mode) { error ("wrong type of argument %s", gcn_kernel_arg_types[a].name); return 0; @@ -2314,17 +2307,17 @@ gcn_function_arg (cumulative_args_t cum_v, machine_mode mode, const_tree type, argument in the argument list. */ static void -gcn_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +gcn_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (cum->normal_function) { - if (!named) + if (!arg.named) return; - int num_regs = num_arg_regs (mode, type); + int num_regs = num_arg_regs (arg); if (num_regs > 0) while ((FIRST_PARM_REG + cum->num) % num_regs != 0) cum->num++; @@ -2336,7 +2329,7 @@ gcn_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, cum->num++; else { - cum->offset += tree_to_uhwi (TYPE_SIZE_UNIT (type)); + cum->offset += tree_to_uhwi (TYPE_SIZE_UNIT (arg.type)); cfun->machine->kernarg_segment_byte_size = cum->offset; } } @@ -2349,22 +2342,21 @@ gcn_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, in registers or that are entirely pushed on the stack. */ static int -gcn_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, tree type, - bool named) +gcn_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (!named) + if (!arg.named) return 0; - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return 0; if (cum->num >= NUM_PARM_REGS) return 0; /* If the argument fits entirely in registers, return 0. */ - if (cum->num + num_arg_regs (mode, type) <= NUM_PARM_REGS) + if (cum->num + num_arg_regs (arg) <= NUM_PARM_REGS) return 0; return (NUM_PARM_REGS - cum->num) * UNITS_PER_WORD; @@ -2493,7 +2485,7 @@ gcn_gimplify_va_arg_expr (tree valist, tree type, tree t, u; bool indirect; - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, 0); + indirect = pass_va_arg_by_reference (type); if (indirect) { type = ptr; diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index b68ee39..c51b32d 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1081,17 +1081,16 @@ h8300_pr_saveall (struct cpp_reader *pfile ATTRIBUTE_UNUSED) pragma_saveall = 1; } -/* If the next function argument with MODE and TYPE is to be passed in - a register, return a reg RTX for the hard register in which to pass - the argument. CUM represents the state after the last argument. - If the argument is to be pushed, NULL_RTX is returned. +/* If the next function argument ARG is to be passed in a register, return + a reg RTX for the hard register in which to pass the argument. CUM + represents the state after the last argument. If the argument is to + be pushed, NULL_RTX is returned. On the H8/300 all normal args are pushed, unless -mquickcall in which case the first 3 arguments are passed in registers. */ static rtx -h8300_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +h8300_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -1119,7 +1118,7 @@ h8300_function_arg (cumulative_args_t cum_v, machine_mode mode, int regpass = 0; /* Never pass unnamed arguments in registers. */ - if (!named) + if (!arg.named) return NULL_RTX; /* Pass 3 regs worth of data in regs when user asked on the command line. */ @@ -1143,34 +1142,25 @@ h8300_function_arg (cumulative_args_t cum_v, machine_mode mode, if (regpass) { - int size; - - if (mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + int size = arg.promoted_size_in_bytes (); if (size + cum->nbytes <= regpass * UNITS_PER_WORD && cum->nbytes / UNITS_PER_WORD <= 3) - result = gen_rtx_REG (mode, cum->nbytes / UNITS_PER_WORD); + result = gen_rtx_REG (arg.mode, cum->nbytes / UNITS_PER_WORD); } return result; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -h8300_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +h8300_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - cum->nbytes += (mode != BLKmode - ? (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD - : (int_size_in_bytes (type) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD); + cum->nbytes += ((arg.promoted_size_in_bytes () + UNITS_PER_WORD - 1) + & -UNITS_PER_WORD); } diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index a9d8981..8e8b4d2 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -863,36 +863,45 @@ const char *host_detect_local_cpu (int argc, const char **argv) if (arch) { /* This is unknown family 0x6 CPU. */ - /* Assume Ice Lake Server. */ - if (has_wbnoinvd) - cpu = "icelake-server"; - /* Assume Ice Lake. */ - else if (has_gfni) - cpu = "icelake-client"; - /* Assume Cannon Lake. */ - else if (has_avx512vbmi) - cpu = "cannonlake"; - /* Assume Knights Mill. */ - else if (has_avx5124vnniw) - cpu = "knm"; - /* Assume Knights Landing. */ - else if (has_avx512er) - cpu = "knl"; - /* Assume Skylake with AVX-512. */ - else if (has_avx512f) - cpu = "skylake-avx512"; - /* Assume Skylake. */ - else if (has_clflushopt) - cpu = "skylake"; - /* Assume Broadwell. */ - else if (has_adx) - cpu = "broadwell"; - else if (has_avx2) + if (has_avx) + { + /* Assume Tiger Lake */ + if (has_avx512vp2intersect) + cpu = "tigerlake"; + /* Assume Cooper Lake */ + else if (has_avx512bf16) + cpu = "cooperlake"; + /* Assume Ice Lake Server. */ + else if (has_wbnoinvd) + cpu = "icelake-server"; + /* Assume Ice Lake. */ + else if (has_avx512bitalg) + cpu = "icelake-client"; + /* Assume Cannon Lake. */ + else if (has_avx512vbmi) + cpu = "cannonlake"; + /* Assume Knights Mill. */ + else if (has_avx5124vnniw) + cpu = "knm"; + /* Assume Knights Landing. */ + else if (has_avx512er) + cpu = "knl"; + /* Assume Skylake with AVX-512. */ + else if (has_avx512f) + cpu = "skylake-avx512"; + /* Assume Skylake. */ + else if (has_clflushopt) + cpu = "skylake"; + /* Assume Broadwell. */ + else if (has_adx) + cpu = "broadwell"; + else if (has_avx2) /* Assume Haswell. */ - cpu = "haswell"; - else if (has_avx) + cpu = "haswell"; + else /* Assume Sandy Bridge. */ - cpu = "sandybridge"; + cpu = "sandybridge"; + } else if (has_sse4_2) { if (has_gfni) diff --git a/gcc/config/i386/i386-builtins.c b/gcc/config/i386/i386-builtins.c index 9736a75..5b388ec 100644 --- a/gcc/config/i386/i386-builtins.c +++ b/gcc/config/i386/i386-builtins.c @@ -1972,7 +1972,9 @@ enum processor_model M_INTEL_COREI7_ICELAKE_CLIENT, M_INTEL_COREI7_ICELAKE_SERVER, M_AMDFAM17H_ZNVER2, - M_INTEL_COREI7_CASCADELAKE + M_INTEL_COREI7_CASCADELAKE, + M_INTEL_COREI7_TIGERLAKE, + M_INTEL_COREI7_COOPERLAKE }; struct _arch_names_table @@ -2001,6 +2003,8 @@ static const _arch_names_table arch_names_table[] = {"icelake-client", M_INTEL_COREI7_ICELAKE_CLIENT}, {"icelake-server", M_INTEL_COREI7_ICELAKE_SERVER}, {"cascadelake", M_INTEL_COREI7_CASCADELAKE}, + {"tigerlake", M_INTEL_COREI7_TIGERLAKE}, + {"cooperlake", M_INTEL_COREI7_COOPERLAKE}, {"bonnell", M_INTEL_BONNELL}, {"silvermont", M_INTEL_SILVERMONT}, {"goldmont", M_INTEL_GOLDMONT}, @@ -2194,6 +2198,14 @@ get_builtin_code_for_version (tree decl, tree *predicate_list) arg_str = "cascadelake"; priority = P_PROC_AVX512F; break; + case PROCESSOR_TIGERLAKE: + arg_str = "tigerlake"; + priority = P_PROC_AVX512F; + break; + case PROCESSOR_COOPERLAKE: + arg_str = "cooperlake"; + priority = P_PROC_AVX512F; + break; case PROCESSOR_BONNELL: arg_str = "bonnell"; priority = P_PROC_SSSE3; diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index ec5f15b..3f054ca 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -222,6 +222,13 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__cascadelake"); def_or_undef (parse_in, "__cascadelake__"); break; + case PROCESSOR_TIGERLAKE: + def_or_undef (parse_in, "__tigerlake"); + def_or_undef (parse_in, "__tigerlake__"); + break; + case PROCESSOR_COOPERLAKE: + def_or_undef (parse_in, "__cooperlake"); + def_or_undef (parse_in, "__cooperlake__"); /* use PROCESSOR_max to not set/unset the arch macro. */ case PROCESSOR_max: break; @@ -370,6 +377,12 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_CASCADELAKE: def_or_undef (parse_in, "__tune_cascadelake__"); break; + case PROCESSOR_TIGERLAKE: + def_or_undef (parse_in, "__tune_tigerlake__"); + break; + case PROCESSOR_COOPERLAKE: + def_or_undef (parse_in, "__tune_cooperlake__"); + break; case PROCESSOR_INTEL: case PROCESSOR_GENERIC: break; diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c index c4a3d30..fb7ac1b 100644 --- a/gcc/config/i386/i386-features.c +++ b/gcc/config/i386/i386-features.c @@ -706,7 +706,7 @@ general_scalar_chain::make_vector_copies (unsigned regno) gen_rtx_SUBREG (SImode, reg, 4)); } else - emit_move_insn (tmp, reg); + emit_move_insn (copy_rtx (tmp), reg); emit_insn (gen_rtx_SET (gen_rtx_SUBREG (vmode, vreg, 0), gen_gpr_to_xmm_move_src (vmode, tmp))); } @@ -810,7 +810,7 @@ general_scalar_chain::convert_reg (unsigned regno) adjust_address (tmp, SImode, 4)); } else - emit_move_insn (scopy, tmp); + emit_move_insn (scopy, copy_rtx (tmp)); } else if (!TARGET_64BIT && smode == DImode) { @@ -910,7 +910,9 @@ general_scalar_chain::convert_op (rtx *op, rtx_insn *insn) { rtx tmp = gen_reg_rtx (GET_MODE (*op)); - emit_insn_before (gen_move_insn (tmp, *op), insn); + emit_insn_before (gen_rtx_SET (gen_rtx_SUBREG (vmode, tmp, 0), + gen_gpr_to_xmm_move_src (vmode, *op)), + insn); *op = gen_rtx_SUBREG (vmode, tmp, 0); if (dump_file) @@ -1664,7 +1666,7 @@ timode_remove_non_convertible_regs (bitmap candidates) instructions into vector mode when profitable. */ static unsigned int -convert_scalars_to_vector () +convert_scalars_to_vector (bool timode_p) { basic_block bb; int converted_insns = 0; @@ -1690,7 +1692,7 @@ convert_scalars_to_vector () { rtx_insn *insn; FOR_BB_INSNS (bb, insn) - if (TARGET_64BIT + if (timode_p && timode_scalar_to_vector_candidate_p (insn)) { if (dump_file) @@ -1699,7 +1701,7 @@ convert_scalars_to_vector () bitmap_set_bit (&candidates[2], INSN_UID (insn)); } - else + else if (!timode_p) { /* Check {SI,DI}mode. */ for (unsigned i = 0; i <= 1; ++i) @@ -1715,7 +1717,7 @@ convert_scalars_to_vector () } } - if (TARGET_64BIT) + if (timode_p) timode_remove_non_convertible_regs (&candidates[2]); for (unsigned i = 0; i <= 1; ++i) general_remove_non_convertible_regs (&candidates[i]); @@ -1875,13 +1877,13 @@ public: /* opt_pass methods: */ virtual bool gate (function *) { - return (timode_p == !!TARGET_64BIT + return ((!timode_p || TARGET_64BIT) && TARGET_STV && TARGET_SSE2 && optimize > 1); } virtual unsigned int execute (function *) { - return convert_scalars_to_vector (); + return convert_scalars_to_vector (timode_p); } opt_pass *clone () diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c index a1741c0..703e44e 100644 --- a/gcc/config/i386/i386-options.c +++ b/gcc/config/i386/i386-options.c @@ -121,8 +121,11 @@ along with GCC; see the file COPYING3. If not see #define m_ICELAKE_CLIENT (HOST_WIDE_INT_1U<<PROCESSOR_ICELAKE_CLIENT) #define m_ICELAKE_SERVER (HOST_WIDE_INT_1U<<PROCESSOR_ICELAKE_SERVER) #define m_CASCADELAKE (HOST_WIDE_INT_1U<<PROCESSOR_CASCADELAKE) +#define m_TIGERLAKE (HOST_WIDE_INT_1U<<PROCESSOR_TIGERLAKE) +#define m_COOPERLAKE (HOST_WIDE_INT_1U<<PROCESSOR_COOPERLAKE) #define m_CORE_AVX512 (m_SKYLAKE_AVX512 | m_CANNONLAKE \ - | m_ICELAKE_CLIENT | m_ICELAKE_SERVER | m_CASCADELAKE) + | m_ICELAKE_CLIENT | m_ICELAKE_SERVER | m_CASCADELAKE \ + | m_TIGERLAKE | m_COOPERLAKE) #define m_CORE_AVX2 (m_HASWELL | m_SKYLAKE | m_CORE_AVX512) #define m_CORE_ALL (m_CORE2 | m_NEHALEM | m_SANDYBRIDGE | m_CORE_AVX2) #define m_GOLDMONT (HOST_WIDE_INT_1U<<PROCESSOR_GOLDMONT) @@ -627,6 +630,8 @@ static const struct processor_costs *processor_cost_table[] = &skylake_cost, &skylake_cost, &skylake_cost, + &skylake_cost, + &skylake_cost, &intel_cost, &geode_cost, &k6_cost, @@ -2049,6 +2054,12 @@ ix86_option_override_internal (bool main_args_p, && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_AVX512BF16)) opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_AVX512BF16; + if (((processor_alias_table[i].flags & PTA_MOVDIRI) != 0) + && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_MOVDIRI)) + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MOVDIRI; + if (((processor_alias_table[i].flags & PTA_MOVDIR64B) != 0) + && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_MOVDIR64B)) + opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_MOVDIR64B; if (((processor_alias_table[i].flags & PTA_SGX) != 0) && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_SGX)) opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_SGX; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 647bcbe..49ab50e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1455,19 +1455,19 @@ ix86_function_arg_regno_p (int regno) return false; } -/* Return if we do not know how to pass TYPE solely in registers. */ +/* Return if we do not know how to pass ARG solely in registers. */ static bool -ix86_must_pass_in_stack (machine_mode mode, const_tree type) +ix86_must_pass_in_stack (const function_arg_info &arg) { - if (must_pass_in_stack_var_size_or_pad (mode, type)) + if (must_pass_in_stack_var_size_or_pad (arg)) return true; /* For 32-bit, we want TImode aggregates to go on the stack. But watch out! The layout_type routine is crafty and tries to trick us into passing currently unsupported vector types on the stack by using TImode. */ - return (!TARGET_64BIT && mode == TImode - && type && TREE_CODE (type) != VECTOR_TYPE); + return (!TARGET_64BIT && arg.mode == TImode + && arg.type && TREE_CODE (arg.type) != VECTOR_TYPE); } /* It returns the size, in bytes, of the area reserved for arguments passed @@ -2062,9 +2062,13 @@ classify_argument (machine_mode mode, const_tree type, if (bytes < 0) return 0; - if (mode != VOIDmode - && targetm.calls.must_pass_in_stack (mode, type)) - return 0; + if (mode != VOIDmode) + { + /* The value of "named" doesn't matter. */ + function_arg_info arg (const_cast<tree> (type), mode, /*named=*/true); + if (targetm.calls.must_pass_in_stack (arg)) + return 0; + } if (type && AGGREGATE_TYPE_P (type)) { @@ -2919,15 +2923,14 @@ function_arg_advance_ms_64 (CUMULATIVE_ARGS *cum, HOST_WIDE_INT bytes, return 0; } -/* Update the data in CUM to advance over an argument of mode MODE and - data type TYPE. (TYPE is null for libcalls where that information - may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -ix86_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +ix86_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + machine_mode mode = arg.mode; HOST_WIDE_INT bytes, words; int nregs; @@ -2936,14 +2939,11 @@ ix86_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, if (!cum->caller && cfun->machine->func_type != TYPE_NORMAL) return; - if (mode == BLKmode) - bytes = int_size_in_bytes (type); - else - bytes = GET_MODE_SIZE (mode); + bytes = arg.promoted_size_in_bytes (); words = CEIL (bytes, UNITS_PER_WORD); - if (type) - mode = type_natural_mode (type, NULL, false); + if (arg.type) + mode = type_natural_mode (arg.type, NULL, false); if (TARGET_64BIT) { @@ -2952,10 +2952,11 @@ ix86_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, if (call_abi == MS_ABI) nregs = function_arg_advance_ms_64 (cum, bytes, words); else - nregs = function_arg_advance_64 (cum, mode, type, words, named); + nregs = function_arg_advance_64 (cum, mode, arg.type, words, + arg.named); } else - nregs = function_arg_advance_32 (cum, mode, type, bytes, words); + nregs = function_arg_advance_32 (cum, mode, arg.type, bytes, words); if (!nregs) { @@ -3206,77 +3207,69 @@ function_arg_ms_64 (const CUMULATIVE_ARGS *cum, machine_mode mode, /* Return where to put the arguments to a function. Return zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. TYPE is the data type of the - argument. It is null for libcalls where that information may not be - available. CUM gives information about the preceding args and about - the function being called. NAMED is nonzero if this argument is a - named parameter (otherwise it is an extra parameter matching an - ellipsis). */ + ARG describes the argument while CUM gives information about the + preceding args and about the function being called. */ static rtx -ix86_function_arg (cumulative_args_t cum_v, machine_mode omode, - const_tree type, bool named) +ix86_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - machine_mode mode = omode; + machine_mode mode = arg.mode; HOST_WIDE_INT bytes, words; - rtx arg; + rtx reg; if (!cum->caller && cfun->machine->func_type != TYPE_NORMAL) { - gcc_assert (type != NULL_TREE); - if (POINTER_TYPE_P (type)) + gcc_assert (arg.type != NULL_TREE); + if (POINTER_TYPE_P (arg.type)) { /* This is the pointer argument. */ - gcc_assert (TYPE_MODE (type) == Pmode); + gcc_assert (TYPE_MODE (arg.type) == Pmode); /* It is at -WORD(AP) in the current frame in interrupt and exception handlers. */ - arg = plus_constant (Pmode, arg_pointer_rtx, -UNITS_PER_WORD); + reg = plus_constant (Pmode, arg_pointer_rtx, -UNITS_PER_WORD); } else { gcc_assert (cfun->machine->func_type == TYPE_EXCEPTION - && TREE_CODE (type) == INTEGER_TYPE - && TYPE_MODE (type) == word_mode); + && TREE_CODE (arg.type) == INTEGER_TYPE + && TYPE_MODE (arg.type) == word_mode); /* The error code is the word-mode integer argument at -2 * WORD(AP) in the current frame of the exception handler. */ - arg = gen_rtx_MEM (word_mode, + reg = gen_rtx_MEM (word_mode, plus_constant (Pmode, arg_pointer_rtx, -2 * UNITS_PER_WORD)); } - return arg; + return reg; } - if (mode == BLKmode) - bytes = int_size_in_bytes (type); - else - bytes = GET_MODE_SIZE (mode); + bytes = arg.promoted_size_in_bytes (); words = CEIL (bytes, UNITS_PER_WORD); /* To simplify the code below, represent vector types with a vector mode even if MMX/SSE are not active. */ - if (type && TREE_CODE (type) == VECTOR_TYPE) - mode = type_natural_mode (type, cum, false); + if (arg.type && TREE_CODE (arg.type) == VECTOR_TYPE) + mode = type_natural_mode (arg.type, cum, false); if (TARGET_64BIT) { enum calling_abi call_abi = cum ? cum->call_abi : ix86_abi; if (call_abi == MS_ABI) - arg = function_arg_ms_64 (cum, mode, omode, named, bytes); + reg = function_arg_ms_64 (cum, mode, arg.mode, arg.named, bytes); else - arg = function_arg_64 (cum, mode, omode, type, named); + reg = function_arg_64 (cum, mode, arg.mode, arg.type, arg.named); } else - arg = function_arg_32 (cum, mode, omode, type, bytes, words); + reg = function_arg_32 (cum, mode, arg.mode, arg.type, bytes, words); /* Track if there are outgoing arguments on stack. */ - if (arg == NULL_RTX && cum->caller) + if (reg == NULL_RTX && cum->caller) cfun->machine->outgoing_args_on_stack = true; - return arg; + return reg; } /* A C expression that indicates when an argument must be passed by @@ -3286,8 +3279,7 @@ ix86_function_arg (cumulative_args_t cum_v, machine_mode omode, appropriate for passing a pointer to that type. */ static bool -ix86_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool) +ix86_pass_by_reference (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -3298,9 +3290,9 @@ ix86_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, /* See Windows x64 Software Convention. */ if (call_abi == MS_ABI) { - HOST_WIDE_INT msize = GET_MODE_SIZE (mode); + HOST_WIDE_INT msize = GET_MODE_SIZE (arg.mode); - if (type) + if (tree type = arg.type) { /* Arrays are passed by reference. */ if (TREE_CODE (type) == ARRAY_TYPE) @@ -3317,7 +3309,7 @@ ix86_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, /* __m128 is passed by reference. */ return msize != 1 && msize != 2 && msize != 4 && msize != 8; } - else if (type && int_size_in_bytes (type) == -1) + else if (arg.type && int_size_in_bytes (arg.type) == -1) return true; } @@ -4097,8 +4089,9 @@ setup_incoming_varargs_ms_64 (CUMULATIVE_ARGS *cum) } static void -ix86_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode, - tree type, int *, int no_rtl) +ix86_setup_incoming_varargs (cumulative_args_t cum_v, + const function_arg_info &arg, + int *, int no_rtl) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); CUMULATIVE_ARGS next_cum; @@ -4117,8 +4110,7 @@ ix86_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode, For stdargs, we do want to skip the last named argument. */ next_cum = *cum; if (stdarg_p (fntype)) - ix86_function_arg_advance (pack_cumulative_args (&next_cum), mode, type, - true); + ix86_function_arg_advance (pack_cumulative_args (&next_cum), arg); if (cum->call_abi == MS_ABI) setup_incoming_varargs_ms_64 (&next_cum); @@ -4307,7 +4299,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); - indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect_p = pass_va_arg_by_reference (type); if (indirect_p) type = build_pointer_type (type); size = arg_int_size_in_bytes (type); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index e0a77e1..167b73e 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -440,6 +440,8 @@ extern const struct processor_costs ix86_size_cost; #define TARGET_ICELAKE_CLIENT (ix86_tune == PROCESSOR_ICELAKE_CLIENT) #define TARGET_ICELAKE_SERVER (ix86_tune == PROCESSOR_ICELAKE_SERVER) #define TARGET_CASCADELAKE (ix86_tune == PROCESSOR_CASCADELAKE) +#define TARGET_TIGERLAKE (ix86_tune == PROCESSOR_TIGERLAKE) +#define TARGET_COOPERLAKE (ix86_tune == PROCESSOR_COOPERLAKE) #define TARGET_INTEL (ix86_tune == PROCESSOR_INTEL) #define TARGET_GENERIC (ix86_tune == PROCESSOR_GENERIC) #define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10) @@ -2303,6 +2305,8 @@ enum processor_type PROCESSOR_ICELAKE_CLIENT, PROCESSOR_ICELAKE_SERVER, PROCESSOR_CASCADELAKE, + PROCESSOR_TIGERLAKE, + PROCESSOR_COOPERLAKE, PROCESSOR_INTEL, PROCESSOR_GEODE, PROCESSOR_K6, @@ -2402,6 +2406,8 @@ const wide_int_bitmask PTA_AVX512VP2INTERSECT (0, HOST_WIDE_INT_1U << 9); const wide_int_bitmask PTA_WAITPKG (0, HOST_WIDE_INT_1U << 9); const wide_int_bitmask PTA_PTWRITE (0, HOST_WIDE_INT_1U << 10); const wide_int_bitmask PTA_AVX512BF16 (0, HOST_WIDE_INT_1U << 11); +const wide_int_bitmask PTA_MOVDIRI(0, HOST_WIDE_INT_1U << 13); +const wide_int_bitmask PTA_MOVDIR64B(0, HOST_WIDE_INT_1U << 14); const wide_int_bitmask PTA_CORE2 = PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR; @@ -2422,6 +2428,7 @@ const wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU | PTA_CLWB; const wide_int_bitmask PTA_CASCADELAKE = PTA_SKYLAKE_AVX512 | PTA_AVX512VNNI; +const wide_int_bitmask PTA_COOPERLAKE = PTA_CASCADELAKE | PTA_AVX512BF16; const wide_int_bitmask PTA_CANNONLAKE = PTA_SKYLAKE | PTA_AVX512F | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU | PTA_AVX512VBMI | PTA_AVX512IFMA | PTA_SHA; @@ -2430,6 +2437,8 @@ const wide_int_bitmask PTA_ICELAKE_CLIENT = PTA_CANNONLAKE | PTA_AVX512VNNI | PTA_RDPID | PTA_CLWB; const wide_int_bitmask PTA_ICELAKE_SERVER = PTA_ICELAKE_CLIENT | PTA_PCONFIG | PTA_WBNOINVD; +const wide_int_bitmask PTA_TIGERLAKE = PTA_ICELAKE_CLIENT | PTA_MOVDIRI + | PTA_MOVDIR64B | PTA_AVX512VP2INTERSECT; const wide_int_bitmask PTA_KNL = PTA_BROADWELL | PTA_AVX512PF | PTA_AVX512ER | PTA_AVX512F | PTA_AVX512CD; const wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE; diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index a07244e..bfec69b 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -199,18 +199,16 @@ static rtx gen_fr_restore_x (rtx, rtx, rtx); static void ia64_option_override (void); static bool ia64_can_eliminate (const int, const int); static machine_mode hfa_element_mode (const_tree, bool); -static void ia64_setup_incoming_varargs (cumulative_args_t, machine_mode, - tree, int *, int); -static int ia64_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static rtx ia64_function_arg_1 (cumulative_args_t, machine_mode, - const_tree, bool, bool); -static rtx ia64_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static void ia64_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, + int *, int); +static int ia64_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +static rtx ia64_function_arg (cumulative_args_t, const function_arg_info &); static rtx ia64_function_incoming_arg (cumulative_args_t, - machine_mode, const_tree, bool); -static void ia64_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); + const function_arg_info &); +static void ia64_function_arg_advance (cumulative_args_t, + const function_arg_info &); static pad_direction ia64_function_arg_padding (machine_mode, const_tree); static unsigned int ia64_function_arg_boundary (machine_mode, const_tree); @@ -4585,19 +4583,20 @@ ia64_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain) } /* Do any needed setup for a variadic function. CUM has not been updated - for the last named argument which has type TYPE and mode MODE. + for the last named argument, which is given by ARG. We generate the actual spill instructions during prologue generation. */ static void -ia64_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int * pretend_size, +ia64_setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size, int second_time ATTRIBUTE_UNUSED) { CUMULATIVE_ARGS next_cum = *get_cumulative_args (cum); /* Skip the current argument. */ - ia64_function_arg_advance (pack_cumulative_args (&next_cum), mode, type, 1); + ia64_function_arg_advance (pack_cumulative_args (&next_cum), arg); if (next_cum.words < MAX_ARGUMENT_SLOTS) { @@ -4745,14 +4744,14 @@ ia64_function_arg_offset (const CUMULATIVE_ARGS *cum, registers. */ static rtx -ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named, bool incoming) +ia64_function_arg_1 (cumulative_args_t cum_v, const function_arg_info &arg, + bool incoming) { const CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int basereg = (incoming ? GR_ARG_FIRST : AR_ARG_FIRST); - int words = ia64_function_arg_words (type, mode); - int offset = ia64_function_arg_offset (cum, type, words); + int words = ia64_function_arg_words (arg.type, arg.mode); + int offset = ia64_function_arg_offset (cum, arg.type, words); machine_mode hfa_mode = VOIDmode; /* For OPEN VMS, emit the instruction setting up the argument register here, @@ -4760,8 +4759,7 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, insns. This is not the conceptually best place to do this, but this is the easiest as we have convenient access to cumulative args info. */ - if (TARGET_ABI_OPEN_VMS && mode == VOIDmode && type == void_type_node - && named == 1) + if (TARGET_ABI_OPEN_VMS && arg.end_marker_p ()) { unsigned HOST_WIDE_INT regval = cum->words; int i; @@ -4780,19 +4778,19 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, /* On OpenVMS argument is either in Rn or Fn. */ if (TARGET_ABI_OPEN_VMS) { - if (FLOAT_MODE_P (mode)) - return gen_rtx_REG (mode, FR_ARG_FIRST + cum->words); + if (FLOAT_MODE_P (arg.mode)) + return gen_rtx_REG (arg.mode, FR_ARG_FIRST + cum->words); else - return gen_rtx_REG (mode, basereg + cum->words); + return gen_rtx_REG (arg.mode, basereg + cum->words); } /* Check for and handle homogeneous FP aggregates. */ - if (type) - hfa_mode = hfa_element_mode (type, 0); + if (arg.type) + hfa_mode = hfa_element_mode (arg.type, 0); /* Unnamed prototyped hfas are passed as usual. Named prototyped hfas and unprototyped hfas are passed specially. */ - if (hfa_mode != VOIDmode && (! cum->prototype || named)) + if (hfa_mode != VOIDmode && (! cum->prototype || arg.named)) { rtx loc[16]; int i = 0; @@ -4812,8 +4810,7 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, /* Fill the FP regs. We do this always. We stop if we reach the end of the argument, the last FP register, or the last argument slot. */ - byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + byte_size = arg.promoted_size_in_bytes (); args_byte_size = int_regs * UNITS_PER_WORD; offset = 0; for (; (offset < byte_size && fp_regs < MAX_ARGUMENT_SLOTS @@ -4869,31 +4866,31 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, else if (gr_size > UNITS_PER_WORD) int_regs += gr_size / UNITS_PER_WORD; } - return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); + return gen_rtx_PARALLEL (arg.mode, gen_rtvec_v (i, loc)); } /* Integral and aggregates go in general registers. If we have run out of FR registers, then FP values must also go in general registers. This can happen when we have a SFmode HFA. */ - else if (mode == TFmode || mode == TCmode - || (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS)) + else if (arg.mode == TFmode || arg.mode == TCmode + || !FLOAT_MODE_P (arg.mode) + || cum->fp_regs == MAX_ARGUMENT_SLOTS) { - int byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + int byte_size = arg.promoted_size_in_bytes (); if (BYTES_BIG_ENDIAN - && (mode == BLKmode || (type && AGGREGATE_TYPE_P (type))) - && byte_size < UNITS_PER_WORD - && byte_size > 0) + && (arg.mode == BLKmode || arg.aggregate_type_p ()) + && byte_size < UNITS_PER_WORD + && byte_size > 0) { rtx gr_reg = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (DImode, (basereg + cum->words + offset)), const0_rtx); - return gen_rtx_PARALLEL (mode, gen_rtvec (1, gr_reg)); + return gen_rtx_PARALLEL (arg.mode, gen_rtvec (1, gr_reg)); } else - return gen_rtx_REG (mode, basereg + cum->words + offset); + return gen_rtx_REG (arg.mode, basereg + cum->words + offset); } @@ -4901,19 +4898,19 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, named, and in a GR register when unnamed. */ else if (cum->prototype) { - if (named) - return gen_rtx_REG (mode, FR_ARG_FIRST + cum->fp_regs); + if (arg.named) + return gen_rtx_REG (arg.mode, FR_ARG_FIRST + cum->fp_regs); /* In big-endian mode, an anonymous SFmode value must be represented as (parallel:SF [(expr_list (reg:DI n) (const_int 0))]) to force the value into the high half of the general register. */ - else if (BYTES_BIG_ENDIAN && mode == SFmode) - return gen_rtx_PARALLEL (mode, + else if (BYTES_BIG_ENDIAN && arg.mode == SFmode) + return gen_rtx_PARALLEL (arg.mode, gen_rtvec (1, gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (DImode, basereg + cum->words + offset), const0_rtx))); else - return gen_rtx_REG (mode, basereg + cum->words + offset); + return gen_rtx_REG (arg.mode, basereg + cum->words + offset); } /* If there is no prototype, then FP values go in both FR and GR registers. */ @@ -4921,10 +4918,10 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, { /* See comment above. */ machine_mode inner_mode = - (BYTES_BIG_ENDIAN && mode == SFmode) ? DImode : mode; + (BYTES_BIG_ENDIAN && arg.mode == SFmode) ? DImode : arg.mode; rtx fp_reg = gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (mode, (FR_ARG_FIRST + gen_rtx_REG (arg.mode, (FR_ARG_FIRST + cum->fp_regs)), const0_rtx); rtx gr_reg = gen_rtx_EXPR_LIST (VOIDmode, @@ -4933,27 +4930,25 @@ ia64_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, + offset)), const0_rtx); - return gen_rtx_PARALLEL (mode, gen_rtvec (2, fp_reg, gr_reg)); + return gen_rtx_PARALLEL (arg.mode, gen_rtvec (2, fp_reg, gr_reg)); } } /* Implement TARGET_FUNCION_ARG target hook. */ static rtx -ia64_function_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +ia64_function_arg (cumulative_args_t cum, const function_arg_info &arg) { - return ia64_function_arg_1 (cum, mode, type, named, false); + return ia64_function_arg_1 (cum, arg, false); } /* Implement TARGET_FUNCION_INCOMING_ARG target hook. */ static rtx ia64_function_incoming_arg (cumulative_args_t cum, - machine_mode mode, - const_tree type, bool named) + const function_arg_info &arg) { - return ia64_function_arg_1 (cum, mode, type, named, true); + return ia64_function_arg_1 (cum, arg, true); } /* Return number of bytes, at the beginning of the argument, that must be @@ -4961,13 +4956,12 @@ ia64_function_incoming_arg (cumulative_args_t cum, in memory. */ static int -ia64_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +ia64_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int words = ia64_function_arg_words (type, mode); - int offset = ia64_function_arg_offset (cum, type, words); + int words = ia64_function_arg_words (arg.type, arg.mode); + int offset = ia64_function_arg_offset (cum, arg.type, words); /* If all argument slots are used, then it must go on the stack. */ if (cum->words + offset >= MAX_ARGUMENT_SLOTS) @@ -5004,12 +4998,12 @@ ia64_arg_type (machine_mode mode) ia64_function_arg. */ static void -ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +ia64_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int words = ia64_function_arg_words (type, mode); - int offset = ia64_function_arg_offset (cum, type, words); + int words = ia64_function_arg_words (arg.type, arg.mode); + int offset = ia64_function_arg_offset (cum, arg.type, words); machine_mode hfa_mode = VOIDmode; /* If all arg slots are already full, then there is nothing to do. */ @@ -5019,7 +5013,7 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, return; } - cum->atypes[cum->words] = ia64_arg_type (mode); + cum->atypes[cum->words] = ia64_arg_type (arg.mode); cum->words += words + offset; /* On OpenVMS argument is either in Rn or Fn. */ @@ -5031,12 +5025,12 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, } /* Check for and handle homogeneous FP aggregates. */ - if (type) - hfa_mode = hfa_element_mode (type, 0); + if (arg.type) + hfa_mode = hfa_element_mode (arg.type, 0); /* Unnamed prototyped hfas are passed as usual. Named prototyped hfas and unprototyped hfas are passed specially. */ - if (hfa_mode != VOIDmode && (! cum->prototype || named)) + if (hfa_mode != VOIDmode && (! cum->prototype || arg.named)) { int fp_regs = cum->fp_regs; /* This is the original value of cum->words + offset. */ @@ -5055,8 +5049,7 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, /* Fill the FP regs. We do this always. We stop if we reach the end of the argument, the last FP register, or the last argument slot. */ - byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + byte_size = arg.promoted_size_in_bytes (); args_byte_size = int_regs * UNITS_PER_WORD; offset = 0; for (; (offset < byte_size && fp_regs < MAX_ARGUMENT_SLOTS @@ -5073,26 +5066,29 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, /* Integral and aggregates go in general registers. So do TFmode FP values. If we have run out of FR registers, then other FP values must also go in general registers. This can happen when we have a SFmode HFA. */ - else if (mode == TFmode || mode == TCmode - || (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS)) + else if (arg.mode == TFmode || arg.mode == TCmode + || !FLOAT_MODE_P (arg.mode) + || cum->fp_regs == MAX_ARGUMENT_SLOTS) cum->int_regs = cum->words; /* If there is a prototype, then FP values go in a FR register when named, and in a GR register when unnamed. */ else if (cum->prototype) { - if (! named) + if (! arg.named) cum->int_regs = cum->words; else /* ??? Complex types should not reach here. */ - cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1); + cum->fp_regs + += (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT ? 2 : 1); } /* If there is no prototype, then FP values go in both FR and GR registers. */ else { /* ??? Complex types should not reach here. */ - cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1); + cum->fp_regs + += (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT ? 2 : 1); cum->int_regs = cum->words; } } @@ -5147,7 +5143,7 @@ ia64_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, gimple_seq *post_p) { /* Variable sized types are passed by reference. */ - if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) + if (pass_va_arg_by_reference (type)) { tree ptrtype = build_pointer_type (type); tree addr = std_gimplify_va_arg_expr (valist, ptrtype, pre_p, post_p); diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index ad21f1c..59c5132 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -152,21 +152,21 @@ static void iq2000_init_builtins (void); static rtx iq2000_expand_builtin (tree, rtx, rtx, machine_mode, int); static bool iq2000_return_in_memory (const_tree, const_tree); static void iq2000_setup_incoming_varargs (cumulative_args_t, - machine_mode, tree, int *, - int); + const function_arg_info &, + int *, int); static bool iq2000_rtx_costs (rtx, machine_mode, int, int, int *, bool); static int iq2000_address_cost (rtx, machine_mode, addr_space_t, bool); static section *iq2000_select_section (tree, int, unsigned HOST_WIDE_INT); static rtx iq2000_legitimize_address (rtx, rtx, machine_mode); -static bool iq2000_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); -static int iq2000_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); +static bool iq2000_pass_by_reference (cumulative_args_t, + const function_arg_info &); +static int iq2000_arg_partial_bytes (cumulative_args_t, + const function_arg_info &arg); static rtx iq2000_function_arg (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static void iq2000_function_arg_advance (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static pad_direction iq2000_function_arg_padding (machine_mode, const_tree); static unsigned int iq2000_function_arg_boundary (machine_mode, const_tree); @@ -1153,12 +1153,11 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, } } -/* Advance the argument of type TYPE and mode MODE to the next argument - position in CUM. */ +/* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void -iq2000_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +iq2000_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -1167,29 +1166,29 @@ iq2000_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, fprintf (stderr, "function_adv({gp reg found = %d, arg # = %2d, words = %2d}, %4s, ", cum->gp_reg_found, cum->arg_number, cum->arg_words, - GET_MODE_NAME (mode)); - fprintf (stderr, "%p", (const void *) type); - fprintf (stderr, ", %d )\n\n", named); + GET_MODE_NAME (arg.mode)); + fprintf (stderr, "%p", (const void *) arg.type); + fprintf (stderr, ", %d )\n\n", arg.named); } cum->arg_number++; - switch (mode) + switch (arg.mode) { case E_VOIDmode: break; default: - gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT - || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); + gcc_assert (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT); cum->gp_reg_found = 1; - cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) + cum->arg_words += ((GET_MODE_SIZE (arg.mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); break; case E_BLKmode: cum->gp_reg_found = 1; - cum->arg_words += ((int_size_in_bytes (type) + UNITS_PER_WORD - 1) + cum->arg_words += ((int_size_in_bytes (arg.type) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); break; @@ -1224,14 +1223,15 @@ iq2000_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, } } -/* Return an RTL expression containing the register for the given mode MODE - and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */ +/* Return an RTL expression containing the register for argument ARG in CUM, + or 0 if the argument is to be passed on the stack. */ static rtx -iq2000_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +iq2000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + tree type = arg.type; + machine_mode mode = arg.mode; rtx ret; int regbase = -1; int bias = 0; @@ -1248,7 +1248,7 @@ iq2000_function_arg (cumulative_args_t cum_v, machine_mode mode, cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode)); fprintf (stderr, "%p", (const void *) type); - fprintf (stderr, ", %d ) = ", named); + fprintf (stderr, ", %d ) = ", arg.named); } @@ -1306,7 +1306,7 @@ iq2000_function_arg (cumulative_args_t cum_v, machine_mode mode, gcc_assert (regbase != -1); if (! type || TREE_CODE (type) != RECORD_TYPE - || ! named || ! TYPE_SIZE_UNIT (type) + || ! arg.named || ! TYPE_SIZE_UNIT (type) || ! tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))) ret = gen_rtx_REG (mode, regbase + *arg_words + bias); else @@ -1378,11 +1378,11 @@ iq2000_function_arg (cumulative_args_t cum_v, machine_mode mode, struct_p ? ", [struct]" : ""); } - /* We will be called with a mode of VOIDmode after the last argument + /* We will be called with an end marker after the last argument has been seen. Whatever we return will be passed to the call insn. If we need any shifts for small structures, return them in a PARALLEL. */ - if (mode == VOIDmode) + if (arg.end_marker_p ()) { if (cum->num_adjusts > 0) ret = gen_rtx_PARALLEL ((machine_mode) cum->fp_code, @@ -1421,13 +1421,12 @@ iq2000_function_arg_boundary (machine_mode mode, const_tree type) } static int -iq2000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +iq2000_arg_partial_bytes (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1) + if (arg.mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1) { if (TARGET_DEBUG_D_MODE) fprintf (stderr, "iq2000_arg_partial_bytes=%d\n", UNITS_PER_WORD); @@ -1968,11 +1967,10 @@ iq2000_expand_prologue (void) passed_mode = Pmode; } - entry_parm = iq2000_function_arg (args_so_far, passed_mode, - passed_type, true); + function_arg_info arg (passed_type, passed_mode, /*named=*/true); + entry_parm = iq2000_function_arg (args_so_far, arg); - iq2000_function_arg_advance (args_so_far, passed_mode, - passed_type, true); + iq2000_function_arg_advance (args_so_far, arg); next_arg = DECL_CHAIN (cur_arg); if (entry_parm && store_args_on_stack) @@ -2014,8 +2012,8 @@ iq2000_expand_prologue (void) iq2000_unction_arg has encoded a PARALLEL rtx, holding a vector of adjustments to be made as the next_arg_reg variable, so we split up the insns, and emit them separately. */ - next_arg_reg = iq2000_function_arg (args_so_far, VOIDmode, - void_type_node, true); + next_arg_reg = iq2000_function_arg (args_so_far, + function_arg_info::end_marker ()); if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL) { rtvec adjust = XVEC (next_arg_reg, 0); @@ -2293,8 +2291,8 @@ iq2000_function_value_regno_p (const unsigned int regno) /* Return true when an argument must be passed by reference. */ static bool -iq2000_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +iq2000_pass_by_reference (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int size; @@ -2302,7 +2300,7 @@ iq2000_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, /* We must pass by reference if we would be both passing in registers and the stack. This is because any subsequent partial arg would be handled incorrectly in this case. */ - if (cum && targetm.calls.must_pass_in_stack (mode, type)) + if (cum && targetm.calls.must_pass_in_stack (arg)) { /* Don't pass the actual CUM to FUNCTION_ARG, because we would get double copies of any offsets generated for small structs @@ -2310,15 +2308,14 @@ iq2000_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, CUMULATIVE_ARGS temp; temp = *cum; - if (iq2000_function_arg (pack_cumulative_args (&temp), mode, type, named) - != 0) + if (iq2000_function_arg (pack_cumulative_args (&temp), arg) != 0) return 1; } - if (type == NULL_TREE || mode == DImode || mode == DFmode) + if (arg.type == NULL_TREE || arg.mode == DImode || arg.mode == DFmode) return 0; - size = int_size_in_bytes (type); + size = int_size_in_bytes (arg.type); return size == -1 || size > UNITS_PER_WORD; } @@ -2895,9 +2892,8 @@ iq2000_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) static void iq2000_setup_incoming_varargs (cumulative_args_t cum_v, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, int * pretend_size, - int no_rtl) + const function_arg_info &, + int *pretend_size, int no_rtl) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); unsigned int iq2000_off = ! cum->last_arg_fp; diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c index 7ed9ac0..267ff27 100644 --- a/gcc/config/lm32/lm32.c +++ b/gcc/config/lm32/lm32.c @@ -64,7 +64,7 @@ static void expand_save_restore (struct lm32_frame_info *info, int op); static void stack_adjust (HOST_WIDE_INT amount); static bool lm32_in_small_data_p (const_tree); static void lm32_setup_incoming_varargs (cumulative_args_t cum, - machine_mode mode, tree type, + const function_arg_info &, int *pretend_size, int no_rtl); static bool lm32_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno, int *total, bool speed); @@ -73,12 +73,9 @@ static bool lm32_legitimate_address_p (machine_mode mode, rtx x, bool strict); static HOST_WIDE_INT lm32_compute_frame_size (int size); static void lm32_option_override (void); -static rtx lm32_function_arg (cumulative_args_t cum, - machine_mode mode, const_tree type, - bool named); +static rtx lm32_function_arg (cumulative_args_t, const function_arg_info &); static void lm32_function_arg_advance (cumulative_args_t cum, - machine_mode mode, - const_tree type, bool named); + const function_arg_info &); static bool lm32_hard_regno_mode_ok (unsigned int, machine_mode); static bool lm32_modes_tieable_p (machine_mode, machine_mode); static HOST_WIDE_INT lm32_starting_frame_offset (void); @@ -619,39 +616,34 @@ lm32_print_operand_address (FILE * file, rtx addr) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ static rtx -lm32_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +lm32_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (mode == VOIDmode) + if (arg.end_marker_p ()) /* Compute operand 2 of the call insn. */ return GEN_INT (0); - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return NULL_RTX; - if (!named || (*cum + LM32_NUM_REGS2 (mode, type) > LM32_NUM_ARG_REGS)) + if (!arg.named + || *cum + LM32_NUM_REGS2 (arg.mode, arg.type) > LM32_NUM_ARG_REGS) return NULL_RTX; - return gen_rtx_REG (mode, *cum + LM32_FIRST_ARG_REG); + return gen_rtx_REG (arg.mode, *cum + LM32_FIRST_ARG_REG); } static void -lm32_function_arg_advance (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +lm32_function_arg_advance (cumulative_args_t cum, + const function_arg_info &arg) { - *get_cumulative_args (cum) += LM32_NUM_REGS2 (mode, type); + *get_cumulative_args (cum) += LM32_NUM_REGS2 (arg.mode, arg.type); } HOST_WIDE_INT @@ -684,8 +676,9 @@ lm32_compute_initial_elimination_offset (int from, int to) } static void -lm32_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode, - tree type, int *pretend_size, int no_rtl) +lm32_setup_incoming_varargs (cumulative_args_t cum_v, + const function_arg_info &arg, + int *pretend_size, int no_rtl) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int first_anon_arg; @@ -702,12 +695,7 @@ lm32_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode, registers, if any used in passing this named paramter in order to determine which is the first registers used to pass anonymous arguments. */ - int size; - - if (mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); + int size = arg.promoted_size_in_bytes (); first_anon_arg = *cum + LM32_FIRST_ARG_REG + diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index d0d24bb..ace00e0 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -76,12 +76,11 @@ static struct machine_function *m32c_init_machine_status (void); static void m32c_insert_attributes (tree, tree *); static bool m32c_legitimate_address_p (machine_mode, rtx, bool); static bool m32c_addr_space_legitimate_address_p (machine_mode, rtx, bool, addr_space_t); -static rtx m32c_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static bool m32c_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); -static void m32c_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static rtx m32c_function_arg (cumulative_args_t, const function_arg_info &); +static bool m32c_pass_by_reference (cumulative_args_t, + const function_arg_info &); +static void m32c_function_arg_advance (cumulative_args_t, + const function_arg_info &); static unsigned int m32c_function_arg_boundary (machine_mode, const_tree); static int m32c_pushm_popm (Push_Pop_Type); static bool m32c_strict_argument_naming (cumulative_args_t); @@ -1320,8 +1319,7 @@ m32c_push_rounding (poly_int64 n) #undef TARGET_FUNCTION_ARG #define TARGET_FUNCTION_ARG m32c_function_arg static rtx -m32c_function_arg (cumulative_args_t ca_v, - machine_mode mode, const_tree type, bool named) +m32c_function_arg (cumulative_args_t ca_v, const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v); @@ -1329,38 +1327,38 @@ m32c_function_arg (cumulative_args_t ca_v, rtx rv = NULL_RTX; #if DEBUG0 fprintf (stderr, "func_arg %d (%s, %d)\n", - ca->parm_num, mode_name[mode], named); - debug_tree ((tree)type); + ca->parm_num, mode_name[arg.mode], arg.named); + debug_tree (arg.type); #endif - if (mode == VOIDmode) + if (arg.end_marker_p ()) return GEN_INT (0); - if (ca->force_mem || !named) + if (ca->force_mem || !arg.named) { #if DEBUG0 fprintf (stderr, "func arg: force %d named %d, mem\n", ca->force_mem, - named); + arg.named); #endif return NULL_RTX; } - if (type && INTEGRAL_TYPE_P (type) && POINTER_TYPE_P (type)) + if (arg.type && INTEGRAL_TYPE_P (arg.type) && POINTER_TYPE_P (arg.type)) return NULL_RTX; - if (type && AGGREGATE_TYPE_P (type)) + if (arg.aggregate_type_p ()) return NULL_RTX; switch (ca->parm_num) { case 1: - if (GET_MODE_SIZE (mode) == 1 || GET_MODE_SIZE (mode) == 2) - rv = gen_rtx_REG (mode, TARGET_A16 ? R1_REGNO : R0_REGNO); + if (GET_MODE_SIZE (arg.mode) == 1 || GET_MODE_SIZE (arg.mode) == 2) + rv = gen_rtx_REG (arg.mode, TARGET_A16 ? R1_REGNO : R0_REGNO); break; case 2: - if (TARGET_A16 && GET_MODE_SIZE (mode) == 2) - rv = gen_rtx_REG (mode, R2_REGNO); + if (TARGET_A16 && GET_MODE_SIZE (arg.mode) == 2) + rv = gen_rtx_REG (arg.mode, R2_REGNO); break; } @@ -1373,10 +1371,7 @@ m32c_function_arg (cumulative_args_t ca_v, #undef TARGET_PASS_BY_REFERENCE #define TARGET_PASS_BY_REFERENCE m32c_pass_by_reference static bool -m32c_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +m32c_pass_by_reference (cumulative_args_t, const function_arg_info &) { return 0; } @@ -1404,9 +1399,7 @@ m32c_init_cumulative_args (CUMULATIVE_ARGS * ca, #define TARGET_FUNCTION_ARG_ADVANCE m32c_function_arg_advance static void m32c_function_arg_advance (cumulative_args_t ca_v, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) + const function_arg_info &) { CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v); diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index ac18aa2..52a1e26 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -86,19 +86,19 @@ static bool m32r_return_in_memory (const_tree, const_tree); static rtx m32r_function_value (const_tree, const_tree, bool); static rtx m32r_libcall_value (machine_mode, const_rtx); static bool m32r_function_value_regno_p (const unsigned int); -static void m32r_setup_incoming_varargs (cumulative_args_t, machine_mode, - tree, int *, int); +static void m32r_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, + int *, int); static void init_idents (void); static bool m32r_rtx_costs (rtx, machine_mode, int, int, int *, bool speed); static int m32r_memory_move_cost (machine_mode, reg_class_t, bool); -static bool m32r_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); -static int m32r_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static rtx m32r_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static void m32r_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static bool m32r_pass_by_reference (cumulative_args_t, + const function_arg_info &arg); +static int m32r_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +static rtx m32r_function_arg (cumulative_args_t, const function_arg_info &); +static void m32r_function_arg_advance (cumulative_args_t, + const function_arg_info &); static bool m32r_can_eliminate (const int, const int); static void m32r_conditional_register_usage (void); static void m32r_trampoline_init (rtx, tree, rtx); @@ -680,20 +680,12 @@ memreg_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED) return MEM_P (op) && REG_P (XEXP (op, 0)); } -/* Return nonzero if TYPE must be passed by indirect reference. */ +/* Return nonzero if ARG must be passed by indirect reference. */ static bool -m32r_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +m32r_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - int size; - - if (type) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + int size = arg.type_size_in_bytes (); return (size < 0 || size > 8); } @@ -1164,17 +1156,13 @@ gen_split_move_double (rtx operands[]) static int -m32r_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +m32r_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int words; unsigned int size = - (((mode == BLKmode && type) - ? (unsigned int) int_size_in_bytes (type) - : GET_MODE_SIZE (mode)) + UNITS_PER_WORD - 1) - / UNITS_PER_WORD; + (arg.promoted_size_in_bytes () + UNITS_PER_WORD - 1) / UNITS_PER_WORD; if (*cum >= M32R_MAX_PARM_REGS) words = 0; @@ -1212,41 +1200,33 @@ m32r_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ /* On the M32R the first M32R_MAX_PARM_REGS args are normally in registers and the rest are pushed. */ static rtx -m32r_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +m32r_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - return (PASS_IN_REG_P (*cum, mode, type) - ? gen_rtx_REG (mode, ROUND_ADVANCE_CUM (*cum, mode, type)) + return (PASS_IN_REG_P (*cum, arg.mode, arg.type) + ? gen_rtx_REG (arg.mode, + ROUND_ADVANCE_CUM (*cum, arg.mode, arg.type)) : NULL_RTX); } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -m32r_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +m32r_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum = (ROUND_ADVANCE_CUM (*cum, mode, type) - + ROUND_ADVANCE_ARG (mode, type)); + *cum = (ROUND_ADVANCE_CUM (*cum, arg.mode, arg.type) + + ROUND_ADVANCE_ARG (arg.mode, arg.type)); } /* Worker function for TARGET_RETURN_IN_MEMORY. */ @@ -1255,8 +1235,8 @@ static bool m32r_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) { cumulative_args_t dummy = pack_cumulative_args (NULL); - - return m32r_pass_by_reference (dummy, TYPE_MODE (type), type, false); + function_arg_info arg (const_cast<tree> (type), /*named=*/false); + return m32r_pass_by_reference (dummy, arg); } /* Worker function for TARGET_FUNCTION_VALUE. */ @@ -1292,12 +1272,13 @@ m32r_function_value_regno_p (const unsigned int regno) create a register parameter block, and then copy any anonymous arguments in registers to memory. - CUM has not been updated for the last named argument which has type TYPE - and mode MODE, and we rely on this fact. */ + CUM has not been updated for the last named argument (which is given + by ARG), and we rely on this fact. */ static void -m32r_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size, int no_rtl) +m32r_setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size, int no_rtl) { int first_anon_arg; @@ -1305,10 +1286,11 @@ m32r_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, return; /* All BLKmode values are passed by reference. */ - gcc_assert (mode != BLKmode); + gcc_assert (arg.mode != BLKmode); - first_anon_arg = (ROUND_ADVANCE_CUM (*get_cumulative_args (cum), mode, type) - + ROUND_ADVANCE_ARG (mode, type)); + first_anon_arg = (ROUND_ADVANCE_CUM (*get_cumulative_args (cum), + arg.mode, arg.type) + + ROUND_ADVANCE_ARG (arg.mode, arg.type)); if (first_anon_arg < M32R_MAX_PARM_REGS) { diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index ca89f37..70f3e5c 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -181,10 +181,9 @@ static void m68k_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; static void m68k_trampoline_init (rtx, tree, rtx); static poly_int64 m68k_return_pops_args (tree, tree, poly_int64); static rtx m68k_delegitimize_address (rtx); -static void m68k_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx m68k_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static void m68k_function_arg_advance (cumulative_args_t, + const function_arg_info &); +static rtx m68k_function_arg (cumulative_args_t, const function_arg_info &); static bool m68k_cannot_force_const_mem (machine_mode mode, rtx x); static bool m68k_output_addr_const_extra (FILE *, rtx); static void m68k_init_sync_libfuncs (void) ATTRIBUTE_UNUSED; @@ -1464,23 +1463,18 @@ m68k_ok_for_sibcall_p (tree decl, tree exp) /* On the m68k all args are always pushed. */ static rtx -m68k_function_arg (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +m68k_function_arg (cumulative_args_t, const function_arg_info &) { return NULL_RTX; } static void -m68k_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +m68k_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum += (mode != BLKmode - ? (GET_MODE_SIZE (mode) + 3) & ~3 - : (int_size_in_bytes (type) + 3) & ~3); + *cum += (arg.promoted_size_in_bytes () + 3) & ~3; } /* Convert X to a legitimate function call memory reference and return the diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index 06f093e..b259da5 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -99,7 +99,9 @@ static int calc_live_regs (int *); static int try_constant_tricks (HOST_WIDE_INT, HOST_WIDE_INT *, HOST_WIDE_INT *); static const char * output_inline_const (machine_mode, rtx *); static void layout_mcore_frame (struct mcore_frame *); -static void mcore_setup_incoming_varargs (cumulative_args_t, machine_mode, tree, int *, int); +static void mcore_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, + int *, int); static cond_type is_cond_candidate (rtx); static rtx_insn *emit_new_cond_insn (rtx_insn *, int); static rtx_insn *conditionalize_block (rtx_insn *); @@ -129,14 +131,11 @@ static bool mcore_rtx_costs (rtx, machine_mode, int, int, static void mcore_external_libcall (rtx); static bool mcore_return_in_memory (const_tree, const_tree); static int mcore_arg_partial_bytes (cumulative_args_t, - machine_mode, - tree, bool); + const function_arg_info &); static rtx mcore_function_arg (cumulative_args_t, - machine_mode, - const_tree, bool); + const function_arg_info &); static void mcore_function_arg_advance (cumulative_args_t, - machine_mode, - const_tree, bool); + const function_arg_info &); static unsigned int mcore_function_arg_boundary (machine_mode, const_tree); static void mcore_asm_trampoline_template (FILE *); @@ -1943,7 +1942,7 @@ mcore_initial_elimination_offset (int from, int to) static void mcore_setup_incoming_varargs (cumulative_args_t args_so_far_v, - machine_mode mode, tree type, + const function_arg_info &arg, int * ptr_pretend_size ATTRIBUTE_UNUSED, int second_time ATTRIBUTE_UNUSED) { @@ -1954,7 +1953,8 @@ mcore_setup_incoming_varargs (cumulative_args_t args_so_far_v, /* We need to know how many argument registers are used before the varargs start, so that we can push the remaining argument registers during the prologue. */ - number_of_regs_before_varargs = *args_so_far + mcore_num_arg_regs (mode, type); + number_of_regs_before_varargs + = *args_so_far + mcore_num_arg_regs (arg.mode, arg.type); /* There is a bug somewhere in the arg handling code. Until I can find it this workaround always pushes the @@ -2713,7 +2713,8 @@ mcore_num_arg_regs (machine_mode mode, const_tree type) { int size; - if (targetm.calls.must_pass_in_stack (mode, type)) + function_arg_info arg (const_cast<tree> (type), mode, /*named=*/true); + if (targetm.calls.must_pass_in_stack (arg)) return 0; if (type && mode == BLKmode) @@ -2786,14 +2787,9 @@ mcore_function_value (const_tree valtype, const_tree func) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. On MCore the first args are normally in registers and the rest are pushed. Any arg that starts within the first @@ -2801,33 +2797,33 @@ mcore_function_value (const_tree valtype, const_tree func) its data type forbids. */ static rtx -mcore_function_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +mcore_function_arg (cumulative_args_t cum, const function_arg_info &arg) { int arg_reg; - if (! named || mode == VOIDmode) + if (!arg.named || arg.end_marker_p ()) return 0; - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return 0; - arg_reg = ROUND_REG (*get_cumulative_args (cum), mode); + arg_reg = ROUND_REG (*get_cumulative_args (cum), arg.mode); if (arg_reg < NPARM_REGS) - return handle_structs_in_regs (mode, type, FIRST_PARM_REG + arg_reg); + return handle_structs_in_regs (arg.mode, arg.type, + FIRST_PARM_REG + arg_reg); return 0; } static void -mcore_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +mcore_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum = (ROUND_REG (*cum, mode) - + (int)named * mcore_num_arg_regs (mode, type)); + *cum = (ROUND_REG (*cum, arg.mode) + + (int) arg.named * mcore_num_arg_regs (arg.mode, arg.type)); } static unsigned int @@ -2841,22 +2837,19 @@ mcore_function_arg_boundary (machine_mode mode, } /* Returns the number of bytes of argument registers required to hold *part* - of a parameter of machine mode MODE and type TYPE (which may be NULL if - the type is not known). If the argument fits entirely in the argument - registers, or entirely on the stack, then 0 is returned. CUM is the - number of argument registers already used by earlier parameters to - the function. */ + of argument ARG. If the argument fits entirely in the argument registers, + or entirely on the stack, then 0 is returned. CUM is the number of + argument registers already used by earlier parameters to the function. */ static int -mcore_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, - tree type, bool named) +mcore_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg) { - int reg = ROUND_REG (*get_cumulative_args (cum), mode); + int reg = ROUND_REG (*get_cumulative_args (cum), arg.mode); - if (named == 0) + if (!arg.named) return 0; - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return 0; /* REG is not the *hardware* register number of the register that holds @@ -2871,7 +2864,7 @@ mcore_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, return 0; /* If the argument fits entirely in registers, return 0. */ - if (reg + mcore_num_arg_regs (mode, type) <= NPARM_REGS) + if (reg + mcore_num_arg_regs (arg.mode, arg.type) <= NPARM_REGS) return 0; /* The argument overflows the number of available argument registers. diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index c2cbe3b..3d0f593 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -1543,29 +1543,28 @@ init_cumulative_args (CUMULATIVE_ARGS * cum, tree fntype, static void microblaze_function_arg_advance (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); cum->arg_number++; - switch (mode) + switch (arg.mode) { case E_VOIDmode: break; default: - gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT - || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); + gcc_assert (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT); cum->gp_reg_found = 1; - cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) + cum->arg_words += ((GET_MODE_SIZE (arg.mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); break; case E_BLKmode: cum->gp_reg_found = 1; - cum->arg_words += ((int_size_in_bytes (type) + UNITS_PER_WORD - 1) + cum->arg_words += ((int_size_in_bytes (arg.type) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); break; @@ -1596,13 +1595,11 @@ microblaze_function_arg_advance (cumulative_args_t cum_v, } } -/* Return an RTL expression containing the register for the given mode, +/* Return an RTL expression containing the register for the given argument or 0 if the argument is to be passed on the stack. */ static rtx -microblaze_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +microblaze_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -1611,7 +1608,7 @@ microblaze_function_arg (cumulative_args_t cum_v, machine_mode mode, int *arg_words = &cum->arg_words; cum->last_arg_fp = 0; - switch (mode) + switch (arg.mode) { case E_SFmode: case E_DFmode: @@ -1624,8 +1621,8 @@ microblaze_function_arg (cumulative_args_t cum_v, machine_mode mode, regbase = GP_ARG_FIRST; break; default: - gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT - || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); + gcc_assert (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT); /* FALLTHRU */ case E_BLKmode: regbase = GP_ARG_FIRST; @@ -1638,10 +1635,10 @@ microblaze_function_arg (cumulative_args_t cum_v, machine_mode mode, { gcc_assert (regbase != -1); - ret = gen_rtx_REG (mode, regbase + *arg_words); + ret = gen_rtx_REG (arg.mode, regbase + *arg_words); } - if (mode == VOIDmode) + if (arg.end_marker_p ()) { if (cum->num_adjusts > 0) ret = gen_rtx_PARALLEL ((machine_mode) cum->fp_code, @@ -1653,30 +1650,25 @@ microblaze_function_arg (cumulative_args_t cum_v, machine_mode mode, /* Return number of bytes of argument to put in registers. */ static int -function_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +function_arg_partial_bytes (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if ((mode == BLKmode - || GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - || GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) + if ((arg.mode == BLKmode + || GET_MODE_CLASS (arg.mode) != MODE_COMPLEX_INT + || GET_MODE_CLASS (arg.mode) != MODE_COMPLEX_FLOAT) && cum->arg_words < MAX_ARGS_IN_REGISTERS) { - int words; - if (mode == BLKmode) - words = ((int_size_in_bytes (type) + UNITS_PER_WORD - 1) - / UNITS_PER_WORD); - else - words = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; - + int words = ((arg.promoted_size_in_bytes () + UNITS_PER_WORD - 1) + / UNITS_PER_WORD); if (words + cum->arg_words <= MAX_ARGS_IN_REGISTERS) return 0; /* structure fits in registers */ return (MAX_ARGS_IN_REGISTERS - cum->arg_words) * UNITS_PER_WORD; } - else if (mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1) + else if (arg.mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1) return UNITS_PER_WORD; return 0; @@ -2921,8 +2913,8 @@ microblaze_expand_prologue (void) passed_mode = Pmode; } - entry_parm = targetm.calls.function_arg (args_so_far, passed_mode, - passed_type, true); + function_arg_info arg (passed_type, passed_mode, /*named=*/true); + entry_parm = targetm.calls.function_arg (args_so_far, arg); if (entry_parm) { @@ -2942,8 +2934,7 @@ microblaze_expand_prologue (void) break; } - targetm.calls.function_arg_advance (args_so_far, passed_mode, - passed_type, true); + targetm.calls.function_arg_advance (args_so_far, arg); next_arg = TREE_CHAIN (cur_arg); if (next_arg == 0) @@ -2957,8 +2948,8 @@ microblaze_expand_prologue (void) /* Split parallel insn into a sequence of insns. */ - next_arg_reg = targetm.calls.function_arg (args_so_far, VOIDmode, - void_type_node, true); + next_arg_reg = targetm.calls.function_arg (args_so_far, + function_arg_info::end_marker ()); if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL) { rtvec adjust = XVEC (next_arg_reg, 0); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 45ddec1..c24dc71 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -5976,17 +5976,16 @@ mips_strict_argument_naming (cumulative_args_t ca ATTRIBUTE_UNUSED) /* Implement TARGET_FUNCTION_ARG. */ static rtx -mips_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +mips_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); struct mips_arg_info info; - /* We will be called with a mode of VOIDmode after the last argument + /* We will be called with an end marker after the last argument has been seen. Whatever we return will be passed to the call expander. If we need a MIPS16 fp_code, return a REG with the code stored as the mode. */ - if (mode == VOIDmode) + if (arg.end_marker_p ()) { if (TARGET_MIPS16 && cum->fp_code != 0) return gen_rtx_REG ((machine_mode) cum->fp_code, 0); @@ -5994,7 +5993,7 @@ mips_function_arg (cumulative_args_t cum_v, machine_mode mode, return NULL; } - mips_get_arg_info (&info, cum, mode, type, named); + mips_get_arg_info (&info, cum, arg.mode, arg.type, arg.named); /* Return straight away if the whole argument is passed on the stack. */ if (info.reg_offset == MAX_ARGS_IN_REGISTERS) @@ -6005,16 +6004,16 @@ mips_function_arg (cumulative_args_t cum_v, machine_mode mode, in a floating-point register. */ if (TARGET_NEWABI && TARGET_HARD_FLOAT - && named - && type != 0 - && TREE_CODE (type) == RECORD_TYPE - && TYPE_SIZE_UNIT (type) - && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))) + && arg.named + && arg.type != 0 + && TREE_CODE (arg.type) == RECORD_TYPE + && TYPE_SIZE_UNIT (arg.type) + && tree_fits_uhwi_p (TYPE_SIZE_UNIT (arg.type))) { tree field; /* First check to see if there is any such field. */ - for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) + for (field = TYPE_FIELDS (arg.type); field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL && SCALAR_FLOAT_TYPE_P (TREE_TYPE (field)) && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD @@ -6033,10 +6032,10 @@ mips_function_arg (cumulative_args_t cum_v, machine_mode mode, /* assign_parms checks the mode of ENTRY_PARM, so we must use the actual mode here. */ - ret = gen_rtx_PARALLEL (mode, rtvec_alloc (info.reg_words)); + ret = gen_rtx_PARALLEL (arg.mode, rtvec_alloc (info.reg_words)); bitpos = 0; - field = TYPE_FIELDS (type); + field = TYPE_FIELDS (arg.type); for (i = 0; i < info.reg_words; i++) { rtx reg; @@ -6069,13 +6068,13 @@ mips_function_arg (cumulative_args_t cum_v, machine_mode mode, and the imaginary part goes in the upper register. */ if (TARGET_NEWABI && info.fpr_p - && GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) + && GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT) { rtx real, imag; machine_mode inner; unsigned int regno; - inner = GET_MODE_INNER (mode); + inner = GET_MODE_INNER (arg.mode); regno = FP_ARG_FIRST + info.reg_offset; if (info.reg_words * UNITS_PER_WORD == GET_MODE_SIZE (inner)) { @@ -6093,23 +6092,23 @@ mips_function_arg (cumulative_args_t cum_v, machine_mode mode, gen_rtx_REG (inner, regno + info.reg_words / 2), GEN_INT (GET_MODE_SIZE (inner))); - return gen_rtx_PARALLEL (mode, gen_rtvec (2, real, imag)); + return gen_rtx_PARALLEL (arg.mode, gen_rtvec (2, real, imag)); } } - return gen_rtx_REG (mode, mips_arg_regno (&info, TARGET_HARD_FLOAT)); + return gen_rtx_REG (arg.mode, mips_arg_regno (&info, TARGET_HARD_FLOAT)); } /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void -mips_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +mips_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); struct mips_arg_info info; - mips_get_arg_info (&info, cum, mode, type, named); + mips_get_arg_info (&info, cum, arg.mode, arg.type, arg.named); if (!info.fpr_p) cum->gp_reg_found = true; @@ -6119,7 +6118,7 @@ mips_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, either the o32 or the o64 ABI, both of which pass at most 2 arguments in FPRs. */ if (cum->arg_number < 2 && info.fpr_p) - cum->fp_code += (mode == SFmode ? 1 : 2) << (cum->arg_number * 2); + cum->fp_code += (arg.mode == SFmode ? 1 : 2) << (cum->arg_number * 2); /* Advance the register count. This has the effect of setting num_gprs to MAX_ARGS_IN_REGISTERS if a doubleword-aligned @@ -6140,12 +6139,12 @@ mips_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, /* Implement TARGET_ARG_PARTIAL_BYTES. */ static int -mips_arg_partial_bytes (cumulative_args_t cum, - machine_mode mode, tree type, bool named) +mips_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg) { struct mips_arg_info info; - mips_get_arg_info (&info, get_cumulative_args (cum), mode, type, named); + mips_get_arg_info (&info, get_cumulative_args (cum), + arg.mode, arg.type, arg.named); return info.stack_words > 0 ? info.reg_words * UNITS_PER_WORD : 0; } @@ -6235,38 +6234,34 @@ mips_pad_reg_upward (machine_mode mode, tree type) /* Return nonzero when an argument must be passed by reference. */ static bool -mips_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +mips_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { if (mips_abi == ABI_EABI) { int size; /* ??? How should SCmode be handled? */ - if (mode == DImode || mode == DFmode - || mode == DQmode || mode == UDQmode - || mode == DAmode || mode == UDAmode) + if (arg.mode == DImode || arg.mode == DFmode + || arg.mode == DQmode || arg.mode == UDQmode + || arg.mode == DAmode || arg.mode == UDAmode) return 0; - size = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + size = arg.type_size_in_bytes (); return size == -1 || size > UNITS_PER_WORD; } else { /* If we have a variable-sized parameter, we have no choice. */ - return targetm.calls.must_pass_in_stack (mode, type); + return targetm.calls.must_pass_in_stack (arg); } } /* Implement TARGET_CALLEE_COPIES. */ static bool -mips_callee_copies (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, bool named) +mips_callee_copies (cumulative_args_t, const function_arg_info &arg) { - return mips_abi == ABI_EABI && named; + return mips_abi == ABI_EABI && arg.named; } /* See whether VALTYPE is a record whose fields should be returned in @@ -6546,9 +6541,9 @@ mips_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED) /* Implement TARGET_SETUP_INCOMING_VARARGS. */ static void -mips_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size ATTRIBUTE_UNUSED, - int no_rtl) +mips_setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) { CUMULATIVE_ARGS local_cum; int gp_saved, fp_saved; @@ -6557,8 +6552,7 @@ mips_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, argument. Advance a local copy of CUM past the last "real" named argument, to find out how many registers are left over. */ local_cum = *get_cumulative_args (cum); - mips_function_arg_advance (pack_cumulative_args (&local_cum), mode, type, - true); + mips_function_arg_advance (pack_cumulative_args (&local_cum), arg); /* Found out how many registers we need to save. */ gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs; @@ -6780,7 +6774,7 @@ mips_std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, unsigned HOST_WIDE_INT align, boundary; bool indirect; - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect = pass_va_arg_by_reference (type); if (indirect) type = build_pointer_type (type); @@ -6867,7 +6861,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, tree addr; bool indirect_p; - indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, 0); + indirect_p = pass_va_arg_by_reference (type); if (indirect_p) type = build_pointer_type (type); @@ -7308,7 +7302,8 @@ mips_output_args_xfer (int fp_code, char direction) else mips_output_64bit_xfer (direction, gparg, fparg); - mips_function_arg_advance (pack_cumulative_args (&cum), mode, NULL, true); + function_arg_info arg (mode, /*named=*/true); + mips_function_arg_advance (pack_cumulative_args (&cum), arg); } } diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 380ecde..8ebb829 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -138,7 +138,7 @@ static void mmix_reorg (void); static void mmix_asm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static void mmix_setup_incoming_varargs - (cumulative_args_t, machine_mode, tree, int *, int); + (cumulative_args_t, const function_arg_info &, int *, int); static void mmix_file_start (void); static void mmix_file_end (void); static void mmix_init_libfuncs (void); @@ -149,19 +149,16 @@ static rtx mmix_struct_value_rtx (tree, int); static machine_mode mmix_promote_function_mode (const_tree, machine_mode, int *, const_tree, int); -static void mmix_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx mmix_function_arg_1 (const cumulative_args_t, machine_mode, - const_tree, bool, bool); -static rtx mmix_function_incoming_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx mmix_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static void mmix_function_arg_advance (cumulative_args_t, + const function_arg_info &); +static rtx mmix_function_incoming_arg (cumulative_args_t, + const function_arg_info &); +static rtx mmix_function_arg (cumulative_args_t, const function_arg_info &); static rtx mmix_function_value (const_tree, const_tree, bool); static rtx mmix_libcall_value (machine_mode, const_rtx); static bool mmix_function_value_regno_p (const unsigned int); static bool mmix_pass_by_reference (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static bool mmix_frame_pointer_required (void); static void mmix_asm_trampoline_template (FILE *); static void mmix_trampoline_init (rtx, tree, rtx); @@ -266,7 +263,7 @@ static HOST_WIDE_INT mmix_starting_frame_offset (void); #undef TARGET_PASS_BY_REFERENCE #define TARGET_PASS_BY_REFERENCE mmix_pass_by_reference #undef TARGET_CALLEE_COPIES -#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_true #undef TARGET_PREFERRED_RELOAD_CLASS #define TARGET_PREFERRED_RELOAD_CLASS mmix_preferred_reload_class @@ -618,13 +615,13 @@ mmix_initial_elimination_offset (int fromreg, int toreg) } static void -mmix_function_arg_advance (cumulative_args_t argsp_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +mmix_function_arg_advance (cumulative_args_t argsp_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *argsp = get_cumulative_args (argsp_v); - int arg_size = MMIX_FUNCTION_ARG_SIZE (mode, type); + int arg_size = MMIX_FUNCTION_ARG_SIZE (arg.mode, arg.type); - argsp->regs = ((targetm.calls.must_pass_in_stack (mode, type) + argsp->regs = ((targetm.calls.must_pass_in_stack (arg) || (arg_size > 8 && !TARGET_LIBFUNC && !argsp->lib)) @@ -636,28 +633,25 @@ mmix_function_arg_advance (cumulative_args_t argsp_v, machine_mode mode, static rtx mmix_function_arg_1 (const cumulative_args_t argsp_v, - machine_mode mode, - const_tree type, - bool named ATTRIBUTE_UNUSED, - bool incoming) + const function_arg_info &arg, bool incoming) { CUMULATIVE_ARGS *argsp = get_cumulative_args (argsp_v); /* Last-argument marker. */ - if (type == void_type_node) + if (arg.end_marker_p ()) return (argsp->regs < MMIX_MAX_ARGS_IN_REGS) - ? gen_rtx_REG (mode, + ? gen_rtx_REG (arg.mode, (incoming ? MMIX_FIRST_INCOMING_ARG_REGNUM : MMIX_FIRST_ARG_REGNUM) + argsp->regs) : NULL_RTX; return (argsp->regs < MMIX_MAX_ARGS_IN_REGS - && !targetm.calls.must_pass_in_stack (mode, type) - && (GET_MODE_BITSIZE (mode) <= 64 + && !targetm.calls.must_pass_in_stack (arg) + && (GET_MODE_BITSIZE (arg.mode) <= 64 || argsp->lib || TARGET_LIBFUNC)) - ? gen_rtx_REG (mode, + ? gen_rtx_REG (arg.mode, (incoming ? MMIX_FIRST_INCOMING_ARG_REGNUM : MMIX_FIRST_ARG_REGNUM) @@ -669,38 +663,33 @@ mmix_function_arg_1 (const cumulative_args_t argsp_v, one that must go on stack. */ static rtx -mmix_function_arg (cumulative_args_t argsp, - machine_mode mode, - const_tree type, - bool named) +mmix_function_arg (cumulative_args_t argsp, const function_arg_info &arg) { - return mmix_function_arg_1 (argsp, mode, type, named, false); + return mmix_function_arg_1 (argsp, arg, false); } static rtx mmix_function_incoming_arg (cumulative_args_t argsp, - machine_mode mode, - const_tree type, - bool named) + const function_arg_info &arg) { - return mmix_function_arg_1 (argsp, mode, type, named, true); + return mmix_function_arg_1 (argsp, arg, true); } /* Returns nonzero for everything that goes by reference, 0 for everything that goes by value. */ static bool -mmix_pass_by_reference (cumulative_args_t argsp_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +mmix_pass_by_reference (cumulative_args_t argsp_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *argsp = get_cumulative_args (argsp_v); /* FIXME: Check: I'm not sure the must_pass_in_stack check is necessary. */ - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return true; - if (MMIX_FUNCTION_ARG_SIZE (mode, type) > 8 + if (MMIX_FUNCTION_ARG_SIZE (arg.mode, arg.type) > 8 && !TARGET_LIBFUNC && (!argsp || !argsp->lib)) return true; @@ -960,8 +949,7 @@ mmix_function_profiler (FILE *stream ATTRIBUTE_UNUSED, static void mmix_setup_incoming_varargs (cumulative_args_t args_so_farp_v, - machine_mode mode, - tree vartype, + const function_arg_info &arg, int *pretend_sizep, int second_time ATTRIBUTE_UNUSED) { @@ -974,7 +962,7 @@ mmix_setup_incoming_varargs (cumulative_args_t args_so_farp_v, /* We assume that one argument takes up one register here. That should be true until we start messing with multi-reg parameters. */ - if ((7 + (MMIX_FUNCTION_ARG_SIZE (mode, vartype))) / 8 != 1) + if ((7 + (MMIX_FUNCTION_ARG_SIZE (arg.mode, arg.type))) / 8 != 1) internal_error ("MMIX Internal: Last named vararg would not fit in a register"); } diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 8fdd1c5..5502d65 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -1526,26 +1526,17 @@ mn10300_va_start (tree valist, rtx nextarg) /* Return true when a parameter should be passed by reference. */ static bool -mn10300_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +mn10300_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - unsigned HOST_WIDE_INT size; - - if (type) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + unsigned HOST_WIDE_INT size = arg.type_size_in_bytes (); return (size > 8 || size == 0); } -/* Return an RTX to represent where a value with mode MODE will be returned - from a function. If the result is NULL_RTX, the argument is pushed. */ +/* Return an RTX to represent where argument ARG will be passed to a function. + If the result is NULL_RTX, the argument is pushed. */ static rtx -mn10300_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +mn10300_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); rtx result = NULL_RTX; @@ -1555,11 +1546,7 @@ mn10300_function_arg (cumulative_args_t cum_v, machine_mode mode, int nregs = 2; /* Figure out the size of the object to be passed. */ - if (mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + size = arg.promoted_size_in_bytes (); cum->nbytes = (cum->nbytes + 3) & ~3; /* Don't pass this arg via a register if all the argument registers @@ -1569,17 +1556,17 @@ mn10300_function_arg (cumulative_args_t cum_v, machine_mode mode, /* Don't pass this arg via a register if it would be split between registers and memory. */ - if (type == NULL_TREE + if (arg.type == NULL_TREE && cum->nbytes + size > nregs * UNITS_PER_WORD) return result; switch (cum->nbytes / UNITS_PER_WORD) { case 0: - result = gen_rtx_REG (mode, FIRST_ARGUMENT_REGNUM); + result = gen_rtx_REG (arg.mode, FIRST_ARGUMENT_REGNUM); break; case 1: - result = gen_rtx_REG (mode, FIRST_ARGUMENT_REGNUM + 1); + result = gen_rtx_REG (arg.mode, FIRST_ARGUMENT_REGNUM + 1); break; default: break; @@ -1588,27 +1575,23 @@ mn10300_function_arg (cumulative_args_t cum_v, machine_mode mode, return result; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -mn10300_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +mn10300_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - cum->nbytes += (mode != BLKmode - ? (GET_MODE_SIZE (mode) + 3) & ~3 - : (int_size_in_bytes (type) + 3) & ~3); + cum->nbytes += (arg.promoted_size_in_bytes () + 3) & ~3; } /* Return the number of bytes of registers to use for an argument passed partially in registers and partially in memory. */ static int -mn10300_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +mn10300_arg_partial_bytes (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int size; @@ -1617,11 +1600,7 @@ mn10300_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, int nregs = 2; /* Figure out the size of the object to be passed. */ - if (mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + size = arg.promoted_size_in_bytes (); cum->nbytes = (cum->nbytes + 3) & ~3; /* Don't pass this arg via a register if all the argument registers @@ -1634,7 +1613,7 @@ mn10300_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, /* Don't pass this arg via a register if it would be split between registers and memory. */ - if (type == NULL_TREE + if (arg.type == NULL_TREE && cum->nbytes + size > nregs * UNITS_PER_WORD) return 0; @@ -3375,7 +3354,7 @@ mn10300_reorg (void) #undef TARGET_PASS_BY_REFERENCE #define TARGET_PASS_BY_REFERENCE mn10300_pass_by_reference #undef TARGET_CALLEE_COPIES -#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_true #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES mn10300_arg_partial_bytes #undef TARGET_FUNCTION_ARG diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c index 0284f3c..d840463 100644 --- a/gcc/config/moxie/moxie.c +++ b/gcc/config/moxie/moxie.c @@ -385,8 +385,7 @@ moxie_initial_elimination_offset (int from, int to) static void moxie_setup_incoming_varargs (cumulative_args_t cum_v, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, + const function_arg_info &, int *pretend_size, int no_rtl) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -424,14 +423,12 @@ moxie_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) NULL_RTX if there's no more space. */ static rtx -moxie_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +moxie_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (*cum < 8) - return gen_rtx_REG (mode, *cum); + return gen_rtx_REG (arg.mode, *cum); else return NULL_RTX; } @@ -441,35 +438,25 @@ moxie_function_arg (cumulative_args_t cum_v, machine_mode mode, : (unsigned) int_size_in_bytes (TYPE)) static void -moxie_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +moxie_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); *cum = (*cum < MOXIE_R6 - ? *cum + ((3 + MOXIE_FUNCTION_ARG_SIZE (mode, type)) / 4) + ? *cum + ((3 + MOXIE_FUNCTION_ARG_SIZE (arg.mode, arg.type)) / 4) : *cum); } -/* Return non-zero if the function argument described by TYPE is to be +/* Return non-zero if the function argument described by ARG is to be passed by reference. */ static bool -moxie_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +moxie_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - unsigned HOST_WIDE_INT size; - - if (type) - { - if (AGGREGATE_TYPE_P (type)) - return true; - size = int_size_in_bytes (type); - } - else - size = GET_MODE_SIZE (mode); - + if (arg.aggregate_type_p ()) + return true; + unsigned HOST_WIDE_INT size = arg.type_size_in_bytes (); return size > 4*6; } @@ -478,9 +465,7 @@ moxie_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, that fit in argument passing registers. */ static int -moxie_arg_partial_bytes (cumulative_args_t cum_v, - machine_mode mode, - tree type, bool named) +moxie_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int bytes_left, size; @@ -488,16 +473,16 @@ moxie_arg_partial_bytes (cumulative_args_t cum_v, if (*cum >= 8) return 0; - if (moxie_pass_by_reference (cum_v, mode, type, named)) + if (moxie_pass_by_reference (cum_v, arg)) size = 4; - else if (type) + else if (arg.type) { - if (AGGREGATE_TYPE_P (type)) + if (AGGREGATE_TYPE_P (arg.type)) return 0; - size = int_size_in_bytes (type); + size = int_size_in_bytes (arg.type); } else - size = GET_MODE_SIZE (mode); + size = GET_MODE_SIZE (arg.mode); bytes_left = (4 * 6) - ((*cum - 2) * 4); diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index fedbdf5..c5cf704 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -710,16 +710,14 @@ msp430_promote_prototypes (const_tree fntype ATTRIBUTE_UNUSED) rtx msp430_function_arg (cumulative_args_t cap, - machine_mode mode, - const_tree type, - bool named) + const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (cap); - msp430_evaluate_arg (cap, mode, type, named); + msp430_evaluate_arg (cap, arg.mode, arg.type, arg.named); if (ca->reg_count) - return gen_rtx_REG (mode, ca->start_reg); + return gen_rtx_REG (arg.mode, ca->start_reg); return 0; } @@ -728,14 +726,11 @@ msp430_function_arg (cumulative_args_t cap, #define TARGET_ARG_PARTIAL_BYTES msp430_arg_partial_bytes int -msp430_arg_partial_bytes (cumulative_args_t cap, - machine_mode mode, - tree type, - bool named) +msp430_arg_partial_bytes (cumulative_args_t cap, const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (cap); - msp430_evaluate_arg (cap, mode, type, named); + msp430_evaluate_arg (cap, arg.mode, arg.type, arg.named); if (ca->reg_count && ca->mem_count) return ca->reg_count * UNITS_PER_WORD; @@ -747,41 +742,27 @@ msp430_arg_partial_bytes (cumulative_args_t cap, #define TARGET_PASS_BY_REFERENCE msp430_pass_by_reference static bool -msp430_pass_by_reference (cumulative_args_t cap ATTRIBUTE_UNUSED, - machine_mode mode, - const_tree type, - bool named ATTRIBUTE_UNUSED) +msp430_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return (mode == BLKmode - || (type && TREE_CODE (type) == RECORD_TYPE) - || (type && TREE_CODE (type) == UNION_TYPE)); + return (arg.mode == BLKmode + || (arg.type && TREE_CODE (arg.type) == RECORD_TYPE) + || (arg.type && TREE_CODE (arg.type) == UNION_TYPE)); } #undef TARGET_CALLEE_COPIES -#define TARGET_CALLEE_COPIES msp430_callee_copies - -static bool -msp430_callee_copies (cumulative_args_t cap ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) -{ - return true; -} +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_true #undef TARGET_FUNCTION_ARG_ADVANCE #define TARGET_FUNCTION_ARG_ADVANCE msp430_function_arg_advance void msp430_function_arg_advance (cumulative_args_t cap, - machine_mode mode, - const_tree type, - bool named) + const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (cap); int i; - msp430_evaluate_arg (cap, mode, type, named); + msp430_evaluate_arg (cap, arg.mode, arg.type, arg.named); if (ca->start_reg >= CA_FIRST_REG) for (i = 0; i < ca->reg_count; i ++) @@ -856,7 +837,7 @@ msp430_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, unsigned HOST_WIDE_INT align, boundary; bool indirect; - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect = pass_va_arg_by_reference (type); if (indirect) type = build_pointer_type (type); diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index eba9812..3caae14 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -1868,19 +1868,20 @@ nds32_can_eliminate (const int from_reg, const int to_reg) /* -- Passing Arguments in Registers. */ static rtx -nds32_function_arg (cumulative_args_t ca, machine_mode mode, - const_tree type, bool named) +nds32_function_arg (cumulative_args_t ca, const function_arg_info &arg) { unsigned int regno; CUMULATIVE_ARGS *cum = get_cumulative_args (ca); + tree type = arg.type; + machine_mode mode = arg.mode; /* The last time this hook is called, - it is called with MODE == VOIDmode. */ - if (mode == VOIDmode) + it is called with an end marker. */ + if (arg.end_marker_p ()) return NULL_RTX; /* For nameless arguments, we need to take care it individually. */ - if (!named) + if (!arg.named) { /* If we are under hard float abi, we have arguments passed on the stack and all situation can be handled by GCC itself. */ @@ -1950,21 +1951,20 @@ nds32_function_arg (cumulative_args_t ca, machine_mode mode, } static bool -nds32_must_pass_in_stack (machine_mode mode, const_tree type) +nds32_must_pass_in_stack (const function_arg_info &arg) { /* Return true if a type must be passed in memory. If it is NOT using hard float abi, small aggregates can be passed in a register even we are calling a variadic function. So there is no need to take padding into consideration. */ if (TARGET_HARD_FLOAT) - return must_pass_in_stack_var_size_or_pad (mode, type); + return must_pass_in_stack_var_size_or_pad (arg); else - return must_pass_in_stack_var_size (mode, type); + return must_pass_in_stack_var_size (arg); } static int -nds32_arg_partial_bytes (cumulative_args_t ca, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +nds32_arg_partial_bytes (cumulative_args_t ca, const function_arg_info &arg) { /* Returns the number of bytes at the beginning of an argument that must be put in registers. The value must be zero for arguments that are @@ -1985,18 +1985,19 @@ nds32_arg_partial_bytes (cumulative_args_t ca, machine_mode mode, /* If we have already runned out of argument registers, return zero so that the argument will be entirely pushed on the stack. */ - if (NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, mode, type) + if (NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, arg.mode, arg.type) >= NDS32_GPR_ARG_FIRST_REGNUM + NDS32_MAX_GPR_REGS_FOR_ARGS) return 0; /* Calculate how many registers do we need for this argument. */ - needed_reg_count = NDS32_NEED_N_REGS_FOR_ARG (mode, type); + needed_reg_count = NDS32_NEED_N_REGS_FOR_ARG (arg.mode, arg.type); /* Calculate how many argument registers have left for passing argument. Note that we should count it from next available register number. */ remaining_reg_count = NDS32_MAX_GPR_REGS_FOR_ARGS - - (NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, mode, type) + - (NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, + arg.mode, arg.type) - NDS32_GPR_ARG_FIRST_REGNUM); /* Note that we have to return the nubmer of bytes, not registers count. */ @@ -2007,12 +2008,14 @@ nds32_arg_partial_bytes (cumulative_args_t ca, machine_mode mode, } static void -nds32_function_arg_advance (cumulative_args_t ca, machine_mode mode, - const_tree type, bool named) +nds32_function_arg_advance (cumulative_args_t ca, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (ca); + tree type = arg.type; + machine_mode mode = arg.mode; - if (named) + if (arg.named) { /* We need to further check TYPE and MODE so that we can determine which kind of register we shall advance. */ @@ -2345,8 +2348,7 @@ nds32_warn_func_return (tree decl) static void nds32_setup_incoming_varargs (cumulative_args_t ca, - machine_mode mode, - tree type, + const function_arg_info &arg, int *pretend_args_size, int second_time ATTRIBUTE_UNUSED) { @@ -2370,14 +2372,14 @@ nds32_setup_incoming_varargs (cumulative_args_t ca, cum = get_cumulative_args (ca); - /* The MODE and TYPE describe the last argument. + /* ARG describes the last argument. We need those information to determine the remaining registers for varargs. */ total_args_regs = NDS32_MAX_GPR_REGS_FOR_ARGS + NDS32_GPR_ARG_FIRST_REGNUM; num_of_used_regs - = NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, mode, type) - + NDS32_NEED_N_REGS_FOR_ARG (mode, type); + = NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, arg.mode, arg.type) + + NDS32_NEED_N_REGS_FOR_ARG (arg.mode, arg.type); remaining_reg_count = total_args_regs - num_of_used_regs; *pretend_args_size = remaining_reg_count * UNITS_PER_WORD; diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c index e54bdba..6167803 100644 --- a/gcc/config/nios2/nios2.c +++ b/gcc/config/nios2/nios2.c @@ -3362,25 +3362,18 @@ nios2_fpu_insn_asm (enum n2fpu_code code) push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ static rtx -nios2_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +nios2_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); rtx return_rtx = NULL_RTX; if (cum->regs_used < NUM_ARG_REGS) - return_rtx = gen_rtx_REG (mode, FIRST_ARG_REGNO + cum->regs_used); + return_rtx = gen_rtx_REG (arg.mode, FIRST_ARG_REGNO + cum->regs_used); return return_rtx; } @@ -3390,20 +3383,11 @@ nios2_function_arg (cumulative_args_t cum_v, machine_mode mode, in memory. */ static int -nios2_arg_partial_bytes (cumulative_args_t cum_v, - machine_mode mode, tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +nios2_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - HOST_WIDE_INT param_size; - - if (mode == BLKmode) - { - param_size = int_size_in_bytes (type); - gcc_assert (param_size >= 0); - } - else - param_size = GET_MODE_SIZE (mode); + HOST_WIDE_INT param_size = arg.promoted_size_in_bytes (); + gcc_assert (param_size >= 0); /* Convert to words (round up). */ param_size = (UNITS_PER_WORD - 1 + param_size) / UNITS_PER_WORD; @@ -3415,25 +3399,15 @@ nios2_arg_partial_bytes (cumulative_args_t cum_v, return 0; } -/* Update the data in CUM to advance over an argument of mode MODE - and data type TYPE; TYPE is null for libcalls where that information - may not be available. */ +/* Update the data in CUM to advance over argument ARG. */ static void -nios2_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +nios2_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - HOST_WIDE_INT param_size; - - if (mode == BLKmode) - { - param_size = int_size_in_bytes (type); - gcc_assert (param_size >= 0); - } - else - param_size = GET_MODE_SIZE (mode); + HOST_WIDE_INT param_size = arg.promoted_size_in_bytes (); + gcc_assert (param_size >= 0); /* Convert to words (round up). */ param_size = (UNITS_PER_WORD - 1 + param_size) / UNITS_PER_WORD; @@ -3525,8 +3499,8 @@ nios2_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) own va_arg type. */ static void nios2_setup_incoming_varargs (cumulative_args_t cum_v, - machine_mode mode, tree type, - int *pretend_size, int second_time) + const function_arg_info &arg, + int *pretend_size, int second_time) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); CUMULATIVE_ARGS local_cum; @@ -3536,7 +3510,7 @@ nios2_setup_incoming_varargs (cumulative_args_t cum_v, cfun->machine->uses_anonymous_args = 1; local_cum = *cum; - nios2_function_arg_advance (local_cum_v, mode, type, true); + nios2_function_arg_advance (local_cum_v, arg); regs_to_push = NUM_ARG_REGS - local_cum.regs_used; diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index ce4602f..90171a9 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -520,30 +520,29 @@ promote_return (machine_mode mode) /* Implement TARGET_FUNCTION_ARG. */ static rtx -nvptx_function_arg (cumulative_args_t ARG_UNUSED (cum_v), machine_mode mode, - const_tree, bool named) +nvptx_function_arg (cumulative_args_t, const function_arg_info &arg) { - if (mode == VOIDmode || !named) + if (arg.end_marker_p () || !arg.named) return NULL_RTX; - return gen_reg_rtx (mode); + return gen_reg_rtx (arg.mode); } /* Implement TARGET_FUNCTION_INCOMING_ARG. */ static rtx -nvptx_function_incoming_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree, bool named) +nvptx_function_incoming_arg (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (mode == VOIDmode || !named) + if (arg.end_marker_p () || !arg.named) return NULL_RTX; /* No need to deal with split modes here, the only case that can happen is complex modes and those are dealt with by TARGET_SPLIT_COMPLEX_ARG. */ - return gen_rtx_UNSPEC (mode, + return gen_rtx_UNSPEC (arg.mode, gen_rtvec (1, GEN_INT (cum->count)), UNSPEC_ARG_REG); } @@ -551,10 +550,7 @@ nvptx_function_incoming_arg (cumulative_args_t cum_v, machine_mode mode, /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void -nvptx_function_arg_advance (cumulative_args_t cum_v, - machine_mode ARG_UNUSED (mode), - const_tree ARG_UNUSED (type), - bool ARG_UNUSED (named)) +nvptx_function_arg_advance (cumulative_args_t cum_v, const function_arg_info &) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -633,11 +629,9 @@ nvptx_function_value_regno_p (const unsigned int regno) reference in memory. */ static bool -nvptx_pass_by_reference (cumulative_args_t ARG_UNUSED (cum), - machine_mode mode, const_tree type, - bool ARG_UNUSED (named)) +nvptx_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return pass_in_memory (mode, type, false); + return pass_in_memory (arg.mode, arg.type, false); } /* Implement TARGET_RETURN_IN_MEMORY. */ diff --git a/gcc/config/or1k/or1k.c b/gcc/config/or1k/or1k.c index f8eed4a..34b9d6f 100644 --- a/gcc/config/or1k/or1k.c +++ b/gcc/config/or1k/or1k.c @@ -928,23 +928,16 @@ or1k_legitimate_constant_p (machine_mode, rtx x) #define TARGET_LEGITIMATE_CONSTANT_P or1k_legitimate_constant_p /* Worker for TARGET_PASS_BY_REFERENCE. - Returns true if an argument of TYPE in MODE should be passed by reference - as required by the OpenRISC ABI. On OpenRISC structures, unions and + Returns true if an argument ARG should be passed by reference as + required by the OpenRISC ABI. On OpenRISC structures, unions and arguments larger than 64-bits are passed by reference. */ static bool -or1k_pass_by_reference (cumulative_args_t, machine_mode mode, - const_tree type, bool) +or1k_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - HOST_WIDE_INT size; - if (type) - { - if (AGGREGATE_TYPE_P (type)) - return true; - size = int_size_in_bytes (type); - } - else - size = GET_MODE_SIZE (mode); + if (arg.aggregate_type_p ()) + return true; + HOST_WIDE_INT size = arg.type_size_in_bytes (); return size < 0 || size > 8; } @@ -1004,20 +997,19 @@ or1k_strict_argument_naming (cumulative_args_t /* ca */) maybe be passed in registers r3 to r8. */ static rtx -or1k_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree /* type */, bool named) +or1k_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { - /* VOIDmode is passed as a special flag for "last argument". */ - if (mode == VOIDmode) + /* Handle the special marker for the end of the arguments. */ + if (arg.end_marker_p ()) return NULL_RTX; CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int nreg = CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD); + int nreg = CEIL (GET_MODE_SIZE (arg.mode), UNITS_PER_WORD); /* Note that all large arguments are passed by reference. */ gcc_assert (nreg <= 2); - if (named && *cum + nreg <= 6) - return gen_rtx_REG (mode, *cum + 3); + if (arg.named && *cum + nreg <= 6) + return gen_rtx_REG (arg.mode, *cum + 3); else return NULL_RTX; } @@ -1027,15 +1019,15 @@ or1k_function_arg (cumulative_args_t cum_v, machine_mode mode, argument. Note, this is not called for arguments passed on the stack. */ static void -or1k_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree /* type */, bool named) +or1k_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int nreg = CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD); + int nreg = CEIL (GET_MODE_SIZE (arg.mode), UNITS_PER_WORD); /* Note that all large arguments are passed by reference. */ gcc_assert (nreg <= 2); - if (named) + if (arg.named) *cum += nreg; } diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 0ab95d8..9366b106 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -164,14 +164,12 @@ static void output_deferred_profile_counters (void) ATTRIBUTE_UNUSED; static void pa_file_end (void); static void pa_init_libfuncs (void); static rtx pa_struct_value_rtx (tree, int); -static bool pa_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); -static int pa_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static void pa_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx pa_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static bool pa_pass_by_reference (cumulative_args_t, + const function_arg_info &); +static int pa_arg_partial_bytes (cumulative_args_t, const function_arg_info &); +static void pa_function_arg_advance (cumulative_args_t, + const function_arg_info &); +static rtx pa_function_arg (cumulative_args_t, const function_arg_info &); static pad_direction pa_function_arg_padding (machine_mode, const_tree); static unsigned int pa_function_arg_boundary (machine_mode, const_tree); static struct machine_function * pa_init_machine_status (void); @@ -199,8 +197,7 @@ static bool pa_cannot_force_const_mem (machine_mode, rtx); static bool pa_legitimate_constant_p (machine_mode, rtx); static unsigned int pa_section_type_flags (tree, const char *, int); static bool pa_legitimate_address_p (machine_mode, rtx, bool); -static bool pa_callee_copies (cumulative_args_t, machine_mode, - const_tree, bool); +static bool pa_callee_copies (cumulative_args_t, const function_arg_info &); static unsigned int pa_hard_regno_nregs (unsigned int, machine_mode); static bool pa_hard_regno_mode_ok (unsigned int, machine_mode); static bool pa_modes_tieable_p (machine_mode, machine_mode); @@ -6223,17 +6220,9 @@ pa_eh_return_handler_rtx (void) or updates the ABI. */ static bool -pa_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +pa_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - HOST_WIDE_INT size; - - if (type) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + HOST_WIDE_INT size = arg.type_size_in_bytes (); if (TARGET_64BIT) return size <= 0; else @@ -6377,7 +6366,7 @@ hppa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, unsigned int size, ofs; bool indirect; - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, 0); + indirect = pass_va_arg_by_reference (type); if (indirect) { type = ptr; @@ -9447,21 +9436,19 @@ pa_function_value_regno_p (const unsigned int regno) return false; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -pa_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +pa_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int arg_size = pa_function_arg_size (mode, type); + int arg_size = pa_function_arg_size (arg.mode, arg.type); cum->nargs_prototype--; cum->words += (arg_size + ((cum->words & 01) - && type != NULL_TREE + && arg.type != NULL_TREE && arg_size > 1)); } @@ -9474,10 +9461,11 @@ pa_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, ??? We might want to restructure this so that it looks more like other ports. */ static rtx -pa_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +pa_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + tree type = arg.type; + machine_mode mode = arg.mode; int max_arg_words = (TARGET_64BIT ? 8 : 4); int alignment = 0; int arg_size; @@ -9485,7 +9473,7 @@ pa_function_arg (cumulative_args_t cum_v, machine_mode mode, int gpr_reg_base; rtx retval; - if (mode == VOIDmode) + if (arg.end_marker_p ()) return NULL_RTX; arg_size = pa_function_arg_size (mode, type); @@ -9685,8 +9673,7 @@ pa_function_arg_boundary (machine_mode mode, const_tree type) then this routine should return zero. */ static int -pa_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +pa_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); unsigned int max_arg_words = 8; @@ -9695,10 +9682,11 @@ pa_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, if (!TARGET_64BIT) return 0; - if (pa_function_arg_size (mode, type) > 1 && (cum->words & 1)) + if (pa_function_arg_size (arg.mode, arg.type) > 1 && (cum->words & 1)) offset = 1; - if (cum->words + offset + pa_function_arg_size (mode, type) <= max_arg_words) + if (cum->words + offset + pa_function_arg_size (arg.mode, arg.type) + <= max_arg_words) /* Arg fits fully into registers. */ return 0; else if (cum->words + offset >= max_arg_words) @@ -10775,10 +10763,7 @@ pa_maybe_emit_compare_and_swap_exchange_loop (rtx target, rtx mem, rtx val) in the 64-bit HP runtime. */ static bool -pa_callee_copies (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +pa_callee_copies (cumulative_args_t, const function_arg_info &) { return !TARGET_CALLER_COPIES; } diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index 5f530a4..62a1b27 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -162,10 +162,9 @@ static rtx pdp11_function_value (const_tree, const_tree, bool); static rtx pdp11_libcall_value (machine_mode, const_rtx); static bool pdp11_function_value_regno_p (const unsigned int); static void pdp11_trampoline_init (rtx, tree, rtx); -static rtx pdp11_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static rtx pdp11_function_arg (cumulative_args_t, const function_arg_info &); static void pdp11_function_arg_advance (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static void pdp11_conditional_register_usage (void); static bool pdp11_legitimate_constant_p (machine_mode, rtx); @@ -2180,45 +2179,25 @@ pdp11_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) emit_move_insn (mem, fnaddr); } -/* Worker function for TARGET_FUNCTION_ARG. - - Determine where to put an argument to a function. - Value is zero to push the argument on the stack, - or a hard register in which to store the argument. - - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. - CUM is a variable of type CUMULATIVE_ARGS which gives info about - the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ +/* Worker function for TARGET_FUNCTION_ARG. */ static rtx -pdp11_function_arg (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +pdp11_function_arg (cumulative_args_t, const function_arg_info &) { return NULL_RTX; } /* Worker function for TARGET_FUNCTION_ARG_ADVANCE. - Update the data in CUM to advance over an argument of mode MODE and - data type TYPE. (TYPE is null for libcalls where that information - may not be available.) */ + Update the data in CUM to advance over argument ARG. */ static void -pdp11_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +pdp11_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum += (mode != BLKmode - ? GET_MODE_SIZE (mode) - : int_size_in_bytes (type)); + *cum += arg.promoted_size_in_bytes (); } /* Make sure everything's fine if we *don't* have an FPU. diff --git a/gcc/config/pru/pru.c b/gcc/config/pru/pru.c index 4e1c081..579d3d4 100644 --- a/gcc/config/pru/pru.c +++ b/gcc/config/pru/pru.c @@ -2152,25 +2152,18 @@ pru_function_arg_regi_mark_slot (int regi, push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ + ARG is a description of the argument. */ static rtx -pru_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, - bool named) +pru_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { rtx return_rtx = NULL_RTX; - int regi = pru_function_arg_regi (cum_v, mode, type, named); + int regi = pru_function_arg_regi (cum_v, arg.mode, arg.type, arg.named); if (regi >= 0) - return_rtx = gen_rtx_REG (mode, regi); + return_rtx = gen_rtx_REG (arg.mode, regi); return return_rtx; } @@ -2179,27 +2172,22 @@ pru_function_arg (cumulative_args_t cum_v, machine_mode mode, between registers and memory, so we can return 0. */ static int -pru_arg_partial_bytes (cumulative_args_t cum_v ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +pru_arg_partial_bytes (cumulative_args_t, const function_arg_info &) { return 0; } -/* Update the data in CUM to advance over an argument of mode MODE - and data type TYPE; TYPE is null for libcalls where that information - may not be available. */ +/* Update the data in CUM to advance over argument ARG. */ static void -pru_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, - bool named) +pru_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { - int regi = pru_function_arg_regi (cum_v, mode, type, named); + int regi = pru_function_arg_regi (cum_v, arg.mode, arg.type, arg.named); if (regi >= 0) - pru_function_arg_regi_mark_slot (regi, cum_v, mode, type, named); + pru_function_arg_regi_mark_slot (regi, cum_v, arg.mode, + arg.type, arg.named); } /* Implement TARGET_FUNCTION_VALUE. */ diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index c12b26f..9b16a1e 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -2743,28 +2743,27 @@ riscv_get_arg_info (struct riscv_arg_info *info, const CUMULATIVE_ARGS *cum, /* Implement TARGET_FUNCTION_ARG. */ static rtx -riscv_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +riscv_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); struct riscv_arg_info info; - if (mode == VOIDmode) + if (arg.end_marker_p ()) return NULL; - return riscv_get_arg_info (&info, cum, mode, type, named, false); + return riscv_get_arg_info (&info, cum, arg.mode, arg.type, arg.named, false); } /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void -riscv_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +riscv_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); struct riscv_arg_info info; - riscv_get_arg_info (&info, cum, mode, type, named, false); + riscv_get_arg_info (&info, cum, arg.mode, arg.type, arg.named, false); /* Advance the register count. This has the effect of setting num_gprs to MAX_ARGS_IN_REGISTERS if a doubleword-aligned @@ -2778,11 +2777,12 @@ riscv_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, static int riscv_arg_partial_bytes (cumulative_args_t cum, - machine_mode mode, tree type, bool named) + const function_arg_info &generic_arg) { struct riscv_arg_info arg; - riscv_get_arg_info (&arg, get_cumulative_args (cum), mode, type, named, false); + riscv_get_arg_info (&arg, get_cumulative_args (cum), generic_arg.mode, + generic_arg.type, generic_arg.named, false); return arg.stack_p ? arg.num_gprs * UNITS_PER_WORD : 0; } @@ -2814,10 +2814,9 @@ riscv_function_value (const_tree type, const_tree func, machine_mode mode) /* Implement TARGET_PASS_BY_REFERENCE. */ static bool -riscv_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +riscv_pass_by_reference (cumulative_args_t cum_v, const function_arg_info &arg) { - HOST_WIDE_INT size = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + HOST_WIDE_INT size = arg.type_size_in_bytes (); struct riscv_arg_info info; CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -2827,7 +2826,7 @@ riscv_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, if (cum != NULL) { /* Don't pass by reference if we can use a floating-point register. */ - riscv_get_arg_info (&info, cum, mode, type, named, false); + riscv_get_arg_info (&info, cum, arg.mode, arg.type, arg.named, false); if (info.num_fprs) return false; } @@ -2847,15 +2846,16 @@ riscv_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED) /* The rules for returning in memory are the same as for passing the first named argument by reference. */ memset (&args, 0, sizeof args); - return riscv_pass_by_reference (cum, TYPE_MODE (type), type, true); + function_arg_info arg (const_cast<tree> (type), /*named=*/true); + return riscv_pass_by_reference (cum, arg); } /* Implement TARGET_SETUP_INCOMING_VARARGS. */ static void -riscv_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size ATTRIBUTE_UNUSED, - int no_rtl) +riscv_setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) { CUMULATIVE_ARGS local_cum; int gp_saved; @@ -2864,7 +2864,7 @@ riscv_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, argument. Advance a local copy of CUM past the last "real" named argument, to find out how many registers are left over. */ local_cum = *get_cumulative_args (cum); - riscv_function_arg_advance (pack_cumulative_args (&local_cum), mode, type, 1); + riscv_function_arg_advance (pack_cumulative_args (&local_cum), arg); /* Found out how many registers we need to save. */ gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs; diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index d2caa11..1c5d1e1 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -1737,21 +1737,11 @@ rl78_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, return mode; } -/* Return an RTL expression describing the register holding a function - parameter of mode MODE and type TYPE or NULL_RTX if the parameter should - be passed on the stack. CUM describes the previous parameters to the - function and NAMED is false if the parameter is part of a variable - parameter list, or the last named parameter before the start of a - variable parameter list. */ - #undef TARGET_FUNCTION_ARG #define TARGET_FUNCTION_ARG rl78_function_arg static rtx -rl78_function_arg (cumulative_args_t cum_v ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +rl78_function_arg (cumulative_args_t, const function_arg_info &) { return NULL_RTX; } @@ -1760,14 +1750,13 @@ rl78_function_arg (cumulative_args_t cum_v ATTRIBUTE_UNUSED, #define TARGET_FUNCTION_ARG_ADVANCE rl78_function_arg_advance static void -rl78_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +rl78_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { int rounded_size; CUMULATIVE_ARGS * cum = get_cumulative_args (cum_v); - rounded_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + rounded_size = arg.promoted_size_in_bytes (); if (rounded_size & 1) rounded_size ++; (*cum) += rounded_size; diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 62aa4bf..7280a4e 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -816,12 +816,12 @@ rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, /* Return true if TYPE must be passed on the stack and not in registers. */ bool -rs6000_must_pass_in_stack (machine_mode mode, const_tree type) +rs6000_must_pass_in_stack (const function_arg_info &arg) { if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2 || TARGET_64BIT) - return must_pass_in_stack_var_size (mode, type); + return must_pass_in_stack_var_size (arg); else - return must_pass_in_stack_var_size_or_pad (mode, type); + return must_pass_in_stack_var_size_or_pad (arg); } static inline bool @@ -1400,11 +1400,11 @@ rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, machine_mode mode, } void -rs6000_function_arg_advance (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +rs6000_function_arg_advance (cumulative_args_t cum, + const function_arg_info &arg) { - rs6000_function_arg_advance_1 (get_cumulative_args (cum), mode, type, named, - 0); + rs6000_function_arg_advance_1 (get_cumulative_args (cum), + arg.mode, arg.type, arg.named, 0); } /* A subroutine of rs6000_darwin64_record_arg. Assign the bits of the @@ -1729,15 +1729,10 @@ rs6000_finish_function_arg (machine_mode mode, rtx *rvec, int k) Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. It is not modified in this routine. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. On RS/6000 the first eight words of non-FP are normally in registers and the rest are pushed. Under AIX, the first 13 FP args are in registers. @@ -1750,14 +1745,15 @@ rs6000_finish_function_arg (machine_mode mode, rtx *rvec, int k) doesn't support PARALLEL anyway. Note that for args passed by reference, function_arg will be called - with MODE and TYPE set to that of the pointer to the arg, not the arg - itself. */ + with ARG describing the pointer to the arg, not the arg itself. */ rtx -rs6000_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +rs6000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + tree type = arg.type; + machine_mode mode = arg.mode; + bool named = arg.named; enum rs6000_abi abi = DEFAULT_ABI; machine_mode elt_mode; int n_elts; @@ -1766,7 +1762,7 @@ rs6000_function_arg (cumulative_args_t cum_v, machine_mode mode, bit that V.4 uses to say fp args were passed in registers. Assume that we don't need the marker for software floating point, or compiler generated library calls. */ - if (mode == VOIDmode) + if (arg.end_marker_p ()) { if (abi == ABI_V4 && (cum->call_cookie & CALL_LIBCALL) == 0 @@ -2007,8 +2003,8 @@ rs6000_function_arg (cumulative_args_t cum_v, machine_mode mode, returns the number of bytes used by the first element of the PARALLEL. */ int -rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named) +rs6000_arg_partial_bytes (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); bool passed_in_gprs = true; @@ -2017,12 +2013,13 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, machine_mode elt_mode; int n_elts; - rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts); + rs6000_discover_homogeneous_aggregate (arg.mode, arg.type, + &elt_mode, &n_elts); if (DEFAULT_ABI == ABI_V4) return 0; - if (USE_ALTIVEC_FOR_ARG_P (cum, elt_mode, named)) + if (USE_ALTIVEC_FOR_ARG_P (cum, elt_mode, arg.named)) { /* If we are passing this arg in the fixed parameter save area (gprs or memory) as well as VRs, we do not use the partial bytes mechanism; @@ -2041,14 +2038,13 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, } /* In this complicated case we just disable the partial_nregs code. */ - if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type)) + if (TARGET_MACHO && rs6000_darwin64_struct_check_p (arg.mode, arg.type)) return 0; - align_words = rs6000_parm_start (mode, type, cum->words); + align_words = rs6000_parm_start (arg.mode, arg.type, cum->words); if (USE_FP_FOR_ARG_P (cum, elt_mode) - && !(TARGET_AIX && !TARGET_ELF - && type != NULL && AGGREGATE_TYPE_P (type))) + && !(TARGET_AIX && !TARGET_ELF && arg.aggregate_type_p ())) { unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3; @@ -2056,7 +2052,7 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, (gprs or memory) as well as FPRs, we do not use the partial bytes mechanism; instead, rs6000_function_arg will return a PARALLEL including a memory element as necessary. */ - if (type + if (arg.type && (cum->nargs_prototype <= 0 || ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) && TARGET_XL_COMPAT @@ -2087,7 +2083,7 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, if (passed_in_gprs && align_words < GP_ARG_NUM_REG - && GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type)) + && GP_ARG_NUM_REG < align_words + rs6000_arg_size (arg.mode, arg.type)) ret = (GP_ARG_NUM_REG - align_words) * (TARGET_32BIT ? 4 : 8); if (ret != 0 && TARGET_DEBUG_ARG) @@ -2111,29 +2107,27 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, reference. */ bool -rs6000_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +rs6000_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - if (!type) + if (!arg.type) return 0; if (DEFAULT_ABI == ABI_V4 && TARGET_IEEEQUAD - && FLOAT128_IEEE_P (TYPE_MODE (type))) + && FLOAT128_IEEE_P (TYPE_MODE (arg.type))) { if (TARGET_DEBUG_ARG) fprintf (stderr, "function_arg_pass_by_reference: V4 IEEE 128-bit\n"); return 1; } - if (DEFAULT_ABI == ABI_V4 && AGGREGATE_TYPE_P (type)) + if (DEFAULT_ABI == ABI_V4 && AGGREGATE_TYPE_P (arg.type)) { if (TARGET_DEBUG_ARG) fprintf (stderr, "function_arg_pass_by_reference: V4 aggregate\n"); return 1; } - if (int_size_in_bytes (type) < 0) + if (int_size_in_bytes (arg.type) < 0) { if (TARGET_DEBUG_ARG) fprintf (stderr, "function_arg_pass_by_reference: variable size\n"); @@ -2142,7 +2136,7 @@ rs6000_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, /* Allow -maltivec -mabi=no-altivec without warning. Altivec vector modes only exist for GCC vector types if -maltivec. */ - if (TARGET_32BIT && !TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) + if (TARGET_32BIT && !TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (arg.mode)) { if (TARGET_DEBUG_ARG) fprintf (stderr, "function_arg_pass_by_reference: AltiVec\n"); @@ -2150,8 +2144,8 @@ rs6000_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, } /* Pass synthetic vectors in memory. */ - if (TREE_CODE (type) == VECTOR_TYPE - && int_size_in_bytes (type) > (TARGET_ALTIVEC_ABI ? 16 : 8)) + if (TREE_CODE (arg.type) == VECTOR_TYPE + && int_size_in_bytes (arg.type) > (TARGET_ALTIVEC_ABI ? 16 : 8)) { static bool warned_for_pass_big_vectors = false; if (TARGET_DEBUG_ARG) @@ -2176,7 +2170,6 @@ rs6000_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, static bool rs6000_parm_needs_stack (cumulative_args_t args_so_far, tree type) { - machine_mode mode; int unsignedp; rtx entry_parm; @@ -2199,20 +2192,19 @@ rs6000_parm_needs_stack (cumulative_args_t args_so_far, tree type) type = TREE_TYPE (first_field (type)); /* See if this arg was passed by invisible reference. */ - if (pass_by_reference (get_cumulative_args (args_so_far), - TYPE_MODE (type), type, true)) - type = build_pointer_type (type); + function_arg_info arg (type, /*named=*/true); + apply_pass_by_reference_rules (get_cumulative_args (args_so_far), arg); /* Find mode as it is passed by the ABI. */ unsignedp = TYPE_UNSIGNED (type); - mode = promote_mode (type, TYPE_MODE (type), &unsignedp); + arg.mode = promote_mode (arg.type, arg.mode, &unsignedp); /* If we must pass in stack, we need a stack. */ - if (rs6000_must_pass_in_stack (mode, type)) + if (rs6000_must_pass_in_stack (arg)) return true; /* If there is no incoming register, we need a stack. */ - entry_parm = rs6000_function_arg (args_so_far, mode, type, true); + entry_parm = rs6000_function_arg (args_so_far, arg); if (entry_parm == NULL) return true; @@ -2222,11 +2214,11 @@ rs6000_parm_needs_stack (cumulative_args_t args_so_far, tree type) return true; /* Also true if we're partially in registers and partially not. */ - if (rs6000_arg_partial_bytes (args_so_far, mode, type, true) != 0) + if (rs6000_arg_partial_bytes (args_so_far, arg) != 0) return true; /* Update info on where next arg arrives in registers. */ - rs6000_function_arg_advance (args_so_far, mode, type, true); + rs6000_function_arg_advance (args_so_far, arg); return false; } @@ -2366,7 +2358,7 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs) CUM is as above. - MODE and TYPE are the mode and type of the current parameter. + ARG is the last named argument. PRETEND_SIZE is a variable that should be set to the amount of stack that must be pushed by the prolog to pretend that our caller pushed @@ -2376,9 +2368,9 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs) stack and set PRETEND_SIZE to the length of the registers pushed. */ void -setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size ATTRIBUTE_UNUSED, - int no_rtl) +setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) { CUMULATIVE_ARGS next_cum; int reg_size = TARGET_32BIT ? 4 : 8; @@ -2388,7 +2380,7 @@ setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, /* Skip the last named argument. */ next_cum = *get_cumulative_args (cum); - rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0); + rs6000_function_arg_advance_1 (&next_cum, arg.mode, arg.type, arg.named, 0); if (DEFAULT_ABI == ABI_V4) { @@ -2462,8 +2454,8 @@ setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, first_reg_offset = next_cum.words; save_area = crtl->args.internal_arg_pointer; - if (targetm.calls.must_pass_in_stack (mode, type)) - first_reg_offset += rs6000_arg_size (TYPE_MODE (type), type); + if (targetm.calls.must_pass_in_stack (arg)) + first_reg_offset += rs6000_arg_size (TYPE_MODE (arg.type), arg.type); } set = get_varargs_alias_set (); @@ -2690,7 +2682,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, int regalign = 0; gimple *stmt; - if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) + if (pass_va_arg_by_reference (type)) { t = rs6000_gimplify_va_arg (valist, ptrtype, pre_p, post_p); return build_va_arg_indirect_ref (t); diff --git a/gcc/config/rs6000/rs6000-internal.h b/gcc/config/rs6000/rs6000-internal.h index 0da040c..baccfb3 100644 --- a/gcc/config/rs6000/rs6000-internal.h +++ b/gcc/config/rs6000/rs6000-internal.h @@ -150,25 +150,20 @@ extern machine_mode rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUS extern bool rs6000_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED); extern bool rs6000_return_in_msb (const_tree valtype); -extern bool rs6000_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED); -extern void setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size ATTRIBUTE_UNUSED, - int no_rtl); +extern bool rs6000_pass_by_reference (cumulative_args_t, + const function_arg_info &); +extern void setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, int *, int); extern unsigned int rs6000_function_arg_boundary (machine_mode mode, const_tree type); -extern bool rs6000_must_pass_in_stack (machine_mode mode, const_tree type); -extern int rs6000_arg_partial_bytes (cumulative_args_t cum_v, - machine_mode mode, tree type, - bool named); -extern void rs6000_function_arg_advance (cumulative_args_t cum, - machine_mode mode, - const_tree type, bool named); +extern bool rs6000_must_pass_in_stack (const function_arg_info &); +extern int rs6000_arg_partial_bytes (cumulative_args_t, + const function_arg_info &); +extern void rs6000_function_arg_advance (cumulative_args_t, + const function_arg_info &); extern pad_direction rs6000_function_arg_padding (machine_mode mode, const_tree type); -extern rtx rs6000_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named); +extern rtx rs6000_function_arg (cumulative_args_t, const function_arg_info &); extern rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, const_tree, bool, bool); extern rtx rs6000_internal_arg_pointer (void); diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 10b8f6e..a1fc22b 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -1064,24 +1064,19 @@ rx_function_arg_size (machine_mode mode, const_tree type) #define NUM_ARG_REGS 4 #define MAX_NUM_ARG_BYTES (NUM_ARG_REGS * UNITS_PER_WORD) -/* Return an RTL expression describing the register holding a function - parameter of mode MODE and type TYPE or NULL_RTX if the parameter should - be passed on the stack. CUM describes the previous parameters to the - function and NAMED is false if the parameter is part of a variable - parameter list, or the last named parameter before the start of a - variable parameter list. */ +/* Return an RTL expression describing the register holding function + argument ARG or NULL_RTX if the parameter should be passed on the + stack. CUM describes the previous parameters to the function. */ static rtx -rx_function_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +rx_function_arg (cumulative_args_t cum, const function_arg_info &arg) { unsigned int next_reg; unsigned int bytes_so_far = *get_cumulative_args (cum); unsigned int size; unsigned int rounded_size; - /* An exploded version of rx_function_arg_size. */ - size = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + size = arg.promoted_size_in_bytes (); /* If the size is not known it cannot be passed in registers. */ if (size < 1) return NULL_RTX; @@ -1095,25 +1090,25 @@ rx_function_arg (cumulative_args_t cum, machine_mode mode, /* Unnamed arguments and the last named argument in a variadic function are always passed on the stack. */ - if (!named) + if (!arg.named) return NULL_RTX; /* Structures must occupy an exact number of registers, otherwise they are passed on the stack. */ - if ((type == NULL || AGGREGATE_TYPE_P (type)) + if ((arg.type == NULL || AGGREGATE_TYPE_P (arg.type)) && (size % UNITS_PER_WORD) != 0) return NULL_RTX; next_reg = (bytes_so_far / UNITS_PER_WORD) + 1; - return gen_rtx_REG (mode, next_reg); + return gen_rtx_REG (arg.mode, next_reg); } static void -rx_function_arg_advance (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +rx_function_arg_advance (cumulative_args_t cum, + const function_arg_info &arg) { - *get_cumulative_args (cum) += rx_function_arg_size (mode, type); + *get_cumulative_args (cum) += rx_function_arg_size (arg.mode, arg.type); } static unsigned int diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 74f1d25..fa17d7d5d 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -11953,26 +11953,23 @@ s390_function_arg_integer (machine_mode mode, const_tree type) return false; } -/* Return 1 if a function argument of type TYPE and mode MODE - is to be passed by reference. The ABI specifies that only - structures of size 1, 2, 4, or 8 bytes are passed by value, - all other structures (and complex numbers) are passed by - reference. */ +/* Return 1 if a function argument ARG is to be passed by reference. + The ABI specifies that only structures of size 1, 2, 4, or 8 bytes + are passed by value, all other structures (and complex numbers) are + passed by reference. */ static bool -s390_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +s390_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - int size = s390_function_arg_size (mode, type); + int size = s390_function_arg_size (arg.mode, arg.type); - if (s390_function_arg_vector (mode, type)) + if (s390_function_arg_vector (arg.mode, arg.type)) return false; if (size > 8) return true; - if (type) + if (tree type = arg.type) { if (AGGREGATE_TYPE_P (type) && exact_log2 (size) < 0) return true; @@ -11985,35 +11982,31 @@ s390_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, return false; } -/* Update the data in CUM to advance over an argument of mode MODE and - data type TYPE. (TYPE is null for libcalls where that information - may not be available.). The boolean NAMED specifies whether the - argument is a named argument (as opposed to an unnamed argument - matching an ellipsis). */ +/* Update the data in CUM to advance over argument ARG. */ static void -s390_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +s390_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (s390_function_arg_vector (mode, type)) + if (s390_function_arg_vector (arg.mode, arg.type)) { /* We are called for unnamed vector stdarg arguments which are passed on the stack. In this case this hook does not have to do anything since stack arguments are tracked by common code. */ - if (!named) + if (!arg.named) return; cum->vrs += 1; } - else if (s390_function_arg_float (mode, type)) + else if (s390_function_arg_float (arg.mode, arg.type)) { cum->fprs += 1; } - else if (s390_function_arg_integer (mode, type)) + else if (s390_function_arg_integer (arg.mode, arg.type)) { - int size = s390_function_arg_size (mode, type); + int size = s390_function_arg_size (arg.mode, arg.type); cum->gprs += ((size + UNITS_PER_LONG - 1) / UNITS_PER_LONG); } else @@ -12024,14 +12017,9 @@ s390_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. On S/390, we use general purpose registers 2 through 6 to pass integer, pointer, and certain structure arguments, and @@ -12040,39 +12028,38 @@ s390_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, are pushed to the stack. */ static rtx -s390_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +s390_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (!named) - s390_check_type_for_vector_abi (type, true, false); + if (!arg.named) + s390_check_type_for_vector_abi (arg.type, true, false); - if (s390_function_arg_vector (mode, type)) + if (s390_function_arg_vector (arg.mode, arg.type)) { /* Vector arguments being part of the ellipsis are passed on the stack. */ - if (!named || (cum->vrs + 1 > VEC_ARG_NUM_REG)) + if (!arg.named || (cum->vrs + 1 > VEC_ARG_NUM_REG)) return NULL_RTX; - return gen_rtx_REG (mode, cum->vrs + FIRST_VEC_ARG_REGNO); + return gen_rtx_REG (arg.mode, cum->vrs + FIRST_VEC_ARG_REGNO); } - else if (s390_function_arg_float (mode, type)) + else if (s390_function_arg_float (arg.mode, arg.type)) { if (cum->fprs + 1 > FP_ARG_NUM_REG) return NULL_RTX; else - return gen_rtx_REG (mode, cum->fprs + 16); + return gen_rtx_REG (arg.mode, cum->fprs + 16); } - else if (s390_function_arg_integer (mode, type)) + else if (s390_function_arg_integer (arg.mode, arg.type)) { - int size = s390_function_arg_size (mode, type); + int size = s390_function_arg_size (arg.mode, arg.type); int n_gprs = (size + UNITS_PER_LONG - 1) / UNITS_PER_LONG; if (cum->gprs + n_gprs > GP_ARG_NUM_REG) return NULL_RTX; else if (n_gprs == 1 || UNITS_PER_WORD == UNITS_PER_LONG) - return gen_rtx_REG (mode, cum->gprs + 2); + return gen_rtx_REG (arg.mode, cum->gprs + 2); else if (n_gprs == 2) { rtvec p = rtvec_alloc (2); @@ -12084,16 +12071,16 @@ s390_function_arg (cumulative_args_t cum_v, machine_mode mode, = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, cum->gprs + 3), GEN_INT (4)); - return gen_rtx_PARALLEL (mode, p); + return gen_rtx_PARALLEL (arg.mode, p); } } - /* After the real arguments, expand_call calls us once again - with a void_type_node type. Whatever we return here is - passed as operand 2 to the call expanders. + /* After the real arguments, expand_call calls us once again with an + end marker. Whatever we return here is passed as operand 2 to the + call expanders. We don't need this feature ... */ - else if (type == void_type_node) + else if (arg.end_marker_p ()) return const0_rtx; gcc_unreachable (); @@ -12476,7 +12463,7 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, s390_check_type_for_vector_abi (type, true, false); - if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) + if (pass_va_arg_by_reference (type)) { if (TARGET_DEBUG_ARG) { @@ -13322,8 +13309,6 @@ s390_call_saved_register_used (tree call_expr) CUMULATIVE_ARGS cum_v; cumulative_args_t cum; tree parameter; - machine_mode mode; - tree type; rtx parm_rtx; int reg, i; @@ -13340,24 +13325,15 @@ s390_call_saved_register_used (tree call_expr) if (TREE_CODE (parameter) == ERROR_MARK) return true; - type = TREE_TYPE (parameter); - gcc_assert (type); - - mode = TYPE_MODE (type); - gcc_assert (mode); - /* We assume that in the target function all parameters are named. This only has an impact on vector argument register usage none of which is call-saved. */ - if (pass_by_reference (&cum_v, mode, type, true)) - { - mode = Pmode; - type = build_pointer_type (type); - } + function_arg_info arg (TREE_TYPE (parameter), /*named=*/true); + apply_pass_by_reference_rules (&cum_v, arg); - parm_rtx = s390_function_arg (cum, mode, type, true); + parm_rtx = s390_function_arg (cum, arg); - s390_function_arg_advance (cum, mode, type, true); + s390_function_arg_advance (cum, arg); if (!parm_rtx) continue; diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index e44e46d..3b22d96 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -280,8 +280,8 @@ static bool sh_function_value_regno_p (const unsigned int); static rtx sh_libcall_value (machine_mode, const_rtx); static bool sh_return_in_memory (const_tree, const_tree); static rtx sh_builtin_saveregs (void); -static void sh_setup_incoming_varargs (cumulative_args_t, machine_mode, - tree, int *, int); +static void sh_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, int *, int); static bool sh_strict_argument_naming (cumulative_args_t); static bool sh_pretend_outgoing_varargs_named (cumulative_args_t); static void sh_atomic_assign_expand_fenv (tree *, tree *, tree *); @@ -294,16 +294,13 @@ static machine_mode sh_promote_function_mode (const_tree type, int *punsignedp, const_tree funtype, int for_return); -static bool sh_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); -static bool sh_callee_copies (cumulative_args_t, machine_mode, - const_tree, bool); -static int sh_arg_partial_bytes (cumulative_args_t, machine_mode, - tree, bool); -static void sh_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx sh_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static bool sh_pass_by_reference (cumulative_args_t, + const function_arg_info &); +static bool sh_callee_copies (cumulative_args_t, const function_arg_info &); +static int sh_arg_partial_bytes (cumulative_args_t, const function_arg_info &); +static void sh_function_arg_advance (cumulative_args_t, + const function_arg_info &); +static rtx sh_function_arg (cumulative_args_t, const function_arg_info &); static int sh_dwarf_calling_convention (const_tree); static void sh_encode_section_info (tree, rtx, int); static bool sh2a_function_vector_p (tree); @@ -7656,9 +7653,8 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, tree addr, lab_over = NULL, result = NULL; tree eff_type; - const bool pass_by_ref = - !VOID_TYPE_P (type) - && targetm.calls.must_pass_in_stack (TYPE_MODE (type), type); + const bool pass_by_ref + = !VOID_TYPE_P (type) && must_pass_va_arg_in_stack (type); if (pass_by_ref) type = build_pointer_type (type); @@ -7901,12 +7897,11 @@ sh_promote_prototypes (const_tree type) } static bool -sh_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +sh_pass_by_reference (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (targetm.calls.must_pass_in_stack (mode, type)) + if (targetm.calls.must_pass_in_stack (arg)) return true; /* ??? std_gimplify_va_arg_expr passes NULL for cum. That function @@ -7919,14 +7914,15 @@ sh_pass_by_reference (cumulative_args_t cum_v, machine_mode mode, } static bool -sh_callee_copies (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +sh_callee_copies (cumulative_args_t cum, const function_arg_info &arg) { /* ??? How can it possibly be correct to return true only on the caller side of the equation? Is there someplace else in the sh backend that's magically producing the copies? */ return (get_cumulative_args (cum)->outgoing - && ((mode == BLKmode ? TYPE_ALIGN (type) : GET_MODE_ALIGNMENT (mode)) + && ((arg.mode == BLKmode + ? TYPE_ALIGN (arg.type) + : GET_MODE_ALIGNMENT (arg.mode)) % SH_MIN_ALIGN_FOR_CALLEE_COPY == 0)); } @@ -7993,20 +7989,17 @@ sh_pass_in_reg_p (const CUMULATIVE_ARGS& cum, machine_mode mode, } static int -sh_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named ATTRIBUTE_UNUSED) +sh_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int words = 0; - if (sh_pass_in_reg_p (*cum, mode, type) + if (sh_pass_in_reg_p (*cum, arg.mode, arg.type) && !TARGET_FPU_DOUBLE - && (sh_round_reg (*cum, mode) - + (mode != BLKmode - ? CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD) - : CEIL (int_size_in_bytes (type), UNITS_PER_WORD)) - > NPARM_REGS (mode))) - words = NPARM_REGS (mode) - sh_round_reg (*cum, mode); + && (sh_round_reg (*cum, arg.mode) + + CEIL (arg.promoted_size_in_bytes (), UNITS_PER_WORD) + > NPARM_REGS (arg.mode))) + words = NPARM_REGS (arg.mode) - sh_round_reg (*cum, arg.mode); return words * UNITS_PER_WORD; } @@ -8016,30 +8009,25 @@ sh_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, Value is zero to push the argument on the stack, or a hard register in which to store the argument. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. On SH the first args are normally in registers and the rest are pushed. Any arg that starts within the first NPARM_REGS words is at least partially passed in a register unless its data type forbids. */ static rtx -sh_function_arg (cumulative_args_t ca_v, machine_mode mode, - const_tree type, bool named) +sh_function_arg (cumulative_args_t ca_v, const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v); + machine_mode mode = arg.mode; - if (mode == VOIDmode) + if (arg.end_marker_p ()) return ca->renesas_abi ? const1_rtx : const0_rtx; - if (sh_pass_in_reg_p (*ca, mode, type) - && (named || ! (TARGET_HITACHI || ca->renesas_abi))) + if (sh_pass_in_reg_p (*ca, mode, arg.type) + && (arg.named || ! (TARGET_HITACHI || ca->renesas_abi))) { int regno; @@ -8078,13 +8066,10 @@ sh_function_arg (cumulative_args_t ca_v, machine_mode mode, return NULL_RTX; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be - available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -sh_function_arg_advance (cumulative_args_t ca_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +sh_function_arg_advance (cumulative_args_t ca_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v); @@ -8094,7 +8079,7 @@ sh_function_arg_advance (cumulative_args_t ca_v, machine_mode mode, if ((TARGET_HITACHI || ca->renesas_abi) && TARGET_FPU_DOUBLE) { /* Note that we've used the skipped register. */ - if (mode == SFmode && ca->free_single_fp_reg) + if (arg.mode == SFmode && ca->free_single_fp_reg) { ca->free_single_fp_reg = 0; return; @@ -8103,21 +8088,19 @@ sh_function_arg_advance (cumulative_args_t ca_v, machine_mode mode, skipped in order to align the DF value. We note this skipped register, because the next SF value will use it, and not the SF that follows the DF. */ - if (mode == DFmode + if (arg.mode == DFmode && sh_round_reg (*ca, DFmode) != sh_round_reg (*ca, SFmode)) { ca->free_single_fp_reg = (sh_round_reg (*ca, SFmode) - + BASE_ARG_REG (mode)); + + BASE_ARG_REG (arg.mode)); } } if (! ((TARGET_SH4 || TARGET_SH2A) || ca->renesas_abi) - || sh_pass_in_reg_p (*ca, mode, type)) - (ca->arg_count[(int) get_sh_arg_class (mode)] - = (sh_round_reg (*ca, mode) - + (mode == BLKmode - ? CEIL (int_size_in_bytes (type), UNITS_PER_WORD) - : CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD)))); + || sh_pass_in_reg_p (*ca, arg.mode, arg.type)) + (ca->arg_count[(int) get_sh_arg_class (arg.mode)] + = (sh_round_reg (*ca, arg.mode) + + CEIL (arg.promoted_size_in_bytes (), UNITS_PER_WORD))); } /* The Renesas calling convention doesn't quite fit into this scheme since @@ -8190,8 +8173,7 @@ sh_return_in_memory (const_tree type, const_tree fndecl) function that tell if a function uses varargs or stdarg. */ static void sh_setup_incoming_varargs (cumulative_args_t ca, - machine_mode mode, - tree type, + const function_arg_info &arg, int *pretend_arg_size, int second_time ATTRIBUTE_UNUSED) { @@ -8200,10 +8182,9 @@ sh_setup_incoming_varargs (cumulative_args_t ca, { int named_parm_regs, anon_parm_regs; - named_parm_regs = (sh_round_reg (*get_cumulative_args (ca), mode) - + (mode == BLKmode - ? CEIL (int_size_in_bytes (type), UNITS_PER_WORD) - : CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD))); + named_parm_regs = (sh_round_reg (*get_cumulative_args (ca), arg.mode) + + CEIL (arg.promoted_size_in_bytes (), + UNITS_PER_WORD)); anon_parm_regs = NPARM_REGS (SImode) - named_parm_regs; if (anon_parm_regs > 0) *pretend_arg_size = anon_parm_regs * 4; @@ -10825,10 +10806,11 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, { tree ptype = build_pointer_type (TREE_TYPE (funtype)); - sh_function_arg_advance (pack_cumulative_args (&cum), Pmode, ptype, true); + function_arg_info ptr_arg (ptype, Pmode, /*named=*/true); + sh_function_arg_advance (pack_cumulative_args (&cum), ptr_arg); } - this_rtx - = sh_function_arg (pack_cumulative_args (&cum), Pmode, ptr_type_node, true); + function_arg_info ptr_arg (ptr_type_node, Pmode, /*named=*/true); + this_rtx = sh_function_arg (pack_cumulative_args (&cum), ptr_arg); /* For SHcompact, we only have r0 for a scratch register: r1 is the static chain pointer (even if you can't have nested virtual functions diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index a15f27f..68e3dce 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -655,20 +655,17 @@ static rtx sparc_legitimize_address (rtx, rtx, machine_mode); static rtx sparc_delegitimize_address (rtx); static bool sparc_mode_dependent_address_p (const_rtx, addr_space_t); static bool sparc_pass_by_reference (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static void sparc_function_arg_advance (cumulative_args_t, - machine_mode, const_tree, bool); -static rtx sparc_function_arg_1 (cumulative_args_t, - machine_mode, const_tree, bool, bool); -static rtx sparc_function_arg (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); +static rtx sparc_function_arg (cumulative_args_t, const function_arg_info &); static rtx sparc_function_incoming_arg (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static pad_direction sparc_function_arg_padding (machine_mode, const_tree); static unsigned int sparc_function_arg_boundary (machine_mode, const_tree); static int sparc_arg_partial_bytes (cumulative_args_t, - machine_mode, tree, bool); + const function_arg_info &); static bool sparc_return_in_memory (const_tree, const_tree); static rtx sparc_struct_value_rtx (tree, int); static rtx sparc_function_value (const_tree, const_tree, bool); @@ -6743,10 +6740,10 @@ sparc_strict_argument_naming (cumulative_args_t ca ATTRIBUTE_UNUSED) Specify whether to pass the argument by reference. */ static bool -sparc_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +sparc_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { + tree type = arg.type; + machine_mode mode = arg.mode; if (TARGET_ARCH32) /* Original SPARC 32-bit ABI says that structures and unions, and quad-precision floats are passed by reference. @@ -7379,24 +7376,22 @@ function_arg_vector_value (int size, int slotno, bool named, int regno) CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. - NAMED is true if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). + ARG is a description of the argument. INCOMING_P is false for TARGET_FUNCTION_ARG, true for TARGET_FUNCTION_INCOMING_ARG. */ static rtx -sparc_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named, bool incoming) +sparc_function_arg_1 (cumulative_args_t cum_v, const function_arg_info &arg, + bool incoming) { const CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); const int regbase = incoming ? SPARC_INCOMING_INT_ARG_FIRST : SPARC_OUTGOING_INT_ARG_FIRST; int slotno, regno, padding; + tree type = arg.type; + machine_mode mode = arg.mode; enum mode_class mclass = GET_MODE_CLASS (mode); + bool named = arg.named; slotno = function_arg_slotno (cum, mode, type, named, incoming, ®no, &padding); @@ -7495,19 +7490,18 @@ sparc_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, /* Handle the TARGET_FUNCTION_ARG target hook. */ static rtx -sparc_function_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +sparc_function_arg (cumulative_args_t cum, const function_arg_info &arg) { - return sparc_function_arg_1 (cum, mode, type, named, false); + return sparc_function_arg_1 (cum, arg, false); } /* Handle the TARGET_FUNCTION_INCOMING_ARG target hook. */ static rtx -sparc_function_incoming_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named) +sparc_function_incoming_arg (cumulative_args_t cum, + const function_arg_info &arg) { - return sparc_function_arg_1 (cum, mode, type, named, true); + return sparc_function_arg_1 (cum, arg, true); } /* For sparc64, objects requiring 16 byte alignment are passed that way. */ @@ -7533,14 +7527,13 @@ sparc_function_arg_boundary (machine_mode mode, const_tree type) mode] will be split between that reg and memory. */ static int -sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, - tree type, bool named) +sparc_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg) { int slotno, regno, padding; /* We pass false for incoming here, it doesn't matter. */ - slotno = function_arg_slotno (get_cumulative_args (cum), mode, type, named, - false, ®no, &padding); + slotno = function_arg_slotno (get_cumulative_args (cum), arg.mode, arg.type, + arg.named, false, ®no, &padding); if (slotno == -1) return 0; @@ -7550,7 +7543,7 @@ sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, /* We are guaranteed by pass_by_reference that the size of the argument is not greater than 8 bytes, so we only need to return one word if the argument is partially passed in registers. */ - const int size = GET_MODE_SIZE (mode); + const int size = GET_MODE_SIZE (arg.mode); if (size > UNITS_PER_WORD && slotno == SPARC_INT_ARG_MAX - 1) return UNITS_PER_WORD; @@ -7560,33 +7553,33 @@ sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, /* We are guaranteed by pass_by_reference that the size of the argument is not greater than 16 bytes, so we only need to return one word if the argument is partially passed in registers. */ - if (type && AGGREGATE_TYPE_P (type)) + if (arg.aggregate_type_p ()) { - const int size = int_size_in_bytes (type); + const int size = int_size_in_bytes (arg.type); if (size > UNITS_PER_WORD && (slotno == SPARC_INT_ARG_MAX - 1 || slotno == SPARC_FP_ARG_MAX - 1)) return UNITS_PER_WORD; } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT - || ((GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT - || (type && VECTOR_TYPE_P (type))) - && !(TARGET_FPU && named))) + else if (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_INT + || ((GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT + || (arg.type && VECTOR_TYPE_P (arg.type))) + && !(TARGET_FPU && arg.named))) { - const int size = (type && VECTOR_FLOAT_TYPE_P (type)) - ? int_size_in_bytes (type) - : GET_MODE_SIZE (mode); + const int size = (arg.type && VECTOR_FLOAT_TYPE_P (arg.type)) + ? int_size_in_bytes (arg.type) + : GET_MODE_SIZE (arg.mode); if (size > UNITS_PER_WORD && slotno == SPARC_INT_ARG_MAX - 1) return UNITS_PER_WORD; } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT - || (type && VECTOR_TYPE_P (type))) + else if (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT + || (arg.type && VECTOR_TYPE_P (arg.type))) { - const int size = (type && VECTOR_FLOAT_TYPE_P (type)) - ? int_size_in_bytes (type) - : GET_MODE_SIZE (mode); + const int size = (arg.type && VECTOR_FLOAT_TYPE_P (arg.type)) + ? int_size_in_bytes (arg.type) + : GET_MODE_SIZE (arg.mode); if (size > UNITS_PER_WORD && slotno == SPARC_FP_ARG_MAX - 1) return UNITS_PER_WORD; @@ -7597,19 +7590,19 @@ sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, } /* Handle the TARGET_FUNCTION_ARG_ADVANCE hook. - Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - TYPE is null for libcalls where that information may not be available. */ + Update the data in CUM to advance over argument ARG. */ static void -sparc_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +sparc_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + tree type = arg.type; + machine_mode mode = arg.mode; int regno, padding; /* We pass false for incoming here, it doesn't matter. */ - function_arg_slotno (cum, mode, type, named, false, ®no, &padding); + function_arg_slotno (cum, mode, type, arg.named, false, ®no, &padding); /* If argument requires leading padding, add it. */ cum->words += padding; @@ -7935,7 +7928,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, bool indirect; tree ptrtype = build_pointer_type (type); - if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) + if (pass_va_arg_by_reference (type)) { indirect = true; size = rsize = UNITS_PER_WORD; diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index f88ad19..7afd43b 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -3829,9 +3829,7 @@ spu_function_value (const_tree type, const_tree func ATTRIBUTE_UNUSED) } static rtx -spu_function_arg (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +spu_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int byte_size; @@ -3839,8 +3837,7 @@ spu_function_arg (cumulative_args_t cum_v, if (*cum >= MAX_REGISTER_ARGS) return 0; - byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + byte_size = arg.promoted_size_in_bytes (); /* The ABI does not allow parameters to be passed partially in reg and partially in stack. */ @@ -3848,7 +3845,7 @@ spu_function_arg (cumulative_args_t cum_v, return 0; /* Make sure small structs are left justified in a register. */ - if ((mode == BLKmode || (type && AGGREGATE_TYPE_P (type))) + if ((arg.mode == BLKmode || arg.aggregate_type_p ()) && byte_size < UNITS_PER_WORD && byte_size > 0) { machine_mode smode; @@ -3859,25 +3856,25 @@ spu_function_arg (cumulative_args_t cum_v, gr_reg = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (smode, FIRST_ARG_REGNUM + *cum), const0_rtx); - return gen_rtx_PARALLEL (mode, gen_rtvec (1, gr_reg)); + return gen_rtx_PARALLEL (arg.mode, gen_rtvec (1, gr_reg)); } else - return gen_rtx_REG (mode, FIRST_ARG_REGNUM + *cum); + return gen_rtx_REG (arg.mode, FIRST_ARG_REGNUM + *cum); } static void -spu_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +spu_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum += (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST + *cum += (arg.type && TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST ? 1 - : mode == BLKmode - ? ((int_size_in_bytes (type) + 15) / 16) - : mode == VOIDmode + : arg.mode == BLKmode + ? ((int_size_in_bytes (arg.type) + 15) / 16) + : arg.mode == VOIDmode ? 1 - : spu_hard_regno_nregs (FIRST_ARG_REGNUM, mode)); + : spu_hard_regno_nregs (FIRST_ARG_REGNUM, arg.mode)); } /* Implement TARGET_FUNCTION_ARG_OFFSET. The SPU ABI wants 32/64-bit @@ -3902,11 +3899,9 @@ spu_function_arg_padding (machine_mode, const_tree) /* Variable sized types are passed by reference. */ static bool -spu_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, bool named ATTRIBUTE_UNUSED) +spu_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST; + return arg.type && TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST; } @@ -4053,8 +4048,7 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p, /* if an object is dynamically sized, a pointer to it is passed instead of the object itself. */ - pass_by_reference_p = pass_by_reference (NULL, TYPE_MODE (type), type, - false); + pass_by_reference_p = pass_va_arg_by_reference (type); if (pass_by_reference_p) type = build_pointer_type (type); size = int_size_in_bytes (type); @@ -4092,8 +4086,9 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p, in the stack then save no registers. Set pretend_args_size to the amount of space needed to save the registers. */ static void -spu_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, - tree type, int *pretend_size, int no_rtl) +spu_setup_incoming_varargs (cumulative_args_t cum, + const function_arg_info &arg, + int *pretend_size, int no_rtl) { if (!no_rtl) { @@ -4104,7 +4099,7 @@ spu_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode, /* cum currently points to the last named argument, we want to start at the next argument. */ - spu_function_arg_advance (pack_cumulative_args (&ncum), mode, type, true); + spu_function_arg_advance (pack_cumulative_args (&ncum), arg); offset = -STACK_POINTER_OFFSET; for (regno = ncum; regno < MAX_REGISTER_ARGS; regno++) diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index aec9f2d..23f546a 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1205,9 +1205,8 @@ xstormy16_function_profiler (void) sorry ("function_profiler support"); } -/* Update CUM to advance past an argument in the argument list. The - values MODE, TYPE and NAMED describe that argument. Once this is - done, the variable CUM is suitable for analyzing the *following* +/* Update CUM to advance past argument ARG. Once this is done, + the variable CUM is suitable for analyzing the *following* argument with `TARGET_FUNCTION_ARG', etc. This function need not do anything if the argument in question was @@ -1217,8 +1216,8 @@ xstormy16_function_profiler (void) the word count. */ static void -xstormy16_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +xstormy16_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -1226,24 +1225,25 @@ xstormy16_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, and partially on the stack, the whole of it is passed on the stack. */ if (*cum < NUM_ARGUMENT_REGISTERS - && *cum + XSTORMY16_WORD_SIZE (type, mode) > NUM_ARGUMENT_REGISTERS) + && (*cum + XSTORMY16_WORD_SIZE (arg.type, arg.mode) + > NUM_ARGUMENT_REGISTERS)) *cum = NUM_ARGUMENT_REGISTERS; - *cum += XSTORMY16_WORD_SIZE (type, mode); + *cum += XSTORMY16_WORD_SIZE (arg.type, arg.mode); } static rtx -xstormy16_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +xstormy16_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - if (mode == VOIDmode) + if (arg.end_marker_p ()) return const0_rtx; - if (targetm.calls.must_pass_in_stack (mode, type) - || *cum + XSTORMY16_WORD_SIZE (type, mode) > NUM_ARGUMENT_REGISTERS) + if (targetm.calls.must_pass_in_stack (arg) + || (*cum + XSTORMY16_WORD_SIZE (arg.type, arg.mode) + > NUM_ARGUMENT_REGISTERS)) return NULL_RTX; - return gen_rtx_REG (mode, *cum + FIRST_ARGUMENT_REGISTER); + return gen_rtx_REG (arg.mode, *cum + FIRST_ARGUMENT_REGISTER); } /* Build the va_list type. @@ -1342,7 +1342,7 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, count = build3 (COMPONENT_REF, TREE_TYPE (f_count), valist, f_count, NULL_TREE); - must_stack = targetm.calls.must_pass_in_stack (TYPE_MODE (type), type); + must_stack = must_pass_va_arg_in_stack (type); size_tree = round_up (size_in_bytes (type), UNITS_PER_WORD); gimplify_expr (&size_tree, pre_p, NULL, is_gimple_val, fb_rvalue); diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 575780f..4f29655 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -159,12 +159,11 @@ tilegx_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) /* Implement TARGET_PASS_BY_REFERENCE. Variable sized types are passed by reference. */ static bool -tilegx_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, bool named ATTRIBUTE_UNUSED) +tilegx_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return (type && TYPE_SIZE (type) - && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST); + return (arg.type + && TYPE_SIZE (arg.type) + && TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST); } @@ -217,13 +216,10 @@ tilegx_function_arg_boundary (machine_mode mode, const_tree type) /* Implement TARGET_FUNCTION_ARG. */ static rtx -tilegx_function_arg (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +tilegx_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS cum = *get_cumulative_args (cum_v); - int byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + int byte_size = arg.promoted_size_in_bytes (); bool doubleword_aligned_p; if (cum >= TILEGX_NUM_ARG_REGS) @@ -231,7 +227,7 @@ tilegx_function_arg (cumulative_args_t cum_v, /* See whether the argument has doubleword alignment. */ doubleword_aligned_p = - tilegx_function_arg_boundary (mode, type) > BITS_PER_WORD; + tilegx_function_arg_boundary (arg.mode, arg.type) > BITS_PER_WORD; if (doubleword_aligned_p) cum += cum & 1; @@ -242,26 +238,24 @@ tilegx_function_arg (cumulative_args_t cum_v, > TILEGX_NUM_ARG_REGS) return NULL_RTX; - return gen_rtx_REG (mode, cum); + return gen_rtx_REG (arg.mode, cum); } /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void tilegx_function_arg_advance (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + int byte_size = arg.promoted_size_in_bytes (); int word_size = (byte_size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; bool doubleword_aligned_p; /* See whether the argument has doubleword alignment. */ doubleword_aligned_p = - tilegx_function_arg_boundary (mode, type) > BITS_PER_WORD; + tilegx_function_arg_boundary (arg.mode, arg.type) > BITS_PER_WORD; if (doubleword_aligned_p) *cum += *cum & 1; @@ -391,8 +385,8 @@ tilegx_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) /* Implement TARGET_SETUP_INCOMING_VARARGS. */ static void tilegx_setup_incoming_varargs (cumulative_args_t cum, - machine_mode mode, - tree type, int *pretend_args, int no_rtl) + const function_arg_info &arg, + int *pretend_args, int no_rtl) { CUMULATIVE_ARGS local_cum = *get_cumulative_args (cum); int first_reg; @@ -400,8 +394,7 @@ tilegx_setup_incoming_varargs (cumulative_args_t cum, /* The caller has advanced CUM up to, but not beyond, the last named argument. Advance a local copy of CUM past the last "real" named argument, to find out how many registers are left over. */ - targetm.calls.function_arg_advance (pack_cumulative_args (&local_cum), - mode, type, true); + targetm.calls.function_arg_advance (pack_cumulative_args (&local_cum), arg); first_reg = local_cum; if (local_cum < TILEGX_NUM_ARG_REGS) @@ -471,8 +464,7 @@ tilegx_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, /* If an object is dynamically sized, a pointer to it is passed instead of the object itself. */ - pass_by_reference_p = pass_by_reference (NULL, TYPE_MODE (type), type, - false); + pass_by_reference_p = pass_va_arg_by_reference (type); if (pass_by_reference_p) type = build_pointer_type (type); diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c index b4adfa4..2e14b2e 100644 --- a/gcc/config/tilepro/tilepro.c +++ b/gcc/config/tilepro/tilepro.c @@ -134,12 +134,11 @@ tilepro_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) /* Implement TARGET_PASS_BY_REFERENCE. Variable sized types are passed by reference. */ static bool -tilepro_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, bool named ATTRIBUTE_UNUSED) +tilepro_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - return (type && TYPE_SIZE (type) - && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST); + return (arg.type + && TYPE_SIZE (arg.type) + && TREE_CODE (TYPE_SIZE (arg.type)) != INTEGER_CST); } @@ -169,13 +168,10 @@ tilepro_function_arg_boundary (machine_mode mode, const_tree type) /* Implement TARGET_FUNCTION_ARG. */ static rtx -tilepro_function_arg (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +tilepro_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS cum = *get_cumulative_args (cum_v); - int byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + int byte_size = arg.promoted_size_in_bytes (); bool doubleword_aligned_p; if (cum >= TILEPRO_NUM_ARG_REGS) @@ -183,7 +179,7 @@ tilepro_function_arg (cumulative_args_t cum_v, /* See whether the argument has doubleword alignment. */ doubleword_aligned_p = - tilepro_function_arg_boundary (mode, type) > BITS_PER_WORD; + tilepro_function_arg_boundary (arg.mode, arg.type) > BITS_PER_WORD; if (doubleword_aligned_p) cum += cum & 1; @@ -194,26 +190,24 @@ tilepro_function_arg (cumulative_args_t cum_v, > TILEPRO_NUM_ARG_REGS) return NULL_RTX; - return gen_rtx_REG (mode, cum); + return gen_rtx_REG (arg.mode, cum); } /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ static void tilepro_function_arg_advance (cumulative_args_t cum_v, - machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - int byte_size = ((mode == BLKmode) - ? int_size_in_bytes (type) : GET_MODE_SIZE (mode)); + int byte_size = arg.promoted_size_in_bytes (); int word_size = (byte_size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; bool doubleword_aligned_p; /* See whether the argument has doubleword alignment. */ doubleword_aligned_p = - tilepro_function_arg_boundary (mode, type) > BITS_PER_WORD; + tilepro_function_arg_boundary (arg.mode, arg.type) > BITS_PER_WORD; if (doubleword_aligned_p) *cum += *cum & 1; @@ -343,8 +337,8 @@ tilepro_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) /* Implement TARGET_SETUP_INCOMING_VARARGS. */ static void tilepro_setup_incoming_varargs (cumulative_args_t cum, - machine_mode mode, - tree type, int *pretend_args, int no_rtl) + const function_arg_info &arg, + int *pretend_args, int no_rtl) { CUMULATIVE_ARGS local_cum = *get_cumulative_args (cum); int first_reg; @@ -352,8 +346,7 @@ tilepro_setup_incoming_varargs (cumulative_args_t cum, /* The caller has advanced CUM up to, but not beyond, the last named argument. Advance a local copy of CUM past the last "real" named argument, to find out how many registers are left over. */ - targetm.calls.function_arg_advance (pack_cumulative_args (&local_cum), - mode, type, true); + targetm.calls.function_arg_advance (pack_cumulative_args (&local_cum), arg); first_reg = local_cum; if (local_cum < TILEPRO_NUM_ARG_REGS) @@ -419,8 +412,7 @@ tilepro_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p, /* if an object is dynamically sized, a pointer to it is passed instead of the object itself. */ - pass_by_reference_p = pass_by_reference (NULL, TYPE_MODE (type), type, - false); + pass_by_reference_p = pass_va_arg_by_reference (type); if (pass_by_reference_p) type = build_pointer_type (type); diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index cca24ed..d5c9ba7 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -110,43 +110,29 @@ v850_all_frame_related (rtx par) Specify whether to pass the argument by reference. */ static bool -v850_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode, const_tree type, - bool named ATTRIBUTE_UNUSED) +v850_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { - unsigned HOST_WIDE_INT size; - if (!TARGET_GCC_ABI) return 0; - if (type) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + unsigned HOST_WIDE_INT size = arg.type_size_in_bytes (); return size > 8; } -/* Return an RTX to represent where an argument with mode MODE - and type TYPE will be passed to a function. If the result - is NULL_RTX, the argument will be pushed. */ +/* Return an RTX to represent where argument ARG will be passed to a function. + If the result is NULL_RTX, the argument will be pushed. */ static rtx -v850_function_arg (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named) +v850_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); rtx result = NULL_RTX; int size, align; - if (!named) + if (!arg.named) return NULL_RTX; - if (mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + size = arg.promoted_size_in_bytes (); size = (size + UNITS_PER_WORD -1) & ~(UNITS_PER_WORD -1); if (size < 1) @@ -158,8 +144,8 @@ v850_function_arg (cumulative_args_t cum_v, machine_mode mode, if (!TARGET_GCC_ABI) align = UNITS_PER_WORD; - else if (size <= UNITS_PER_WORD && type) - align = TYPE_ALIGN (type) / BITS_PER_UNIT; + else if (size <= UNITS_PER_WORD && arg.type) + align = TYPE_ALIGN (arg.type) / BITS_PER_UNIT; else align = size; @@ -168,23 +154,23 @@ v850_function_arg (cumulative_args_t cum_v, machine_mode mode, if (cum->nbytes > 4 * UNITS_PER_WORD) return NULL_RTX; - if (type == NULL_TREE + if (arg.type == NULL_TREE && cum->nbytes + size > 4 * UNITS_PER_WORD) return NULL_RTX; switch (cum->nbytes / UNITS_PER_WORD) { case 0: - result = gen_rtx_REG (mode, 6); + result = gen_rtx_REG (arg.mode, 6); break; case 1: - result = gen_rtx_REG (mode, 7); + result = gen_rtx_REG (arg.mode, 7); break; case 2: - result = gen_rtx_REG (mode, 8); + result = gen_rtx_REG (arg.mode, 8); break; case 3: - result = gen_rtx_REG (mode, 9); + result = gen_rtx_REG (arg.mode, 9); break; default: result = NULL_RTX; @@ -196,27 +182,22 @@ v850_function_arg (cumulative_args_t cum_v, machine_mode mode, /* Return the number of bytes which must be put into registers for values which are part in registers and part in memory. */ static int -v850_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, - tree type, bool named) +v850_arg_partial_bytes (cumulative_args_t cum_v, const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int size, align; - if (!named) + if (!arg.named) return 0; - if (mode == BLKmode) - size = int_size_in_bytes (type); - else - size = GET_MODE_SIZE (mode); - + size = arg.promoted_size_in_bytes (); if (size < 1) size = 1; if (!TARGET_GCC_ABI) align = UNITS_PER_WORD; - else if (type) - align = TYPE_ALIGN (type) / BITS_PER_UNIT; + else if (arg.type) + align = TYPE_ALIGN (arg.type) / BITS_PER_UNIT; else align = size; @@ -228,34 +209,29 @@ v850_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, if (cum->nbytes + size <= 4 * UNITS_PER_WORD) return 0; - if (type == NULL_TREE + if (arg.type == NULL_TREE && cum->nbytes + size > 4 * UNITS_PER_WORD) return 0; return 4 * UNITS_PER_WORD - cum->nbytes; } -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -v850_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +v850_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); if (!TARGET_GCC_ABI) - cum->nbytes += (((mode != BLKmode - ? GET_MODE_SIZE (mode) - : int_size_in_bytes (type)) + UNITS_PER_WORD - 1) + cum->nbytes += ((arg.promoted_size_in_bytes () + UNITS_PER_WORD - 1) & -UNITS_PER_WORD); else - cum->nbytes += (((type && int_size_in_bytes (type) > 8 + cum->nbytes += (((arg.type && int_size_in_bytes (arg.type) > 8 ? GET_MODE_SIZE (Pmode) - : (mode != BLKmode - ? GET_MODE_SIZE (mode) - : int_size_in_bytes (type))) + UNITS_PER_WORD - 1) + : (HOST_WIDE_INT) arg.promoted_size_in_bytes ()) + + UNITS_PER_WORD - 1) & -UNITS_PER_WORD); } @@ -3287,7 +3263,7 @@ v850_modes_tieable_p (machine_mode mode1, machine_mode mode2) #define TARGET_PASS_BY_REFERENCE v850_pass_by_reference #undef TARGET_CALLEE_COPIES -#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true +#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_arg_info_true #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES v850_arg_partial_bytes diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 9559ffb..1c220ff 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -54,10 +54,9 @@ static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, static int vax_address_cost_1 (rtx); static int vax_address_cost (rtx, machine_mode, addr_space_t, bool); static bool vax_rtx_costs (rtx, machine_mode, int, int, int *, bool); -static rtx vax_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); -static void vax_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static rtx vax_function_arg (cumulative_args_t, const function_arg_info &); +static void vax_function_arg_advance (cumulative_args_t, + const function_arg_info &); static rtx vax_struct_value_rtx (tree, int); static void vax_asm_trampoline_template (FILE *); static void vax_trampoline_init (rtx, tree, rtx); @@ -2141,43 +2140,23 @@ vax_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, return size > 255 * 4 ? 0 : (HOST_WIDE_INT) size; } -/* Define where to put the arguments to a function. - Value is zero to push the argument on the stack, - or a hard register in which to store the argument. - - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. - CUM is a variable of type CUMULATIVE_ARGS which gives info about - the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ - -/* On the VAX all args are pushed. */ +/* Implement TARGET_FUNCTION_ARG. On the VAX all args are pushed. */ static rtx -vax_function_arg (cumulative_args_t cum ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +vax_function_arg (cumulative_args_t, const function_arg_info &) { return NULL_RTX; } -/* Update the data in CUM to advance over an argument of mode MODE and - data type TYPE. (TYPE is null for libcalls where that information - may not be available.) */ +/* Update the data in CUM to advance over argument ARG. */ static void -vax_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +vax_function_arg_advance (cumulative_args_t cum_v, + const function_arg_info &arg) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - *cum += (mode != BLKmode - ? (GET_MODE_SIZE (mode) + 3) & ~3 - : (int_size_in_bytes (type) + 3) & ~3); + *cum += (arg.promoted_size_in_bytes () + 3) & ~3; } static HOST_WIDE_INT diff --git a/gcc/config/visium/visium.c b/gcc/config/visium/visium.c index 431f64c..b51c23f 100644 --- a/gcc/config/visium/visium.c +++ b/gcc/config/visium/visium.c @@ -158,14 +158,13 @@ static struct machine_function *visium_init_machine_status (void); /* Target hooks and TARGET_INITIALIZER */ -static bool visium_pass_by_reference (cumulative_args_t, machine_mode, - const_tree, bool); +static bool visium_pass_by_reference (cumulative_args_t, + const function_arg_info &); -static rtx visium_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static rtx visium_function_arg (cumulative_args_t, const function_arg_info &); -static void visium_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); +static void visium_function_arg_advance (cumulative_args_t, + const function_arg_info &); static bool visium_return_in_memory (const_tree, const_tree fntype); @@ -175,8 +174,8 @@ static rtx visium_function_value (const_tree, const_tree fn_decl_or_type, static rtx visium_libcall_value (machine_mode, const_rtx); static void visium_setup_incoming_varargs (cumulative_args_t, - machine_mode, - tree, int *, int); + const function_arg_info &, + int *, int); static void visium_va_start (tree valist, rtx nextarg); @@ -1310,11 +1309,9 @@ visium_reorg (void) /* Return true if an argument must be passed by indirect reference. */ static bool -visium_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type, - bool named ATTRIBUTE_UNUSED) +visium_pass_by_reference (cumulative_args_t, const function_arg_info &arg) { + tree type = arg.type; return type && (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == VECTOR_TYPE); } @@ -1332,59 +1329,54 @@ visium_pass_by_reference (cumulative_args_t ca ATTRIBUTE_UNUSED, in general registers. */ static rtx -visium_function_arg (cumulative_args_t pcum_v, machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +visium_function_arg (cumulative_args_t pcum_v, const function_arg_info &arg) { int size; CUMULATIVE_ARGS *ca = get_cumulative_args (pcum_v); - size = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; - if (mode == VOIDmode) + size = (GET_MODE_SIZE (arg.mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + if (arg.end_marker_p ()) return GEN_INT (0); /* Scalar or complex single precision floating point arguments are returned in floating registers. */ if (TARGET_FPU - && ((GET_MODE_CLASS (mode) == MODE_FLOAT - && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE) - || (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT - && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2))) + && ((GET_MODE_CLASS (arg.mode) == MODE_FLOAT + && GET_MODE_SIZE (arg.mode) <= UNITS_PER_HWFPVALUE) + || (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT + && GET_MODE_SIZE (arg.mode) <= UNITS_PER_HWFPVALUE * 2))) { if (ca->frcount + size <= MAX_ARGS_IN_FP_REGISTERS) - return gen_rtx_REG (mode, FP_ARG_FIRST + ca->frcount); + return gen_rtx_REG (arg.mode, FP_ARG_FIRST + ca->frcount); else return NULL_RTX; } if (ca->grcount + size <= MAX_ARGS_IN_GP_REGISTERS) - return gen_rtx_REG (mode, ca->grcount + GP_ARG_FIRST); + return gen_rtx_REG (arg.mode, ca->grcount + GP_ARG_FIRST); return NULL_RTX; } -/* Update the summarizer variable pointed to by PCUM_V to advance past an - argument in the argument list. The values MODE, TYPE and NAMED describe - that argument. Once this is done, the variable CUM is suitable for +/* Update the summarizer variable pointed to by PCUM_V to advance past + argument ARG. Once this is done, the variable CUM is suitable for analyzing the _following_ argument with visium_function_arg. */ static void visium_function_arg_advance (cumulative_args_t pcum_v, - machine_mode mode, - const_tree type ATTRIBUTE_UNUSED, - bool named) + const function_arg_info &arg) { - int size = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + int size = (GET_MODE_SIZE (arg.mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int stack_size = 0; CUMULATIVE_ARGS *ca = get_cumulative_args (pcum_v); /* Scalar or complex single precision floating point arguments are returned in floating registers. */ if (TARGET_FPU - && ((GET_MODE_CLASS (mode) == MODE_FLOAT - && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE) - || (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT - && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2))) + && ((GET_MODE_CLASS (arg.mode) == MODE_FLOAT + && GET_MODE_SIZE (arg.mode) <= UNITS_PER_HWFPVALUE) + || (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT + && GET_MODE_SIZE (arg.mode) <= UNITS_PER_HWFPVALUE * 2))) { if (ca->frcount + size <= MAX_ARGS_IN_FP_REGISTERS) ca->frcount += size; @@ -1407,7 +1399,7 @@ visium_function_arg_advance (cumulative_args_t pcum_v, } } - if (named) + if (arg.named) ca->stack_words += stack_size; } @@ -1462,8 +1454,7 @@ visium_libcall_value (machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED) static void visium_setup_incoming_varargs (cumulative_args_t pcum_v, - machine_mode mode, - tree type, + const function_arg_info &arg, int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) { @@ -1489,7 +1480,7 @@ visium_setup_incoming_varargs (cumulative_args_t pcum_v, /* The caller has advanced ARGS_SO_FAR up to, but not beyond, the last named argument. Advance a local copy of ARGS_SO_FAR past the last "real" named argument, to find out how many registers are left over. */ - TARGET_FUNCTION_ARG_ADVANCE (local_args_so_far, mode, type, 1); + TARGET_FUNCTION_ARG_ADVANCE (local_args_so_far, arg); /* Find how many registers we need to save. */ locargs = get_cumulative_args (local_args_so_far); @@ -1637,8 +1628,7 @@ visium_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, tree f_ovfl, f_gbase, f_fbase, f_gbytes, f_fbytes; tree ovfl, base, bytes; HOST_WIDE_INT size, rsize; - const bool by_reference_p - = pass_by_reference (NULL, TYPE_MODE (type), type, false); + const bool by_reference_p = pass_va_arg_by_reference (type); const bool float_reg_arg_p = (TARGET_FPU && !by_reference_p && ((GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index a999567..98f30c5 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -141,12 +141,11 @@ static tree xtensa_build_builtin_va_list (void); static bool xtensa_return_in_memory (const_tree, const_tree); static tree xtensa_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); -static void xtensa_function_arg_advance (cumulative_args_t, machine_mode, - const_tree, bool); -static rtx xtensa_function_arg (cumulative_args_t, machine_mode, - const_tree, bool); +static void xtensa_function_arg_advance (cumulative_args_t, + const function_arg_info &); +static rtx xtensa_function_arg (cumulative_args_t, const function_arg_info &); static rtx xtensa_function_incoming_arg (cumulative_args_t, - machine_mode, const_tree, bool); + const function_arg_info &); static rtx xtensa_function_value (const_tree, const_tree, bool); static rtx xtensa_libcall_value (machine_mode, const_rtx); static bool xtensa_function_value_regno_p (const unsigned int); @@ -2106,8 +2105,8 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, int incoming) /* Advance the argument to the next argument position. */ static void -xtensa_function_arg_advance (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +xtensa_function_arg_advance (cumulative_args_t cum, + const function_arg_info &arg) { int words, max; int *arg_words; @@ -2115,12 +2114,11 @@ xtensa_function_arg_advance (cumulative_args_t cum, machine_mode mode, arg_words = &get_cumulative_args (cum)->arg_words; max = MAX_ARGS_IN_REGISTERS; - words = (((mode != BLKmode) - ? (int) GET_MODE_SIZE (mode) - : int_size_in_bytes (type)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + words = ((arg.promoted_size_in_bytes () + UNITS_PER_WORD - 1) + / UNITS_PER_WORD); if (*arg_words < max - && (targetm.calls.must_pass_in_stack (mode, type) + && (targetm.calls.must_pass_in_stack (arg) || *arg_words + words > max)) *arg_words = max; @@ -2128,13 +2126,13 @@ xtensa_function_arg_advance (cumulative_args_t cum, machine_mode mode, } -/* Return an RTL expression containing the register for the given mode, +/* Return an RTL expression containing the register for the given argument, or 0 if the argument is to be passed on the stack. INCOMING_P is nonzero if this is an incoming argument to the current function. */ static rtx -xtensa_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, - const_tree type, bool incoming_p) +xtensa_function_arg_1 (cumulative_args_t cum_v, const function_arg_info &arg, + bool incoming_p) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int regbase, words, max; @@ -2145,13 +2143,12 @@ xtensa_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, regbase = (incoming_p ? GP_ARG_FIRST : GP_OUTGOING_ARG_FIRST); max = MAX_ARGS_IN_REGISTERS; - words = (((mode != BLKmode) - ? (int) GET_MODE_SIZE (mode) - : int_size_in_bytes (type)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + words = ((arg.promoted_size_in_bytes () + UNITS_PER_WORD - 1) + / UNITS_PER_WORD); - if (type && (TYPE_ALIGN (type) > BITS_PER_WORD)) + if (arg.type && (TYPE_ALIGN (arg.type) > BITS_PER_WORD)) { - int align = MIN (TYPE_ALIGN (type), STACK_BOUNDARY) / BITS_PER_WORD; + int align = MIN (TYPE_ALIGN (arg.type), STACK_BOUNDARY) / BITS_PER_WORD; *arg_words = (*arg_words + align - 1) & -align; } @@ -2163,25 +2160,24 @@ xtensa_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, if (cum->incoming && regno <= A7_REG && regno + words > A7_REG) cfun->machine->need_a7_copy = TARGET_WINDOWED_ABI; - return gen_rtx_REG (mode, regno); + return gen_rtx_REG (arg.mode, regno); } /* Implement TARGET_FUNCTION_ARG. */ static rtx -xtensa_function_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +xtensa_function_arg (cumulative_args_t cum, const function_arg_info &arg) { - return xtensa_function_arg_1 (cum, mode, type, false); + return xtensa_function_arg_1 (cum, arg, false); } /* Implement TARGET_FUNCTION_INCOMING_ARG. */ static rtx -xtensa_function_incoming_arg (cumulative_args_t cum, machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) +xtensa_function_incoming_arg (cumulative_args_t cum, + const function_arg_info &arg) { - return xtensa_function_arg_1 (cum, mode, type, true); + return xtensa_function_arg_1 (cum, arg, true); } static unsigned int @@ -3252,7 +3248,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, tree lab_false, lab_over, lab_false2; bool indirect; - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect = pass_va_arg_by_reference (type); if (indirect) type = build_pointer_type (type); @@ -3328,7 +3324,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, array = create_tmp_var (ptr_type_node); lab_over = NULL; - if (!targetm.calls.must_pass_in_stack (TYPE_MODE (type), type)) + if (!must_pass_va_arg_in_stack (type)) { lab_false = create_artificial_label (UNKNOWN_LOCATION); lab_over = create_artificial_label (UNKNOWN_LOCATION); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c40bc9c..d47c2f7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-08-21 Richard Sandiford <richard.sandiford@arm.com> + + PR c++/91505 + * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside + the BUILT_IN_NORMAL block rather than afterward. + 2019-08-19 Marek Polacek <polacek@redhat.com> PR c++/91264 - detect modifying const objects in constexpr. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 08b7baa..88aa69c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2565,9 +2565,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) set_builtin_decl_declared_p (fncode, true); break; } - } - copy_attributes_to_builtin (newdecl); + copy_attributes_to_builtin (newdecl); + } } if (new_defines_function) /* If defining a function declared with other language diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index a4db1fa..a7821c2 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,40 @@ +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/88722 + * modules.cc: Include diagnostic.h. + (register_moduleinfo): Use sorry instead of gcc_assert for targets + without named sections. + +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + * d-target.cc: Include diagnostic.h. + (Target::_init): Set Tsize_t and Tptrdiff_t as D ushort and short if + the target pointer size is 2. Add sorry if the pointer size is not + either 2, 4, or 8. + +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/90446 + * d-lang.cc (d_type_for_mode): Check for all internal __intN types. + (d_type_for_size): Likewise. + +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/90445 + * d-builtins.cc (d_build_c_type_nodes): Test UINTMAX_TYPE for setting + uintmax_type_node. Set signed_size_type_node as the signed_type_for + size_type_node. + +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/90444 + * d-builtins.cc (build_frontend_type): Build anonymous RECORD_TYPE + nodes as well, push all fields to the struct members. + (d_build_builtins_module): Push anonymous va_list structs to the + builtins module, naming them __builtin_va_list. + (d_init_builtins): Use sorry instead of gcc_unreachable if va_list did + not succeed in being represented as a D type. + 2019-08-13 Richard Sandiford <richard.sandiford@arm.com> PR middle-end/91421 diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc index 3ebee72..2f7319c 100644 --- a/gcc/d/d-builtins.cc +++ b/gcc/d/d-builtins.cc @@ -213,38 +213,54 @@ build_frontend_type (tree type) break; case RECORD_TYPE: - if (TYPE_NAME (type)) + { + Identifier *ident = TYPE_IDENTIFIER (type) ? + Identifier::idPool (IDENTIFIER_POINTER (TYPE_IDENTIFIER (type))) : NULL; + + /* Neither the `object' and `gcc.builtins' modules will not exist when + this is called. Use a stub 'object' module parent in the meantime. + If `gcc.builtins' is later imported, the parent will be overridden + with the correct module symbol. */ + static Identifier *object = Identifier::idPool ("object"); + static Module *stubmod = Module::create ("object.d", object, 0, 0); + + StructDeclaration *sdecl = StructDeclaration::create (Loc (), ident, + false); + sdecl->parent = stubmod; + sdecl->structsize = int_size_in_bytes (type); + sdecl->alignsize = TYPE_ALIGN_UNIT (type); + sdecl->alignment = STRUCTALIGN_DEFAULT; + sdecl->sizeok = SIZEOKdone; + sdecl->type = (TypeStruct::create (sdecl))->addMod (mod); + sdecl->type->ctype = type; + sdecl->type->merge2 (); + + sdecl->members = new Dsymbols; + + for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { - tree structname = DECL_NAME (TYPE_NAME (type)); - Identifier *ident - = Identifier::idPool (IDENTIFIER_POINTER (structname)); - - /* Neither the `object' and `gcc.builtins' modules will not exist when - this is called. Use a stub 'object' module parent in the meantime. - If `gcc.builtins' is later imported, the parent will be overridden - with the correct module symbol. */ - static Identifier *object = Identifier::idPool ("object"); - static Module *stubmod = Module::create ("object.d", object, 0, 0); - - StructDeclaration *sdecl = StructDeclaration::create (Loc (), ident, - false); - sdecl->parent = stubmod; - sdecl->structsize = int_size_in_bytes (type); - sdecl->alignsize = TYPE_ALIGN_UNIT (type); - sdecl->alignment = STRUCTALIGN_DEFAULT; - sdecl->sizeok = SIZEOKdone; - sdecl->type = (TypeStruct::create (sdecl))->addMod (mod); - sdecl->type->ctype = type; - sdecl->type->merge2 (); - - /* Does not seem necessary to convert fields, but the members field - must be non-null for the above size setting to stick. */ - sdecl->members = new Dsymbols; - dtype = sdecl->type; - builtin_converted_decls.safe_push (builtin_data (dtype, type, sdecl)); - return dtype; + Type *ftype = build_frontend_type (TREE_TYPE (field)); + if (!ftype) + { + delete sdecl->members; + return NULL; + } + + Identifier *fident + = Identifier::idPool (IDENTIFIER_POINTER (DECL_NAME (field))); + VarDeclaration *vd = VarDeclaration::create (Loc (), ftype, fident, + NULL); + vd->offset = tree_to_uhwi (DECL_FIELD_OFFSET (field)); + vd->semanticRun = PASSsemanticdone; + vd->csym = field; + sdecl->members->push (vd); + sdecl->fields.push (vd); } - break; + + dtype = sdecl->type; + builtin_converted_decls.safe_push (builtin_data (dtype, type, sdecl)); + return dtype; + } case FUNCTION_TYPE: dtype = build_frontend_type (TREE_TYPE (type)); @@ -561,7 +577,7 @@ d_build_builtins_module (Module *m) /* Currently, there is no need to run semantic, but we do want to output initializers, typeinfo, and others on demand. */ Dsymbol *dsym = builtin_converted_decls[i].dsym; - if (dsym != NULL) + if (dsym != NULL && !dsym->isAnonymous ()) { dsym->parent = m; members->push (dsym); @@ -569,7 +585,18 @@ d_build_builtins_module (Module *m) } /* va_list should already be built, so no need to convert to D type again. */ - members->push (build_alias_declaration ("__builtin_va_list", Type::tvalist)); + StructDeclaration *sd = (Type::tvalist->ty == Tstruct) + ? ((TypeStruct *) Type::tvalist)->sym : NULL; + if (sd == NULL || !sd->isAnonymous ()) + { + members->push (build_alias_declaration ("__builtin_va_list", + Type::tvalist)); + } + else + { + sd->ident = Identifier::idPool ("__builtin_va_list"); + members->push (sd); + } /* Expose target-specific integer types to the builtins module. */ { @@ -735,27 +762,25 @@ d_build_c_type_nodes (void) = build_pointer_type (build_qualified_type (char_type_node, TYPE_QUAL_CONST)); - if (strcmp (SIZE_TYPE, "unsigned int") == 0) + if (strcmp (UINTMAX_TYPE, "unsigned int") == 0) { intmax_type_node = integer_type_node; uintmax_type_node = unsigned_type_node; - signed_size_type_node = integer_type_node; } - else if (strcmp (SIZE_TYPE, "long unsigned int") == 0) + else if (strcmp (UINTMAX_TYPE, "long unsigned int") == 0) { intmax_type_node = long_integer_type_node; uintmax_type_node = long_unsigned_type_node; - signed_size_type_node = long_integer_type_node; } - else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0) + else if (strcmp (UINTMAX_TYPE, "long long unsigned int") == 0) { intmax_type_node = long_long_integer_type_node; uintmax_type_node = long_long_unsigned_type_node; - signed_size_type_node = long_long_integer_type_node; } else gcc_unreachable (); + signed_size_type_node = signed_type_for (size_type_node); wint_type_node = unsigned_type_node; pid_type_node = integer_type_node; } @@ -1116,10 +1141,7 @@ d_init_builtins (void) /* Build the "standard" abi va_list. */ Type::tvalist = build_frontend_type (va_list_type_node); if (!Type::tvalist) - { - error ("cannot represent built-in %<va_list%> type in D"); - gcc_unreachable (); - } + sorry ("cannot represent built-in %<va_list%> type in D"); /* Map the va_list type to the D frontend Type. This is to prevent both errors in gimplification or an ICE in targetm.canonical_va_list_type. */ diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index f23f719..db0db0e 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -1360,6 +1360,17 @@ d_type_for_mode (machine_mode mode, int unsignedp) if (mode == TYPE_MODE (build_pointer_type (d_int_type))) return build_pointer_type (d_int_type); + for (int i = 0; i < NUM_INT_N_ENTS; i ++) + { + if (int_n_enabled_p[i] && mode == int_n_data[i].m) + { + if (unsignedp) + return int_n_trees[i].unsigned_type; + else + return int_n_trees[i].signed_type; + } + } + if (COMPLEX_MODE_P (mode)) { machine_mode inner_mode; @@ -1408,6 +1419,17 @@ d_type_for_size (unsigned bits, int unsignedp) if (bits <= TYPE_PRECISION (d_cent_type)) return unsignedp ? d_ucent_type : d_cent_type; + for (int i = 0; i < NUM_INT_N_ENTS; i ++) + { + if (int_n_enabled_p[i] && bits == int_n_data[i].bitsize) + { + if (unsignedp) + return int_n_trees[i].unsigned_type; + else + return int_n_trees[i].signed_type; + } + } + return 0; } diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc index 8d85534..dfaf9bf 100644 --- a/gcc/d/d-target.cc +++ b/gcc/d/d-target.cc @@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "memmodel.h" #include "fold-const.h" +#include "diagnostic.h" #include "stor-layout.h" #include "tm.h" #include "tm_p.h" @@ -145,17 +146,24 @@ Target::_init (void) Target::maxStaticDataSize = tree_to_shwi (TYPE_MAX_VALUE (integer_type_node)); /* Define what type to use for size_t, ptrdiff_t. */ - if (POINTER_SIZE == 64) + if (Target::ptrsize == 8) { global.params.isLP64 = true; Tsize_t = Tuns64; Tptrdiff_t = Tint64; } - else + else if (Target::ptrsize == 4) { Tsize_t = Tuns32; Tptrdiff_t = Tint32; } + else if (Target::ptrsize == 2) + { + Tsize_t = Tuns16; + Tptrdiff_t = Tint16; + } + else + sorry ("D does not support pointers on this target."); Type::tsize_t = Type::basic[Tsize_t]; Type::tptrdiff_t = Type::basic[Tptrdiff_t]; diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index d208aea..578f3fc 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -792f0fdf249b21531dc91690024827f4f9ecbb97 +b37a537d36c2ac69afa505a3110e2328c9fc0114 The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/gcc/d/dmd/expression.c b/gcc/d/dmd/expression.c index c674392..5f1bfa8 100644 --- a/gcc/d/dmd/expression.c +++ b/gcc/d/dmd/expression.c @@ -2920,10 +2920,12 @@ void IntegerExp::normalize() case Tint64: value = (d_int64) value; break; case Tuns64: value = (d_uns64) value; break; case Tpointer: - if (Target::ptrsize == 4) - value = (d_uns32) value; - else if (Target::ptrsize == 8) + if (Target::ptrsize == 8) value = (d_uns64) value; + else if (Target::ptrsize == 4) + value = (d_uns32) value; + else if (Target::ptrsize == 2) + value = (d_uns16) value; else assert(0); break; diff --git a/gcc/d/dmd/hdrgen.c b/gcc/d/dmd/hdrgen.c index 4eaa1ae..395aa32 100644 --- a/gcc/d/dmd/hdrgen.c +++ b/gcc/d/dmd/hdrgen.c @@ -2152,10 +2152,12 @@ public: if ((sinteger_t)uval >= 0) { dinteger_t sizemax; - if (Target::ptrsize == 4) - sizemax = 0xFFFFFFFFUL; - else if (Target::ptrsize == 8) + if (Target::ptrsize == 8) sizemax = 0xFFFFFFFFFFFFFFFFULL; + else if (Target::ptrsize == 4) + sizemax = 0xFFFFFFFFUL; + else if (Target::ptrsize == 2) + sizemax = 0xFFFFUL; else assert(0); if (uval <= sizemax && uval <= 0x7FFFFFFFFFFFFFFFULL) @@ -2296,12 +2298,10 @@ public: buf->writestring("cast("); buf->writestring(t->toChars()); buf->writeByte(')'); - if (Target::ptrsize == 4) - goto L3; - else if (Target::ptrsize == 8) + if (Target::ptrsize == 8) goto L4; else - assert(0); + goto L3; default: /* This can happen if errors, such as diff --git a/gcc/d/dmd/root/filename.c b/gcc/d/dmd/root/filename.c index 6144d81..ad6b114 100644 --- a/gcc/d/dmd/root/filename.c +++ b/gcc/d/dmd/root/filename.c @@ -110,7 +110,8 @@ Strings *FileName::splitPath(const char *path) case '~': { char *home = getenv("HOME"); - if (home) + // Expand ~ only if it is prefixing the rest of the path. + if (!buf.offset && p[1] == '/' && home) buf.writestring(home); else buf.writestring("~"); diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc index 88cc5e8..a25e06a 100644 --- a/gcc/d/modules.cc +++ b/gcc/d/modules.cc @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see #include "dmd/module.h" #include "tree.h" +#include "diagnostic.h" #include "fold-const.h" #include "tm.h" #include "function.h" @@ -404,7 +405,8 @@ build_dso_registry_var (const char * name, tree type) static void register_moduleinfo (Module *decl, tree minfo) { - gcc_assert (targetm_common.have_named_sections); + if (!targetm_common.have_named_sections) + sorry ("%<-fmoduleinfo%> is not supported on this target"); /* Build the ModuleInfo reference, this is done once for every Module. */ tree ident = mangle_internal_decl (decl, "__moduleRef", "Z"); diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 2ba9b74..235be99 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -21489,6 +21489,12 @@ Intel Core i7 Ice Lake Server CPU. @item cascadelake Intel Core i7 Cascadelake CPU. +@item tigerlake +Intel Core i7 Tigerlake CPU. + +@item cooperlake +Intel Core i7 Cooperlake CPU. + @item bonnell Intel Atom Bonnell CPU. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index df6fefd..d3a2242 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -3472,11 +3472,6 @@ This section contains general configuration information for all Alpha-based platforms using ELF@. In addition to reading this section, please read all other sections that match your target. -We require binutils 2.11.2 or newer. -Previous binutils releases had a number of problems with DWARF 2 -debugging information, not the least of which is incorrect linking of -shared libraries. - @html <hr /> @end html diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ca11179..08e6b52 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27559,6 +27559,22 @@ SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB, AVX512VL, AVX512BW, AVX512DQ, AVX512CD and AVX512VNNI instruction set support. +@item cooperlake +Intel cooperlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, +SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, +BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB, +AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VNNI and AVX512BF16 instruction +set support. + +@item tigerlake +Intel Tigerlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, +SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, +BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, +AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB, UMIP, +RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, VPCLMULQDQ, +VAES, PCONFIG, WBNOINVD, MOVDIRI, MOVDIR64B and AVX512VP2INTERSECT instruction +set support. + @item k6 AMD K6 CPU with MMX instruction set support. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index f05b311..5506908 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3961,18 +3961,10 @@ This section describes the macros which let you control how various types of arguments are passed in registers or how they are arranged in the stack. -@deftypefn {Target Hook} rtx TARGET_FUNCTION_ARG (cumulative_args_t @var{ca}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named}) -Return an RTX indicating whether a function argument is passed in a -register and if so, which register. - -The arguments are @var{ca}, which summarizes all the previous -arguments; @var{mode}, the machine mode of the argument; @var{type}, -the data type of the argument as a tree node or 0 if that is not known -(which happens for C support library functions); and @var{named}, -which is @code{true} for an ordinary argument and @code{false} for -nameless arguments that correspond to @samp{@dots{}} in the called -function's prototype. @var{type} can be an incomplete type if a -syntax error has previously occurred. +@deftypefn {Target Hook} rtx TARGET_FUNCTION_ARG (cumulative_args_t @var{ca}, const function_arg_info @var{&arg}) +Return an RTX indicating whether function argument @var{arg} is passed +in a register and if so, which register. Argument @var{ca} summarizes all +the previous arguments. The return value is usually either a @code{reg} RTX for the hard register in which to pass the argument, or zero to pass the argument @@ -4020,14 +4012,14 @@ defined, the argument will be computed in the stack and then loaded into a register. @end deftypefn -@deftypefn {Target Hook} bool TARGET_MUST_PASS_IN_STACK (machine_mode @var{mode}, const_tree @var{type}) -This target hook should return @code{true} if we should not pass @var{type} +@deftypefn {Target Hook} bool TARGET_MUST_PASS_IN_STACK (const function_arg_info @var{&arg}) +This target hook should return @code{true} if we should not pass @var{arg} solely in registers. The file @file{expr.h} defines a definition that is usually appropriate, refer to @file{expr.h} for additional documentation. @end deftypefn -@deftypefn {Target Hook} rtx TARGET_FUNCTION_INCOMING_ARG (cumulative_args_t @var{ca}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named}) +@deftypefn {Target Hook} rtx TARGET_FUNCTION_INCOMING_ARG (cumulative_args_t @var{ca}, const function_arg_info @var{&arg}) Define this hook if the caller and callee on the target have different views of where arguments are passed. Also define this hook if there are functions that are never directly called, but are invoked by the hardware @@ -4057,7 +4049,7 @@ Perform a target dependent initialization of pic_offset_table_rtx. This hook is called at the start of register allocation. @end deftypefn -@deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES (cumulative_args_t @var{cum}, machine_mode @var{mode}, tree @var{type}, bool @var{named}) +@deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES (cumulative_args_t @var{cum}, const function_arg_info @var{&arg}) This target hook returns the number of bytes at the beginning of an argument that must be put in registers. The value must be zero for arguments that are passed entirely in registers or that are entirely @@ -4076,11 +4068,11 @@ register to be used by the caller for this argument; likewise @code{TARGET_FUNCTION_INCOMING_ARG}, for the called function. @end deftypefn -@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE (cumulative_args_t @var{cum}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named}) -This target hook should return @code{true} if an argument at the +@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE (cumulative_args_t @var{cum}, const function_arg_info @var{&arg}) +This target hook should return @code{true} if argument @var{arg} at the position indicated by @var{cum} should be passed by reference. This predicate is queried after target independent reasons for being -passed by reference, such as @code{TREE_ADDRESSABLE (type)}. +passed by reference, such as @code{TREE_ADDRESSABLE (@var{arg}.type)}. If the hook returns true, a copy of that argument is made in memory and a pointer to the argument is passed instead of the argument itself. @@ -4088,7 +4080,7 @@ The pointer is passed in whatever way is appropriate for passing a pointer to that type. @end deftypefn -@deftypefn {Target Hook} bool TARGET_CALLEE_COPIES (cumulative_args_t @var{cum}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named}) +@deftypefn {Target Hook} bool TARGET_CALLEE_COPIES (cumulative_args_t @var{cum}, const function_arg_info @var{&arg}) The function argument described by the parameters to this hook is known to be passed by reference. The hook should return true if the function argument should be copied by the callee instead of copied @@ -4167,10 +4159,9 @@ argument @var{libname} exists for symmetry with @c --mew 5feb93 i switched the order of the sentences. --mew 10feb93 @end defmac -@deftypefn {Target Hook} void TARGET_FUNCTION_ARG_ADVANCE (cumulative_args_t @var{ca}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named}) +@deftypefn {Target Hook} void TARGET_FUNCTION_ARG_ADVANCE (cumulative_args_t @var{ca}, const function_arg_info @var{&arg}) This hook updates the summarizer variable pointed to by @var{ca} to -advance past an argument in the argument list. The values @var{mode}, -@var{type} and @var{named} describe that argument. Once this is done, +advance past argument @var{arg} in the argument list. Once this is done, the variable @var{cum} is suitable for analyzing the @emph{following} argument with @code{TARGET_FUNCTION_ARG}, etc. @@ -5202,7 +5193,7 @@ return value of this function should be an RTX that contains the value to use as the return of @code{__builtin_saveregs}. @end deftypefn -@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time}) +@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (cumulative_args_t @var{args_so_far}, const function_arg_info @var{&arg}, int *@var{pretend_args_size}, int @var{second_time}) This target hook offers an alternative to using @code{__builtin_saveregs} and defining the hook @code{TARGET_EXPAND_BUILTIN_SAVEREGS}. Use it to store the anonymous @@ -5213,8 +5204,8 @@ pass all their arguments on the stack. The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data structure, containing the values that are obtained after processing the -named arguments. The arguments @var{mode} and @var{type} describe the -last named argument---its machine mode and its data type as a tree node. +named arguments. The argument @var{arg} describes the last of these named +arguments. The target hook should do two things: first, push onto the stack all the argument registers @emph{not} used for the named arguments, and second, @@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" #include "rtl-iter.h" #include "cfgcleanup.h" +#include "calls.h" /* This file contains three techniques for performing Dead Store Elimination (dse). @@ -2343,7 +2344,8 @@ get_call_args (rtx call_insn, tree fn, rtx *args, int nargs) if (!is_int_mode (TYPE_MODE (TREE_VALUE (arg)), &mode)) return false; - reg = targetm.calls.function_arg (args_so_far, mode, NULL_TREE, true); + function_arg_info arg (mode, /*named=*/true); + reg = targetm.calls.function_arg (args_so_far, arg); if (!reg || !REG_P (reg) || GET_MODE (reg) != mode) return false; @@ -2375,7 +2377,7 @@ get_call_args (rtx call_insn, tree fn, rtx *args, int nargs) if (tmp) args[idx] = tmp; - targetm.calls.function_arg_advance (args_so_far, mode, NULL_TREE, true); + targetm.calls.function_arg_advance (args_so_far, arg); } if (arg != void_list_node || idx != nargs) return false; @@ -2537,10 +2539,13 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn) clear_rhs_from_active_local_stores (); } } - else if (SIBLING_CALL_P (insn) && reload_completed) + else if (SIBLING_CALL_P (insn) + && (reload_completed || HARD_FRAME_POINTER_IS_ARG_POINTER)) /* Arguments for a sibling call that are pushed to memory are passed using the incoming argument pointer of the current function. After - reload that might be (and likely is) frame pointer based. */ + reload that might be (and likely is) frame pointer based. And, if + it is a frame pointer on the target, even before reload we need to + kill frame pointer based stores. */ add_wild_read (bb_info); else /* Every other call, including pure functions, may read any memory @@ -1709,14 +1709,13 @@ block_move_libcall_safe_for_call_parm (void) for ( ; arg != void_list_node ; arg = TREE_CHAIN (arg)) { machine_mode mode = TYPE_MODE (TREE_VALUE (arg)); - rtx tmp = targetm.calls.function_arg (args_so_far, mode, - NULL_TREE, true); + function_arg_info arg_info (mode, /*named=*/true); + rtx tmp = targetm.calls.function_arg (args_so_far, arg_info); if (!tmp || !REG_P (tmp)) return false; - if (targetm.calls.arg_partial_bytes (args_so_far, mode, NULL, 1)) + if (targetm.calls.arg_partial_bytes (args_so_far, arg_info)) return false; - targetm.calls.function_arg_advance (args_so_far, mode, - NULL_TREE, true); + targetm.calls.function_arg_advance (args_so_far, arg_info); } } return true; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1f44776..3eca99e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2019-08-20 Mark Eggleston <mark.eggleston@codethink.com> + + PR fortran/89236 + * intrinsic.texi: Add GNU extension notes to DIM, MOD, MODULO. + 2019-08-19 Mark Eggleston <mark.eggleston@codethink.com> * gfortran.texi: Delete paragraph about integer overload errors diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 3aa068d..31b97c4 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -4876,11 +4876,13 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{X} @tab The type shall be @code{INTEGER} or @code{REAL} -@item @var{Y} @tab The type shall be the same type and kind as @var{X}. +@item @var{Y} @tab The type shall be the same type and kind as @var{X}. (As +a GNU extension, arguments of different kinds are permitted.) @end multitable @item @emph{Return value}: -The return value is of type @code{INTEGER} or @code{REAL}. +The return value is of type @code{INTEGER} or @code{REAL}. (As a GNU +extension, kind is the largest kind of the actual arguments.) @item @emph{Example}: @smallexample @@ -10607,14 +10609,16 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be a scalar of type @code{INTEGER} or @code{REAL}. @item @var{P} @tab Shall be a scalar of the same type and kind as @var{A} -and not equal to zero. +and not equal to zero. (As a GNU extension, arguments of different kinds are +permitted.) @end multitable @item @emph{Return value}: The return value is the result of @code{A - (INT(A/P) * P)}. The type and kind of the return value is the same as that of the arguments. The returned value has the same sign as A and a magnitude less than the -magnitude of P. +magnitude of P. (As a GNU extension, kind is the largest kind of the actual +arguments.) @item @emph{Example}: @smallexample @@ -10678,11 +10682,13 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be a scalar of type @code{INTEGER} or @code{REAL}. @item @var{P} @tab Shall be a scalar of the same type and kind as @var{A}. -It shall not be zero. +It shall not be zero. (As a GNU extension, arguments of different kinds are +permitted.) @end multitable @item @emph{Return value}: -The type and kind of the result are those of the arguments. +The type and kind of the result are those of the arguments. (As a GNU +extension, kind is the largest kind of the actual arguments.) @table @asis @item If @var{A} and @var{P} are of type @code{INTEGER}: @code{MODULO(A,P)} has the value @var{R} such that @code{A=Q*P+R}, where @@ -12917,7 +12923,7 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be of type @code{INTEGER} or @code{REAL} -@item @var{B} @tab Shall be of the same type and kind as @var{A} +@item @var{B} @tab Shall be of the same type and kind as @var{A}. @end multitable @item @emph{Return value}: diff --git a/gcc/function.c b/gcc/function.c index e368f7c..05241a3 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2264,16 +2264,13 @@ struct assign_parm_data_all struct assign_parm_data_one { tree nominal_type; - tree passed_type; + function_arg_info arg; rtx entry_parm; rtx stack_parm; machine_mode nominal_mode; machine_mode passed_mode; - machine_mode promoted_mode; struct locate_and_pad_arg_data locate; int partial; - BOOL_BITFIELD named_arg : 1; - BOOL_BITFIELD passed_pointer : 1; }; /* A subroutine of assign_parms. Initialize ALL. */ @@ -2407,24 +2404,22 @@ static void assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, struct assign_parm_data_one *data) { - tree nominal_type, passed_type; - machine_mode nominal_mode, passed_mode, promoted_mode; int unsignedp; - memset (data, 0, sizeof (*data)); + *data = assign_parm_data_one (); /* NAMED_ARG is a misnomer. We really mean 'non-variadic'. */ if (!cfun->stdarg) - data->named_arg = 1; /* No variadic parms. */ + data->arg.named = 1; /* No variadic parms. */ else if (DECL_CHAIN (parm)) - data->named_arg = 1; /* Not the last non-variadic parm. */ + data->arg.named = 1; /* Not the last non-variadic parm. */ else if (targetm.calls.strict_argument_naming (all->args_so_far)) - data->named_arg = 1; /* Only variadic ones are unnamed. */ + data->arg.named = 1; /* Only variadic ones are unnamed. */ else - data->named_arg = 0; /* Treat as variadic. */ + data->arg.named = 0; /* Treat as variadic. */ - nominal_type = TREE_TYPE (parm); - passed_type = DECL_ARG_TYPE (parm); + data->nominal_type = TREE_TYPE (parm); + data->arg.type = DECL_ARG_TYPE (parm); /* Look out for errors propagating this far. Also, if the parameter's type is void then its value doesn't matter. */ @@ -2432,47 +2427,39 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, /* This can happen after weird syntax errors or if an enum type is defined among the parms. */ || TREE_CODE (parm) != PARM_DECL - || passed_type == NULL - || VOID_TYPE_P (nominal_type)) + || data->arg.type == NULL + || VOID_TYPE_P (data->nominal_type)) { - nominal_type = passed_type = void_type_node; - nominal_mode = passed_mode = promoted_mode = VOIDmode; - goto egress; + data->nominal_type = data->arg.type = void_type_node; + data->nominal_mode = data->passed_mode = data->arg.mode = VOIDmode; + return; } /* Find mode of arg as it is passed, and mode of arg as it should be during execution of this function. */ - passed_mode = TYPE_MODE (passed_type); - nominal_mode = TYPE_MODE (nominal_type); + data->passed_mode = data->arg.mode = TYPE_MODE (data->arg.type); + data->nominal_mode = TYPE_MODE (data->nominal_type); /* If the parm is to be passed as a transparent union or record, use the type of the first field for the tests below. We have already verified that the modes are the same. */ - if ((TREE_CODE (passed_type) == UNION_TYPE - || TREE_CODE (passed_type) == RECORD_TYPE) - && TYPE_TRANSPARENT_AGGR (passed_type)) - passed_type = TREE_TYPE (first_field (passed_type)); + if ((TREE_CODE (data->arg.type) == UNION_TYPE + || TREE_CODE (data->arg.type) == RECORD_TYPE) + && TYPE_TRANSPARENT_AGGR (data->arg.type)) + data->arg.type = TREE_TYPE (first_field (data->arg.type)); /* See if this arg was passed by invisible reference. */ - if (pass_by_reference (&all->args_so_far_v, passed_mode, - passed_type, data->named_arg)) + if (apply_pass_by_reference_rules (&all->args_so_far_v, data->arg)) { - passed_type = nominal_type = build_pointer_type (passed_type); - data->passed_pointer = true; - passed_mode = nominal_mode = TYPE_MODE (nominal_type); + data->nominal_type = data->arg.type; + data->passed_mode = data->nominal_mode = data->arg.mode; } /* Find mode as it is passed by the ABI. */ - unsignedp = TYPE_UNSIGNED (passed_type); - promoted_mode = promote_function_mode (passed_type, passed_mode, &unsignedp, - TREE_TYPE (current_function_decl), 0); - - egress: - data->nominal_type = nominal_type; - data->passed_type = passed_type; - data->nominal_mode = nominal_mode; - data->passed_mode = passed_mode; - data->promoted_mode = promoted_mode; + unsignedp = TYPE_UNSIGNED (data->arg.type); + data->arg.mode + = promote_function_mode (data->arg.type, data->arg.mode, &unsignedp, + TREE_TYPE (current_function_decl), 0); } /* A subroutine of assign_parms. Invoke setup_incoming_varargs. */ @@ -2483,9 +2470,9 @@ assign_parms_setup_varargs (struct assign_parm_data_all *all, { int varargs_pretend_bytes = 0; - targetm.calls.setup_incoming_varargs (all->args_so_far, - data->promoted_mode, - data->passed_type, + function_arg_info last_named_arg = data->arg; + last_named_arg.named = true; + targetm.calls.setup_incoming_varargs (all->args_so_far, last_named_arg, &varargs_pretend_bytes, no_rtl); /* If the back-end has requested extra stack space, record how much is @@ -2506,22 +2493,19 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, rtx entry_parm; bool in_regs; - if (data->promoted_mode == VOIDmode) + if (data->arg.mode == VOIDmode) { data->entry_parm = data->stack_parm = const0_rtx; return; } targetm.calls.warn_parameter_passing_abi (all->args_so_far, - data->passed_type); + data->arg.type); entry_parm = targetm.calls.function_incoming_arg (all->args_so_far, - data->promoted_mode, - data->passed_type, - data->named_arg); - + data->arg); if (entry_parm == 0) - data->promoted_mode = data->passed_mode; + data->arg.mode = data->passed_mode; /* Determine parm's home in the stack, in case it arrives in the stack or we should pretend it did. Compute the stack position and rtx where @@ -2537,32 +2521,29 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, #ifdef STACK_PARMS_IN_REG_PARM_AREA in_regs = true; #endif - if (!in_regs && !data->named_arg) + if (!in_regs && !data->arg.named) { if (targetm.calls.pretend_outgoing_varargs_named (all->args_so_far)) { rtx tem; + function_arg_info named_arg = data->arg; + named_arg.named = true; tem = targetm.calls.function_incoming_arg (all->args_so_far, - data->promoted_mode, - data->passed_type, true); + named_arg); in_regs = tem != NULL; } } /* If this parameter was passed both in registers and in the stack, use the copy on the stack. */ - if (targetm.calls.must_pass_in_stack (data->promoted_mode, - data->passed_type)) + if (targetm.calls.must_pass_in_stack (data->arg)) entry_parm = 0; if (entry_parm) { int partial; - partial = targetm.calls.arg_partial_bytes (all->args_so_far, - data->promoted_mode, - data->passed_type, - data->named_arg); + partial = targetm.calls.arg_partial_bytes (all->args_so_far, data->arg); data->partial = partial; /* The caller might already have allocated stack space for the @@ -2597,7 +2578,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, } } - locate_and_pad_parm (data->promoted_mode, data->passed_type, in_regs, + locate_and_pad_parm (data->arg.mode, data->arg.type, in_regs, all->reg_parm_stack_space, entry_parm ? data->partial : 0, current_function_decl, &all->stack_args_size, &data->locate); @@ -2668,21 +2649,21 @@ assign_parm_find_stack_rtl (tree parm, struct assign_parm_data_one *data) stack_parm = crtl->args.internal_arg_pointer; if (offset_rtx != const0_rtx) stack_parm = gen_rtx_PLUS (Pmode, stack_parm, offset_rtx); - stack_parm = gen_rtx_MEM (data->promoted_mode, stack_parm); + stack_parm = gen_rtx_MEM (data->arg.mode, stack_parm); - if (!data->passed_pointer) + if (!data->arg.pass_by_reference) { set_mem_attributes (stack_parm, parm, 1); /* set_mem_attributes could set MEM_SIZE to the passed mode's size, while promoted mode's size is needed. */ - if (data->promoted_mode != BLKmode - && data->promoted_mode != DECL_MODE (parm)) + if (data->arg.mode != BLKmode + && data->arg.mode != DECL_MODE (parm)) { - set_mem_size (stack_parm, GET_MODE_SIZE (data->promoted_mode)); + set_mem_size (stack_parm, GET_MODE_SIZE (data->arg.mode)); if (MEM_EXPR (stack_parm) && MEM_OFFSET_KNOWN_P (stack_parm)) { poly_int64 offset = subreg_lowpart_offset (DECL_MODE (parm), - data->promoted_mode); + data->arg.mode); if (maybe_ne (offset, 0)) set_mem_offset (stack_parm, MEM_OFFSET (stack_parm) - offset); } @@ -2697,8 +2678,23 @@ assign_parm_find_stack_rtl (tree parm, struct assign_parm_data_one *data) intentionally forcing upward padding. Otherwise we have to come up with a guess at the alignment based on OFFSET_RTX. */ poly_int64 offset; - if (data->locate.where_pad != PAD_DOWNWARD || data->entry_parm) + if (data->locate.where_pad == PAD_NONE || data->entry_parm) align = boundary; + else if (data->locate.where_pad == PAD_UPWARD) + { + align = boundary; + /* If the argument offset is actually more aligned than the nominal + stack slot boundary, take advantage of that excess alignment. + Don't make any assumptions if STACK_POINTER_OFFSET is in use. */ + if (poly_int_rtx_p (offset_rtx, &offset) + && known_eq (STACK_POINTER_OFFSET, 0)) + { + unsigned int offset_align = known_alignment (offset) * BITS_PER_UNIT; + if (offset_align == 0 || offset_align > STACK_BOUNDARY) + offset_align = STACK_BOUNDARY; + align = MAX (align, offset_align); + } + } else if (poly_int_rtx_p (offset_rtx, &offset)) { align = least_bit_hwi (boundary); @@ -2734,8 +2730,7 @@ assign_parm_adjust_entry_rtl (struct assign_parm_data_one *data) locations. The Irix 6 ABI has examples of this. */ if (GET_CODE (entry_parm) == PARALLEL) emit_group_store (validize_mem (copy_rtx (stack_parm)), entry_parm, - data->passed_type, - int_size_in_bytes (data->passed_type)); + data->arg.type, int_size_in_bytes (data->arg.type)); else { gcc_assert (data->partial % UNITS_PER_WORD == 0); @@ -2791,7 +2786,7 @@ assign_parm_remove_parallels (struct assign_parm_data_one *data) if (GET_CODE (entry_parm) == PARALLEL && GET_MODE (entry_parm) != BLKmode) { rtx parmreg = gen_reg_rtx (GET_MODE (entry_parm)); - emit_group_store (parmreg, entry_parm, data->passed_type, + emit_group_store (parmreg, entry_parm, data->arg.type, GET_MODE_SIZE (GET_MODE (entry_parm))); entry_parm = parmreg; } @@ -2830,7 +2825,7 @@ assign_parm_adjust_stack_rtl (struct assign_parm_data_one *data) pointers in their passed stack slots. */ else if (crtl->stack_protect_guard && (flag_stack_protect == 2 - || data->passed_pointer + || data->arg.pass_by_reference || POINTER_TYPE_P (data->nominal_type))) stack_parm = NULL; @@ -2852,8 +2847,8 @@ assign_parm_setup_block_p (struct assign_parm_data_one *data) /* Only assign_parm_setup_block knows how to deal with register arguments that are padded at the least significant end. */ if (REG_P (data->entry_parm) - && known_lt (GET_MODE_SIZE (data->promoted_mode), UNITS_PER_WORD) - && (BLOCK_REG_PADDING (data->passed_mode, data->passed_type, 1) + && known_lt (GET_MODE_SIZE (data->arg.mode), UNITS_PER_WORD) + && (BLOCK_REG_PADDING (data->passed_mode, data->arg.type, 1) == (BYTES_BIG_ENDIAN ? PAD_UPWARD : PAD_DOWNWARD))) return true; #endif @@ -2908,7 +2903,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all, data->stack_parm = NULL; } - size = int_size_in_bytes (data->passed_type); + size = int_size_in_bytes (data->arg.type); size_stored = CEIL_ROUND (size, UNITS_PER_WORD); if (stack_parm == 0) { @@ -2963,12 +2958,12 @@ assign_parm_setup_block (struct assign_parm_data_all *all, /* Handle values in multiple non-contiguous locations. */ if (GET_CODE (entry_parm) == PARALLEL && !MEM_P (mem)) - emit_group_store (mem, entry_parm, data->passed_type, size); + emit_group_store (mem, entry_parm, data->arg.type, size); else if (GET_CODE (entry_parm) == PARALLEL) { push_to_sequence2 (all->first_conversion_insn, all->last_conversion_insn); - emit_group_store (mem, entry_parm, data->passed_type, size); + emit_group_store (mem, entry_parm, data->arg.type, size); all->first_conversion_insn = get_insns (); all->last_conversion_insn = get_last_insn (); end_sequence (); @@ -2988,7 +2983,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all, if (mode != BLKmode #ifdef BLOCK_REG_PADDING && (size == UNITS_PER_WORD - || (BLOCK_REG_PADDING (mode, data->passed_type, 1) + || (BLOCK_REG_PADDING (mode, data->arg.type, 1) != (BYTES_BIG_ENDIAN ? PAD_UPWARD : PAD_DOWNWARD))) #endif ) @@ -3029,7 +3024,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all, additional changes to work correctly. */ gcc_checking_assert (BYTES_BIG_ENDIAN && (BLOCK_REG_PADDING (mode, - data->passed_type, 1) + data->arg.type, 1) == PAD_UPWARD)); int by = (UNITS_PER_WORD - size) * BITS_PER_UNIT; @@ -3050,7 +3045,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all, handle all cases (e.g. SIZE == 3). */ else if (size != UNITS_PER_WORD #ifdef BLOCK_REG_PADDING - && (BLOCK_REG_PADDING (mode, data->passed_type, 1) + && (BLOCK_REG_PADDING (mode, data->arg.type, 1) == PAD_DOWNWARD) #else && BYTES_BIG_ENDIAN @@ -3074,7 +3069,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all, gcc_checking_assert (size > UNITS_PER_WORD); #ifdef BLOCK_REG_PADDING gcc_checking_assert (BLOCK_REG_PADDING (GET_MODE (mem), - data->passed_type, 0) + data->arg.type, 0) == PAD_UPWARD); #endif emit_move_insn (mem, entry_parm); @@ -3143,9 +3138,9 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, /* If this was an item that we received a pointer to, set rtl appropriately. */ - if (data->passed_pointer) + if (data->arg.pass_by_reference) { - rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data->passed_type)), parmreg); + rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data->arg.type)), parmreg); set_mem_attributes (rtl, parm, 1); } else @@ -3160,7 +3155,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, validated_mem = validize_mem (copy_rtx (data->entry_parm)); need_conversion = (data->nominal_mode != data->passed_mode - || promoted_nominal_mode != data->promoted_mode); + || promoted_nominal_mode != data->arg.mode); moved = false; if (need_conversion @@ -3313,7 +3308,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, /* If we were passed a pointer but the actual value can safely live in a register, retrieve it and use it directly. */ - if (data->passed_pointer && TYPE_MODE (TREE_TYPE (parm)) != BLKmode) + if (data->arg.pass_by_reference && TYPE_MODE (TREE_TYPE (parm)) != BLKmode) { /* We can't use nominal_mode, because it will have been set to Pmode above. We must use the actual mode of the parm. */ @@ -3430,7 +3425,7 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm, assign_parm_remove_parallels (data); - if (data->promoted_mode != data->nominal_mode) + if (data->arg.mode != data->nominal_mode) { /* Conversion is required. */ rtx tempreg = gen_reg_rtx (GET_MODE (data->entry_parm)); @@ -3463,9 +3458,9 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm, if (data->stack_parm == 0) { - int align = STACK_SLOT_ALIGNMENT (data->passed_type, + int align = STACK_SLOT_ALIGNMENT (data->arg.type, GET_MODE (data->entry_parm), - TYPE_ALIGN (data->passed_type)); + TYPE_ALIGN (data->arg.type)); data->stack_parm = assign_stack_local (GET_MODE (data->entry_parm), GET_MODE_SIZE (GET_MODE (data->entry_parm)), @@ -3485,7 +3480,7 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm, to_conversion = true; emit_block_move (dest, src, - GEN_INT (int_size_in_bytes (data->passed_type)), + GEN_INT (int_size_in_bytes (data->arg.type)), BLOCK_OP_NORMAL); } else @@ -3609,10 +3604,9 @@ assign_parms (tree fndecl) if (SUPPORTS_STACK_ALIGNMENT) { unsigned int align - = targetm.calls.function_arg_boundary (data.promoted_mode, - data.passed_type); - align = MINIMUM_ALIGNMENT (data.passed_type, data.promoted_mode, - align); + = targetm.calls.function_arg_boundary (data.arg.mode, + data.arg.type); + align = MINIMUM_ALIGNMENT (data.arg.type, data.arg.mode, align); if (TYPE_ALIGN (data.nominal_type) > align) align = MINIMUM_ALIGNMENT (data.nominal_type, TYPE_MODE (data.nominal_type), @@ -3634,10 +3628,10 @@ assign_parms (tree fndecl) assign_parm_adjust_entry_rtl (&data); } /* Record permanently how this parm was passed. */ - if (data.passed_pointer) + if (data.arg.pass_by_reference) { rtx incoming_rtl - = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data.passed_type)), + = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data.arg.type)), data.entry_parm); set_decl_incoming_rtl (parm, incoming_rtl, true); } @@ -3648,7 +3642,7 @@ assign_parms (tree fndecl) if (assign_parm_setup_block_p (&data)) assign_parm_setup_block (&all, parm, &data); - else if (data.passed_pointer || use_register_for_decl (parm)) + else if (data.arg.pass_by_reference || use_register_for_decl (parm)) assign_parm_setup_reg (&all, parm, &data); else assign_parm_setup_stack (&all, parm, &data); @@ -3657,8 +3651,7 @@ assign_parms (tree fndecl) assign_parms_setup_varargs (&all, &data, false); /* Update info on where next arg arrives in registers. */ - targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode, - data.passed_type, data.named_arg); + targetm.calls.function_arg_advance (all.args_so_far, data.arg); } if (targetm.calls.split_complex_arg) @@ -3845,14 +3838,13 @@ gimplify_parameters (gimple_seq *cleanup) continue; /* Update info on where next arg arrives in registers. */ - targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode, - data.passed_type, data.named_arg); + targetm.calls.function_arg_advance (all.args_so_far, data.arg); /* ??? Once upon a time variable_size stuffed parameter list SAVE_EXPRs (amongst others) onto a pending sizes list. This turned out to be less than manageable in the gimple world. Now we have to hunt them down ourselves. */ - walk_tree_without_duplicates (&data.passed_type, + walk_tree_without_duplicates (&data.arg.type, gimplify_parm_type, &stmts); if (TREE_CODE (DECL_SIZE_UNIT (parm)) != INTEGER_CST) @@ -3861,11 +3853,11 @@ gimplify_parameters (gimple_seq *cleanup) gimplify_one_sizepos (&DECL_SIZE_UNIT (parm), &stmts); } - if (data.passed_pointer) + if (data.arg.pass_by_reference) { - tree type = TREE_TYPE (data.passed_type); - if (reference_callee_copied (&all.args_so_far_v, TYPE_MODE (type), - type, data.named_arg)) + tree type = TREE_TYPE (data.arg.type); + function_arg_info orig_arg (type, data.arg.named); + if (reference_callee_copied (&all.args_so_far_v, orig_arg)) { tree local, t; diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index b1a6579..5c02446 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -b0ba5daa8216a0424b24f74466cedab0b986f3b4 +82d27f0f140f33406cf59c0fb262f6dba3077f8e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 995a18c..378dab5 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -1560,10 +1560,14 @@ Func_descriptor_expression::do_get_backend(Translate_context* context) || no->name().find("equal") != std::string::npos)) is_exported_runtime = true; + bool is_referenced_by_inline = + no->is_function() && no->func_value()->is_referenced_by_inline(); + bool is_hidden = ((no->is_function() && no->func_value()->enclosing() != NULL) || (Gogo::is_hidden_name(no->name()) - && !is_exported_runtime) + && !is_exported_runtime + && !is_referenced_by_inline) || Gogo::is_thunk(no)); bvar = context->backend()->immutable_struct(var_name, asm_name, @@ -6734,11 +6738,10 @@ Binary_expression::do_check_types(Gogo*) this->report_error(_("shift of non-integer operand")); if (right_type->is_string_type()) - this->report_error(_("shift count not unsigned integer")); + this->report_error(_("shift count not integer")); else if (!right_type->is_abstract() - && (right_type->integer_type() == NULL - || !right_type->integer_type()->is_unsigned())) - this->report_error(_("shift count not unsigned integer")); + && right_type->integer_type() == NULL) + this->report_error(_("shift count not integer")); else { Numeric_constant nc; @@ -6746,7 +6749,7 @@ Binary_expression::do_check_types(Gogo*) { mpz_t val; if (!nc.to_int(&val)) - this->report_error(_("shift count not unsigned integer")); + this->report_error(_("shift count not integer")); else { if (mpz_sgn(val) < 0) @@ -6865,9 +6868,11 @@ Binary_expression::do_get_backend(Translate_context* context) // In Go, a shift larger than the size of the type is well-defined. // This is not true in C, so we need to insert a conditional. + // We also need to check for a negative shift count. if (is_shift_op) { go_assert(left_type->integer_type() != NULL); + go_assert(right_type->integer_type() != NULL); int bits = left_type->integer_type()->bits(); @@ -6909,6 +6914,23 @@ Binary_expression::do_get_backend(Translate_context* context) ret, overflow, loc); mpz_clear(bitsval); } + + if (!right_type->integer_type()->is_unsigned() + && (!this->right_->numeric_constant_value(&nc) + || nc.to_unsigned_long(&ul) != Numeric_constant::NC_UL_VALID)) + { + Bexpression* zero_expr = + gogo->backend()->integer_constant_expression(right_btype, zero); + Bexpression* compare = + gogo->backend()->binary_expression(OPERATOR_LT, right, zero_expr, + loc); + const int errcode = RUNTIME_ERROR_SHIFT_BY_NEGATIVE; + Bexpression* crash = + gogo->runtime_error(errcode, loc)->get_backend(context); + Bfunction* bfn = context->function()->func_value()->get_decl(); + ret = gogo->backend()->conditional_expression(bfn, btype, compare, + crash, ret, loc); + } } // Add checks for division by zero and division overflow as needed. @@ -13773,7 +13795,7 @@ Field_reference_expression::do_lower(Gogo* gogo, Named_object* function, if (nt != NULL) s.append(Gogo::unpack_hidden_name(nt->name())); s.push_back('.'); - s.append(field->field_name()); + s.append(Gogo::unpack_hidden_name(field->field_name())); s.push_back('"'); // We can't use a string here, because internally a string holds a diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 30523f7..8a24070 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -5430,6 +5430,29 @@ Gogo::convert_named_types_in_bindings(Bindings* bindings) } } +void +debug_go_gogo(Gogo* gogo) +{ + if (gogo != NULL) + gogo->debug_dump(); +} + +void +Gogo::debug_dump() +{ + std::cerr << "Packages:\n"; + for (Packages::const_iterator p = this->packages_.begin(); + p != this->packages_.end(); + ++p) + { + const char *tag = " "; + if (p->second == this->package_) + tag = "* "; + std::cerr << tag << "'" << p->first << "' " + << p->second->pkgpath() << " " << ((void*)p->second) << "\n"; + } +} + // Class Function. Function::Function(Function_type* type, Named_object* enclosing, Block* block, @@ -8593,6 +8616,61 @@ Named_object::get_id(Gogo* gogo) return decl_name; } +void +debug_go_named_object(Named_object* no) +{ + if (no == NULL) + { + std::cerr << "<null>"; + return; + } + std::cerr << "'" << no->name() << "': "; + const char *tag; + switch (no->classification()) + { + case Named_object::NAMED_OBJECT_UNINITIALIZED: + tag = "uninitialized"; + break; + case Named_object::NAMED_OBJECT_ERRONEOUS: + tag = "<error>"; + break; + case Named_object::NAMED_OBJECT_UNKNOWN: + tag = "<unknown>"; + break; + case Named_object::NAMED_OBJECT_CONST: + tag = "constant"; + break; + case Named_object::NAMED_OBJECT_TYPE: + tag = "type"; + break; + case Named_object::NAMED_OBJECT_TYPE_DECLARATION: + tag = "type_decl"; + break; + case Named_object::NAMED_OBJECT_VAR: + tag = "var"; + break; + case Named_object::NAMED_OBJECT_RESULT_VAR: + tag = "result_var"; + break; + case Named_object::NAMED_OBJECT_SINK: + tag = "<sink>"; + break; + case Named_object::NAMED_OBJECT_FUNC: + tag = "func"; + break; + case Named_object::NAMED_OBJECT_FUNC_DECLARATION: + tag = "func_decl"; + break; + case Named_object::NAMED_OBJECT_PACKAGE: + tag = "package"; + break; + default: + tag = "<unknown named object classification>"; + break; + }; + std::cerr << tag << "\n"; +} + // Get the backend representation for this named object. void @@ -9140,6 +9218,31 @@ Bindings::traverse(Traverse* traverse, bool is_global) return TRAVERSE_CONTINUE; } +void +Bindings::debug_dump() +{ + std::set<Named_object*> defs; + for (size_t i = 0; i < this->named_objects_.size(); ++i) + defs.insert(this->named_objects_[i]); + for (Contour::iterator p = this->bindings_.begin(); + p != this->bindings_.end(); + ++p) + { + const char* tag = " "; + if (defs.find(p->second) != defs.end()) + tag = "* "; + std::cerr << tag; + debug_go_named_object(p->second); + } +} + +void +debug_go_bindings(Bindings* bindings) +{ + if (bindings != NULL) + bindings->debug_dump(); +} + // Class Label. // Clear any references to this label. diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h index 6ffdc59..4521763 100644 --- a/gcc/go/gofrontend/gogo.h +++ b/gcc/go/gofrontend/gogo.h @@ -341,6 +341,9 @@ class Gogo set_debug_optimization(bool b) { this->debug_optimization_ = b; } + // Dump to stderr for debugging + void debug_dump(); + // Return the size threshold used to determine whether to issue // a nil-check for a given pointer dereference. A threshold of -1 // implies that all potentially faulting dereference ops should @@ -1540,6 +1543,11 @@ class Function set_is_inline_only() { this->is_inline_only_ = true; } + // Report whether the function is referenced by an inline body. + bool + is_referenced_by_inline() const + { return this->is_referenced_by_inline_; } + // Mark the function as referenced by an inline body. void set_is_referenced_by_inline() @@ -3068,6 +3076,9 @@ class Bindings first_declaration() { return this->bindings_.empty() ? NULL : this->bindings_.begin()->second; } + // Dump to stderr for debugging + void debug_dump(); + private: Named_object* add_named_object_to_contour(Contour*, Named_object*); @@ -3739,6 +3750,9 @@ static const int RUNTIME_ERROR_DIVISION_BY_ZERO = 11; // Go statement with nil function. static const int RUNTIME_ERROR_GO_NIL = 12; +// Shift by negative value. +static const int RUNTIME_ERROR_SHIFT_BY_NEGATIVE = 13; + // This is used by some of the langhooks. extern Gogo* go_get_gogo(); @@ -3746,4 +3760,10 @@ extern Gogo* go_get_gogo(); // interface. extern bool saw_errors(); +// For use in the debugger +extern void debug_go_gogo(Gogo*); +extern void debug_go_named_object(Named_object*); +extern void debug_go_bindings(Bindings*); + + #endif // !defined(GO_GOGO_H) @@ -836,13 +836,18 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final, /* The priority is encoded in the constructor or destructor name. collect2 will sort the names and arrange that they are called at program startup. */ - if (final) - sprintf (which_buf, "%c_%.5d_%d", which, priority, counter++); + if (!targetm.have_ctors_dtors && final) + { + sprintf (which_buf, "%c_%.5d_%d", which, priority, counter++); + name = get_file_function_name (which_buf); + } else - /* Proudce sane name but one not recognizable by collect2, just for the - case we fail to inline the function. */ - sprintf (which_buf, "sub_%c_%.5d_%d", which, priority, counter++); - name = get_file_function_name (which_buf); + { + /* Proudce sane name but one not recognizable by collect2, just for the + case we fail to inline the function. */ + sprintf (which_buf, "_sub_%c_%.5d_%d", which, priority, counter++); + name = get_identifier (which_buf); + } decl = build_decl (input_location, FUNCTION_DECL, name, build_function_type_list (void_type_node, NULL_TREE)); diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 583516c..0e59cfb 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" #include "attribs.h" #include "debug.h" +#include "calls.h" /* Data type for the expressions representing sizes of data types. It is the first integer type laid out. */ @@ -1859,8 +1860,9 @@ compute_record_mode (tree type) || (TREE_CODE (type) == UNION_TYPE && (GET_MODE_CLASS (mode) == MODE_INT || (GET_MODE_CLASS (mode) == MODE_PARTIAL_INT - && targetm.calls.pass_by_reference (pack_cumulative_args (0), - mode, type, 0))))) + && (targetm.calls.pass_by_reference + (pack_cumulative_args (0), + function_arg_info (type, mode, /*named=*/false))))))) && mode != VOIDmode && poly_int_tree_p (TYPE_SIZE (type), &type_size) && known_eq (GET_MODE_BITSIZE (mode), type_size)) diff --git a/gcc/target.def b/gcc/target.def index 4266b8c..b2332d8 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -4450,18 +4450,18 @@ or 3-byte structure is returned at the most significant end of a\n\ from __builtin_va_arg. */ DEFHOOK (pass_by_reference, - "This target hook should return @code{true} if an argument at the\n\ + "This target hook should return @code{true} if argument @var{arg} at the\n\ position indicated by @var{cum} should be passed by reference. This\n\ predicate is queried after target independent reasons for being\n\ -passed by reference, such as @code{TREE_ADDRESSABLE (type)}.\n\ +passed by reference, such as @code{TREE_ADDRESSABLE (@var{arg}.type)}.\n\ \n\ If the hook returns true, a copy of that argument is made in memory and a\n\ pointer to the argument is passed instead of the argument itself.\n\ The pointer is passed in whatever way is appropriate for passing a pointer\n\ to that type.", bool, - (cumulative_args_t cum, machine_mode mode, const_tree type, bool named), - hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) + (cumulative_args_t cum, const function_arg_info &arg), + hook_bool_CUMULATIVE_ARGS_arg_info_false) DEFHOOK (expand_builtin_saveregs, @@ -4486,8 +4486,8 @@ pass all their arguments on the stack.\n\ \n\ The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data\n\ structure, containing the values that are obtained after processing the\n\ -named arguments. The arguments @var{mode} and @var{type} describe the\n\ -last named argument---its machine mode and its data type as a tree node.\n\ +named arguments. The argument @var{arg} describes the last of these named\n\ +arguments.\n\ \n\ The target hook should do two things: first, push onto the stack all the\n\ argument registers @emph{not} used for the named arguments, and second,\n\ @@ -4507,7 +4507,7 @@ arguments of the function are being analyzed for the second time. This\n\ happens for an inline function, which is not actually compiled until the\n\ end of the source file. The hook @code{TARGET_SETUP_INCOMING_VARARGS} should\n\ not generate any instructions in this case.", - void, (cumulative_args_t args_so_far, machine_mode mode, tree type, + void, (cumulative_args_t args_so_far, const function_arg_info &arg, int *pretend_args_size, int second_time), default_setup_incoming_varargs) @@ -4630,11 +4630,11 @@ false.", Need audit to verify that this is the case. */ DEFHOOK (must_pass_in_stack, - "This target hook should return @code{true} if we should not pass @var{type}\n\ + "This target hook should return @code{true} if we should not pass @var{arg}\n\ solely in registers. The file @file{expr.h} defines a\n\ definition that is usually appropriate, refer to @file{expr.h} for additional\n\ documentation.", - bool, (machine_mode mode, const_tree type), + bool, (const function_arg_info &arg), must_pass_in_stack_var_size_or_pad) /* Return true if type TYPE, mode MODE, which is passed by reference, @@ -4653,8 +4653,8 @@ not be generated.\n\ \n\ The default version of this hook always returns false.", bool, - (cumulative_args_t cum, machine_mode mode, const_tree type, bool named), - hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) + (cumulative_args_t cum, const function_arg_info &arg), + hook_bool_CUMULATIVE_ARGS_arg_info_false) /* Return zero for arguments passed entirely on the stack or entirely in registers. If passed in both, return the number of bytes passed @@ -4677,8 +4677,8 @@ compiler when this occurs, and how many bytes should go in registers.\n\ @code{TARGET_FUNCTION_ARG} for these arguments should return the first\n\ register to be used by the caller for this argument; likewise\n\ @code{TARGET_FUNCTION_INCOMING_ARG}, for the called function.", - int, (cumulative_args_t cum, machine_mode mode, tree type, bool named), - hook_int_CUMULATIVE_ARGS_mode_tree_bool_0) + int, (cumulative_args_t cum, const function_arg_info &arg), + hook_int_CUMULATIVE_ARGS_arg_info_0) /* Update the state in CA to advance past an argument in the argument list. The values MODE, TYPE, and NAMED describe that @@ -4686,8 +4686,7 @@ register to be used by the caller for this argument; likewise\n\ DEFHOOK (function_arg_advance, "This hook updates the summarizer variable pointed to by @var{ca} to\n\ -advance past an argument in the argument list. The values @var{mode},\n\ -@var{type} and @var{named} describe that argument. Once this is done,\n\ +advance past argument @var{arg} in the argument list. Once this is done,\n\ the variable @var{cum} is suitable for analyzing the @emph{following}\n\ argument with @code{TARGET_FUNCTION_ARG}, etc.\n\ \n\ @@ -4695,7 +4694,7 @@ This hook need not do anything if the argument in question was passed\n\ on the stack. The compiler knows how to track the amount of stack space\n\ used for arguments without any special help.", void, - (cumulative_args_t ca, machine_mode mode, const_tree type, bool named), + (cumulative_args_t ca, const function_arg_info &arg), default_function_arg_advance) DEFHOOK @@ -4732,17 +4731,9 @@ constant size shorter than an @code{int}, and upward otherwise.", argument. */ DEFHOOK (function_arg, - "Return an RTX indicating whether a function argument is passed in a\n\ -register and if so, which register.\n\ -\n\ -The arguments are @var{ca}, which summarizes all the previous\n\ -arguments; @var{mode}, the machine mode of the argument; @var{type},\n\ -the data type of the argument as a tree node or 0 if that is not known\n\ -(which happens for C support library functions); and @var{named},\n\ -which is @code{true} for an ordinary argument and @code{false} for\n\ -nameless arguments that correspond to @samp{@dots{}} in the called\n\ -function's prototype. @var{type} can be an incomplete type if a\n\ -syntax error has previously occurred.\n\ + "Return an RTX indicating whether function argument @var{arg} is passed\n\ +in a register and if so, which register. Argument @var{ca} summarizes all\n\ +the previous arguments.\n\ \n\ The return value is usually either a @code{reg} RTX for the hard\n\ register in which to pass the argument, or zero to pass the argument\n\ @@ -4788,8 +4779,7 @@ is not defined and @code{TARGET_FUNCTION_ARG} returns nonzero for such an\n\ argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is\n\ defined, the argument will be computed in the stack and then loaded into\n\ a register.", - rtx, (cumulative_args_t ca, machine_mode mode, const_tree type, - bool named), + rtx, (cumulative_args_t ca, const function_arg_info &arg), default_function_arg) DEFHOOK @@ -4811,8 +4801,7 @@ so that it can be used to pass special arguments.\n\ \n\ If @code{TARGET_FUNCTION_INCOMING_ARG} is not defined,\n\ @code{TARGET_FUNCTION_ARG} serves both purposes.", - rtx, (cumulative_args_t ca, machine_mode mode, const_tree type, - bool named), + rtx, (cumulative_args_t ca, const function_arg_info &arg), default_function_incoming_arg) DEFHOOK diff --git a/gcc/target.h b/gcc/target.h index 633e384..a656930 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -149,6 +149,9 @@ class ao_ref; /* This is defined in tree-vectorizer.h. */ class _stmt_vec_info; +/* This is defined in calls.h. */ +class function_arg_info; + /* These are defined in tree-vect-stmts.c. */ extern tree stmt_vectype (class _stmt_vec_info *); extern bool stmt_in_inner_loop_p (class _stmt_vec_info *); diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 111ed2e..1d12ec5 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -193,11 +193,8 @@ default_expand_builtin_saveregs (void) } void -default_setup_incoming_varargs (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, - int *pretend_arg_size ATTRIBUTE_UNUSED, - int second_time ATTRIBUTE_UNUSED) +default_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, int *, int) { } @@ -323,22 +320,19 @@ default_cxx_get_cookie_size (tree type) of the TARGET_PASS_BY_REFERENCE hook uses just MUST_PASS_IN_STACK. */ bool -hook_pass_by_reference_must_pass_in_stack (cumulative_args_t c ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, const_tree type ATTRIBUTE_UNUSED, - bool named_arg ATTRIBUTE_UNUSED) +hook_pass_by_reference_must_pass_in_stack (cumulative_args_t, + const function_arg_info &arg) { - return targetm.calls.must_pass_in_stack (mode, type); + return targetm.calls.must_pass_in_stack (arg); } /* Return true if a parameter follows callee copies conventions. This version of the hook is true for all named arguments. */ bool -hook_callee_copies_named (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, bool named) +hook_callee_copies_named (cumulative_args_t, const function_arg_info &arg) { - return named; + return arg.named; } /* Emit to STREAM the assembler syntax for insn operand X. */ @@ -750,28 +744,22 @@ default_builtin_reciprocal (tree) } bool -hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false ( - cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) +hook_bool_CUMULATIVE_ARGS_arg_info_false (cumulative_args_t, + const function_arg_info &) { return false; } bool -hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true ( - cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) +hook_bool_CUMULATIVE_ARGS_arg_info_true (cumulative_args_t, + const function_arg_info &) { return true; } int -hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 ( - cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) +hook_int_CUMULATIVE_ARGS_arg_info_0 (cumulative_args_t, + const function_arg_info &) { return 0; } @@ -783,10 +771,7 @@ hook_void_CUMULATIVE_ARGS_tree (cumulative_args_t ca ATTRIBUTE_UNUSED, } void -default_function_arg_advance (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +default_function_arg_advance (cumulative_args_t, const function_arg_info &) { gcc_unreachable (); } @@ -827,19 +812,13 @@ default_function_arg_padding (machine_mode mode, const_tree type) } rtx -default_function_arg (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +default_function_arg (cumulative_args_t, const function_arg_info &) { gcc_unreachable (); } rtx -default_function_incoming_arg (cumulative_args_t ca ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED, - const_tree type ATTRIBUTE_UNUSED, - bool named ATTRIBUTE_UNUSED) +default_function_incoming_arg (cumulative_args_t, const function_arg_info &) { gcc_unreachable (); } @@ -2177,7 +2156,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, if (ARGS_GROW_DOWNWARD) gcc_unreachable (); - indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); + indirect = pass_va_arg_by_reference (type); if (indirect) type = build_pointer_type (type); diff --git a/gcc/targhooks.h b/gcc/targhooks.h index 017a9d2..20a6e79 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -40,7 +40,9 @@ extern machine_mode default_cc_modes_compatible (machine_mode, extern bool default_return_in_memory (const_tree, const_tree); extern rtx default_expand_builtin_saveregs (void); -extern void default_setup_incoming_varargs (cumulative_args_t, machine_mode, tree, int *, int); +extern void default_setup_incoming_varargs (cumulative_args_t, + const function_arg_info &, + int *, int); extern rtx default_builtin_setjmp_frame_value (void); extern bool default_pretend_outgoing_varargs_named (cumulative_args_t); @@ -63,9 +65,9 @@ extern tree default_cxx_guard_type (void); extern tree default_cxx_get_cookie_size (tree); extern bool hook_pass_by_reference_must_pass_in_stack - (cumulative_args_t, machine_mode mode, const_tree, bool); + (cumulative_args_t, const function_arg_info &); extern bool hook_callee_copies_named - (cumulative_args_t ca, machine_mode, const_tree, bool); + (cumulative_args_t ca, const function_arg_info &); extern void default_print_operand (FILE *, rtx, int); extern void default_print_operand_address (FILE *, machine_mode, rtx); @@ -133,24 +135,23 @@ extern void default_goacc_reduction (gcall *); extern bool hook_bool_CUMULATIVE_ARGS_false (cumulative_args_t); extern bool hook_bool_CUMULATIVE_ARGS_true (cumulative_args_t); -extern bool hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false - (cumulative_args_t, machine_mode, const_tree, bool); -extern bool hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true - (cumulative_args_t, machine_mode, const_tree, bool); -extern int hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 - (cumulative_args_t, machine_mode, tree, bool); +extern bool hook_bool_CUMULATIVE_ARGS_arg_info_false + (cumulative_args_t, const function_arg_info &); +extern bool hook_bool_CUMULATIVE_ARGS_arg_info_true + (cumulative_args_t, const function_arg_info &); +extern int hook_int_CUMULATIVE_ARGS_arg_info_0 + (cumulative_args_t, const function_arg_info &); extern void hook_void_CUMULATIVE_ARGS_tree (cumulative_args_t, tree); extern const char *hook_invalid_arg_for_unprototyped_fn (const_tree, const_tree, const_tree); extern void default_function_arg_advance - (cumulative_args_t, machine_mode, const_tree, bool); + (cumulative_args_t, const function_arg_info &); extern HOST_WIDE_INT default_function_arg_offset (machine_mode, const_tree); extern pad_direction default_function_arg_padding (machine_mode, const_tree); -extern rtx default_function_arg - (cumulative_args_t, machine_mode, const_tree, bool); -extern rtx default_function_incoming_arg - (cumulative_args_t, machine_mode, const_tree, bool); +extern rtx default_function_arg (cumulative_args_t, const function_arg_info &); +extern rtx default_function_incoming_arg (cumulative_args_t, + const function_arg_info &); extern unsigned int default_function_arg_boundary (machine_mode, const_tree); extern unsigned int default_function_arg_round_boundary (machine_mode, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6f0bec8..27c5144 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,97 @@ +2019-08-21 Richard Sandiford <richard.sandiford@arm.com> + + PR c++/91505 + * g++.target/i386/crc32-4.C: New test. + +2019-08-21 Richard Biener <rguenther@suse.de> + + PR tree-optimization/91482 + * gcc.dg/tree-ssa/pr91482.c: New testcase. + +2019-08-21 Eric Botcazou <ebotcazou@adacore.com> + + * c-c++-common/dump-ada-spec-15.c: New test. + +2019-08-21 Christophe Lyon <christophe.lyon@linaro.org> + + * gcc.target/arm/cmse/cmse-9.c: Add quotes to expected + warning messages. + +2019-08-21 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/prot9.adb, gnat.dg/prot9_gen.ads, + gnat.dg/prot9_pkg1.ads, gnat.dg/prot9_pkg2.ads: New testcase. + +2019-08-21 Javier Miranda <miranda@adacore.com> + + * gnat.dg/implicit_param.adb, gnat.dg/implicit_param_pkg.ads: + New testcase. + +2019-08-20 Martin Sebor <msebor@redhat.com> + + PR testsuite/91458 + * g++.dg/tree-ssa/ssa-dse-1.C: Use the same search pattern + unconditionally (correcting r272199, PR middle-end/90676). + * gcc.dg/tree-prof/stringop-2.c: Same. + +2019-08-20 Ian Lance Taylor <iant@golang.org> + + * go.test/test/fixedbugs/bug073.go: Update for language changes. + +2019-08-20 Matthew Beliveau <mbelivea@redhat.com> + + * gcc.dg/tree-ssa/redundant-assign-zero-1.c: New test. + * gcc.dg/tree-ssa/redundant-assign-zero-2.c: New test. + +2019-08-20 Richard Biener <rguenther@suse.de> + + PR tree-optimization/37242 + * gcc.dg/tree-ssa/ssa-fre-80.c: New testcase. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * gnat.dg/storage_size1.adb: New testcase. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * gnat.dg/loop_entry2.adb: New testcase. + +2019-08-20 Ed Schonberg <schonberg@adacore.com> + + * gnat.dg/tagged5.adb, gnat.dg/tagged5.ads: New testcase. + +2019-08-20 Gary Dismukes <dismukes@adacore.com> + + * gnat.dg/type_conv2.adb, gnat.dg/type_conv2.ads: New testcase. + +2019-08-20 Bob Duff <duff@adacore.com> + + * gnat.dg/unchecked_convert14.adb: New testcase. + +2019-08-20 Bob Duff <duff@adacore.com> + + * gnat.dg/object_size1.adb: New testcase. + +2019-08-20 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.c-torture/execute/20190820-1.c: New test. + +2019-08-20 Richard Biener <rguenther@suse.de> + + PR target/91498 + * gcc.target/i386/minmax-7.c: New testcase. + +2019-08-20 Lili Cui <lili.cui@intel.com> + + * gcc.target/i386/funcspec-56.inc: Handle new march. + * g++.target/i386/mv16.C: Handle new march + +2019-08-20 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR middle-end/89544 + * gcc.target/arm/unaligned-argument-1.c: New test. + * gcc.target/arm/unaligned-argument-2.c: New test. + 2019-08-19 Joel Hutton <Joel.Hutton@arm.com> * gcc.target/aarch64/fmul_scvtf_1.c: New test. diff --git a/gcc/testsuite/c-c++-common/dump-ada-spec-15.c b/gcc/testsuite/c-c++-common/dump-ada-spec-15.c new file mode 100644 index 0000000..a4b54a6 --- /dev/null +++ b/gcc/testsuite/c-c++-common/dump-ada-spec-15.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-ada-spec" } */ + +extern void (*signal (int __sig, void (*__handler)(int)))(int); + +/* { dg-final { cleanup-ada-spec } } */ diff --git a/gcc/testsuite/g++.dg/tree-ssa/ssa-dse-1.C b/gcc/testsuite/g++.dg/tree-ssa/ssa-dse-1.C index bed4886..65f7ddb 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/ssa-dse-1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/ssa-dse-1.C @@ -97,5 +97,4 @@ int main() } -/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct FixBuf \\*\\)&<retval> \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { ! store_merge } } } } - { dg-final { scan-tree-dump-times "MEM <char\\\[\[0-9\]+]> \\\[\\(struct FixBuf \\*\\)&<retval> \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { store_merge } } } } */ +/* { dg-final { scan-tree-dump-times "MEM <char\\\[\[0-9\]+]> \\\[\\(struct FixBuf \\*\\)&<retval> \\+ \[0-9\]+B\\\] = {}" 1 "dse1" } } */ diff --git a/gcc/testsuite/g++.target/i386/crc32-4.C b/gcc/testsuite/g++.target/i386/crc32-4.C new file mode 100644 index 0000000..542ded6 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/crc32-4.C @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx2" } */ + +#include "../../gcc.target/i386/crc32-4.c" diff --git a/gcc/testsuite/g++.target/i386/mv16.C b/gcc/testsuite/g++.target/i386/mv16.C index 81e1511..422b9cd 100644 --- a/gcc/testsuite/g++.target/i386/mv16.C +++ b/gcc/testsuite/g++.target/i386/mv16.C @@ -72,6 +72,14 @@ int __attribute__ ((target("arch=cascadelake"))) foo () { return 19; } +int __attribute__ ((target("arch=tigerlake"))) foo () { + return 20; +} + +int __attribute__ ((target("arch=cooperlake"))) foo () { + return 21; +} + int main () { int val = foo (); @@ -100,6 +108,10 @@ int main () assert (val == 18); else if (__builtin_cpu_is ("cascadelake")) assert (val == 19); + else if (__builtin_cpu_is ("tigerlake")) + assert (val == 20); + else if (__builtin_cpu_is ("cooperlake")) + assert (val == 21); else assert (val == 0); diff --git a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c new file mode 100644 index 0000000..6a06eff --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c @@ -0,0 +1,111 @@ +/* PR rtl-optimization/91347 */
+/* Reported by John David Anglin <danglin@gcc.gnu.org> */
+
+typedef unsigned short __u16;
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+typedef __u16 u16;
+typedef __s32 s32;
+typedef __u32 u32;
+typedef __u64 u64;
+typedef _Bool bool;
+typedef s32 int32_t;
+typedef u32 uint32_t;
+typedef u64 uint64_t;
+
+char hex_asc_upper[16];
+u16 decpair[100];
+
+static __attribute__ ((noipa)) void
+put_dec_full4 (char *buf, unsigned r)
+{
+ unsigned q;
+ q = (r * 0x147b) >> 19;
+ *((u16 *)buf) = decpair[r - 100*q];
+ buf += 2;
+ *((u16 *)buf) = decpair[q];
+}
+
+static __attribute__ ((noipa)) unsigned
+put_dec_helper4 (char *buf, unsigned x)
+{
+ uint32_t q = (x * (uint64_t)0x346DC5D7) >> 43;
+ put_dec_full4(buf, x - q * 10000);
+ return q;
+}
+
+static __attribute__ ((noipa)) char *
+put_dec (char *buf, unsigned long long n)
+{
+ uint32_t d3, d2, d1, q, h;
+ d1 = ((uint32_t)n >> 16);
+ h = (n >> 32);
+ d2 = (h ) & 0xffff;
+ d3 = (h >> 16);
+ q = 656 * d3 + 7296 * d2 + 5536 * d1 + ((uint32_t)n & 0xffff);
+ q = put_dec_helper4(buf, q);
+ q += 7671 * d3 + 9496 * d2 + 6 * d1;
+ q = put_dec_helper4(buf+4, q);
+ q += 4749 * d3 + 42 * d2;
+ q = put_dec_helper4(buf+8, q);
+ return buf;
+}
+
+struct printf_spec {
+ unsigned int type:8;
+ signed int field_width:24;
+ unsigned int flags:8;
+ unsigned int base:8;
+ signed int precision:16;
+} __attribute__((__packed__));
+
+static __attribute__ ((noipa)) char *
+number (char *buf, char *end, unsigned long long num, struct printf_spec spec)
+{
+
+ char tmp[3 * sizeof(num)] __attribute__((__aligned__(2)));
+ char sign;
+ char locase;
+ int need_pfx = ((spec.flags & 64) && spec.base != 10);
+ int i;
+ bool is_zero = num == 0LL;
+ int field_width = spec.field_width;
+ int precision = spec.precision;
+
+ i = 0;
+ if (num < spec.base)
+ tmp[i++] = hex_asc_upper[num] | locase;
+ else if (spec.base != 10) {
+ int mask = spec.base - 1;
+ int shift = 3;
+ if (spec.base == 16)
+ shift = 4;
+ else
+ __builtin_abort ();
+ do {
+ tmp[i++] = (hex_asc_upper[((unsigned char)num) & mask] | locase);
+ num >>= shift;
+ } while (num);
+ } else {
+ i = put_dec(tmp, num) - tmp;
+ }
+ return buf;
+}
+
+static __attribute__ ((noipa)) char *
+pointer_string (char *buf, char *end, const void *ptr, struct printf_spec spec)
+{
+ spec.base = 16;
+ spec.flags = 0;
+ return number(buf, end, 100, spec);
+}
+
+int
+main (void)
+{
+ struct printf_spec spec;
+ char *s = pointer_string (0, 0, 0, spec);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c b/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c index 0264bb3..b7471bf 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c @@ -22,5 +22,4 @@ main() /* autofdo doesn't support value profiling for now: */ /* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 4 stringop" "profile"} } */ /* The versioned memset of size 4 should be optimized to an assignment. - { dg-final-use-not-autofdo { scan-tree-dump "MEM\\\[\\(void .\\)&a\\\] = 168430090" "optimized" { target { ! store_merge } } } } - { dg-final-use-not-autofdo { scan-tree-dump "MEM <\[a-z \]+> \\\[\\(void .\\)&a\\\] = 168430090" "optimized" { target { store_merge } } } } */ + { dg-final-use-not-autofdo { scan-tree-dump "MEM <\[a-z \]+> \\\[\\(void .\\)&a\\\] = 168430090" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c b/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c new file mode 100644 index 0000000..7d6a724 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-ccp1 -fdump-tree-store-merging" } */ + +void write64 (void *p) +{ + unsigned *p1 = (unsigned *) __builtin_assume_aligned (p, 8); + *p1++ = 0; + unsigned *p2 = (unsigned *) __builtin_assume_aligned (p1, 4); + *p2++ = 1; +} + +/* { dg-final { scan-tree-dump-times "__builtin_assume_aligned" 1 "ccp1" } } */ +/* { dg-final { scan-tree-dump "New sequence of 1 stores to replace old one of 2 stores" "store-merging" { target lp64 } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/redundant-assign-zero-1.c b/gcc/testsuite/gcc.dg/tree-ssa/redundant-assign-zero-1.c new file mode 100644 index 0000000..b8d01d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/redundant-assign-zero-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dse-details" } */ + +void blah (char *); + +void bar () +{ + char a[256] = ""; + a[3] = 0; + blah (a); +} + +/* { dg-final { scan-tree-dump-times "Deleted redundant store" 1 "dse1"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/redundant-assign-zero-2.c b/gcc/testsuite/gcc.dg/tree-ssa/redundant-assign-zero-2.c new file mode 100644 index 0000000..8cefa6f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/redundant-assign-zero-2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dse-details" } */ + +#include <string.h> + +void blahd (double *); + +void fubar () +{ + double d; + double *x = &d; + + memset (&d, 0 , sizeof d); + *x = 0.0; + blahd (x); +} + +/* { dg-final { scan-tree-dump-times "Deleted redundant store" 1 "dse1"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-80.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-80.c new file mode 100644 index 0000000..0176508 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-80.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-fre1" } */ + +unsigned long a, b; +void foo (int m, int f) +{ + unsigned long tem = (unsigned long)m; + a = tem + 1; + if (f) + { + int tem2 = m + 1; + b = (unsigned long)tem2; /* Eliminated to a. */ + } +} + +/* { dg-final { scan-tree-dump-times "\\(long unsigned int\\)" 1 "fre1" } } */ diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-9.c b/gcc/testsuite/gcc.target/arm/cmse/cmse-9.c index 9e81e30..d8874ee 100644 --- a/gcc/testsuite/gcc.target/arm/cmse/cmse-9.c +++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-9.c @@ -2,12 +2,12 @@ /* { dg-skip-if "Testing exclusion of -mcmse" { arm-*-* } { "-mcmse" } { "" } } */ -void __attribute__ ((cmse_nonsecure_call)) (*bar) (int); /* { dg-warning "attribute ignored without -mcmse option" } */ -typedef void __attribute__ ((cmse_nonsecure_call)) baz (int); /* { dg-warning "attribute ignored without -mcmse option" } */ +void __attribute__ ((cmse_nonsecure_call)) (*bar) (int); /* { dg-warning "attribute ignored without '-mcmse' option" } */ +typedef void __attribute__ ((cmse_nonsecure_call)) baz (int); /* { dg-warning "attribute ignored without '-mcmse' option" } */ int __attribute__ ((cmse_nonsecure_entry)) foo (int a, baz b) -{ /* { dg-warning "attribute ignored without -mcmse option" } */ +{ /* { dg-warning "attribute ignored without '-mcmse' option" } */ bar (a); b (a); return a + 1; diff --git a/gcc/testsuite/gcc.target/arm/unaligned-argument-1.c b/gcc/testsuite/gcc.target/arm/unaligned-argument-1.c new file mode 100644 index 0000000..805a3a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/unaligned-argument-1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_ldrd_strd_ok } */ +/* { dg-options "-marm -mno-unaligned-access -O3" } */ + +struct s { + int a, b; +} __attribute__((aligned(8))); + +struct s f0; + +void f(int a, int b, int c, int d, struct s f) +{ + f0 = f; +} + +/* { dg-final { scan-assembler-times "ldrd" 1 } } */ +/* { dg-final { scan-assembler-times "strd" 1 } } */ +/* { dg-final { scan-assembler-times "stm" 0 } } */ diff --git a/gcc/testsuite/gcc.target/arm/unaligned-argument-2.c b/gcc/testsuite/gcc.target/arm/unaligned-argument-2.c new file mode 100644 index 0000000..a35ce3a --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/unaligned-argument-2.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_ldrd_strd_ok } */ +/* { dg-options "-marm -mno-unaligned-access -O3" } */ + +struct s { + int a, b; +} __attribute__((aligned(8))); + +struct s f0; + +void f(int a, int b, int c, int d, int e, struct s f) +{ + f0 = f; +} + +/* { dg-final { scan-assembler-times "ldrd" 0 } } */ +/* { dg-final { scan-assembler-times "strd" 0 } } */ +/* { dg-final { scan-assembler-times "stm" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc b/gcc/testsuite/gcc.target/i386/funcspec-56.inc index 0eb83a7..200d272 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc +++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc @@ -151,6 +151,8 @@ extern void test_arch_cannonlake (void) __attribute__((__target__("arch=cannonl extern void test_arch_icelake_client (void) __attribute__((__target__("arch=icelake-client"))); extern void test_arch_icelake_server (void) __attribute__((__target__("arch=icelake-server"))); extern void test_arch_cascadelake (void) __attribute__((__target__("arch=cascadelake"))); +extern void test_arch_tigerlake (void) __attribute__((__target__("arch=tigerlake"))); +extern void test_arch_cooperlake (void) __attribute__((__target__("arch=cooperlake"))); extern void test_arch_k8 (void) __attribute__((__target__("arch=k8"))); extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3"))); extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron"))); diff --git a/gcc/testsuite/gcc.target/i386/minmax-7.c b/gcc/testsuite/gcc.target/i386/minmax-7.c new file mode 100644 index 0000000..905f085 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/minmax-7.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=haswell" } */ + +extern int numBins; +extern int binOffst; +extern int binWidth; +extern int Trybin; +void foo (int); + +void bar (int aleft, int axcenter) +{ + int a1LoBin = (((Trybin=((axcenter + aleft)-binOffst)/binWidth)<0) + ? 0 : ((Trybin>numBins) ? numBins : Trybin)); + foo (a1LoBin); +} + +/* We do not want the RA to spill %esi for it's dual-use but using + pminsd is OK. */ +/* { dg-final { scan-assembler-not "rsp" { target { ! { ia32 } } } } } */ +/* { dg-final { scan-assembler "pminsd" } } */ diff --git a/gcc/testsuite/gnat.dg/implicit_param.adb b/gcc/testsuite/gnat.dg/implicit_param.adb new file mode 100644 index 0000000..89de0c3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/implicit_param.adb @@ -0,0 +1,19 @@ +-- { dg-do compile } + +with Implicit_Param_Pkg; + +procedure Implicit_Param is + subtype Tiny is Integer range 1 .. 5; + V : Tiny := 4; + + function Func62 return Implicit_Param_Pkg.Lim_Rec is + begin + return + (case V is + when 1 .. 3 => Implicit_Param_Pkg.Func_Lim_Rec, + when 4 .. 5 => raise Program_Error); + end Func62; + +begin + null; +end Implicit_Param; diff --git a/gcc/testsuite/gnat.dg/implicit_param_pkg.ads b/gcc/testsuite/gnat.dg/implicit_param_pkg.ads new file mode 100644 index 0000000..ce6c7e6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/implicit_param_pkg.ads @@ -0,0 +1,8 @@ +package Implicit_Param_Pkg is + type Lim_Rec is limited record + A : Integer; + B : Boolean; + end record; + + function Func_Lim_Rec return Lim_Rec; +end Implicit_Param_Pkg; diff --git a/gcc/testsuite/gnat.dg/loop_entry2.adb b/gcc/testsuite/gnat.dg/loop_entry2.adb new file mode 100644 index 0000000..1708e73 --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_entry2.adb @@ -0,0 +1,11 @@ +-- { dg-do compile } +-- { dg-options "-gnata" } + +procedure Loop_Entry2 (S : String) is + J : Integer := S'First; +begin + while S(J..J+1) = S(J..J+1) loop + pragma Loop_Invariant (for all K in J'Loop_Entry .. J => K <= J); + J := J + 1; + end loop; +end; diff --git a/gcc/testsuite/gnat.dg/object_size1.adb b/gcc/testsuite/gnat.dg/object_size1.adb new file mode 100644 index 0000000..85c6962 --- /dev/null +++ b/gcc/testsuite/gnat.dg/object_size1.adb @@ -0,0 +1,13 @@ +-- { dg-do compile } + +with Text_IO; use Text_IO; + +procedure Object_Size1 is + type Zero_Size_Type is (Solo); + + for Zero_Size_Type'Size use 0; + for Zero_Size_Type'Object_Size use 0; -- { dg-error "Object_Size must be positive" } +begin + Put_Line (Zero_Size_Type'Size'Image); + Put_Line (Zero_Size_Type'Object_Size'Image); +end Object_Size1; diff --git a/gcc/testsuite/gnat.dg/prot9.adb b/gcc/testsuite/gnat.dg/prot9.adb new file mode 100644 index 0000000..6d1a21d --- /dev/null +++ b/gcc/testsuite/gnat.dg/prot9.adb @@ -0,0 +1,10 @@ +-- { dg-do compile } + +with Prot9_Gen; +with Prot9_Pkg1; + +procedure Prot9 is + package Dummy is new Prot9_Gen (Prot9_Pkg1.Prot_Type); +begin + null; +end Prot9; diff --git a/gcc/testsuite/gnat.dg/prot9_gen.ads b/gcc/testsuite/gnat.dg/prot9_gen.ads new file mode 100644 index 0000000..656866e --- /dev/null +++ b/gcc/testsuite/gnat.dg/prot9_gen.ads @@ -0,0 +1,9 @@ +generic + type Field_Type is limited private; +package Prot9_Gen is + + type Field_Pointer is access all Field_Type; + + Pointer : Field_Pointer := new Field_Type; + +end Prot9_Gen; diff --git a/gcc/testsuite/gnat.dg/prot9_pkg1.ads b/gcc/testsuite/gnat.dg/prot9_pkg1.ads new file mode 100644 index 0000000..5b995bc --- /dev/null +++ b/gcc/testsuite/gnat.dg/prot9_pkg1.ads @@ -0,0 +1,11 @@ +with Prot9_Pkg2; + +package Prot9_Pkg1 is + + type Prot_Type is limited private; + +private + + type Prot_Type is new Prot9_Pkg2.Prot_Type; + +end Prot9_Pkg1; diff --git a/gcc/testsuite/gnat.dg/prot9_pkg2.ads b/gcc/testsuite/gnat.dg/prot9_pkg2.ads new file mode 100644 index 0000000..af0e03b --- /dev/null +++ b/gcc/testsuite/gnat.dg/prot9_pkg2.ads @@ -0,0 +1,16 @@ +with Ada.Containers.Doubly_Linked_Lists; + +package Prot9_Pkg2 is + + type Prot_type is limited private; + +private + + package My_Lists is new Ada.Containers.Doubly_Linked_Lists (Integer); + + protected type Prot_type is + private + L : My_Lists.List; + end Prot_type; + +end Prot9_Pkg2; diff --git a/gcc/testsuite/gnat.dg/storage_size1.adb b/gcc/testsuite/gnat.dg/storage_size1.adb new file mode 100644 index 0000000..970caf1 --- /dev/null +++ b/gcc/testsuite/gnat.dg/storage_size1.adb @@ -0,0 +1,19 @@ +-- { dg-do compile } + +with Ada.Text_IO; with Ada.Integer_Text_IO; + +procedure Storage_Size1 is + + package O renames Ada.Text_IO; + package T renames Ada.Integer_Text_IO; + + type Struct is record first, second: Integer; end record; + + type SP is access Struct + with Storage_Size => 64 * Struct'Max_Size_In_Storage_Elements; + +begin + + T.Put(SP'Storage_Size); O.New_Line(1); + +end Storage_Size1; diff --git a/gcc/testsuite/gnat.dg/tagged5.adb b/gcc/testsuite/gnat.dg/tagged5.adb new file mode 100644 index 0000000..ffccca8 --- /dev/null +++ b/gcc/testsuite/gnat.dg/tagged5.adb @@ -0,0 +1,6 @@ +-- { dg-do compile } +-- { dg-options "-gnata" } + +package body Tagged5 is + procedure Dummy is null; +end Tagged5; diff --git a/gcc/testsuite/gnat.dg/tagged5.ads b/gcc/testsuite/gnat.dg/tagged5.ads new file mode 100644 index 0000000..3047269 --- /dev/null +++ b/gcc/testsuite/gnat.dg/tagged5.ads @@ -0,0 +1,18 @@ +package Tagged5 is + + type T is limited interface; + + not overriding function Element + (Self : T; + Index : Positive) + return Integer is abstract + with Pre'Class => Index + Index ** 2 in 1 .. 10; + + function First + (Self : T'Class) + return Integer + is (Self.Element (1)); + + procedure Dummy; + +end Tagged5; diff --git a/gcc/testsuite/gnat.dg/type_conv2.adb b/gcc/testsuite/gnat.dg/type_conv2.adb new file mode 100644 index 0000000..d1818c6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/type_conv2.adb @@ -0,0 +1,16 @@ +-- { dg-do compile } + +package body Type_Conv2 is + + function Wrap (X : Integer) return Root'Class is + begin + return Der_I'(X => X); + end Wrap; + + procedure Proc_Static is + D : constant Der_I := Der_I (Wrap (0)); -- { dg-error "initialization of limited object requires aggregate or function call" } + begin + null; + end Proc_Static; + +end Type_Conv2; diff --git a/gcc/testsuite/gnat.dg/type_conv2.ads b/gcc/testsuite/gnat.dg/type_conv2.ads new file mode 100644 index 0000000..b9ddeb2 --- /dev/null +++ b/gcc/testsuite/gnat.dg/type_conv2.ads @@ -0,0 +1,13 @@ +package Type_Conv2 is + + type Root is abstract tagged limited null record; + + type Der_I is new Root with record + X : Integer; + end record; + + function Wrap (X : Integer) return Root'Class; + + procedure Proc_Static; + +end Type_Conv2; diff --git a/gcc/testsuite/gnat.dg/unchecked_convert14.adb b/gcc/testsuite/gnat.dg/unchecked_convert14.adb new file mode 100644 index 0000000..756d836 --- /dev/null +++ b/gcc/testsuite/gnat.dg/unchecked_convert14.adb @@ -0,0 +1,30 @@ +-- { dg-do compile } + +with Ada.Unchecked_Conversion; +with System.Storage_Elements; use System.Storage_Elements; + +procedure Unchecked_Convert14 is + + type R is record + I : Integer; + C : Character; + end record; + + subtype Buffer is Storage_Array (1 .. 0); + + function As_Buffer is new Ada.Unchecked_Conversion -- { dg-warning "types for unchecked conversion have different sizes" } + (Source => R, Target => Buffer); + + type Buffer_1 is array (Storage_Offset range 1 .. 1) of Storage_Element; + + function As_Buffer_1 is new Ada.Unchecked_Conversion -- { dg-warning "types for unchecked conversion have different sizes" } + (Source => R, Target => Buffer_1); + + B : Buffer; + B_1 : Buffer_1; + My_R : R := (1, 'x'); + +begin + B := As_Buffer (My_R); + B_1 := As_Buffer_1 (My_R); +end Unchecked_Convert14; diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug073.go b/gcc/testsuite/go.test/test/fixedbugs/bug073.go index 49b47ae..f3605b3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug073.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug073.go @@ -1,4 +1,4 @@ -// errorcheck +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,8 +7,8 @@ package main func main() { - var s int = 0; - var x int = 0; - x = x << s; // ERROR "illegal|inval|shift" - x = x >> s; // ERROR "illegal|inval|shift" + var s int = 0 + var x int = 0 + x = x << s // as of 1.13, these are ok + x = x >> s // as of 1.13, these are ok } diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 458b218..5af3810 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2315,6 +2315,32 @@ ccp_folder::fold_stmt (gimple_stmt_iterator *gsi) } } + /* If there's no extra info from an assume_aligned call, + drop it so it doesn't act as otherwise useless dataflow + barrier. */ + if (gimple_call_builtin_p (stmt, BUILT_IN_ASSUME_ALIGNED)) + { + tree ptr = gimple_call_arg (stmt, 0); + ccp_prop_value_t ptrval = get_value_for_expr (ptr, true); + if (ptrval.lattice_val == CONSTANT + && TREE_CODE (ptrval.value) == INTEGER_CST + && ptrval.mask != 0) + { + ccp_prop_value_t val + = bit_value_assume_aligned (stmt, NULL_TREE, ptrval, false); + unsigned int ptralign = least_bit_hwi (ptrval.mask.to_uhwi ()); + unsigned int align = least_bit_hwi (val.mask.to_uhwi ()); + if (ptralign == align + && ((TREE_INT_CST_LOW (ptrval.value) & (align - 1)) + == (TREE_INT_CST_LOW (val.value) & (align - 1)))) + { + bool res = update_call_from_tree (gsi, ptr); + gcc_assert (res); + return true; + } + } + } + /* Propagate into the call arguments. Compared to replace_uses_in this can use the argument slot types for type verification instead of the current argument type. We also can safely diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 5b7c4fc..ba67884 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -628,11 +628,8 @@ dse_optimize_redundant_stores (gimple *stmt) tree fndecl; if ((is_gimple_assign (use_stmt) && gimple_vdef (use_stmt) - && ((gimple_assign_rhs_code (use_stmt) == CONSTRUCTOR - && CONSTRUCTOR_NELTS (gimple_assign_rhs1 (use_stmt)) == 0 - && !gimple_clobber_p (stmt)) - || (gimple_assign_rhs_code (use_stmt) == INTEGER_CST - && integer_zerop (gimple_assign_rhs1 (use_stmt))))) + && (gimple_assign_single_p (use_stmt) + && initializer_zerop (gimple_assign_rhs1 (use_stmt)))) || (gimple_call_builtin_p (use_stmt, BUILT_IN_NORMAL) && (fndecl = gimple_call_fndecl (use_stmt)) != NULL && (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET @@ -1027,16 +1024,11 @@ dse_dom_walker::dse_optimize_stmt (gimple_stmt_iterator *gsi) { bool by_clobber_p = false; - /* First see if this store is a CONSTRUCTOR and if there - are subsequent CONSTRUCTOR stores which are totally - subsumed by this statement. If so remove the subsequent - CONSTRUCTOR store. - - This will tend to make fewer calls into memset with longer - arguments. */ - if (gimple_assign_rhs_code (stmt) == CONSTRUCTOR - && CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt)) == 0 - && !gimple_clobber_p (stmt)) + /* Check if this statement stores zero to a memory location, + and if there is a subsequent store of zero to the same + memory location. If so, remove the subsequent store. */ + if (gimple_assign_single_p (stmt) + && initializer_zerop (gimple_assign_rhs1 (stmt))) dse_optimize_redundant_stores (stmt); /* Self-assignments are zombies. */ diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index eb7e4be..76cad43 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -4312,8 +4312,12 @@ visit_nary_op (tree lhs, gassign *stmt) operation. */ if (INTEGRAL_TYPE_P (type) && TREE_CODE (rhs1) == SSA_NAME - /* We only handle sign-changes or zero-extension -> & mask. */ - && ((TYPE_UNSIGNED (TREE_TYPE (rhs1)) + /* We only handle sign-changes, zero-extension -> & mask or + sign-extension if we know the inner operation doesn't + overflow. */ + && (((TYPE_UNSIGNED (TREE_TYPE (rhs1)) + || (INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (rhs1)))) && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (rhs1))) || TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (rhs1)))) { @@ -4347,7 +4351,9 @@ visit_nary_op (tree lhs, gassign *stmt) { unsigned lhs_prec = TYPE_PRECISION (type); unsigned rhs_prec = TYPE_PRECISION (TREE_TYPE (rhs1)); - if (lhs_prec == rhs_prec) + if (lhs_prec == rhs_prec + || (INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (rhs1)))) { gimple_match_op match_op (gimple_match_cond::UNCOND, NOP_EXPR, type, ops[0]); diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 67f25c1..af18528 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -6293,14 +6293,12 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn) && targetm.calls.struct_value_rtx (type, 0) == 0) { tree struct_addr = build_pointer_type (TREE_TYPE (type)); - machine_mode mode = TYPE_MODE (struct_addr); + function_arg_info arg (struct_addr, /*named=*/true); rtx reg; INIT_CUMULATIVE_ARGS (args_so_far_v, type, NULL_RTX, fndecl, nargs + 1); - reg = targetm.calls.function_arg (args_so_far, mode, - struct_addr, true); - targetm.calls.function_arg_advance (args_so_far, mode, - struct_addr, true); + reg = targetm.calls.function_arg (args_so_far, arg); + targetm.calls.function_arg_advance (args_so_far, arg); if (reg == NULL_RTX) { for (; link; link = XEXP (link, 1)) @@ -6318,11 +6316,9 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn) nargs); if (obj_type_ref && TYPE_ARG_TYPES (type) != void_list_node) { - machine_mode mode; t = TYPE_ARG_TYPES (type); - mode = TYPE_MODE (TREE_VALUE (t)); - this_arg = targetm.calls.function_arg (args_so_far, mode, - TREE_VALUE (t), true); + function_arg_info arg (TREE_VALUE (t), /*named=*/true); + this_arg = targetm.calls.function_arg (args_so_far, arg); if (this_arg && !REG_P (this_arg)) this_arg = NULL_RTX; else if (this_arg == NULL_RTX) @@ -6430,30 +6426,24 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn) } if (t && t != void_list_node) { - tree argtype = TREE_VALUE (t); - machine_mode mode = TYPE_MODE (argtype); rtx reg; - if (pass_by_reference (&args_so_far_v, mode, argtype, true)) - { - argtype = build_pointer_type (argtype); - mode = TYPE_MODE (argtype); - } - reg = targetm.calls.function_arg (args_so_far, mode, - argtype, true); - if (TREE_CODE (argtype) == REFERENCE_TYPE - && INTEGRAL_TYPE_P (TREE_TYPE (argtype)) + function_arg_info arg (TREE_VALUE (t), /*named=*/true); + apply_pass_by_reference_rules (&args_so_far_v, arg); + reg = targetm.calls.function_arg (args_so_far, arg); + if (TREE_CODE (arg.type) == REFERENCE_TYPE + && INTEGRAL_TYPE_P (TREE_TYPE (arg.type)) && reg && REG_P (reg) - && GET_MODE (reg) == mode - && (GET_MODE_CLASS (mode) == MODE_INT - || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT) + && GET_MODE (reg) == arg.mode + && (GET_MODE_CLASS (arg.mode) == MODE_INT + || GET_MODE_CLASS (arg.mode) == MODE_PARTIAL_INT) && REG_P (x) && REGNO (x) == REGNO (reg) - && GET_MODE (x) == mode + && GET_MODE (x) == arg.mode && item) { machine_mode indmode - = TYPE_MODE (TREE_TYPE (argtype)); + = TYPE_MODE (TREE_TYPE (arg.type)); rtx mem = gen_rtx_MEM (indmode, x); cselib_val *val = cselib_lookup (mem, indmode, 0, VOIDmode); if (val && cselib_preserved_value_p (val)) @@ -6493,8 +6483,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn) } } } - targetm.calls.function_arg_advance (args_so_far, mode, - argtype, true); + targetm.calls.function_arg_advance (args_so_far, arg); t = TREE_CHAIN (t); } } diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 33b6fa8..c793ea4 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-08-20 Lili Cui <lilicui@intel.com> + + * config/i386/cpuinfo.h: Add INTEL_COREI7_TIGERLAKE and + INTEL_COREI7_COOPERLAKE. + 2019-07-31 Matt Thomas <matt@3am-software.com> Nick Hudson <nick@nthcliff.demon.co.uk> Matthew Green <mrg@eterna.com.au> diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h index 68ca466..67209d5 100644 --- a/libgcc/config/i386/cpuinfo.h +++ b/libgcc/config/i386/cpuinfo.h @@ -77,6 +77,8 @@ enum processor_subtypes INTEL_COREI7_ICELAKE_SERVER, AMDFAM17H_ZNVER2, INTEL_COREI7_CASCADELAKE, + INTEL_COREI7_TIGERLAKE, + INTEL_COREI7_COOPERLAKE, CPU_SUBTYPE_MAX }; diff --git a/libgo/runtime/go-runtime-error.c b/libgo/runtime/go-runtime-error.c index c9ccf98..8179e68 100644 --- a/libgo/runtime/go-runtime-error.c +++ b/libgo/runtime/go-runtime-error.c @@ -55,7 +55,10 @@ enum DIVISION_BY_ZERO = 11, /* Go statement with nil function. */ - GO_NIL = 12 + GO_NIL = 12, + + /* Shift by negative value. */ + SHIFT_BY_NEGATIVE = 13 }; extern void __go_runtime_error (int32) __attribute__ ((noreturn)); @@ -112,6 +115,9 @@ __go_runtime_error (int32 i) runtime_g()->m->throwing = -1; runtime_throw ("go of nil func value"); + case SHIFT_BY_NEGATIVE: + runtime_panicstring ("negative shift amount"); + default: runtime_panicstring ("unknown runtime error"); } diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index c15227b..76b13f4 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,25 @@ +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + * libdruntime/Makefile.am (DRUNTIME_DSOURCES_BIONIC): Add + core/sys/bionic/string.d. + (DRUNTIME_DSOURCES_DARWIN): Add core/sys/darwin/string.d. + (DRUNTIME_DSOURCES_DRAGONFLYBSD): Add core/sys/dragonflybsd/string.d, + core/sys/dragonflybsd/sys/socket.d. + (DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/string.d. + (DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/string.d. + (DRUNTIME_DSOURCES_NETBSD): Add core/sys/netbsd/string.d, + core/sys/netbsd/sys/featuretest.d. + * libdruntime/Makefile.in: Regenerate. + +2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org> + + * libdruntime/Makefile.am (DRUNTIME_DSOURCES_OPENBSD): Add + core/sys/openbsd/sys/cdefs.d, core/sys/openbsd/sys/elf.d, + core/sys/openbsd/sys/elf32.d, core/sys/openbsd/sys/elf64.d, + core/sys/openbsd/sys/elf_common.d, core/sys/openbsd/sys/link_elf.d, + core/sys/openbsd/sys/mman.d, core/sys/openbsd/time.d. + * libdruntime/Makefile.in: Regenerate. + 2019-05-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * m4/druntime/os.m4 (DRUNTIME_OS_LINK_SPEC): Only use -z diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE index a142195..b8da026 100644 --- a/libphobos/libdruntime/MERGE +++ b/libphobos/libdruntime/MERGE @@ -1,4 +1,4 @@ -cb1583b4b7313bb6d79a5102b6c91e71f5181b19 +5bb8ce19fa495e5f794b3c513ae1bf7aabae93ff The first line of this file holds the git revision number of the last merge done from the dlang/druntime repository. diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index bf9bff09..d3fc347 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -162,21 +162,21 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \ core/sync/rwmutex.d core/sync/semaphore.d core/thread.d core/time.d \ core/vararg.d gcc/attribute.d gcc/backtrace.d gcc/builtins.d gcc/deh.d \ gcc/emutls.d gcc/gthread.d gcc/sections/android.d \ - gcc/sections/elf_shared.d gcc/sections/osx.d \ - gcc/sections/package.d gcc/sections/win32.d gcc/sections/win64.d \ - gcc/unwind/arm.d gcc/unwind/arm_common.d gcc/unwind/c6x.d \ - gcc/unwind/generic.d gcc/unwind/package.d gcc/unwind/pe.d object.d \ - rt/aApply.d rt/aApplyR.d rt/aaA.d rt/adi.d rt/arrayassign.d \ - rt/arraycast.d rt/arraycat.d rt/cast_.d rt/config.d rt/critical_.d \ - rt/deh.d rt/dmain2.d rt/invariant.d rt/lifetime.d rt/memory.d \ - rt/minfo.d rt/monitor_.d rt/obj.d rt/qsort.d rt/sections.d \ - rt/switch_.d rt/tlsgc.d rt/typeinfo/ti_Acdouble.d \ - rt/typeinfo/ti_Acfloat.d rt/typeinfo/ti_Acreal.d \ - rt/typeinfo/ti_Adouble.d rt/typeinfo/ti_Afloat.d rt/typeinfo/ti_Ag.d \ - rt/typeinfo/ti_Aint.d rt/typeinfo/ti_Along.d rt/typeinfo/ti_Areal.d \ - rt/typeinfo/ti_Ashort.d rt/typeinfo/ti_C.d rt/typeinfo/ti_byte.d \ - rt/typeinfo/ti_cdouble.d rt/typeinfo/ti_cent.d rt/typeinfo/ti_cfloat.d \ - rt/typeinfo/ti_char.d rt/typeinfo/ti_creal.d rt/typeinfo/ti_dchar.d \ + gcc/sections/elf_shared.d gcc/sections/osx.d gcc/sections/package.d \ + gcc/sections/win32.d gcc/sections/win64.d gcc/unwind/arm.d \ + gcc/unwind/arm_common.d gcc/unwind/c6x.d gcc/unwind/generic.d \ + gcc/unwind/package.d gcc/unwind/pe.d object.d rt/aApply.d rt/aApplyR.d \ + rt/aaA.d rt/adi.d rt/arrayassign.d rt/arraycast.d rt/arraycat.d \ + rt/cast_.d rt/config.d rt/critical_.d rt/deh.d rt/dmain2.d \ + rt/invariant.d rt/lifetime.d rt/memory.d rt/minfo.d rt/monitor_.d \ + rt/obj.d rt/qsort.d rt/sections.d rt/switch_.d rt/tlsgc.d \ + rt/typeinfo/ti_Acdouble.d rt/typeinfo/ti_Acfloat.d \ + rt/typeinfo/ti_Acreal.d rt/typeinfo/ti_Adouble.d \ + rt/typeinfo/ti_Afloat.d rt/typeinfo/ti_Ag.d rt/typeinfo/ti_Aint.d \ + rt/typeinfo/ti_Along.d rt/typeinfo/ti_Areal.d rt/typeinfo/ti_Ashort.d \ + rt/typeinfo/ti_C.d rt/typeinfo/ti_byte.d rt/typeinfo/ti_cdouble.d \ + rt/typeinfo/ti_cent.d rt/typeinfo/ti_cfloat.d rt/typeinfo/ti_char.d \ + rt/typeinfo/ti_creal.d rt/typeinfo/ti_dchar.d \ rt/typeinfo/ti_delegate.d rt/typeinfo/ti_double.d \ rt/typeinfo/ti_float.d rt/typeinfo/ti_idouble.d \ rt/typeinfo/ti_ifloat.d rt/typeinfo/ti_int.d rt/typeinfo/ti_ireal.d \ @@ -198,7 +198,7 @@ DRUNTIME_DSOURCES_GC = gc/bits.d gc/config.d gc/gcinterface.d \ DRUNTIME_DSOURCES_GCSTUB = gcstub/gc.d DRUNTIME_DSOURCES_BIONIC = core/sys/bionic/fcntl.d \ - core/sys/bionic/unistd.d + core/sys/bionic/string.d core/sys/bionic/unistd.d DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/crt_externs.d \ core/sys/darwin/dlfcn.d core/sys/darwin/execinfo.d \ @@ -206,35 +206,39 @@ DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/crt_externs.d \ core/sys/darwin/mach/kern_return.d core/sys/darwin/mach/loader.d \ core/sys/darwin/mach/port.d core/sys/darwin/mach/semaphore.d \ core/sys/darwin/mach/thread_act.d core/sys/darwin/netinet/in_.d \ - core/sys/darwin/pthread.d core/sys/darwin/sys/cdefs.d \ - core/sys/darwin/sys/event.d core/sys/darwin/sys/mman.d + core/sys/darwin/pthread.d core/sys/darwin/string.d \ + core/sys/darwin/sys/cdefs.d core/sys/darwin/sys/event.d \ + core/sys/darwin/sys/mman.d DRUNTIME_DSOURCES_DRAGONFLYBSD = core/sys/dragonflybsd/dlfcn.d \ core/sys/dragonflybsd/execinfo.d core/sys/dragonflybsd/netinet/in_.d \ - core/sys/dragonflybsd/pthread_np.d core/sys/dragonflybsd/sys/_bitset.d \ + core/sys/dragonflybsd/pthread_np.d core/sys/dragonflybsd/string.d \ + core/sys/dragonflybsd/sys/_bitset.d \ core/sys/dragonflybsd/sys/_cpuset.d core/sys/dragonflybsd/sys/cdefs.d \ core/sys/dragonflybsd/sys/elf.d core/sys/dragonflybsd/sys/elf32.d \ core/sys/dragonflybsd/sys/elf64.d \ core/sys/dragonflybsd/sys/elf_common.d \ core/sys/dragonflybsd/sys/event.d core/sys/dragonflybsd/sys/link_elf.d \ - core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/time.d + core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/sys/socket.d \ + core/sys/dragonflybsd/time.d DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/dlfcn.d \ core/sys/freebsd/execinfo.d core/sys/freebsd/netinet/in_.d \ - core/sys/freebsd/pthread_np.d core/sys/freebsd/sys/_bitset.d \ - core/sys/freebsd/sys/_cpuset.d core/sys/freebsd/sys/cdefs.d \ - core/sys/freebsd/sys/elf.d core/sys/freebsd/sys/elf32.d \ - core/sys/freebsd/sys/elf64.d core/sys/freebsd/sys/elf_common.d \ - core/sys/freebsd/sys/event.d core/sys/freebsd/sys/link_elf.d \ - core/sys/freebsd/sys/mman.d core/sys/freebsd/sys/mount.d \ - core/sys/freebsd/time.d core/sys/freebsd/unistd.d + core/sys/freebsd/pthread_np.d core/sys/freebsd/string.d \ + core/sys/freebsd/sys/_bitset.d core/sys/freebsd/sys/_cpuset.d \ + core/sys/freebsd/sys/cdefs.d core/sys/freebsd/sys/elf.d \ + core/sys/freebsd/sys/elf32.d core/sys/freebsd/sys/elf64.d \ + core/sys/freebsd/sys/elf_common.d core/sys/freebsd/sys/event.d \ + core/sys/freebsd/sys/link_elf.d core/sys/freebsd/sys/mman.d \ + core/sys/freebsd/sys/mount.d core/sys/freebsd/time.d \ + core/sys/freebsd/unistd.d DRUNTIME_DSOURCES_LINUX = core/sys/linux/config.d \ core/sys/linux/dlfcn.d core/sys/linux/elf.d core/sys/linux/epoll.d \ core/sys/linux/errno.d core/sys/linux/execinfo.d \ core/sys/linux/fcntl.d core/sys/linux/ifaddrs.d core/sys/linux/link.d \ core/sys/linux/netinet/in_.d core/sys/linux/netinet/tcp.d \ - core/sys/linux/sched.d core/sys/linux/stdio.d \ + core/sys/linux/sched.d core/sys/linux/stdio.d core/sys/linux/string.d \ core/sys/linux/sys/auxv.d core/sys/linux/sys/eventfd.d \ core/sys/linux/sys/file.d core/sys/linux/sys/inotify.d \ core/sys/linux/sys/mman.d core/sys/linux/sys/netinet/tcp.d \ @@ -245,13 +249,19 @@ DRUNTIME_DSOURCES_LINUX = core/sys/linux/config.d \ core/sys/linux/timerfd.d core/sys/linux/tipc.d core/sys/linux/unistd.d DRUNTIME_DSOURCES_NETBSD = core/sys/netbsd/dlfcn.d \ - core/sys/netbsd/execinfo.d core/sys/netbsd/sys/elf.d \ - core/sys/netbsd/sys/elf32.d core/sys/netbsd/sys/elf64.d \ - core/sys/netbsd/sys/elf_common.d core/sys/netbsd/sys/event.d \ + core/sys/netbsd/execinfo.d core/sys/netbsd/string.d \ + core/sys/netbsd/sys/elf.d core/sys/netbsd/sys/elf32.d \ + core/sys/netbsd/sys/elf64.d core/sys/netbsd/sys/elf_common.d \ + core/sys/netbsd/sys/event.d core/sys/netbsd/sys/featuretest.d \ core/sys/netbsd/sys/link_elf.d core/sys/netbsd/sys/mman.d \ core/sys/netbsd/time.d -DRUNTIME_DSOURCES_OPENBSD = core/sys/openbsd/dlfcn.d +DRUNTIME_DSOURCES_OPENBSD = core/sys/openbsd/dlfcn.d \ + core/sys/openbsd/string.d core/sys/openbsd/sys/cdefs.d \ + core/sys/openbsd/sys/elf.d core/sys/openbsd/sys/elf32.d \ + core/sys/openbsd/sys/elf64.d core/sys/openbsd/sys/elf_common.d \ + core/sys/openbsd/sys/link_elf.d core/sys/openbsd/sys/mman.d \ + core/sys/openbsd/time.d DRUNTIME_DSOURCES_POSIX = core/sys/posix/aio.d \ core/sys/posix/arpa/inet.d core/sys/posix/config.d \ diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 19ee94f..aaf05b5 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -278,13 +278,14 @@ am__objects_9 = core/sys/darwin/crt_externs.lo \ core/sys/darwin/mach/semaphore.lo \ core/sys/darwin/mach/thread_act.lo \ core/sys/darwin/netinet/in_.lo core/sys/darwin/pthread.lo \ - core/sys/darwin/sys/cdefs.lo core/sys/darwin/sys/event.lo \ - core/sys/darwin/sys/mman.lo + core/sys/darwin/string.lo core/sys/darwin/sys/cdefs.lo \ + core/sys/darwin/sys/event.lo core/sys/darwin/sys/mman.lo @DRUNTIME_OS_DARWIN_TRUE@am__objects_10 = $(am__objects_9) am__objects_11 = core/sys/dragonflybsd/dlfcn.lo \ core/sys/dragonflybsd/execinfo.lo \ core/sys/dragonflybsd/netinet/in_.lo \ core/sys/dragonflybsd/pthread_np.lo \ + core/sys/dragonflybsd/string.lo \ core/sys/dragonflybsd/sys/_bitset.lo \ core/sys/dragonflybsd/sys/_cpuset.lo \ core/sys/dragonflybsd/sys/cdefs.lo \ @@ -295,13 +296,16 @@ am__objects_11 = core/sys/dragonflybsd/dlfcn.lo \ core/sys/dragonflybsd/sys/event.lo \ core/sys/dragonflybsd/sys/link_elf.lo \ core/sys/dragonflybsd/sys/mman.lo \ + core/sys/dragonflybsd/sys/socket.lo \ core/sys/dragonflybsd/time.lo @DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__objects_12 = $(am__objects_11) -am__objects_13 = core/sys/bionic/fcntl.lo core/sys/bionic/unistd.lo +am__objects_13 = core/sys/bionic/fcntl.lo core/sys/bionic/string.lo \ + core/sys/bionic/unistd.lo @DRUNTIME_OS_ANDROID_TRUE@am__objects_14 = $(am__objects_13) am__objects_15 = core/sys/freebsd/dlfcn.lo \ core/sys/freebsd/execinfo.lo core/sys/freebsd/netinet/in_.lo \ - core/sys/freebsd/pthread_np.lo core/sys/freebsd/sys/_bitset.lo \ + core/sys/freebsd/pthread_np.lo core/sys/freebsd/string.lo \ + core/sys/freebsd/sys/_bitset.lo \ core/sys/freebsd/sys/_cpuset.lo core/sys/freebsd/sys/cdefs.lo \ core/sys/freebsd/sys/elf.lo core/sys/freebsd/sys/elf32.lo \ core/sys/freebsd/sys/elf64.lo \ @@ -311,12 +315,19 @@ am__objects_15 = core/sys/freebsd/dlfcn.lo \ core/sys/freebsd/time.lo core/sys/freebsd/unistd.lo @DRUNTIME_OS_FREEBSD_TRUE@am__objects_16 = $(am__objects_15) am__objects_17 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/execinfo.lo \ - core/sys/netbsd/sys/elf.lo core/sys/netbsd/sys/elf32.lo \ - core/sys/netbsd/sys/elf64.lo core/sys/netbsd/sys/elf_common.lo \ - core/sys/netbsd/sys/event.lo core/sys/netbsd/sys/link_elf.lo \ - core/sys/netbsd/sys/mman.lo core/sys/netbsd/time.lo + core/sys/netbsd/string.lo core/sys/netbsd/sys/elf.lo \ + core/sys/netbsd/sys/elf32.lo core/sys/netbsd/sys/elf64.lo \ + core/sys/netbsd/sys/elf_common.lo core/sys/netbsd/sys/event.lo \ + core/sys/netbsd/sys/featuretest.lo \ + core/sys/netbsd/sys/link_elf.lo core/sys/netbsd/sys/mman.lo \ + core/sys/netbsd/time.lo @DRUNTIME_OS_NETBSD_TRUE@am__objects_18 = $(am__objects_17) -am__objects_19 = core/sys/openbsd/dlfcn.lo +am__objects_19 = core/sys/openbsd/dlfcn.lo core/sys/openbsd/string.lo \ + core/sys/openbsd/sys/cdefs.lo core/sys/openbsd/sys/elf.lo \ + core/sys/openbsd/sys/elf32.lo core/sys/openbsd/sys/elf64.lo \ + core/sys/openbsd/sys/elf_common.lo \ + core/sys/openbsd/sys/link_elf.lo core/sys/openbsd/sys/mman.lo \ + core/sys/openbsd/time.lo @DRUNTIME_OS_OPENBSD_TRUE@am__objects_20 = $(am__objects_19) am__objects_21 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \ core/sys/linux/elf.lo core/sys/linux/epoll.lo \ @@ -324,15 +335,16 @@ am__objects_21 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \ core/sys/linux/fcntl.lo core/sys/linux/ifaddrs.lo \ core/sys/linux/link.lo core/sys/linux/netinet/in_.lo \ core/sys/linux/netinet/tcp.lo core/sys/linux/sched.lo \ - core/sys/linux/stdio.lo core/sys/linux/sys/auxv.lo \ - core/sys/linux/sys/eventfd.lo core/sys/linux/sys/file.lo \ - core/sys/linux/sys/inotify.lo core/sys/linux/sys/mman.lo \ - core/sys/linux/sys/netinet/tcp.lo core/sys/linux/sys/prctl.lo \ - core/sys/linux/sys/signalfd.lo core/sys/linux/sys/socket.lo \ - core/sys/linux/sys/sysinfo.lo core/sys/linux/sys/time.lo \ - core/sys/linux/sys/xattr.lo core/sys/linux/termios.lo \ - core/sys/linux/time.lo core/sys/linux/timerfd.lo \ - core/sys/linux/tipc.lo core/sys/linux/unistd.lo + core/sys/linux/stdio.lo core/sys/linux/string.lo \ + core/sys/linux/sys/auxv.lo core/sys/linux/sys/eventfd.lo \ + core/sys/linux/sys/file.lo core/sys/linux/sys/inotify.lo \ + core/sys/linux/sys/mman.lo core/sys/linux/sys/netinet/tcp.lo \ + core/sys/linux/sys/prctl.lo core/sys/linux/sys/signalfd.lo \ + core/sys/linux/sys/socket.lo core/sys/linux/sys/sysinfo.lo \ + core/sys/linux/sys/time.lo core/sys/linux/sys/xattr.lo \ + core/sys/linux/termios.lo core/sys/linux/time.lo \ + core/sys/linux/timerfd.lo core/sys/linux/tipc.lo \ + core/sys/linux/unistd.lo @DRUNTIME_OS_LINUX_TRUE@am__objects_22 = $(am__objects_21) am__objects_23 = core/sys/windows/accctrl.lo \ core/sys/windows/aclapi.lo core/sys/windows/aclui.lo \ @@ -758,21 +770,21 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \ core/sync/rwmutex.d core/sync/semaphore.d core/thread.d core/time.d \ core/vararg.d gcc/attribute.d gcc/backtrace.d gcc/builtins.d gcc/deh.d \ gcc/emutls.d gcc/gthread.d gcc/sections/android.d \ - gcc/sections/elf_shared.d gcc/sections/osx.d \ - gcc/sections/package.d gcc/sections/win32.d gcc/sections/win64.d \ - gcc/unwind/arm.d gcc/unwind/arm_common.d gcc/unwind/c6x.d \ - gcc/unwind/generic.d gcc/unwind/package.d gcc/unwind/pe.d object.d \ - rt/aApply.d rt/aApplyR.d rt/aaA.d rt/adi.d rt/arrayassign.d \ - rt/arraycast.d rt/arraycat.d rt/cast_.d rt/config.d rt/critical_.d \ - rt/deh.d rt/dmain2.d rt/invariant.d rt/lifetime.d rt/memory.d \ - rt/minfo.d rt/monitor_.d rt/obj.d rt/qsort.d rt/sections.d \ - rt/switch_.d rt/tlsgc.d rt/typeinfo/ti_Acdouble.d \ - rt/typeinfo/ti_Acfloat.d rt/typeinfo/ti_Acreal.d \ - rt/typeinfo/ti_Adouble.d rt/typeinfo/ti_Afloat.d rt/typeinfo/ti_Ag.d \ - rt/typeinfo/ti_Aint.d rt/typeinfo/ti_Along.d rt/typeinfo/ti_Areal.d \ - rt/typeinfo/ti_Ashort.d rt/typeinfo/ti_C.d rt/typeinfo/ti_byte.d \ - rt/typeinfo/ti_cdouble.d rt/typeinfo/ti_cent.d rt/typeinfo/ti_cfloat.d \ - rt/typeinfo/ti_char.d rt/typeinfo/ti_creal.d rt/typeinfo/ti_dchar.d \ + gcc/sections/elf_shared.d gcc/sections/osx.d gcc/sections/package.d \ + gcc/sections/win32.d gcc/sections/win64.d gcc/unwind/arm.d \ + gcc/unwind/arm_common.d gcc/unwind/c6x.d gcc/unwind/generic.d \ + gcc/unwind/package.d gcc/unwind/pe.d object.d rt/aApply.d rt/aApplyR.d \ + rt/aaA.d rt/adi.d rt/arrayassign.d rt/arraycast.d rt/arraycat.d \ + rt/cast_.d rt/config.d rt/critical_.d rt/deh.d rt/dmain2.d \ + rt/invariant.d rt/lifetime.d rt/memory.d rt/minfo.d rt/monitor_.d \ + rt/obj.d rt/qsort.d rt/sections.d rt/switch_.d rt/tlsgc.d \ + rt/typeinfo/ti_Acdouble.d rt/typeinfo/ti_Acfloat.d \ + rt/typeinfo/ti_Acreal.d rt/typeinfo/ti_Adouble.d \ + rt/typeinfo/ti_Afloat.d rt/typeinfo/ti_Ag.d rt/typeinfo/ti_Aint.d \ + rt/typeinfo/ti_Along.d rt/typeinfo/ti_Areal.d rt/typeinfo/ti_Ashort.d \ + rt/typeinfo/ti_C.d rt/typeinfo/ti_byte.d rt/typeinfo/ti_cdouble.d \ + rt/typeinfo/ti_cent.d rt/typeinfo/ti_cfloat.d rt/typeinfo/ti_char.d \ + rt/typeinfo/ti_creal.d rt/typeinfo/ti_dchar.d \ rt/typeinfo/ti_delegate.d rt/typeinfo/ti_double.d \ rt/typeinfo/ti_float.d rt/typeinfo/ti_idouble.d \ rt/typeinfo/ti_ifloat.d rt/typeinfo/ti_int.d rt/typeinfo/ti_ireal.d \ @@ -793,7 +805,7 @@ DRUNTIME_DSOURCES_GC = gc/bits.d gc/config.d gc/gcinterface.d \ DRUNTIME_DSOURCES_GCSTUB = gcstub/gc.d DRUNTIME_DSOURCES_BIONIC = core/sys/bionic/fcntl.d \ - core/sys/bionic/unistd.d + core/sys/bionic/string.d core/sys/bionic/unistd.d DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/crt_externs.d \ core/sys/darwin/dlfcn.d core/sys/darwin/execinfo.d \ @@ -801,35 +813,39 @@ DRUNTIME_DSOURCES_DARWIN = core/sys/darwin/crt_externs.d \ core/sys/darwin/mach/kern_return.d core/sys/darwin/mach/loader.d \ core/sys/darwin/mach/port.d core/sys/darwin/mach/semaphore.d \ core/sys/darwin/mach/thread_act.d core/sys/darwin/netinet/in_.d \ - core/sys/darwin/pthread.d core/sys/darwin/sys/cdefs.d \ - core/sys/darwin/sys/event.d core/sys/darwin/sys/mman.d + core/sys/darwin/pthread.d core/sys/darwin/string.d \ + core/sys/darwin/sys/cdefs.d core/sys/darwin/sys/event.d \ + core/sys/darwin/sys/mman.d DRUNTIME_DSOURCES_DRAGONFLYBSD = core/sys/dragonflybsd/dlfcn.d \ core/sys/dragonflybsd/execinfo.d core/sys/dragonflybsd/netinet/in_.d \ - core/sys/dragonflybsd/pthread_np.d core/sys/dragonflybsd/sys/_bitset.d \ + core/sys/dragonflybsd/pthread_np.d core/sys/dragonflybsd/string.d \ + core/sys/dragonflybsd/sys/_bitset.d \ core/sys/dragonflybsd/sys/_cpuset.d core/sys/dragonflybsd/sys/cdefs.d \ core/sys/dragonflybsd/sys/elf.d core/sys/dragonflybsd/sys/elf32.d \ core/sys/dragonflybsd/sys/elf64.d \ core/sys/dragonflybsd/sys/elf_common.d \ core/sys/dragonflybsd/sys/event.d core/sys/dragonflybsd/sys/link_elf.d \ - core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/time.d + core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/sys/socket.d \ + core/sys/dragonflybsd/time.d DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/dlfcn.d \ core/sys/freebsd/execinfo.d core/sys/freebsd/netinet/in_.d \ - core/sys/freebsd/pthread_np.d core/sys/freebsd/sys/_bitset.d \ - core/sys/freebsd/sys/_cpuset.d core/sys/freebsd/sys/cdefs.d \ - core/sys/freebsd/sys/elf.d core/sys/freebsd/sys/elf32.d \ - core/sys/freebsd/sys/elf64.d core/sys/freebsd/sys/elf_common.d \ - core/sys/freebsd/sys/event.d core/sys/freebsd/sys/link_elf.d \ - core/sys/freebsd/sys/mman.d core/sys/freebsd/sys/mount.d \ - core/sys/freebsd/time.d core/sys/freebsd/unistd.d + core/sys/freebsd/pthread_np.d core/sys/freebsd/string.d \ + core/sys/freebsd/sys/_bitset.d core/sys/freebsd/sys/_cpuset.d \ + core/sys/freebsd/sys/cdefs.d core/sys/freebsd/sys/elf.d \ + core/sys/freebsd/sys/elf32.d core/sys/freebsd/sys/elf64.d \ + core/sys/freebsd/sys/elf_common.d core/sys/freebsd/sys/event.d \ + core/sys/freebsd/sys/link_elf.d core/sys/freebsd/sys/mman.d \ + core/sys/freebsd/sys/mount.d core/sys/freebsd/time.d \ + core/sys/freebsd/unistd.d DRUNTIME_DSOURCES_LINUX = core/sys/linux/config.d \ core/sys/linux/dlfcn.d core/sys/linux/elf.d core/sys/linux/epoll.d \ core/sys/linux/errno.d core/sys/linux/execinfo.d \ core/sys/linux/fcntl.d core/sys/linux/ifaddrs.d core/sys/linux/link.d \ core/sys/linux/netinet/in_.d core/sys/linux/netinet/tcp.d \ - core/sys/linux/sched.d core/sys/linux/stdio.d \ + core/sys/linux/sched.d core/sys/linux/stdio.d core/sys/linux/string.d \ core/sys/linux/sys/auxv.d core/sys/linux/sys/eventfd.d \ core/sys/linux/sys/file.d core/sys/linux/sys/inotify.d \ core/sys/linux/sys/mman.d core/sys/linux/sys/netinet/tcp.d \ @@ -840,13 +856,20 @@ DRUNTIME_DSOURCES_LINUX = core/sys/linux/config.d \ core/sys/linux/timerfd.d core/sys/linux/tipc.d core/sys/linux/unistd.d DRUNTIME_DSOURCES_NETBSD = core/sys/netbsd/dlfcn.d \ - core/sys/netbsd/execinfo.d core/sys/netbsd/sys/elf.d \ - core/sys/netbsd/sys/elf32.d core/sys/netbsd/sys/elf64.d \ - core/sys/netbsd/sys/elf_common.d core/sys/netbsd/sys/event.d \ + core/sys/netbsd/execinfo.d core/sys/netbsd/string.d \ + core/sys/netbsd/sys/elf.d core/sys/netbsd/sys/elf32.d \ + core/sys/netbsd/sys/elf64.d core/sys/netbsd/sys/elf_common.d \ + core/sys/netbsd/sys/event.d core/sys/netbsd/sys/featuretest.d \ core/sys/netbsd/sys/link_elf.d core/sys/netbsd/sys/mman.d \ core/sys/netbsd/time.d -DRUNTIME_DSOURCES_OPENBSD = core/sys/openbsd/dlfcn.d +DRUNTIME_DSOURCES_OPENBSD = core/sys/openbsd/dlfcn.d \ + core/sys/openbsd/string.d core/sys/openbsd/sys/cdefs.d \ + core/sys/openbsd/sys/elf.d core/sys/openbsd/sys/elf32.d \ + core/sys/openbsd/sys/elf64.d core/sys/openbsd/sys/elf_common.d \ + core/sys/openbsd/sys/link_elf.d core/sys/openbsd/sys/mman.d \ + core/sys/openbsd/time.d + DRUNTIME_DSOURCES_POSIX = core/sys/posix/aio.d \ core/sys/posix/arpa/inet.d core/sys/posix/config.d \ core/sys/posix/dirent.d core/sys/posix/dlfcn.d core/sys/posix/fcntl.d \ @@ -1316,6 +1339,7 @@ core/sys/darwin/netinet/$(am__dirstamp): core/sys/darwin/netinet/in_.lo: \ core/sys/darwin/netinet/$(am__dirstamp) core/sys/darwin/pthread.lo: core/sys/darwin/$(am__dirstamp) +core/sys/darwin/string.lo: core/sys/darwin/$(am__dirstamp) core/sys/darwin/sys/$(am__dirstamp): @$(MKDIR_P) core/sys/darwin/sys @: > core/sys/darwin/sys/$(am__dirstamp) @@ -1335,6 +1359,8 @@ core/sys/dragonflybsd/netinet/in_.lo: \ core/sys/dragonflybsd/netinet/$(am__dirstamp) core/sys/dragonflybsd/pthread_np.lo: \ core/sys/dragonflybsd/$(am__dirstamp) +core/sys/dragonflybsd/string.lo: \ + core/sys/dragonflybsd/$(am__dirstamp) core/sys/dragonflybsd/sys/$(am__dirstamp): @$(MKDIR_P) core/sys/dragonflybsd/sys @: > core/sys/dragonflybsd/sys/$(am__dirstamp) @@ -1358,11 +1384,14 @@ core/sys/dragonflybsd/sys/link_elf.lo: \ core/sys/dragonflybsd/sys/$(am__dirstamp) core/sys/dragonflybsd/sys/mman.lo: \ core/sys/dragonflybsd/sys/$(am__dirstamp) +core/sys/dragonflybsd/sys/socket.lo: \ + core/sys/dragonflybsd/sys/$(am__dirstamp) core/sys/dragonflybsd/time.lo: core/sys/dragonflybsd/$(am__dirstamp) core/sys/bionic/$(am__dirstamp): @$(MKDIR_P) core/sys/bionic @: > core/sys/bionic/$(am__dirstamp) core/sys/bionic/fcntl.lo: core/sys/bionic/$(am__dirstamp) +core/sys/bionic/string.lo: core/sys/bionic/$(am__dirstamp) core/sys/bionic/unistd.lo: core/sys/bionic/$(am__dirstamp) core/sys/freebsd/$(am__dirstamp): @$(MKDIR_P) core/sys/freebsd @@ -1375,6 +1404,7 @@ core/sys/freebsd/netinet/$(am__dirstamp): core/sys/freebsd/netinet/in_.lo: \ core/sys/freebsd/netinet/$(am__dirstamp) core/sys/freebsd/pthread_np.lo: core/sys/freebsd/$(am__dirstamp) +core/sys/freebsd/string.lo: core/sys/freebsd/$(am__dirstamp) core/sys/freebsd/sys/$(am__dirstamp): @$(MKDIR_P) core/sys/freebsd/sys @: > core/sys/freebsd/sys/$(am__dirstamp) @@ -1398,6 +1428,7 @@ core/sys/netbsd/$(am__dirstamp): @: > core/sys/netbsd/$(am__dirstamp) core/sys/netbsd/dlfcn.lo: core/sys/netbsd/$(am__dirstamp) core/sys/netbsd/execinfo.lo: core/sys/netbsd/$(am__dirstamp) +core/sys/netbsd/string.lo: core/sys/netbsd/$(am__dirstamp) core/sys/netbsd/sys/$(am__dirstamp): @$(MKDIR_P) core/sys/netbsd/sys @: > core/sys/netbsd/sys/$(am__dirstamp) @@ -1407,6 +1438,8 @@ core/sys/netbsd/sys/elf64.lo: core/sys/netbsd/sys/$(am__dirstamp) core/sys/netbsd/sys/elf_common.lo: \ core/sys/netbsd/sys/$(am__dirstamp) core/sys/netbsd/sys/event.lo: core/sys/netbsd/sys/$(am__dirstamp) +core/sys/netbsd/sys/featuretest.lo: \ + core/sys/netbsd/sys/$(am__dirstamp) core/sys/netbsd/sys/link_elf.lo: core/sys/netbsd/sys/$(am__dirstamp) core/sys/netbsd/sys/mman.lo: core/sys/netbsd/sys/$(am__dirstamp) core/sys/netbsd/time.lo: core/sys/netbsd/$(am__dirstamp) @@ -1414,6 +1447,20 @@ core/sys/openbsd/$(am__dirstamp): @$(MKDIR_P) core/sys/openbsd @: > core/sys/openbsd/$(am__dirstamp) core/sys/openbsd/dlfcn.lo: core/sys/openbsd/$(am__dirstamp) +core/sys/openbsd/string.lo: core/sys/openbsd/$(am__dirstamp) +core/sys/openbsd/sys/$(am__dirstamp): + @$(MKDIR_P) core/sys/openbsd/sys + @: > core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/cdefs.lo: core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/elf.lo: core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/elf32.lo: core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/elf64.lo: core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/elf_common.lo: \ + core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/link_elf.lo: \ + core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/sys/mman.lo: core/sys/openbsd/sys/$(am__dirstamp) +core/sys/openbsd/time.lo: core/sys/openbsd/$(am__dirstamp) core/sys/linux/$(am__dirstamp): @$(MKDIR_P) core/sys/linux @: > core/sys/linux/$(am__dirstamp) @@ -1433,6 +1480,7 @@ core/sys/linux/netinet/in_.lo: core/sys/linux/netinet/$(am__dirstamp) core/sys/linux/netinet/tcp.lo: core/sys/linux/netinet/$(am__dirstamp) core/sys/linux/sched.lo: core/sys/linux/$(am__dirstamp) core/sys/linux/stdio.lo: core/sys/linux/$(am__dirstamp) +core/sys/linux/string.lo: core/sys/linux/$(am__dirstamp) core/sys/linux/sys/$(am__dirstamp): @$(MKDIR_P) core/sys/linux/sys @: > core/sys/linux/sys/$(am__dirstamp) @@ -1753,6 +1801,8 @@ mostlyclean-compile: -rm -f core/sys/netbsd/sys/*.lo -rm -f core/sys/openbsd/*.$(OBJEXT) -rm -f core/sys/openbsd/*.lo + -rm -f core/sys/openbsd/sys/*.$(OBJEXT) + -rm -f core/sys/openbsd/sys/*.lo -rm -f core/sys/posix/*.$(OBJEXT) -rm -f core/sys/posix/*.lo -rm -f core/sys/posix/arpa/*.$(OBJEXT) @@ -1871,6 +1921,7 @@ clean-libtool: -rm -rf core/sys/netbsd/.libs core/sys/netbsd/_libs -rm -rf core/sys/netbsd/sys/.libs core/sys/netbsd/sys/_libs -rm -rf core/sys/openbsd/.libs core/sys/openbsd/_libs + -rm -rf core/sys/openbsd/sys/.libs core/sys/openbsd/sys/_libs -rm -rf core/sys/posix/.libs core/sys/posix/_libs -rm -rf core/sys/posix/arpa/.libs core/sys/posix/arpa/_libs -rm -rf core/sys/posix/net/.libs core/sys/posix/net/_libs @@ -2025,6 +2076,7 @@ distclean-generic: -rm -f core/sys/netbsd/$(am__dirstamp) -rm -f core/sys/netbsd/sys/$(am__dirstamp) -rm -f core/sys/openbsd/$(am__dirstamp) + -rm -f core/sys/openbsd/sys/$(am__dirstamp) -rm -f core/sys/posix/$(am__dirstamp) -rm -f core/sys/posix/arpa/$(am__dirstamp) -rm -f core/sys/posix/net/$(am__dirstamp) diff --git a/libphobos/libdruntime/core/stdc/assert_.d b/libphobos/libdruntime/core/stdc/assert_.d index ca7afe9..18af713 100644 --- a/libphobos/libdruntime/core/stdc/assert_.d +++ b/libphobos/libdruntime/core/stdc/assert_.d @@ -60,6 +60,15 @@ else version (NetBSD) */ void __assert(const(char)* file, int line, const(char)* exp); } +else version (OpenBSD) +{ + /*** + * Assert failure function in the OpenBSD C library. + */ + void __assert(const(char)* file, int line, const(char)* exp); + /// + void __assert2(const(char)* file, int line, const(char)* func, const(char)* exp); +} else version (DragonFlyBSD) { /*** diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d index a1a5214..e101bb2 100644 --- a/libphobos/libdruntime/core/stdc/fenv.d +++ b/libphobos/libdruntime/core/stdc/fenv.d @@ -249,16 +249,16 @@ else version (NetBSD) { struct _x87 { - ushort control; /* Control word register */ + ushort control; /* Control word register */ ushort unused1; - ushort status; /* Status word register */ + ushort status; /* Status word register */ ushort unused2; - ushort tag; /* Tag word register */ + ushort tag; /* Tag word register */ ushort unused3; uint[4] others; /* EIP, Pointer Selector, etc */ }; _x87 x87; - uint32_t mxcsr; /* Control and status register */ + uint mxcsr; /* Control and status register */ }; } @@ -375,7 +375,42 @@ else version (Solaris) } else version (CRuntime_Musl) { - version (X86_64) + version (AArch64) + { + struct fenv_t + { + uint __fpcr; + uint __fpsr; + } + alias uint fexcept_t; + } + else version (ARM) + { + struct fenv_t + { + c_ulong __cw; + } + alias c_ulong fexcept_t; + } + else version (IBMZ_Any) + { + alias uint fenv_t; + alias uint fexcept_t; + } + else version (MIPS_Any) + { + struct fenv_t + { + uint __cw; + } + alias ushort fexcept_t; + } + else version (PPC_Any) + { + alias double fenv_t; + alias uint fexcept_t; + } + else version (X86_Any) { struct fenv_t { @@ -391,7 +426,8 @@ else version (CRuntime_Musl) uint __data_offset; ushort __data_selector; ushort __unused5; - uint __mxcsr; + version (X86_64) + uint __mxcsr; } alias ushort fexcept_t; } diff --git a/libphobos/libdruntime/core/stdc/math.d b/libphobos/libdruntime/core/stdc/math.d index 9b19004..4929789 100644 --- a/libphobos/libdruntime/core/stdc/math.d +++ b/libphobos/libdruntime/core/stdc/math.d @@ -2935,407 +2935,406 @@ else version (NetBSD) else version (OpenBSD) { /// - real acosl(real x); + double acos(double x); /// - real asinl(real x); + double asin(double x); /// - pure real atanl(real x); + pure double atan(double x); /// - real atan2l(real y, real x); + double atan2(double, double); /// - pure real cosl(real x); + pure double cos(double x); /// - pure real sinl(real x); + pure double sin(double x); /// - pure real tanl(real x); + pure double tan(double x); /// - real acoshl(real x); + double cosh(double x); /// - pure real asinhl(real x); + double sinh(double x); /// - real atanhl(real x); + pure double tanh(double x); /// - real coshl(real x); + double exp(double x); /// - real sinhl(real x); + pure double frexp(double, int *exp); /// - pure real tanhl(real x); + double ldexp(double, int exp); /// - real expl(real x); + double log(double x); /// - real exp2l(real x); + double log10(double x); /// - real expm1l(real x); + pure double modf(double x, double *iptr); /// - pure real frexpl(real value, int* exp); + double pow(double x, double y); /// - int ilogbl(real x); + double sqrt(double x); /// - real ldexpl(real x, int exp); + pure double ceil(double x); /// - real logbl(real x); + pure double fabs(double x); /// - real logb10l(real x); + pure double floor(double x); /// - real logb1pl(real x); + double fmod(double x, double); /// - real logb2l(real x); + double acosh(double x); /// - real logbl(real x); + pure double asinh(double x); /// - pure real modfl(real value, real *iptr); + double atanh(double x); /// - real scalbnl(real x, int n); + double exp2(double x); /// - real scalblnl(real x, c_long n); + double expm1(double x); /// - pure real cbrtl(real x); + int ilogb(double x); /// - pure real fabsl(real x); + double log1p(double x); /// - real hypotl(real x, real y); + double log2(double x); /// - real powl(real x, real y); + double logb(double x); /// - real sqrtl(real x); + double scalbn(double x, int n); /// - pure real ceill(real x); + double scalbln(double x, c_long n); /// - pure real floorl(real x); + pure double cbrt(double x); /// - pure real nearbyintl(real x); + double hypot(double x, double y); /// - pure real rintl(real x); + pure double erf(double x); /// - c_long lrintl(real x); + double erfc(double x); /// - long llrintl(real x); + double lgamma(double x); /// - pure real roundl(real x); + double tgamma(double x); /// - c_long lroundl(real x); + pure double nearbyint(double x); /// - long llroundl(real x); + pure double rint(double x); /// - pure real truncl(real x); + c_long lrint(double x); /// - real fmodl(real x, real y); + long llrint(double x); /// - real remainderl(real x, real y); + pure double round(double x); /// - real remquol(real x, real y, int* quo); + c_long lround(double x); /// - pure real copysignl(real x, real y); + long llround(double x); /// - pure double nan(char* tagp); + pure double trunc(double x); /// - pure float nanf(char* tagp); + double remainder(double x , double y); /// - pure real nanl(char* tagp); + double remquo(double x, double y, int * quo); /// - real nextafterl(real x, real y); + pure double copysign(double x, double y); /// - real nexttowardl(real x, real y); + pure double nan(const char *); /// - real fdiml(real x, real y); + double nextafter(double x, double y); /// - pure real fmaxl(real x, real y); + double nexttoward(double x, real y); /// - pure real fminl(real x, real y); + double fdim(double x, double y); /// - pure real fmal(real x, real y, real z); - + pure double fmax(double x, double y); /// - double acos(double x); + pure double fmin(double x, double y); /// - float acosf(float x); - + pure double fma(double x, double y, double z); /// - double asin(double x); + double j0(double x); /// - float asinf(float x); - + double j1(double x); /// - pure double atan(double x); + double jn(int, double); /// - pure float atanf(float x); - + double y0(double x); /// - double atan2(double y, double x); + double y1(double x); /// - float atan2f(float y, float x); - + double yn(int, double); /// - pure double cos(double x); + double gamma(double x); /// - pure float cosf(float x); - + double scalb(double x, double y); /// - pure double sin(double x); + double drem(double x, double y); /// - pure float sinf(float x); - + int finite(double x); /// - pure double tan(double x); + double gamma_r(double x, int *); /// - pure float tanf(float x); + double lgamma_r(double x, int *); + /// + double significand(double x); /// - double acosh(double x); + float acosf(float x); /// - float acoshf(float x); - + float asinf(float x); /// - pure double asinh(double x); + pure float atanf(float x); /// - pure float asinhf(float x); - + float atan2f(float x, float y); /// - double atanh(double x); + pure float cosf(float x); /// - float atanhf(float x); - + pure float sinf(float x); /// - double cosh(double x); + pure float tanf(float x); /// - float coshf(float x); - + float acoshf(float x); /// - double sinh(double x); + pure float asinhf(float x); /// - float sinhf(float x); - + float atanhf(float x); /// - pure double tanh(double x); + float coshf(float x); /// - pure float tanhf(float x); - + float sinhf(float x); /// - double exp(double x); + pure float tanhf(float x); /// - float expf(float x); - + float expf(float x); /// - double exp2(double x); + float exp2f(float x); /// - float exp2f(float x); + float expm1f(float x); /// - real exp2l(real x); - + pure float frexpf(float x, int *exp); /// - double expm1(double x); + int ilogbf(float x); /// - float expm1f(float x); - + float ldexpf(float x, int exp); /// - pure double frexp(double value, int* exp); + float logf(float x); /// - pure float frexpf(float value, int* exp); - + float log10f(float x); /// - int ilogb(double x); + float log1pf(float x); /// - int ilogbf(float x); - + float log2f(float x); /// - double ldexp(double x, int exp); + float logbf(float x); /// - float ldexpf(float x, int exp); - + pure float modff(float x, float *iptr); /// - double log(double x); + float scalbnf(float x, int y); /// - float logf(float x); - + float scalblnf(float x, c_long y); /// - double log10(double x); + pure float cbrtf(float x); /// - float log10f(float x); - + pure float fabsf(float x); /// - double log1p(double x); + float hypotf(float x, float y); /// - float log1pf(float x); - + float powf(float x, float y); /// - double log2(double x); + float sqrtf(float x); /// - float log2f(float x); + pure float erff(float x); /// - real log2l(real x); - + float erfcf(float x); /// - double logb(double x); + float lgammaf(float x); /// - float logbf(float x); - + float tgammaf(float x); /// - pure double modf(double value, double* iptr); + pure float ceilf(float x); /// - pure float modff(float value, float* iptr); - + pure float floorf(float x); /// - double scalbn(double x, int n); + pure float nearbyintf(float x); /// - float scalbnf(float x, int n); - + pure float rintf(float x); /// - double scalbln(double x, c_long n); + c_long lrintf(float x); /// - float scalblnf(float x, c_long n); - + long llrintf(float x); /// - pure double cbrt(double x); + pure float roundf(float x); /// - pure float cbrtf(float x); - + c_long lroundf(float x); /// - pure double fabs(double x); + long llroundf(float x); /// - pure float fabsf(float x); - + pure float truncf(float x); /// - double hypot(double x, double y); + pure float fmodf(float x, float y); /// - float hypotf(float x, float y); - + float remainderf(float x, float y); /// - double pow(double x, double y); + float remquof(float x, float y, int *iptr); /// - float powf(float x, float y); - + pure float copysignf(float x, float y); /// - double sqrt(double x); + pure float nanf(const char *); /// - float sqrtf(float x); - + float nextafterf(float x, float y); /// - pure double erf(double x); + float nexttowardf(float x, real y); /// - pure float erff(float x); + float fdimf(float x, float y); /// - pure real erfl(real x); - + pure float fmaxf(float x, float y); /// - double erfc(double x); + pure float fminf(float x, float y); /// - float erfcf(float x); + pure float fmaf(float x, float y, float z); /// - real erfcl(real x); - + float j0f(float x); /// - double lgamma(double x); + float j1f(float x); /// - float lgammaf(float x); + float jnf(int, float); /// - real lgammal(real x); - + float scalbf(float x, float); /// - double tgamma(double x); + float y0f(float x); /// - float tgammaf(float x); + float y1f(float x); /// - real tgammal(real x); - + float ynf(int, float); /// - pure double ceil(double x); + float gammaf(float x); /// - pure float ceilf(float x); - + float dremf(float x, float); /// - pure double floor(double x); + pure int finitef(float x); /// - pure float floorf(float x); - + pure int isinff(float x); /// - pure double nearbyint(double x); + pure int isnanf(float x); /// - pure float nearbyintf(float x); - + float gammaf_r(float x, int *); /// - pure double rint(double x); + float lgammaf_r(float x, int *); + /// + float significandf(float x); /// - pure float rintf(float x); /// - c_long lrint(double x); + pure real acosl(real x); /// - c_long lrintf(float x); - + pure real asinl(real x); /// - long llrint(double x); + pure real atanl(real x); /// - long llrintf(float x); - + real atan2l(real x, real y); /// - pure double round(double x); + pure real cosl(real x); /// - pure float roundf(float x); - + pure real sinl(real x); /// - c_long lround(double x); + pure real tanl(real x); /// - c_long lroundf(float x); - + real acoshl(real x); /// - long llround(double x); + pure real asinhl(real x); /// - long llroundf(float x); - + real atanhl(real x); /// - pure double trunc(double x); + real coshl(real x); /// - pure float truncf(float x); - + real sinhl(real x); /// - double fmod(double x, double y); + pure real tanhl(real x); /// - float fmodf(float x, float y); - + real expl(real x); /// - double remainder(double x, double y); + real exp2l(real x); /// - float remainderf(float x, float y); - + real expm1l(real x); /// - double remquo(double x, double y, int* quo); + pure real frexpl(real x, int *exp); /// - float remquof(float x, float y, int* quo); - + int ilogbl(real x); /// - pure double copysign(double x, double y); + real ldexpl(real x, int exp); /// - pure float copysignf(float x, float y); - + real logl(real x); /// - double nextafter(double x, double y); + real log10l(real x); /// - float nextafterf(float x, float y); - + real log1pl(real x); /// - double nexttoward(double x, real y); + real log2l(real x); /// - float nexttowardf(float x, real y); - + real logbl(real x); /// - double fdim(double x, double y); + pure real modfl(real x, real *iptr); /// - float fdimf(float x, float y); - + real scalbnl(real x, int y); /// - pure double fmax(double x, double y); + real scalblnl(real x, c_long y); /// - pure float fmaxf(float x, float y); - + pure real cbrtl(real x); /// - pure double fmin(double x, double y); + pure real fabsl(real x); /// - pure float fminf(float x, float y); - + real hypotl(real x, real y); /// - pure double fma(double x, double y, double z); + real powl(real x, real y); /// - pure float fmaf(float x, float y, float z); + real sqrtl(real x); + /// + pure real erfl(real x); + /// + real erfcl(real x); + /// + real lgammal(real x); + /// + real tgammal(real x); + /// + pure real ceill(real x); + /// + pure real floorl(real x); + /// + pure real nearbyintl(real x); + /// + pure real rintl(real x); + /// + c_long lrintl(real x); + /// + long llrintl(real x); + /// + pure real roundl(real x); + /// + c_long lroundl(real x); + /// + long llroundl(real x); + /// + pure real truncl(real x); + /// + pure real fmodl(real x, real); + /// + pure real remainderl(real x, real); + /// + pure real remquol(real x, real y, int *iptr); + /// + pure real copysignl(real x, real y); + /// + pure real nanl(const char *); + /// + real nextafterl(real x, real y); + /// + real nexttowardl(real x, real y); + /// + real fdiml(real x, real y); + /// + pure real fmaxl(real x, real y); + /// + pure real fminl(real x, real y); + /// + pure real fmal(real x, real, real); } else version (DragonFlyBSD) { diff --git a/libphobos/libdruntime/core/stdc/stdio.d b/libphobos/libdruntime/core/stdc/stdio.d index 3cdfa6a..e68f393 100644 --- a/libphobos/libdruntime/core/stdc/stdio.d +++ b/libphobos/libdruntime/core/stdc/stdio.d @@ -425,12 +425,23 @@ else version (CRuntime_Glibc) void* _markers; _IO_FILE* _chain; int _fileno; - int _blksize; - int _old_offset; + int _flags2; + ptrdiff_t _old_offset; ushort _cur_column; byte _vtable_offset; char[1] _shortbuf = 0; void* _lock; + + ptrdiff_t _offset; + + /*_IO_codecvt*/ void* _codecvt; + /*_IO_wide_data*/ void* _wide_data; + _IO_FILE *_freeres_list; + void *_freeres_buf; + size_t __pad5; + int _mode; + + char[15 * int.sizeof - 4 * (void*).sizeof - size_t.sizeof] _unused2; } /// @@ -621,6 +632,8 @@ else version (OpenBSD) } /// + alias __sFILE _iobuf; + /// alias shared(__sFILE) FILE; } else version (DragonFlyBSD) @@ -994,14 +1007,16 @@ else version (OpenBSD) _IONBF = 2, } - private extern shared FILE[] __sF; - + private extern __gshared FILE[3] __sF; + @property auto __stdin()() { return &__sF[0]; } + @property auto __stdout()() { return &__sF[1]; } + @property auto __stderr()() { return &__sF[2]; } /// - shared stdin = &__sF[0]; + alias __stdin stdin; /// - shared stdout = &__sF[1]; + alias __stdout stdout; /// - shared stderr = &__sF[2]; + alias __stderr stderr; } else version (DragonFlyBSD) { @@ -1476,17 +1491,17 @@ else version (OpenBSD) @trusted private { /// - pure void clearerr(FILE*); - alias __clearerr = clearerr; + pragma(mangle, "clearerr") + pure void __clearerr(FILE*); /// - pure int feof(FILE*); - alias __feof = feof; + pragma(mangle, "feof") + pure int __feof(FILE*); /// - pure int ferror(FILE*); - alias __ferror = ferror; + pragma(mangle, "ferror") + pure int __ferror(FILE*); /// - int fileno(FILE*); - alias __fileno = fileno; + pragma(mangle, "fileno") + int __fileno(FILE*); } enum __SLBF = 0x0001; @@ -1506,9 +1521,9 @@ else version (OpenBSD) enum __SALC = 0x4000; enum __SIGN = 0x8000; - extern int __isthreaded; + extern immutable __gshared int __isthreaded; - extern (D) + extern (D) @trusted { void __sclearerr()(FILE* p) { @@ -1530,17 +1545,17 @@ else version (OpenBSD) return p._file; } - int clearerr()(FILE* file) + pure void clearerr()(FILE* file) { - return !__isthreaded ? __sclearerr(file) : __clearerr(file); + !__isthreaded ? __sclearerr(file) : __clearerr(file); } - int feof()(FILE* file) + pure int feof()(FILE* file) { return !__isthreaded ? __sfeof(file) : __feof(file); } - int ferror()(FILE* file) + pure int ferror()(FILE* file) { return !__isthreaded ? __sferror(file) : __ferror(file); } diff --git a/libphobos/libdruntime/core/sys/bionic/string.d b/libphobos/libdruntime/core/sys/bionic/string.d new file mode 100644 index 0000000..cbee06c --- /dev/null +++ b/libphobos/libdruntime/core/sys/bionic/string.d @@ -0,0 +1,17 @@ +/** + * D header file for Bionic string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.bionic.string; + +public import core.stdc.string; + +version (CRuntime_Bionic): +extern (C): +nothrow: +@nogc: + +pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); diff --git a/libphobos/libdruntime/core/sys/darwin/mach/dyld.d b/libphobos/libdruntime/core/sys/darwin/mach/dyld.d index cee31a4..5bf5609 100644 --- a/libphobos/libdruntime/core/sys/darwin/mach/dyld.d +++ b/libphobos/libdruntime/core/sys/darwin/mach/dyld.d @@ -32,6 +32,7 @@ public import core.sys.darwin.mach.loader; uint _dyld_image_count(); const(char)* _dyld_get_image_name(uint image_index); mach_header* _dyld_get_image_header(uint image_index); +intptr_t _dyld_get_image_vmaddr_slide(uint image_index); void _dyld_register_func_for_add_image(void function(in mach_header* mh, intptr_t vmaddr_slide)); void _dyld_register_func_for_remove_image(void function(in mach_header* mh, intptr_t vmaddr_slide)); diff --git a/libphobos/libdruntime/core/sys/darwin/mach/loader.d b/libphobos/libdruntime/core/sys/darwin/mach/loader.d index 0330e55..af42485 100644 --- a/libphobos/libdruntime/core/sys/darwin/mach/loader.d +++ b/libphobos/libdruntime/core/sys/darwin/mach/loader.d @@ -1,27 +1,36 @@ /** - * Copyright: Copyright Digital Mars 2010-2018. - * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). - * Authors: Jacob Carlborg + * This file describes the format of Mach-O object files. + * + * D header file for `mach-o/loader.h` from the macOS 10.15 SDK. + * + * Copyright: Copyright Digital Mars 2010-2019. + * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). + * Authors: Jacob Carlborg * Version: Initial created: Feb 20, 2010-2018 - * Source: $(DRUNTIMESRC core/sys/darwin/mach/_loade.d) + * Source: $(DRUNTIMESRC core/sys/darwin/mach/_loader.d) */ module core.sys.darwin.mach.loader; +import core.stdc.config; + version (CoreDdoc) { - /// Represents the header of a Mach-O file for 32-bit architecture. + /** + * The 32-bit mach header appears at the very beginning of the object file + * for 32-bit architectures. + */ struct mach_header { - /// The mach magic number identifier. + /// Mach magic number identifier. uint magic; - /// CPU specifier. + /// Cpu specifier. int cputype; /// Machine specifier. int cpusubtype; - /// The type of the file. + /// Type of file. uint filetype; /// Number of load commands. @@ -34,19 +43,32 @@ version (CoreDdoc) uint flags; } - /// Represents the header of a Mach-O file for 64-bit architecture. + /// Constant for the magic field of the mach_header (32-bit architectures) + enum + { + /// The mach magic number + MH_MAGIC, + + /// NXSwapInt(MH_MAGIC) + MH_CIGAM + } + + /** + * The 64-bit mach header appears at the very beginning of object files for + * 64-bit architectures. + */ struct mach_header_64 { - /// The mach magic number identifier. + /// Mach magic number identifier. uint magic; - /// CPU specifier. + /// Cpu specifier. int cputype; /// Machine specifier. int cpusubtype; - /// The type of the file. + /// Type of file. uint filetype; /// Number of load commands. @@ -62,89 +84,488 @@ version (CoreDdoc) uint reserved; } - /// - enum MH_MAGIC : uint; + /// Constant for the magic field of the mach_header_64 (64-bit architectures) + enum + { + /// The 64-bit mach magic number. + MH_MAGIC_64, - /// - enum MH_CIGAM : uint; + /// NXSwapInt(MH_MAGIC_64). + MH_CIGAM_64 + } - /// - enum MH_MAGIC_64 : uint; + /** + * The layout of the file depends on the filetype. For all but the MH_OBJECT + * file type the segments are padded out and aligned on a segment alignment + * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, + * MH_DYLIB, MH_DYLINKER and MH_BUNDLE file types also have the headers + * included as part of their first segment. + * + * The file type MH_OBJECT is a compact format intended as output of the + * assembler and input (and possibly output) of the link editor (the .o + * format). All sections are in one unnamed segment with no segment padding. + * This format is used as an executable format when the file is so small the + * segment padding greatly increases its size. + * + * The file type MH_PRELOAD is an executable format intended for things that + * are not executed under the kernel (proms, stand alones, kernels, etc). + * The format can be executed under the kernel but may demand paged it and + * not preload it before execution. + * + * A core file is in MH_CORE format and can be any in an arbitrary legal + * Mach-O file. + * + * Constants for the filetype field of the mach_header + */ + enum + { + /// Relocatable object file. + MH_OBJECT, - /// - enum MH_CIGAM_64 : uint; + /// Demand paged executable file. + MH_EXECUTE, - /// - enum SEG_PAGEZERO : string; + /// Fixed VM shared library file. + MH_FVMLIB, - /// - enum SEG_TEXT : string; + /// Core file. + MH_CORE, - /// - enum SECT_TEXT : string; + /// Preloaded executable file. + MH_PRELOAD, - /// - enum SECT_FVMLIB_INIT0 : string; + /// Dynamically bound shared library. + MH_DYLIB, - /// - enum SECT_FVMLIB_INIT1 : string; + /// Dynamic link editor. + MH_DYLINKER, - /// - enum SEG_DATA : string; + /// Dynamically bound bundle file. + MH_BUNDLE, - /// - enum SECT_DATA : string; + /// Shared library stub for static linking only, no section contents. + MH_DYLIB_STUB, - /// - enum SECT_BSS : string; + /// Companion file with only debug sections. + MH_DSYM, - /// - enum SECT_COMMON : string; + /// X86_64 kexts. + MH_KEXT_BUNDLE + } - /// - enum SEG_OBJC : string; - /// - enum SECT_OBJC_SYMBOLS : string; + /// Constants for the flags field of the mach_header + enum + { + /// The object file has no undefined references. + MH_NOUNDEFS, - /// - enum SECT_OBJC_MODULES : string; + /** + * The object file is the output of an incremental link against a base + * file and can't be link edited again. + */ + MH_INCRLINK, - /// - enum SECT_OBJC_STRINGS : string; + /** + * The object file is input for the dynamic linker and can't be + * statically link edited again. + */ + MH_DYLDLINK, - /// - enum SECT_OBJC_REFS : string; + /** + * The object file's undefined references are bound by the dynamic + * linker when loaded. + */ + MH_BINDATLOAD, + + /// The file has its dynamic undefined references prebound. + MH_PREBOUND, - /// - enum SEG_ICON : string; + /// The file has its read-only and read-write segments split. + MH_SPLIT_SEGS, - /// - enum SECT_ICON_HEADER : string; + /** + * The shared library init routine is to be run lazily via catching + * memory faults to its writeable segments (obsolete). + */ + MH_LAZY_INIT, + + /// The image is using two-level name space bindings. + MH_TWOLEVEL, + + /// The executable is forcing all images to use flat name space bindings. + MH_FORCE_FLAT, + + /** + * This umbrella guarantees no multiple definitions of symbols in its + * sub-images so the two-level namespace hints can always be used. + */ + MH_NOMULTIDEFS, + + /// Do not have dyld notify the prebinding agent about this executable. + MH_NOFIXPREBINDING, + + /** + * The binary is not prebound but can have its prebinding redone. only + * used when MH_PREBOUND is not set. + */ + MH_PREBINDABLE, + + /** + * Indicates that this binary binds to all two-level namespace modules + * of its dependent libraries. only used when MH_PREBINDABLE and + * MH_TWOLEVEL are both set. + */ + MH_ALLMODSBOUND, + + /** + * Safe to divide up the sections into sub-sections via symbols for dead + * code stripping. + */ + MH_SUBSECTIONS_VIA_SYMBOLS, + + /// The binary has been canonicalized via the unprebind operation. + MH_CANONICAL, + + /// The final linked image contains external weak symbols. + MH_WEAK_DEFINES, + + /// The final linked image uses weak symbols. + MH_BINDS_TO_WEAK, + + + + /** + * When this bit is set, all stacks in the task will be given stack + * execution privilege. Only used in MH_EXECUTE filetypes. + */ + MH_ALLOW_STACK_EXECUTION, + + /** + * When this bit is set, the binary declares it is safe for use in + * processes with uid zero. + */ + MH_ROOT_SAFE, + + + + /** + * When this bit is set, the binary declares it is safe for use in + * processes when issetugid() is true. + */ + MH_SETUID_SAFE, + + + + /** + * When this bit is set on a dylib, the static linker does not need to + * examine dependent dylibs to see if any are re-exported. + */ + MH_NO_REEXPORTED_DYLIBS, + + /** + * When this bit is set, the OS will load the main executable at a + * random address. Only used in MH_EXECUTE filetypes. + */ + MH_PIE, + + /** + * Only for use on dylibs. When linking against a dylib that has this + * bit set, the static linker will automatically not create a + * LC_LOAD_DYLIB load command to the dylib if no symbols are being + * referenced from the dylib.. + */ + MH_DEAD_STRIPPABLE_DYLIB, + + /// Contains a section of type S_THREAD_LOCAL_VARIABLES. + MH_HAS_TLV_DESCRIPTORS, + + + + /** + * When this bit is set, the OS will run the main executable with a + * non-executable heap even on platforms (e.g. i386) that don't require + * it. Only used in MH_EXECUTE filetypes. + */ + MH_NO_HEAP_EXECUTION, + + + + /// The code was linked for use in an application extension.. + MH_APP_EXTENSION_SAFE, - /// - enum SECT_ICON_TIFF : string; - /// - enum SEG_LINKEDIT : string; + /** + * The external symbols listed in the nlist symbol table do not include + * all the symbols listed in the dyld info. + */ + MH_NLIST_OUTOFSYNC_WITH_DYLDINFO, + + /** + * Allow LC_MIN_VERSION_MACOS and LC_BUILD_VERSION load commands with + * the platforms macOS, iOSMac, iOSSimulator, tvOSSimulator and + * watchOSSimulator. + */ + MH_SIM_SUPPORT, + + /** + * Only for use on dylibs. When this bit is set, the dylib is part of + * the dyld shared cache, rather than loose in the filesystem. + */ + MH_DYLIB_IN_CACHE + } + + /** + * The load commands directly follow the mach_header. The total size of all + * of the commands is given by the sizeofcmds field in the mach_header. All + * load commands must have as their first two fields cmd and cmdsize. The + * cmd field is filled in with a constant for that command type. Each + * command type has a structure specifically for it. The cmdsize field is + * the size in bytes of the particular load command structure plus anything + * that follows it that is a part of the load command + * (i.e. section structures, strings, etc.). To advance to the next load + * command the cmdsize can be added to the offset or pointer of the current + * load command. The cmdsize for 32-bit architectures MUST be a multiple of + * 4 bytes and for 64-bit architectures MUST be a multiple of 8 bytes + * (these are forever the maximum alignment of any load commands). The + * padded bytes must be zero. All tables in the object file must also + * follow these rules so the file can be memory mapped. Otherwise the + * pointers to these tables will not work well or at all on some machines. + * With all padding zeroed like objects will compare byte for byte. + */ + struct load_command + { + /// Type of load command. + uint cmd; + + /// Total size of command in bytes. + uint cmdsize; + } + + /** + * After MacOS X 10.1 when a new load command is added that is required to + * be understood by the dynamic linker for the image to execute properly the + * LC_REQ_DYLD bit will be or'ed into the load command constant. If the + * dynamic linker sees such a load command it it does not understand will + * issue a "unknown load command required for execution" error and refuse to + * use the image. Other load commands without this bit that are not + * understood will simply be ignored. + */ + enum LC_REQ_DYLD; + + /// Constants for the cmd field of all load commands, the type. + enum + { + /// Segment of this file to be mapped. + LC_SEGMENT, + + /// Link-edit stab symbol table info. + LC_SYMTAB, + + /// Link-edit gdb symbol table info (obsolete). + LC_SYMSEG, + + /// Thread. + LC_THREAD, + + /// Unix thread (includes a stack). + LC_UNIXTHREAD, + + /// Load a specified fixed VM shared library. + LC_LOADFVMLIB, + + /// Fixed VM shared library identification. + LC_IDFVMLIB, + + /// Object identification info (obsolete). + LC_IDENT, + + /// Fixed VM file inclusion (internal use). + LC_FVMFILE, + + /// Prepage command (internal use). + LC_PREPAGE, + + /// Dynamic link-edit symbol table info. + LC_DYSYMTAB, + + /// Load a dynamically linked shared library. + LC_LOAD_DYLIB, + + /// Dynamically linked shared lib ident. + LC_ID_DYLIB, + + /// Load a dynamic linker. + LC_LOAD_DYLINKER, + + /// Dynamic linker identification. + LC_ID_DYLINKER, + + /// Modules prebound for a dynamically linked shared library. + LC_PREBOUND_DYLIB, + + /// Image routines. + LC_ROUTINES, + + /// Sub framework. + LC_SUB_FRAMEWORK, + + /// Sub umbrella. + LC_SUB_UMBRELLA, + + /// Sub client. + LC_SUB_CLIENT, + + /// Sub library. + LC_SUB_LIBRARY, + + /// Two-level namespace lookup hints. + LC_TWOLEVEL_HINTS, + + /// Prebind checksum. + LC_PREBIND_CKSUM + } + + + /** + * Load a dynamically linked shared library that is allowed to be missing + * (all symbols are weak imported). + */ /// - enum SEG_UNIXSTACK : string; + enum LC_LOAD_WEAK_DYLIB; /// - enum SEG_IMPORT : string; + enum + { + /// 64-bit segment of this file to be mapped. + LC_SEGMENT_64, + + /// 64-bit image routines. + LC_ROUTINES_64, + + /// The uuid. + LC_UUID, + + /// Runpath additions. + LC_RPATH, + + /// Local of code signature. + LC_CODE_SIGNATURE, + + /// Local of info to split segments. + LC_SEGMENT_SPLIT_INFO, + + /// Load and re-export dylib. + LC_REEXPORT_DYLIB, + + /// Delay load of dylib until first use. + LC_LAZY_LOAD_DYLIB, + + /// Encrypted segment information. + LC_ENCRYPTION_INFO, + + /// Compressed dyld information. + LC_DYLD_INFO, + + /// Compressed dyld information only. + LC_DYLD_INFO_ONLY, + + /// Load upward dylib. + LC_LOAD_UPWARD_DYLIB, + + /// Build for MacOSX min OS version. + LC_VERSION_MIN_MACOSX, + + /// Build for iPhoneOS min OS version. + LC_VERSION_MIN_IPHONEOS, + + /// Compressed table of function start addresses. + LC_FUNCTION_STARTS, + + /// String for dyld to treat like environment variable. + LC_DYLD_ENVIRONMENT, + + /// Replacement for LC_UNIXTHREAD. + LC_MAIN, + + /// Table of non-instructions in __text. + LC_DATA_IN_CODE, + + /// Source version used to build binary. + LC_SOURCE_VERSION, + + /// Code signing DRs copied from linked dylibs. + LC_DYLIB_CODE_SIGN_DRS, + + /// 64-bit encrypted segment information. + LC_ENCRYPTION_INFO_64, + + /// Linker options in MH_OBJECT files. + LC_LINKER_OPTION, + + /// Optimization hints in MH_OBJECT files. + LC_LINKER_OPTIMIZATION_HINT, + + /// Build for AppleTV min OS version. + LC_VERSION_MIN_TVOS, + + /// Build for Watch min OS version. + LC_VERSION_MIN_WATCHOS, - /// Represents a segment command in a Mach-O file for 32-bit architecture. + /// Arbitrary data included within a Mach-O file. + LC_NOTE, + + /// Build for platform min OS version. + LC_BUILD_VERSION, + + /// Used with linkedit_data_command, payload is trie. + LC_DYLD_EXPORTS_TRIE, + + /// Used with linkedit_data_command. + LC_DYLD_CHAINED_FIXUPS + } + + + /** + * A variable length string in a load command is represented by an lc_str + * union. The strings are stored just after the load command structure and + * the offset is from the start of the load command structure. The size + * of the string is reflected in the cmdsize field of the load command. + * Once again any padded bytes to bring the cmdsize field to a multiple + * of 4 bytes must be zero. + */ + union lc_str + { + /// Offset to the string. + uint offset; + + /// Pointer to the string (only available on non 64 bit platforms). + char* ptr; + } + + /** + * The segment load command indicates that a part of this file is to be + * mapped into the task's address space. The size of this segment in memory, + * vmsize, maybe equal to or larger than the amount to map from this file, + * filesize. The file is mapped starting at fileoff to the beginning of + * the segment in memory, vmaddr. The rest of the memory of the segment, + * if any, is allocated zero fill on demand. The segment's maximum virtual + * memory protection and initial virtual memory protection are specified + * by the maxprot and initprot fields. If the segment has sections then the + * section structures directly follow the segment command and their size is + * reflected in cmdsize. + */ struct segment_command { - /// Type of load command, i.e. `LC_SEGMENT`. + /// LC_SEGMENT. uint cmd; - /// The size of this segment, includes size of section structs. + /// Includes sizeof section structs. uint cmdsize; - /// The name of this segment. - char[16] segname = 0; + /// Segment name. + char[16] segname; /// Memory address of this segment. uint vmaddr; @@ -164,36 +585,41 @@ version (CoreDdoc) /// Initial VM protection. int initprot; - /// Number of sections in this segment. + /// Number of sections in segment. uint nsects; /// Flags. uint flags; } - /// Represents a segment command in a Mach-O file for 64-bit architecture. + /* + * The 64-bit segment load command indicates that a part of this file is to + * be mapped into a 64-bit task's address space. If the 64-bit segment has + * sections then section_64 structures directly follow the 64-bit segment + * command and their size is reflected in cmdsize. + */ struct segment_command_64 { - /// Type of load command, i.e. `LC_SEGMENT`. + /// LC_SEGMENT_64. uint cmd; - /// The size of this segment, includes size of section structs. + /// Includes sizeof section_64 structs. uint cmdsize; - /// The name of this segment. - char[16] segname = 0; + /// Segment name. + char[16] segname; /// Memory address of this segment. - long vmaddr; + ulong vmaddr; /// Memory size of this segment. - long vmsize; + ulong vmsize; /// File offset of this segment. - long fileoff; + ulong fileoff; /// Amount to map from the file. - long filesize; + ulong filesize; /// Maximum VM protection. int maxprot; @@ -201,89 +627,1946 @@ version (CoreDdoc) /// Initial VM protection. int initprot; - /// Number of sections in this segment. + /// Number of sections in segment. uint nsects; /// Flags. uint flags; } - /// Represents a section in a Mach-O file for 32-bit architecture. + /// Constants for the flags field of the segment_command. + enum + { + /** + * The file contents for this segment is for the high part of the VM + * space, the low part is zero filled (for stacks in core files). + */ + SG_HIGHVM, + + /** + * This segment is the VM that is allocated by a fixed VM library, + * for overlap checking in the link editor. + */ + SG_FVMLIB, + + /** + * This segment has nothing that was relocated in it and nothing + * relocated to it, that is it maybe safely replaced without relocation. + */ + SG_NORELOC, + + /** + * This segment is protected. + * + * If the segment starts at file offset 0, the first page of the segment + * is not protected. All other pages of the segment are protected. + */ + SG_PROTECTED_VERSION_1, + + /// This segment is made read-only after fixups. + SG_READ_ONLY + } + + + /** + * A segment is made up of zero or more sections. Non-MH_OBJECT files have + * all of their segments with the proper sections in each, and padded to the + * specified segment alignment when produced by the link editor. The first + * segment of a MH_EXECUTE and MH_FVMLIB format file contains the + * mach_header and load commands of the object file before its first + * section. The zero fill sections are always last in their segment + * (in all formats). This allows the zeroroed segment padding to be mapped + * into memory where zero fill sections might be. The gigabyte zero fill + * sections, those with the section type S_GB_ZEROFILL, can only be in a + * segment with sections of this type. These segments are then placed after + * all other segments. + * + * The MH_OBJECT format has all of its sections in one segment for + * compactness. There is no padding to a specified segment boundary and the + * mach_header and load commands are not part of the segment. + * + * Sections with the same section name, sectname, going into the same + * segment, segname, are combined by the link editor. The resulting section, + * is aligned to the maximum alignment of the combined sections and is the + * new section's alignment. The combined sections are aligned to their + * original alignment in the combined section. Any padded bytes to get the + * specified alignment are zeroed. + * + * The format of the relocation entries referenced by the reloff and nreloc + * fields of the section structure for mach object files is described in the + * header file <reloc.h>. + */ struct section { - /// The name of this this section. - char[16] sectname = 0; + /// Name of this section. + char[16] sectname; - /// The name of the segment this section belongs to. - char[16] segname = 0; + /// Segment this section goes in. + char[16] segname; - /// The memory address of this section. + /// Memory address of this section. uint addr; - /// The size of this section in bytes. + /// Size in bytes of this section. uint size; - /// The file offset of this section. + /// File offset of this section. uint offset; - /// The alignment (power of two) of this section. + /// Section alignment (power of 2). uint align_; - /// The file offset of the relocation entries. + /// File offset of relocation entries. uint reloff; - /// The number of relocation entries. + /// Number of relocation entries. uint nreloc; - /// Flags, section type and attributes. + /// Flags (section type and attributes). uint flags; - /// Reserved. + /// Reserved (for offset or index). uint reserved1; - /// Reserved. + /// Reserved (for count or sizeof). uint reserved2; } - /// Represents a section in a Mach-O file for 64-bit architecture. + /// struct section_64 { - /// The name of this this section. - char[16] sectname = 0; + /// Name of this section. + char[16] sectname; - /// The name of the segment this section belongs to. - char[16] segname = 0; + /// Segment this section goes in. + char[16] segname; - /// The memory address of this section. + /// Memory address of this section. ulong addr; - /// The size of this section in bytes. + /// Size in bytes of this section. ulong size; - /// The file offset of this section. + /// File offset of this section. uint offset; - /// The alignment (power of two) of this section. + /// Section alignment (power of 2). uint align_; - /// The file offset of the relocation entries. + /// File offset of relocation entries. uint reloff; - /// The number of relocation entries. + /// Number of relocation entries. uint nreloc; - /// Flags, section type and attributes. + /// Flags (section type and attributes). uint flags; - /// Reserved. + /// Reserved (for offset or index). uint reserved1; - /// Reserved. + /// Reserved (for count or sizeof). uint reserved2; /// Reserved. uint reserved3; } + + /** + * The flags field of a section structure is separated into two parts a section + * type and section attributes. The section types are mutually exclusive (it + * can only have one type) but the section attributes are not (it may have more + * than one attribute). + */ + enum + { + /// 256 section types. + SECTION_TYPE, + + /// 24 section attributes. + SECTION_ATTRIBUTES + } + + /// Constants for the type of a section. + enum + { + /// Regular section. + S_REGULAR, + + /// Zero fill on demand section. + S_ZEROFILL, + + /// Section with only literal C strings. + S_CSTRING_LITERALS, + + /// Section with only 4 byte literals. + S_4BYTE_LITERALS, + + /// Section with only 8 byte literals. + S_8BYTE_LITERALS, + + /// Section with only pointers to literals. + S_LITERAL_POINTERS, + + /** + * Section with only non-lazy symbol pointers. + * + * For the two types of symbol pointers sections and the symbol stubs + * section they have indirect symbol table entries. For each of the + * entries in the section the indirect symbol table entries, in + * corresponding order in the indirect symbol table, start at the index + * stored in the reserved1 field of the section structure. Since the + * indirect symbol table entries correspond to the entries in the + * section the number of indirect symbol table entries is inferred from + * the size of the section divided by the size of the entries in the + * section. For symbol pointers sections the size of the entries in the + * section is 4 bytes and for symbol stubs sections the byte size of the + * stubs is stored in the reserved2 field of the section structure. + */ + S_NON_LAZY_SYMBOL_POINTERS, + + /// Section with only lazy symbol pointers. + S_LAZY_SYMBOL_POINTERS, + + /// Section with only symbol stubs, byte size of stub in the reserved2 field. + S_SYMBOL_STUBS, + + /// Section with only function pointers for initialization. + S_MOD_INIT_FUNC_POINTERS, + + /// Section with only function pointers for termination. + S_MOD_TERM_FUNC_POINTERS, + + /// Section contains symbols that are to be coalesced. + S_COALESCED, + + /// Zero fill on demand section (that can be larger than 4 gigabytes). + S_GB_ZEROFILL, + + /// Section with only pairs of function pointers for interposing. + S_INTERPOSING, + + /// Section with only 16 byte literals. + S_16BYTE_LITERALS, + + /// Section contains DTrace Object Format. + S_DTRACE_DOF, + + /// Section with only lazy symbol pointers to lazy loaded dylibs. + S_LAZY_DYLIB_SYMBOL_POINTERS, + + + + // Section types to support thread local variables. + + /// Template of initial values for TLVs. + S_THREAD_LOCAL_REGULAR, + + /// Template of initial values for TLVs. + S_THREAD_LOCAL_ZEROFILL, + + /// TLV descriptors. + S_THREAD_LOCAL_VARIABLES, + + /// Pointers to TLV descriptors. + S_THREAD_LOCAL_VARIABLE_POINTERS, + + /// Functions to call to initialize TLV values. + S_THREAD_LOCAL_INIT_FUNCTION_POINTERS, + + /// 32-bit offsets to initializers. + S_INIT_FUNC_OFFSETS + } + + /** + * Constants for the section attributes part of the flags field of a section + * structure. + */ + enum + { + /// User setable attributes. + SECTION_ATTRIBUTES_USR, + + /// Section contains only true machine instructions. + S_ATTR_PURE_INSTRUCTIONS, + + /// Section contains coalesced symbols that are not to be in a ranlib table of contents. + S_ATTR_NO_TOC, + + /// Ok to strip static symbols in this section in files with the MH_DYLDLINK flag. + S_ATTR_STRIP_STATIC_SYMS, + + /// No dead stripping. + S_ATTR_NO_DEAD_STRIP, + + /// Blocks are live if they reference live blocks. + S_ATTR_LIVE_SUPPORT, + + /// Used with i386 code stubs written on by dyld. + S_ATTR_SELF_MODIFYING_CODE, + + /** + * A debug section. + * + * If a segment contains any sections marked with S_ATTR_DEBUG then all + * sections in that segment must have this attribute. No section other + * than a section marked with this attribute may reference the contents + * of this section. A section with this attribute may contain no symbols + * and must have a section type S_REGULAR. The static linker will not + * copy section contents from sections with this attribute into its + * output file. These sections generally contain DWARF debugging info. + */ + S_ATTR_DEBUG, + + /// System setable attributes. + SECTION_ATTRIBUTES_SYS, + + /// Section contains some machine instructions. + S_ATTR_SOME_INSTRUCTIONS, + + /// Section has external relocation entries. + S_ATTR_EXT_RELOC, + + /// Section has local relocation entries. + S_ATTR_LOC_RELOC + } + + /** + * The names of segments and sections in them are mostly meaningless to the + * link-editor. But there are few things to support traditional UNIX + * executables that require the link-editor and assembler to use some names + * agreed upon by convention. + * + * The initial protection of the "__TEXT" segment has write protection + * turned off (not writeable). + * + * The link-editor will allocate common symbols at the end of the "__common" + * section in the "__DATA" segment. It will create the section and segment + * if needed. + * + * The currently known segment names and the section names in those segments. + */ + enum + { + /** + * The pagezero segment which has no protections and catches NULL + * references for MH_EXECUTE files. + */ + SEG_PAGEZERO, + + + + /// The tradition UNIX text segment. + SEG_TEXT, + + /// The real text part of the text section no headers, and no padding. + SECT_TEXT, + + /// The fvmlib initialization section. + SECT_FVMLIB_INIT0, + + /// The section following the fvmlib initialization section. + SECT_FVMLIB_INIT1, + + + + /// The tradition UNIX data segment. + SEG_DATA, + + /// The real initialized data section no padding, no bss overlap. + SECT_DATA, + + /// The real uninitialized data section no padding. + SECT_BSS, + + /// The section common symbols are allocated in by the link editor. + SECT_COMMON, + + + + /// Objective-C runtime segment. + SEG_OBJC, + + /// Symbol table. + SECT_OBJC_SYMBOLS, + + /// Module information. + SECT_OBJC_MODULES, + + /// String table. + SECT_OBJC_STRINGS, + + /// String table. + SECT_OBJC_REFS, + + + + /// The icon segment. + SEG_ICON, + + /// The icon headers. + SECT_ICON_HEADER, + + /// The icons in tiff format. + SECT_ICON_TIFF, + + + + /** + * The segment containing all structs created and maintained by the link + * editor. Created with -seglinkedit option to ld(1) for MH_EXECUTE and + * FVMLIB file types only. + */ + SEG_LINKEDIT, + + + /// The unix stack segment. + SEG_UNIXSTACK, + + + /** + * The segment for the self (dyld) modifing code stubs that has read, + * write and execute permissions. + */ + SEG_IMPORT + } + + /** + * Fixed virtual memory shared libraries are identified by two things. The + * target pathname (the name of the library as found for execution), and the + * minor version number. The address of where the headers are loaded is in + * header_addr. (THIS IS OBSOLETE and no longer supported). + */ + struct fvmlib + { + /// Library's target pathname. + lc_str name; + + /// Library's minor version number. + uint minor_version; + + /// Library's header address. + uint header_addr; + } + + /** + * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header) + * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library. + * An object that uses a fixed virtual shared library also contains a + * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses. + * (THIS IS OBSOLETE and no longer supported). + */ + struct fvmlib_command + { + /// LC_IDFVMLIB or LC_LOADFVMLIB. + uint cmd; + + /// Includes pathname string. + uint cmdsize; + + /// The library identification. + fvmlib fvmlib_; + } + + /** + * Dynamically linked shared libraries are identified by two things. The + * pathname (the name of the library as found for execution), and the + * compatibility version number. The pathname must match and the + * compatibility number in the user of the library must be greater than or + * equal to the library being used. The time stamp is used to record the + * time a library was built and copied into user so it can be use to + * determined if the library used at runtime is exactly the same as used to + * built the program. + */ + struct dylib + { + /// Library's path name. + lc_str name; + + /// Library's build time stamp. + uint timestamp; + + /// Library's current version number. + uint current_version; + + /// Library's compatibility version number. + uint compatibility_version; + } + + /** + * A dynamically linked shared library + * (filetype == MH_DYLIB in the mach header) contains a dylib_command + * (cmd == LC_ID_DYLIB) to identify the library. An object that uses a + * dynamically linked shared library also contains a dylib_command + * (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or LC_REEXPORT_DYLIB) for each + * library it uses. + */ + struct dylib_command + { + /// LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB, LC_REEXPORT_DYLIB. + uint cmd; + + /// Includes pathname string. + uint cmdsize; + + /// The library identification. + dylib dylib_; + } + + /** + * A dynamically linked shared library may be a subframework of an umbrella + * framework. If so it will be linked with "-umbrella umbrella_name" where + * Where "umbrella_name" is the name of the umbrella framework. A + * subframework can only be linked against by its umbrella framework or + * other subframeworks that are part of the same umbrella framework. + * Otherwise the static link editor produces an error and states to link + * against the umbrella framework. The name of the umbrella framework for + * subframeworks is recorded in the following structure. + */ + struct sub_framework_command + { + /// LC_SUB_FRAMEWORK. + uint cmd; + + /// Includes umbrella string. + uint cmdsize; + + /// The umbrella framework name. + lc_str umbrella; + } + + /** + * For dynamically linked shared libraries that are subframework of an + * umbrella framework they can allow clients other than the umbrella + * framework or other subframeworks in the same umbrella framework. To do + * this the subframework is built with "-allowable_client client_name" and + * an LC_SUB_CLIENT load command is created for each -allowable_client flag. + * The client_name is usually a framework name. It can also be a name used + * for bundles clients where the bundle is built with + * "-client_name client_name". + */ + struct sub_client_command + { + /// LC_SUB_CLIENT. + uint cmd; + + /// Includes client string. + uint cmdsize; + + /// The client name. + lc_str client; + } + + /** + * A dynamically linked shared library may be a sub_umbrella of an umbrella + * framework. If so it will be linked with "-sub_umbrella umbrella_name" + * where "umbrella_name" is the name of the sub_umbrella framework. When + * statically linking when -twolevel_namespace is in effect a twolevel + * namespace umbrella framework will only cause its subframeworks and those + * frameworks listed as sub_umbrella frameworks to be implicited linked in. + * Any other dependent dynamic libraries will not be linked it when + * -twolevel_namespace is in effect. The primary library recorded by the + * static linker when resolving a symbol in these libraries will be the + * umbrella framework. Zero or more sub_umbrella frameworks may be use by an + * umbrella framework. The name of a sub_umbrella framework is recorded in + * the following structure. + */ + struct sub_umbrella_command + { + /// LC_SUB_UMBRELLA. + uint cmd; + + /// Includes sub_umbrella string. + uint cmdsize; + + /// The sub_umbrella framework name. + lc_str sub_umbrella; + } + + /** + * A dynamically linked shared library may be a sub_library of another + * shared library. If so it will be linked with "-sub_library library_name" + * where "library_name" is the name of the sub_library shared library. When + * statically linking when -twolevel_namespace is in effect a twolevel + * namespace shared library will only cause its subframeworks and those + * frameworks listed as sub_umbrella frameworks and libraries listed as + * sub_libraries to be implicited linked in. Any other dependent dynamic + * libraries will not be linked it when -twolevel_namespace is in effect. + * The primary library recorded by the static linker when resolving a symbol + * in these libraries will be the umbrella framework (or dynamic library). + * Zero or more sub_library shared libraries may be use by an umbrella + * framework or (or dynamic library). The name of a sub_library framework is + * recorded in the following structure. For example + * /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc". + */ + struct sub_library_command + { + /// LC_SUB_LIBRARY. + uint cmd; + + /// Includes sub_library string. + uint cmdsize; + + /// The sub_library name. + lc_str sub_library; + } + + /** + * A program (filetype == MH_EXECUTE) that is + * prebound to its dynamic libraries has one of these for each library that + * the static linker used in prebinding. It contains a bit vector for the + * modules in the library. The bits indicate which modules are bound (1) and + * which are not (0) from the library. The bit for module 0 is the low bit + * of the first byte. So the bit for the Nth module is: + * (linked_modules[N/8] >> N%8) & 1 + */ + struct prebound_dylib_command + { + /// LC_PREBOUND_DYLIB. + uint cmd; + + /// Includes strings. + uint cmdsize; + + /// Library's path name. + lc_str name; + + /// Number of modules in library. + uint nmodules; + + /// Bit vector of linked modules. + lc_str linked_modules; + } + + /** + * A program that uses a dynamic linker contains a dylinker_command to + * identify the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic + * linker contains a dylinker_command to identify the dynamic linker + * (LC_ID_DYLINKER). A file can have at most one of these. + * This struct is also used for the LC_DYLD_ENVIRONMENT load command and + * contains string for dyld to treat like environment variable. + */ + struct dylinker_command + { + /// LC_ID_DYLINKER, LC_LOAD_DYLINKER or LC_DYLD_ENVIRONMENT. + uint cmd; + + /// Includes pathname string. + uint cmdsize; + + /// Dynamic linker's path name. + lc_str name; + } + + /** + * Thread commands contain machine-specific data structures suitable for + * use in the thread state primitives. The machine specific data structures + * follow the struct thread_command as follows. + * Each flavor of machine specific data structure is preceded by an uint32_t + * constant for the flavor of that data structure, an uint32_t that is the + * count of uint32_t's of the size of the state data structure and then + * the state data structure follows. This triple may be repeated for many + * flavors. The constants for the flavors, counts and state data structure + * definitions are expected to be in the header file <machine/thread_status.h>. + * These machine specific data structures sizes must be multiples of + * 4 bytes. The cmdsize reflects the total size of the thread_command + * and all of the sizes of the constants for the flavors, counts and state + * data structures. + * + * For executable objects that are unix processes there will be one + * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor. + * This is the same as a LC_THREAD, except that a stack is automatically + * created (based on the shell's limit for the stack size). Command + * arguments and environment variables are copied onto that stack. + */ + struct thread_command + { + /// LC_THREAD or LC_UNIXTHREAD. + uint cmd; + + /// Total size of this command. + uint cmdsize; + } + + /** + * The routines command contains the address of the dynamic shared library + * initialization routine and an index into the module table for the module + * that defines the routine. Before any modules are used from the library + * the dynamic linker fully binds the module that defines the initialization + * routine and then calls it. This gets called before any module + * initialization routines (used for C++ static constructors) in the library. + */ + struct routines_command + { + /// LC_ROUTINES. + uint cmd; + + /// Total size of this command. + uint cmdsize; + + /// Address of initialization routine. + uint init_address; + + /// Index into the module table that. + uint init_module; + + // the init routine is defined in + + /// + uint reserved1; + + /// + uint reserved2; + + /// + uint reserved3; + + /// + uint reserved4; + + /// + uint reserved5; + + /// + uint reserved6; + } + + /// The 64-bit routines command. Same use as above. + struct routines_command_64 + { + /// LC_ROUTINES_64. + uint cmd; + + /// Total size of this command. + uint cmdsize; + + /// Address of initialization routine. + ulong init_address; + + /// Index into the module table that. + ulong init_module; + + /* the init routine is defined in */ + + /// + ulong reserved1; + + /// + ulong reserved2; + + /// + ulong reserved3; + + /// + ulong reserved4; + + /// + ulong reserved5; + + /// + ulong reserved6; + } + + /** + * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD + * "stab" style symbol table information as described in the header files + * <nlist.h> and <stab.h>. + */ + struct symtab_command + { + /// LC_SYMTAB. + uint cmd; + + /// Sizeof(struct symtab_command). + uint cmdsize; + + /// Symbol table offset. + uint symoff; + + /// Number of symbol table entries. + uint nsyms; + + /// String table offset. + uint stroff; + + /// String table size in bytes. + uint strsize; + } + + /** + * This is the second set of the symbolic information which is used to + * support the data structures for the dynamically link editor. + * + * The original set of symbolic information in the symtab_command which contains + * the symbol and string tables must also be present when this load command is + * present. When this load command is present the symbol table is organized + * into three groups of symbols: + * * local symbols (static and debugging symbols) - grouped by module + * * defined external symbols - grouped by module (sorted by name if not lib) + * * undefined external symbols (sorted by name if MH_BINDATLOAD is not set, + * and in order the were seen by the static + * linker if MH_BINDATLOAD is set) + * + * In this load command there are offsets and counts to each of the three + * groups of symbols. + * + * This load command contains a the offsets and sizes of the following new + * symbolic information tables: + * * table of contents + * * module table + * * reference symbol table + * * indirect symbol table + * + * The first three tables above (the table of contents, module table and + * reference symbol table) are only present if the file is a dynamically + * linked shared library. For executable and object modules, which are files + * containing only one module, the information that would be in these three + * tables is determined as follows: + * * table of contents - the defined external symbols are sorted by name + * * module table - the file contains only one module so everything in the + * file is part of the module. + * * reference symbol table - is the defined and undefined external symbols + * + * For dynamically linked shared library files this load command also + * contains offsets and sizes to the pool of relocation entries for all + * sections separated into two groups: + * * external relocation entries + * * local relocation entries + * + * For executable and object modules the relocation entries continue to hang + * off the section structures. + */ + struct dysymtab_command + { + /// LC_DYSYMTAB. + uint cmd; + + /// sizeof(struct dysymtab_command). + uint cmdsize; + + /** + * Index to local symbols. + * + * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command + * are grouped into the following three groups: + * * local symbols (further grouped by the module they are from) + * * defined external symbols (further grouped by the module they are from) + * * undefined symbols + * + * The local symbols are used only for debugging. The dynamic binding + * process may have to use them to indicate to the debugger the local + * symbols for a module that is being bound. + * + * The last two groups are used by the dynamic binding process to do the + * binding (indirectly through the module table and the reference symbol + * table when this is a dynamically linked shared library file). + */ + uint ilocalsym; + + /// Number of local symbols. + uint nlocalsym; + + + + /// Index to externally defined symbols. + uint iextdefsym; + + /// Number of externally defined symbols. + uint nextdefsym; + + + + /// Index to undefined symbols. + uint iundefsym; + + /// Number of undefined symbols. + uint nundefsym; + + /** + * File offset to table of contents. + * + * For the for the dynamic binding process to find which module a symbol + * is defined in the table of contents is used (analogous to the ranlib + * structure in an archive) which maps defined external symbols to + * modules they are defined in. This exists only in a dynamically linked + * shared library file. For executable and object modules the defined + * external symbols are sorted by name and is use as the table of + * contents. + */ + uint tocoff; + + /// Number of entries in table of contents. + uint ntoc; + + /** + * File offset to module table. + * + * To support dynamic binding of "modules" (whole object files) the + * symbol table must reflect the modules that the file was created from. + * This is done by having a module table that has indexes and counts + * into the merged tables for each module. The module structure that + * these two entries refer to is described below. This exists only in a + * dynamically linked shared library file. For executable and object + * modules the file only contains one module so everything in the file + * belongs to the module. + */ + uint modtaboff; + + /// Number of module table entries. + uint nmodtab; + + /** + * Offset to referenced symbol table. + * + * To support dynamic module binding the module structure for each + * module indicates the external references (defined and undefined) each + * module makes. For each module there is an offset and a count into the + * reference symbol table for the symbols that the module references. + * This exists only in a dynamically linked shared library file. For + * executable and object modules the defined external symbols and the + * undefined external symbols indicates the external references. + */ + uint extrefsymoff; + + /// Number of referenced symbol table entries. + uint nextrefsyms; + + /** + * File offset to the indirect symbol table. + * + * The sections that contain "symbol pointers" and "routine stubs" have + * indexes and (implied counts based on the size of the section and + * fixed size of the entry) into the "indirect symbol" table for each + * pointer and stub. For every section of these two types the index into + * the indirect symbol table is stored in the section header in the + * field reserved1. An indirect symbol table entry is simply a 32bit + * index into the symbol table to the symbol that the pointer or stub is + * referring to. The indirect symbol table is ordered to match the + * entries in the section. + */ + uint indirectsymoff; + + /// Number of indirect symbol table entries. + uint nindirectsyms; + + /** + * Offset to external relocation entries- + * + * To support relocating an individual module in a library file quickly + * the external relocation entries for each module in the library need + * to be accessed efficiently. Since the relocation entries can't be + * accessed through the section headers for a library file they are + * separated into groups of local and external entries further grouped + * by module. In this case the presents of this load command who's + * extreloff, nextrel, locreloff and nlocrel fields are non-zero + * indicates that the relocation entries of non-merged sections are not + * referenced through the section structures (and the reloff and nreloc + * fields in the section headers are set to zero). + * + * Since the relocation entries are not accessed through the section + * headers this requires the r_address field to be something other than + * a section offset to identify the item to be relocated. In this case + * r_address is set to the offset from the vmaddr of the first + * LC_SEGMENT command. For MH_SPLIT_SEGS images r_address is set to the + * offset from thevmaddr of the first read-write LC_SEGMENT command. + * + * The relocation entries are grouped by module and the module table + * entries have indexes and counts into them for the group of external + * relocation entries for that the module. + * + * For sections that are merged across modules there must not be any + * remaining external relocation entries for them (for merged sections + * remaining relocation entries must be local). + */ + uint extreloff; + + /// Number of external relocation entries. + uint nextrel; + + /** + * Offset to local relocation entries. + * + * All the local relocation entries are grouped together (they are not + * grouped by their module since they are only used if the object is + * moved from it statically link edited address). + */ + uint locreloff; + + /// Number of local relocation entries. + uint nlocrel; + } + + /** + * An indirect symbol table entry is simply a 32bit index into the symbol + * table to the symbol that the pointer or stub is referring to. Unless it + * is for a non-lazy symbol pointer section for a defined symbol which + * strip(1) as removed. In which case it has the value + * INDIRECT_SYMBOL_LOCAL. If the symbol was also absolute + * INDIRECT_SYMBOL_ABS is or'ed with that. + */ + enum + { + /// + INDIRECT_SYMBOL_LOCAL, + + /// + INDIRECT_SYMBOL_ABS + } + + /// A table of contents entry. + struct dylib_table_of_contents + { + /// The defined external symbol (index into the symbol table). + uint symbol_index; + + /// Index into the module table this symbol is defined in. + uint module_index; + } + + /// A module table entry. + struct dylib_module + { + /// The module name (index into string table). + uint module_name; + + + + /// Index into externally defined symbols. + uint iextdefsym; + + /// Number of externally defined symbols. + uint nextdefsym; + + /// Index into reference symbol table. + uint irefsym; + + /// Number of reference symbol table entries. + uint nrefsym; + + /// Index into symbols for local symbols. + uint ilocalsym; + + /// Number of local symbols. + uint nlocalsym; + + + + /// Index into external relocation entries. + uint iextrel; + + /// Number of external relocation entries. + uint nextrel; + + + + /** + * Low 16 bits are the index into the init section, high 16 bits are the + * index into the term section. + */ + uint iinit_iterm; + + /** + * Low 16 bits are the number of init section entries, high 16 bits are + * the number of term section entries. + */ + uint ninit_nterm; + + + + /** + * The (__OBJC,__module_info) section. + * + * For this module address of the start of. + */ + uint objc_module_info_addr; + + /** + * The (__OBJC,__module_info) section. + * + * For this module size of. + */ + uint objc_module_info_size; + } + + /// A 64-bit module table entry. + struct dylib_module_64 + { + /// The module name (index into string table). + uint module_name; + + + + /// Index into externally defined symbols. + uint iextdefsym; + + /// Number of externally defined symbols. + uint nextdefsym; + + /// Index into reference symbol table. + uint irefsym; + + /// Number of reference symbol table entries. + uint nrefsym; + + /// Index into symbols for local symbols. + uint ilocalsym; + + /// Number of local symbols. + uint nlocalsym; + + + + /// Index into external relocation entries. + uint iextrel; + + /// Number of external relocation entries. + uint nextrel; + + + + /** + * Low 16 bits are the index into the init section, high 16 bits are the + * index into the term section. + */ + uint iinit_iterm; + + /** + * Low 16 bits are the number of init section entries, high 16 bits are + * the number of term section entries. + */ + uint ninit_nterm; + + + + /** + * The (__OBJC,__module_info) section. + * + * For this module size of. + */ + uint objc_module_info_size; + + /** + * The (__OBJC,__module_info) section. + * + * For this module address of the start of. + */ + ulong objc_module_info_addr; + } + + /** + * The entries in the reference symbol table are used when loading the + * module (both by the static and dynamic link editors) and if the module is + * unloaded or replaced. Therefore all external symbols + * (defined and undefined) are listed in the module's reference table. The + * flags describe the type of reference that is being made. The constants + * for the flags are defined in <mach-o/nlist.h> as they are also used for + * symbol table entries. + */ + struct dylib_reference + { + /// Index into the symbol table. + @property uint isym() const pure nothrow @nogc @safe; + + /// ditto + @property void isym(uint v) @safe pure nothrow @nogc; + + /// Flags to indicate the type of reference. + @property uint flags() const pure nothrow @nogc @safe; + + /// ditto + @property void flags(uint v) pure nothrow @nogc @safe; + } + + /** + * The twolevel_hints_command contains the offset and number of hints in the + * two-level namespace lookup hints table. + */ + struct twolevel_hints_command + { + /// LC_TWOLEVEL_HINTS. + uint cmd; + + /// Sizeof(struct twolevel_hints_command). + uint cmdsize; + + /// Offset to the hint table. + uint offset; + + /// Number of hints in the hint table. + uint nhints; + } + + /** + * The entries in the two-level namespace lookup hints table are + * twolevel_hint structs. These provide hints to the dynamic link editor + * where to start looking for an undefined symbol in a two-level namespace + * image. The isub_image field is an index into the sub-images + * (sub-frameworks and sub-umbrellas list) that made up the two-level image + * that the undefined symbol was found in when it was built by the static + * link editor. If isub-image is 0 the the symbol is expected to be defined + * in library and not in the sub-images. If isub-image is non-zero it is an + * index into the array of sub-images for the umbrella with the first index + * in the sub-images being 1. The array of sub-images is the ordered list of + * sub-images of the umbrella that would be searched for a symbol that has + * the umbrella recorded as its primary library. The table of contents index + * is an index into the library's table of contents. This is used as the + * starting point of the binary search or a directed linear search. + */ + struct twolevel_hint + { + /// Index into the sub images. + @property uint isub_image() const pure nothrow @nogc @safe; + + /// ditto + @property void isub_image(uint v) pure nothrow @nogc @safe; + + /// Index into the table of contents. + @property uint itoc() const pure nothrow @nogc @safe; + + /// ditto + @property void itoc(uint v) pure nothrow @nogc @safe; + } + + /** + * The prebind_cksum_command contains the value of the original check sum + * for prebound files or zero. When a prebound file is first created or + * modified for other than updating its prebinding information the value of + * the check sum is set to zero. When the file has it prebinding re-done and + * if the value of the check sum is zero the original check sum is + * calculated and stored in cksum field of this load command in the output + * file. If when the prebinding is re-done and the cksum field is non-zero + * it is left unchanged from the input file. + */ + struct prebind_cksum_command + { + /// LC_PREBIND_CKSUM. + uint cmd; + + /// Sizeof(struct prebind_cksum_command). + uint cmdsize; + + /// The check sum or zero. + uint cksum; + } + + /** + * The uuid load command contains a single 128-bit unique random number that + * identifies an object produced by the static link editor. + */ + struct uuid_command + { + /// LC_UUID. + uint cmd; + + /// Sizeof(struct uuid_command). + uint cmdsize; + + /// The 128-bit uuid. + ubyte[16] uuid; + } + + /** + * The rpath_command contains a path which at runtime should be added to + * the current run path used to find @rpath prefixed dylibs. + */ + struct rpath_command + { + /// LC_RPATH. + uint cmd; + + /// Includes string. + uint cmdsize; + + /// Path to add to run path. + lc_str path; + } + + /** + * The linkedit_data_command contains the offsets and sizes of a blob + * of data in the __LINKEDIT segment. + */ + struct linkedit_data_command + { + /** + * LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, LC_FUNCTION_STARTS, + * LC_DATA_IN_CODE, LC_DYLIB_CODE_SIGN_DRS, + * LC_LINKER_OPTIMIZATION_HINT, LC_DYLD_EXPORTS_TRIE or + * LC_DYLD_CHAINED_FIXUPS. + */ + uint cmd; + + /// Sizeof(struct linkedit_data_command). + uint cmdsize; + + /// File offset of data in __LINKEDIT segment. + uint dataoff; + + /// File size of data in __LINKEDIT segment. + uint datasize; + + } + + /** + * The encryption_info_command contains the file offset and size of an + * of an encrypted segment. + */ + struct encryption_info_command + { + /// LC_ENCRYPTION_INFO. + uint cmd; + + /// Sizeof(struct encryption_info_command). + uint cmdsize; + + /// File offset of encrypted range. + uint cryptoff; + + /// File size of encrypted range. + uint cryptsize; + + /// Which encryption system, 0 means not-encrypted yet. + uint cryptid; + } + + /** + * The encryption_info_command_64 contains the file offset and size of an + * of an encrypted segment (for use in x86_64 targets). + */ + struct encryption_info_command_64 + { + /// LC_ENCRYPTION_INFO_64. + uint cmd; + + /// Sizeof(struct encryption_info_command_64). + uint cmdsize; + + /// File offset of encrypted range. + uint cryptoff; + + /// File size of encrypted range. + uint cryptsize; + + /// Which encryption system, 0 means not-encrypted yet. + uint cryptid; + + /// Padding to make this struct's size a multiple of 8 bytes. + uint pad; + } + + /** + * The version_min_command contains the min OS version on which this + * binary was built to run. + */ + struct version_min_command + { + /** + * LC_VERSION_MIN_MACOSX or LC_VERSION_MIN_IPHONEOS or + * LC_VERSION_MIN_WATCHOS or LC_VERSION_MIN_TVOS. + */ + uint cmd; + + /// Sizeof(struct min_version_command). + uint cmdsize; + + /// X.Y.Z is encoded in nibbles xxxx.yy.zz. + uint version_; + + /// X.Y.Z is encoded in nibbles xxxx.yy.zz. + uint sdk; + } + + /** + * The build_version_command contains the min OS version on which this + * binary was built to run for its platform. The list of known platforms and + * tool values following it. + */ + struct build_version_command + { + /// LC_BUILD_VERSION. + uint cmd; + + /** + * Sizeof(struct build_version_command) plus ntools + * sizeof(struct build_tool_version). + */ + uint cmdsize; + + /// Platform. + uint platform; + + /// X.Y.Z is encoded in nibbles xxxx.yy.zz. + uint minos; + + /// X.Y.Z is encoded in nibbles xxxx.yy.zz. + uint sdk; + + /// Number of tool entries following this. + uint ntools; + + } + + /// + struct build_tool_version + { + /// Enum for the tool. + uint tool; + + /// Version number of the tool. + uint version_; + } + + /// Known values for the platform field above. + enum + { + /// + PLATFORM_MACOS, + + /// + PLATFORM_IOS, + + /// + PLATFORM_TVOS, + + /// + PLATFORM_WATCHOS, + + /// + PLATFORM_BRIDGEOS, + + /// + PLATFORM_UIKITFORMAC, + + /// + PLATFORM_IOSSIMULATOR, + + /// + PLATFORM_TVOSSIMULATOR, + + /// + PLATFORM_WATCHOSSIMULATOR, + + /// + PLATFORM_DRIVERKIT + } + + + /// Known values for the tool field above. + enum + { + /// + TOOL_CLANG, + + /// + TOOL_SWIFT, + + /// + TOOL_LD + } + + /** + * The dyld_info_command contains the file offsets and sizes of + * the new compressed form of the information dyld needs to + * load the image. This information is used by dyld on Mac OS X + * 10.6 and later. All information pointed to by this command + * is encoded using byte streams, so no endian swapping is needed + * to interpret it. + */ + struct dyld_info_command + { + /// LC_DYLD_INFO or LC_DYLD_INFO_ONLY. + uint cmd; + + /// Sizeof(struct dyld_info_command). + uint cmdsize; + + + + /** + * File offset to rebase info. + * + * Dyld rebases an image whenever dyld loads it at an address different + * from its preferred address. The rebase information is a stream + * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_. + * Conceptually the rebase information is a table of tuples: + * <seg-index, seg-offset, type> + * The opcodes are a compressed way to encode the table by only + * encoding when a column changes. In addition simple patterns + * like "every n'th offset for m times" can be encoded in a few + * bytes. + */ + uint rebase_off; + + /// Size of rebase info. + uint rebase_size; + + + + /** + * File offset to binding info. + * + * Dyld binds an image during the loading process, if the image + * requires any pointers to be initialized to symbols in other images. + * The bind information is a stream of byte sized + * opcodes whose symbolic names start with BIND_OPCODE_. + * Conceptually the bind information is a table of tuples: + * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend> + * The opcodes are a compressed way to encode the table by only + * encoding when a column changes. In addition simple patterns + * like for runs of pointers initialzed to the same value can be + * encoded in a few bytes. + */ + uint bind_off; + + /// Size of binding info. + uint bind_size; + + + + /** + * File offset to weak binding info. + * + * Some C++ programs require dyld to unique symbols so that all + * images in the process use the same copy of some code/data. + * This step is done after binding. The content of the weak_bind + * info is an opcode stream like the bind_info. But it is sorted + * alphabetically by symbol name. This enable dyld to walk + * all images with weak binding information in order and look + * for collisions. If there are no collisions, dyld does + * no updating. That means that some fixups are also encoded + * in the bind_info. For instance, all calls to "operator new" + * are first bound to libstdc++.dylib using the information + * in bind_info. Then if some image overrides operator new + * that is detected when the weak_bind information is processed + * and the call to operator new is then rebound. + */ + uint weak_bind_off; + + /// Size of weak binding info. + uint weak_bind_size; + + + + /** + * File offset to lazy binding info. + * + * Some uses of external symbols do not need to be bound immediately. + * Instead they can be lazily bound on first use. The lazy_bind + * are contains a stream of BIND opcodes to bind all lazy symbols. + * Normal use is that dyld ignores the lazy_bind section when + * loading an image. Instead the static linker arranged for the + * lazy pointer to initially point to a helper function which + * pushes the offset into the lazy_bind area for the symbol + * needing to be bound, then jumps to dyld which simply adds + * the offset to lazy_bind_off to get the information on what + * to bind. + */ + uint lazy_bind_off; + + /// Size of lazy binding infs. + uint lazy_bind_size; + + + + /** + * File offset to lazy binding info. + * + * The symbols exported by a dylib are encoded in a trie. This + * is a compact representation that factors out common prefixes. + * It also reduces LINKEDIT pages in RAM because it encodes all + * information (name, address, flags) in one small, contiguous range. + * The export area is a stream of nodes. The first node sequentially + * is the start node for the trie. + * + * Nodes for a symbol start with a uleb128 that is the length of + * the exported symbol information for the string so far. + * If there is no exported symbol, the node starts with a zero byte. + * If there is exported info, it follows the length. + * + * First is a uleb128 containing flags. Normally, it is followed by + * a uleb128 encoded offset which is location of the content named + * by the symbol from the mach_header for the image. If the flags + * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is + * a uleb128 encoded library ordinal, then a zero terminated + * UTF8 string. If the string is zero length, then the symbol + * is re-export from the specified dylib with the same name. + * If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following + * the flags is two uleb128s: the stub offset and the resolver offset. + * The stub is used by non-lazy pointers. The resolver is used + * by lazy pointers and must be called to get the actual address to use. + * + * After the optional exported symbol information is a byte of + * how many edges (0-255) that this node has leaving it, + * followed by each edge. + * Each edge is a zero terminated UTF8 of the addition chars + * in the symbol, followed by a uleb128 offset for the node that + * edge points to. + * + */ + uint export_off; + + /// Size of lazy binding infs. + uint export_size; + } + + /// The following are used to encode rebasing information. + enum + { + /// + REBASE_TYPE_POINTER, + + /// + REBASE_TYPE_TEXT_ABSOLUTE32, + + /// + REBASE_TYPE_TEXT_PCREL32, + + + + /// + REBASE_OPCODE_MASK, + + /// + REBASE_IMMEDIATE_MASK, + + /// + REBASE_OPCODE_DONE, + + /// + REBASE_OPCODE_SET_TYPE_IMM, + + /// + REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB, + + /// + REBASE_OPCODE_ADD_ADDR_ULEB, + + /// + REBASE_OPCODE_ADD_ADDR_IMM_SCALED, + + /// + REBASE_OPCODE_DO_REBASE_IMM_TIMES, + + /// + REBASE_OPCODE_DO_REBASE_ULEB_TIMES, + + /// + REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB, + + /// + REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB + } + + + /// The following are used to encode binding information. + enum + { + /// + BIND_TYPE_POINTER, + + /// + BIND_TYPE_TEXT_ABSOLUTE32, + + /// + BIND_TYPE_TEXT_PCREL32, + + + + /// + BIND_SPECIAL_DYLIB_SELF, + + /// + BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE, + + /// + BIND_SPECIAL_DYLIB_FLAT_LOOKUP, + + /// + BIND_SPECIAL_DYLIB_WEAK_LOOKUP, + + + + /// + BIND_SYMBOL_FLAGS_WEAK_IMPORT, + + /// + BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION, + + + + /// + BIND_OPCODE_MASK, + + /// + BIND_IMMEDIATE_MASK, + + /// + BIND_OPCODE_DONE, + + /// + BIND_OPCODE_SET_DYLIB_ORDINAL_IMM, + + /// + BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB, + + /// + BIND_OPCODE_SET_DYLIB_SPECIAL_IMM, + + /// + BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM, + + /// + BIND_OPCODE_SET_TYPE_IMM, + + /// + BIND_OPCODE_SET_ADDEND_SLEB, + + /// + BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB, + + /// + BIND_OPCODE_ADD_ADDR_ULEB, + + /// + BIND_OPCODE_DO_BIND, + + /// + BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB, + + /// + BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED, + + /// + BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB, + + /// + BIND_OPCODE_THREADED, + + /// + BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB, + + /// + BIND_SUBOPCODE_THREADED_APPLY + } + + /** + * The following are used on the flags byte of a terminal node + * in the export information. + */ + enum + { + + /// + EXPORT_SYMBOL_FLAGS_KIND_MASK, + + /// + EXPORT_SYMBOL_FLAGS_KIND_REGULAR, + + /// + EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL, + + /// + EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE, + + /// + EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION, + + /// + EXPORT_SYMBOL_FLAGS_REEXPORT, + + /// + EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, + + } + + + /* + * The linker_option_command contains linker options embedded in object files. + */ + struct linker_option_command + { + /// LC_LINKER_OPTION only used in MH_OBJECT filetypes. + uint cmd; + + /// + uint cmdsize; + + /** + * Number of strings concatenation of zero terminated UTF8 strings. + * Zero filled at end to align. + */ + uint count; + } + + /** + * The symseg_command contains the offset and size of the GNU style + * symbol table information as described in the header file <symseg.h>. + * The symbol roots of the symbol segments must also be aligned properly + * in the file. So the requirement of keeping the offsets aligned to a + * multiple of a 4 bytes translates to the length field of the symbol + * roots also being a multiple of a long. Also the padding must again be + * zeroed. (THIS IS OBSOLETE and no longer supported). + */ + struct symseg_command + { + /// LC_SYMSEG. + uint cmd; + + /// Sizeof(struct symseg_command). + uint cmdsize; + + /// Symbol segment offset. + uint offset; + + /// Symbol segment size in bytes. + uint size; + } + + /** + * The ident_command contains a free format string table following the + * ident_command structure. The strings are null terminated and the size of + * the command is padded out with zero bytes to a multiple of 4 bytes/ + * (THIS IS OBSOLETE and no longer supported). + */ + struct ident_command + { + /// LC_IDENT. + uint cmd; + + /// Strings that follow this command. + uint cmdsize; + } + + /** + * The fvmfile_command contains a reference to a file to be loaded at the + * specified virtual address. (Presently, this command is reserved for + * internal use. The kernel ignores this command when loading a program into + * memory). + */ + struct fvmfile_command + { + /// LC_FVMFILE. + uint cmd; + + /// Includes pathname string. + uint cmdsize; + + /// Files pathname. + lc_str name; + + /// Files virtual address. + uint header_addr; + } + + /** + * The entry_point_command is a replacement for thread_command. + * It is used for main executables to specify the location (file offset) + * of main(). If -stack_size was used at link time, the stacksize + * field will contain the stack size need for the main thread. + */ + struct entry_point_command + { + /// LC_MAIN only used in MH_EXECUTE filetypes. + uint cmd; + + /// 24. + uint cmdsize; + + /// File (__TEXT) offset of main(). + ulong entryoff; + + /// If not zero, initial stack size. + ulong stacksize; + } + + /** + * The source_version_command is an optional load command containing + * the version of the sources used to build the binary. + */ + struct source_version_command + { + /// LC_SOURCE_VERSION. + uint cmd; + + /// 16. + uint cmdsize; + + /// A.B.C.D.E packed as a24.b10.c10.d10.e10. + ulong version_; + } + + /** + * The LC_DATA_IN_CODE load commands uses a linkedit_data_command + * to point to an array of data_in_code_entry entries. Each entry + * describes a range of data in a code section. + */ + struct data_in_code_entry + { + /// From mach_header to start of data range. + uint offset; + + /// Number of bytes in data range. + ushort length; + + /// A DICE_KIND_* value. + ushort kind; + } + + /// + enum + { + /// + DICE_KIND_DATA, + + /// + DICE_KIND_JUMP_TABLE8, + + /// + DICE_KIND_JUMP_TABLE16, + + /// + DICE_KIND_JUMP_TABLE32, + + /// + DICE_KIND_ABS_JUMP_TABLE32 + } + + /** + * Sections of type S_THREAD_LOCAL_VARIABLES contain an array + * of tlv_descriptor structures. + */ + struct tlv_descriptor + { + /// + void* function (tlv_descriptor*) thunk; + + /// + c_ulong key; + + /// + c_ulong offset; + } + + /** + * LC_NOTE commands describe a region of arbitrary data included in a Mach-O + * file. Its initial use is to record extra data in MH_CORE files. + */ + struct note_command + { + /// LC_NOTE. + uint cmd; + + /// Sizeof(struct note_command). + uint cmdsize; + + /// Owner name for this LC_NOTE. + char[16] data_owner; + + /// File offset of this data. + ulong offset; + + /// Length of data region. + ulong size; + } } else version (OSX) @@ -301,19 +2584,25 @@ extern (C): struct mach_header { uint magic; - int cputype; - int cpusubtype; + int cputype; + int cpusubtype; uint filetype; uint ncmds; uint sizeofcmds; uint flags; } +enum +{ + MH_MAGIC = 0xfeedface, + MH_CIGAM = 0xcefaedfe +} + struct mach_header_64 { uint magic; - int cputype; - int cpusubtype; + int cputype; + int cpusubtype; uint filetype; uint ncmds; uint sizeofcmds; @@ -321,31 +2610,145 @@ struct mach_header_64 uint reserved; } -enum uint MH_MAGIC = 0xfeedface; -enum uint MH_CIGAM = 0xcefaedfe; -enum uint MH_MAGIC_64 = 0xfeedfacf; -enum uint MH_CIGAM_64 = 0xcffaedfe; - -enum SEG_PAGEZERO = "__PAGEZERO"; -enum SEG_TEXT = "__TEXT"; -enum SECT_TEXT = "__text"; -enum SECT_FVMLIB_INIT0 = "__fvmlib_init0"; -enum SECT_FVMLIB_INIT1 = "__fvmlib_init1"; -enum SEG_DATA = "__DATA"; -enum SECT_DATA = "__data"; -enum SECT_BSS = "__bss"; -enum SECT_COMMON = "__common"; -enum SEG_OBJC = "__OBJC"; -enum SECT_OBJC_SYMBOLS = "__symbol_table"; -enum SECT_OBJC_MODULES = "__module_info"; -enum SECT_OBJC_STRINGS = "__selector_strs"; -enum SECT_OBJC_REFS = "__selector_refs"; -enum SEG_ICON = "__ICON"; -enum SECT_ICON_HEADER = "__header"; -enum SECT_ICON_TIFF = "__tiff"; -enum SEG_LINKEDIT = "__LINKEDIT"; -enum SEG_UNIXSTACK = "__UNIXSTACK"; -enum SEG_IMPORT = "__IMPORT"; +enum +{ + MH_MAGIC_64 = 0xfeedfacf, + MH_CIGAM_64 = 0xcffaedfe +} + +enum +{ + MH_OBJECT = 0x1, + MH_EXECUTE = 0x2, + MH_FVMLIB = 0x3, + MH_CORE = 0x4, + MH_PRELOAD = 0x5, + MH_DYLIB = 0x6, + MH_DYLINKER = 0x7, + MH_BUNDLE = 0x8, + MH_DYLIB_STUB = 0x9, + MH_DSYM = 0xa, + MH_KEXT_BUNDLE = 0xb +} + +enum +{ + MH_NOUNDEFS = 0x1, + MH_INCRLINK = 0x2, + MH_DYLDLINK = 0x4, + MH_BINDATLOAD = 0x8, + MH_PREBOUND = 0x10, + MH_SPLIT_SEGS = 0x20, + MH_LAZY_INIT = 0x40, + MH_TWOLEVEL = 0x80, + MH_FORCE_FLAT = 0x100, + MH_NOMULTIDEFS = 0x200, + MH_NOFIXPREBINDING = 0x400, + MH_PREBINDABLE = 0x800, + MH_ALLMODSBOUND = 0x1000, + MH_SUBSECTIONS_VIA_SYMBOLS = 0x2000, + MH_CANONICAL = 0x4000, + MH_WEAK_DEFINES = 0x8000, + MH_BINDS_TO_WEAK = 0x10000, + + MH_ALLOW_STACK_EXECUTION = 0x20000, + MH_ROOT_SAFE = 0x40000, + + MH_SETUID_SAFE = 0x80000, + MH_NO_REEXPORTED_DYLIBS = 0x100000, + MH_PIE = 0x200000, + MH_DEAD_STRIPPABLE_DYLIB = 0x400000, + MH_HAS_TLV_DESCRIPTORS = 0x800000, + + MH_NO_HEAP_EXECUTION = 0x1000000, + + MH_APP_EXTENSION_SAFE = 0x02000000, + + MH_NLIST_OUTOFSYNC_WITH_DYLDINFO = 0x04000000, + + MH_SIM_SUPPORT = 0x08000000, + + MH_DYLIB_IN_CACHE = 0x80000000 +} + +struct load_command +{ + uint cmd; + uint cmdsize; +} + +enum LC_REQ_DYLD = 0x80000000; + +enum +{ + LC_SEGMENT = 0x1, + LC_SYMTAB = 0x2, + LC_SYMSEG = 0x3, + LC_THREAD = 0x4, + LC_UNIXTHREAD = 0x5, + LC_LOADFVMLIB = 0x6, + LC_IDFVMLIB = 0x7, + LC_IDENT = 0x8, + LC_FVMFILE = 0x9, + LC_PREPAGE = 0xa, + LC_DYSYMTAB = 0xb, + LC_LOAD_DYLIB = 0xc, + LC_ID_DYLIB = 0xd, + LC_LOAD_DYLINKER = 0xe, + LC_ID_DYLINKER = 0xf, + LC_PREBOUND_DYLIB = 0x10, + LC_ROUTINES = 0x11, + LC_SUB_FRAMEWORK = 0x12, + LC_SUB_UMBRELLA = 0x13, + LC_SUB_CLIENT = 0x14, + LC_SUB_LIBRARY = 0x15, + LC_TWOLEVEL_HINTS = 0x16, + LC_PREBIND_CKSUM = 0x17 +} + +enum LC_LOAD_WEAK_DYLIB = 0x18 | LC_REQ_DYLD; + +enum +{ + LC_SEGMENT_64 = 0x19, + LC_ROUTINES_64 = 0x1a, + LC_UUID = 0x1b, + LC_RPATH = 0x1c | LC_REQ_DYLD, + LC_CODE_SIGNATURE = 0x1d, + LC_SEGMENT_SPLIT_INFO = 0x1e, + LC_REEXPORT_DYLIB = 0x1f | LC_REQ_DYLD, + LC_LAZY_LOAD_DYLIB = 0x20, + LC_ENCRYPTION_INFO = 0x21, + LC_DYLD_INFO = 0x22, + LC_DYLD_INFO_ONLY = 0x22 | LC_REQ_DYLD, + LC_LOAD_UPWARD_DYLIB = 0x23 | LC_REQ_DYLD, + LC_VERSION_MIN_MACOSX = 0x24, + LC_VERSION_MIN_IPHONEOS = 0x25, + LC_FUNCTION_STARTS = 0x26, + LC_DYLD_ENVIRONMENT = 0x27, + LC_MAIN = 0x28 | LC_REQ_DYLD, + LC_DATA_IN_CODE = 0x29, + LC_SOURCE_VERSION = 0x2A, + LC_DYLIB_CODE_SIGN_DRS = 0x2B, + LC_ENCRYPTION_INFO_64 = 0x2C, + LC_LINKER_OPTION = 0x2D, + LC_LINKER_OPTIMIZATION_HINT = 0x2E, + LC_VERSION_MIN_TVOS = 0x2F, + LC_VERSION_MIN_WATCHOS = 0x30, + LC_NOTE = 0x31, + LC_BUILD_VERSION = 0x32, + LC_DYLD_EXPORTS_TRIE = 0x33 | LC_REQ_DYLD, + LC_DYLD_CHAINED_FIXUPS = 0x34 | LC_REQ_DYLD +} + +union lc_str +{ + uint offset; + + version (D_LP64) {} + else + char* ptr; +} struct segment_command { @@ -367,44 +2770,679 @@ struct segment_command_64 uint cmd; uint cmdsize; char[16] segname = 0; - long vmaddr; - long vmsize; - long fileoff; - long filesize; + ulong vmaddr; + ulong vmsize; + ulong fileoff; + ulong filesize; int maxprot; int initprot; uint nsects; uint flags; } +enum +{ + SG_HIGHVM = 0x1, + SG_FVMLIB = 0x2, + SG_NORELOC = 0x4, + SG_PROTECTED_VERSION_1 = 0x8, + SG_READ_ONLY = 0x10 +} + struct section { char[16] sectname = 0; char[16] segname = 0; - uint addr; - uint size; - uint offset; - uint align_; - uint reloff; - uint nreloc; - uint flags; - uint reserved1; - uint reserved2; + uint addr; + uint size; + uint offset; + uint align_; + uint reloff; + uint nreloc; + uint flags; + uint reserved1; + uint reserved2; } struct section_64 { char[16] sectname = 0; char[16] segname = 0; - ulong addr; - ulong size; - uint offset; - uint align_; - uint reloff; - uint nreloc; - uint flags; - uint reserved1; - uint reserved2; - uint reserved3; + ulong addr; + ulong size; + uint offset; + uint align_; + uint reloff; + uint nreloc; + uint flags; + uint reserved1; + uint reserved2; + uint reserved3; +} + + +enum +{ + SECTION_TYPE = 0x000000ff, + SECTION_ATTRIBUTES = 0xffffff00 +} + +enum +{ + S_REGULAR = 0x0, + S_ZEROFILL = 0x1, + S_CSTRING_LITERALS = 0x2, + S_4BYTE_LITERALS = 0x3, + S_8BYTE_LITERALS = 0x4, + S_LITERAL_POINTERS = 0x5, + S_NON_LAZY_SYMBOL_POINTERS = 0x6, + S_LAZY_SYMBOL_POINTERS = 0x7, + S_SYMBOL_STUBS = 0x8, + S_MOD_INIT_FUNC_POINTERS = 0x9, + S_MOD_TERM_FUNC_POINTERS = 0xa, + S_COALESCED = 0xb, + S_GB_ZEROFILL = 0xc, + S_INTERPOSING = 0xd, + S_16BYTE_LITERALS = 0xe, + S_DTRACE_DOF = 0xf, + S_LAZY_DYLIB_SYMBOL_POINTERS = 0x10, + + S_THREAD_LOCAL_REGULAR = 0x11, + S_THREAD_LOCAL_ZEROFILL = 0x12, + S_THREAD_LOCAL_VARIABLES = 0x13, + S_THREAD_LOCAL_VARIABLE_POINTERS = 0x14, + S_THREAD_LOCAL_INIT_FUNCTION_POINTERS = 0x15, + S_INIT_FUNC_OFFSETS = 0x16 +} + +enum +{ + SECTION_ATTRIBUTES_USR = 0xff000000, + S_ATTR_PURE_INSTRUCTIONS = 0x80000000, + S_ATTR_NO_TOC = 0x40000000, + S_ATTR_STRIP_STATIC_SYMS = 0x20000000, + S_ATTR_NO_DEAD_STRIP = 0x10000000, + S_ATTR_LIVE_SUPPORT = 0x08000000, + S_ATTR_SELF_MODIFYING_CODE = 0x04000000, + S_ATTR_DEBUG = 0x02000000, + SECTION_ATTRIBUTES_SYS = 0x00ffff00, + S_ATTR_SOME_INSTRUCTIONS = 0x00000400, + S_ATTR_EXT_RELOC = 0x00000200, + S_ATTR_LOC_RELOC = 0x00000100 +} + +enum +{ + SEG_PAGEZERO = "__PAGEZERO", + + SEG_TEXT = "__TEXT", + SECT_TEXT = "__text", + SECT_FVMLIB_INIT0 = "__fvmlib_init0", + SECT_FVMLIB_INIT1 = "__fvmlib_init1", + + SEG_DATA = "__DATA", + SECT_DATA = "__data", + SECT_BSS = "__bss", + SECT_COMMON = "__common", + + SEG_OBJC = "__OBJC", + SECT_OBJC_SYMBOLS = "__symbol_table", + SECT_OBJC_MODULES = "__module_info", + SECT_OBJC_STRINGS = "__selector_strs", + SECT_OBJC_REFS = "__selector_refs", + + SEG_ICON = "__ICON", + SECT_ICON_HEADER = "__header", + SECT_ICON_TIFF = "__tiff", + + SEG_LINKEDIT = "__LINKEDIT", + + SEG_UNIXSTACK = "__UNIXSTACK", + + SEG_IMPORT = "__IMPORT" +} + +struct fvmlib +{ + lc_str name; + uint minor_version; + uint header_addr; } +struct fvmlib_command +{ + uint cmd; + uint cmdsize; + fvmlib fvmlib_; +} + +struct dylib +{ + lc_str name; + uint timestamp; + uint current_version; + uint compatibility_version; +} + +struct dylib_command +{ + uint cmd; + uint cmdsize; + dylib dylib_; +} + +struct sub_framework_command +{ + uint cmd; + uint cmdsize; + lc_str umbrella; +} + +struct sub_client_command +{ + uint cmd; + uint cmdsize; + lc_str client; +} + +struct sub_umbrella_command +{ + uint cmd; + uint cmdsize; + lc_str sub_umbrella; +} + +struct sub_library_command +{ + uint cmd; + uint cmdsize; + lc_str sub_library; +} + +struct prebound_dylib_command +{ + uint cmd; + uint cmdsize; + lc_str name; + uint nmodules; + lc_str linked_modules; +} + +struct dylinker_command +{ + uint cmd; + uint cmdsize; + lc_str name; +} + +struct thread_command +{ + uint cmd; + uint cmdsize; +} + +struct routines_command +{ + uint cmd; + uint cmdsize; + uint init_address; + uint init_module; + uint reserved1; + uint reserved2; + uint reserved3; + uint reserved4; + uint reserved5; + uint reserved6; +} + +struct routines_command_64 +{ + uint cmd; + uint cmdsize; + ulong init_address; + ulong init_module; + ulong reserved1; + ulong reserved2; + ulong reserved3; + ulong reserved4; + ulong reserved5; + ulong reserved6; +} + +struct symtab_command +{ + uint cmd; + uint cmdsize; + uint symoff; + uint nsyms; + uint stroff; + uint strsize; +} + +struct dysymtab_command +{ + uint cmd; + uint cmdsize; + + uint ilocalsym; + uint nlocalsym; + + uint iextdefsym; + uint nextdefsym; + + uint iundefsym; + uint nundefsym; + + uint tocoff; + uint ntoc; + + uint modtaboff; + uint nmodtab; + + uint extrefsymoff; + uint nextrefsyms; + + uint indirectsymoff; + uint nindirectsyms; + + uint extreloff; + uint nextrel; + + uint locreloff; + uint nlocrel; +} + +enum +{ + INDIRECT_SYMBOL_LOCAL = 0x80000000, + INDIRECT_SYMBOL_ABS = 0x40000000 +} + +struct dylib_table_of_contents +{ + uint symbol_index; + uint module_index; +} + +struct dylib_module +{ + uint module_name; + + uint iextdefsym; + uint nextdefsym; + uint irefsym; + uint nrefsym; + uint ilocalsym; + uint nlocalsym; + + uint iextrel; + uint nextrel; + + uint iinit_iterm; + uint ninit_nterm; + + uint objc_module_info_addr; + uint objc_module_info_size; +} + +struct dylib_module_64 +{ + uint module_name; + + uint iextdefsym; + uint nextdefsym; + uint irefsym; + uint nrefsym; + uint ilocalsym; + uint nlocalsym; + + uint iextrel; + uint nextrel; + + uint iinit_iterm; + uint ninit_nterm; + + uint objc_module_info_size; + ulong objc_module_info_addr; +} + +struct dylib_reference +{ + private uint storage; + + @property uint isym()() const pure nothrow @nogc @safe + { + return cast(uint) ((storage & 16777215U) >> 0U); + } + + @property void isym()(uint v) @safe pure nothrow @nogc + in + { + assert(v >= 0U, "Value is smaller than the minimum value of bitfield 'isym'"); + assert(v <= 16777215U, "Value is greater than the maximum value of bitfield 'isym'"); + } + body + { + storage = cast(uint) ((storage & (-1 - cast(uint) 16777215U)) | + ((cast(uint) v << 0U) & 16777215U)); + } + + @property uint flags()() const pure nothrow @nogc @safe + { + return cast(uint) ((storage & 4278190080U) >> 24U); + } + + @property void flags()(uint v) pure nothrow @nogc @safe + in + { + assert(v >= 0U, "Value is smaller than the minimum value of bitfield 'flags'"); + assert(v <= 255U, "Value is greater than the maximum value of bitfield 'flags'"); + } + body + { + storage = cast(uint) ((storage & (-1 - cast(uint) 4278190080U)) | + ((cast(uint) v << 24U) & 4278190080U)); + } +} + +struct twolevel_hints_command +{ + uint cmd; + uint cmdsize; + uint offset; + uint nhints; +} + +struct twolevel_hint +{ + private uint storage; + + @property uint isub_image()() const pure nothrow @nogc @safe + { + return cast(uint) ((storage & 255U) >>0U); + } + + @property void isub_image()(uint v) pure nothrow @nogc @safe + in + { + assert(v >= 0U, "Value is smaller than the minimum value of bitfield 'isub_image'"); + assert(v <= 255U, "Value is greater than the maximum value of bitfield 'isub_image'"); + } + body + { + storage = cast(uint) ((storage & (-1-cast(uint)255U)) | + ((cast(uint) v << 0U) & 255U)); + } + + @property uint itoc()() const pure nothrow @nogc @safe + { + return cast(uint) ((storage & 4294967040U) >>8U); + } + + @property void itoc()(uint v) pure nothrow @nogc @safe + in + { + assert(v >= 0U, "Value is smaller than the minimum value of bitfield 'itoc'"); + assert(v <= 16777215U, "Value is greater than the maximum value of bitfield 'itoc'"); + } + body + { + storage = cast(uint) ((storage & (-1-cast(uint)4294967040U)) | + ((cast(uint) v << 8U) & 4294967040U)); + } +} + +struct prebind_cksum_command +{ + uint cmd; + uint cmdsize; + uint cksum; +} + +struct uuid_command +{ + uint cmd; + uint cmdsize; + ubyte[16] uuid; +} + +struct rpath_command +{ + uint cmd; + uint cmdsize; + lc_str path; +} + +struct linkedit_data_command +{ + uint cmd; + uint cmdsize; + uint dataoff; + uint datasize; +} + +struct encryption_info_command +{ + uint cmd; + uint cmdsize; + uint cryptoff; + uint cryptsize; + uint cryptid; +} + +struct encryption_info_command_64 +{ + uint cmd; + uint cmdsize; + uint cryptoff; + uint cryptsize; + uint cryptid; + uint pad; +} + +struct version_min_command +{ + uint cmd; + uint cmdsize; + uint version_; + uint sdk; +} + +struct build_version_command +{ + uint cmd; + uint cmdsize; + + uint platform; + uint minos; + uint sdk; + uint ntools; +} + +struct build_tool_version +{ + uint tool; + uint version_; +} + +enum +{ + PLATFORM_MACOS = 1, + PLATFORM_IOS = 2, + PLATFORM_TVOS = 3, + PLATFORM_WATCHOS = 4, + PLATFORM_BRIDGEOS = 5, + PLATFORM_UIKITFORMAC = 6, + PLATFORM_IOSSIMULATOR = 7, + PLATFORM_TVOSSIMULATOR = 8, + PLATFORM_WATCHOSSIMULATOR = 9, + PLATFORM_DRIVERKIT = 10 +} + +enum +{ + TOOL_CLANG = 1, + TOOL_SWIFT = 2, + TOOL_LD = 3 +} + +struct dyld_info_command +{ + uint cmd; + uint cmdsize; + + uint rebase_off; + uint rebase_size; + + uint bind_off; + uint bind_size; + + uint weak_bind_off; + uint weak_bind_size; + + uint lazy_bind_off; + uint lazy_bind_size; + + uint export_off; + uint export_size; +} + +enum +{ + REBASE_TYPE_POINTER = 1, + REBASE_TYPE_TEXT_ABSOLUTE32 = 2, + REBASE_TYPE_TEXT_PCREL32 = 3, + + REBASE_OPCODE_MASK = 0xF0, + REBASE_IMMEDIATE_MASK = 0x0F, + REBASE_OPCODE_DONE = 0x00, + REBASE_OPCODE_SET_TYPE_IMM = 0x10, + REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB = 0x20, + REBASE_OPCODE_ADD_ADDR_ULEB = 0x30, + REBASE_OPCODE_ADD_ADDR_IMM_SCALED = 0x40, + REBASE_OPCODE_DO_REBASE_IMM_TIMES = 0x50, + REBASE_OPCODE_DO_REBASE_ULEB_TIMES = 0x60, + REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB = 0x70, + REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB = 0x80 +} + +enum +{ + BIND_TYPE_POINTER = 1, + BIND_TYPE_TEXT_ABSOLUTE32 = 2, + BIND_TYPE_TEXT_PCREL32 = 3, + + BIND_SPECIAL_DYLIB_SELF = 0, + BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE = -1, + BIND_SPECIAL_DYLIB_FLAT_LOOKUP = -2, + BIND_SPECIAL_DYLIB_WEAK_LOOKUP = -3, + + BIND_SYMBOL_FLAGS_WEAK_IMPORT = 0x1, + BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION = 0x8, + + BIND_OPCODE_MASK = 0xF0, + BIND_IMMEDIATE_MASK = 0x0F, + BIND_OPCODE_DONE = 0x00, + BIND_OPCODE_SET_DYLIB_ORDINAL_IMM = 0x10, + BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB = 0x20, + BIND_OPCODE_SET_DYLIB_SPECIAL_IMM = 0x30, + BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM = 0x40, + BIND_OPCODE_SET_TYPE_IMM = 0x50, + BIND_OPCODE_SET_ADDEND_SLEB = 0x60, + BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB = 0x70, + BIND_OPCODE_ADD_ADDR_ULEB = 0x80, + BIND_OPCODE_DO_BIND = 0x90, + BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB = 0xA0, + BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED = 0xB0, + BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB = 0xC0, + BIND_OPCODE_THREADED = 0xD0, + BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB = 0x00, + BIND_SUBOPCODE_THREADED_APPLY = 0x01 +} + +enum +{ + EXPORT_SYMBOL_FLAGS_KIND_MASK = 0x03, + EXPORT_SYMBOL_FLAGS_KIND_REGULAR = 0x00, + EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL = 0x01, + EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE = 0x02, + EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION = 0x04, + EXPORT_SYMBOL_FLAGS_REEXPORT = 0x08, + EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER = 0x10 +} + +struct linker_option_command +{ + uint cmd; + uint cmdsize; + uint count; +} + +struct symseg_command +{ + uint cmd; + uint cmdsize; + uint offset; + uint size; +} + +struct ident_command +{ + uint cmd; + uint cmdsize; +} + +struct fvmfile_command +{ + uint cmd; + uint cmdsize; + lc_str name; + uint header_addr; +} + +struct entry_point_command +{ + uint cmd; + uint cmdsize; + ulong entryoff; + ulong stacksize; +} + +struct source_version_command +{ + uint cmd; + uint cmdsize; + ulong version_; +} + +struct data_in_code_entry +{ + uint offset; + ushort length; + ushort kind; +} + +enum +{ + DICE_KIND_DATA = 0x0001, + DICE_KIND_JUMP_TABLE8 = 0x0002, + DICE_KIND_JUMP_TABLE16 = 0x0003, + DICE_KIND_JUMP_TABLE32 = 0x0004, + DICE_KIND_ABS_JUMP_TABLE32 = 0x0005, +} + +struct tlv_descriptor +{ + void* function(tlv_descriptor*) thunk; + c_ulong key; + c_ulong offset; +} + +struct note_command +{ + uint cmd; + uint cmdsize; + char[16] data_owner = 0; + ulong offset; + ulong size; +} diff --git a/libphobos/libdruntime/core/sys/darwin/string.d b/libphobos/libdruntime/core/sys/darwin/string.d new file mode 100644 index 0000000..bd65fde --- /dev/null +++ b/libphobos/libdruntime/core/sys/darwin/string.d @@ -0,0 +1,31 @@ +/** + * D header file for Darwin string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.darwin.string; + +public import core.stdc.string; +import core.sys.darwin.sys.cdefs; + +version (OSX) + version = Darwin; +else version (iOS) + version = Darwin; +else version (TVOS) + version = Darwin; +else version (WatchOS) + version = Darwin; + +version (Darwin): +extern (C): +nothrow: +@nogc: + +static if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) +{ + // ^ __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); + pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); +} diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/string.d b/libphobos/libdruntime/core/sys/dragonflybsd/string.d new file mode 100644 index 0000000..b64178f --- /dev/null +++ b/libphobos/libdruntime/core/sys/dragonflybsd/string.d @@ -0,0 +1,22 @@ +/** + * D header file for DragonFlyBSD string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.dragonflybsd.string; + +public import core.stdc.string; +import core.sys.dragonflybsd.sys.cdefs; + +version (DragonFlyBSD): +extern (C): +nothrow: +@nogc: + +static if (__BSD_VISIBLE) +{ + pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); +} + diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/sys/socket.d b/libphobos/libdruntime/core/sys/dragonflybsd/sys/socket.d new file mode 100644 index 0000000..8ac54e2 --- /dev/null +++ b/libphobos/libdruntime/core/sys/dragonflybsd/sys/socket.d @@ -0,0 +1,86 @@ +/** + * D header file for DragonFlyBSD + * + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) + */ +module core.sys.dragonflybsd.sys.socket; + +public import core.sys.posix.sys.socket; + +version (DragonFlyBSD): +extern(C): +@nogc: +nothrow: + +enum +{ + AF_IMPLINK = 3, + AF_PUP = 4, + AF_CHAOS = 5, + AF_NETBIOS = 6, + AF_ISO = 7, + AF_OSI = AF_ISO, + AF_ECMA = 8, + AF_DATAKIT = 9, + AF_CCITT = 10, + AF_SNA = 11, + AF_DECnet = 12, + AF_DLI = 13, + AF_LAT = 14, + AF_HYLINK = 15, + AF_ROUTE = 17, + AF_LINK = 18, + pseudo_AF_XTP = 19, + AF_COIP = 20, + AF_CNT = 21, + pseudo_AF_RTIP = 22, + AF_SIP = 24, + pseudo_AF_PIP = 25, + AF_ISDN = 26, + AF_E164 = AF_ISDN, + pseudo_AF_KEY = 27, + AF_NATM = 29, + AF_ATM = 30, + pseudo_AF_HDRCMPLT = 31, + AF_NETGRAPH = 32, + AF_BLUETOOTH = 33, + AF_MPLS = 34, + AF_IEEE80211 = 35, +} + +/* protocol families */ +enum PF_UNSPEC = AF_UNSPEC; +enum PF_LOCAL = AF_LOCAL; +enum PF_UNIX = PF_LOCAL; +enum PF_INET = AF_INET; +enum PF_IMPLINK = AF_IMPLINK; +enum PF_PUP = AF_PUP; +enum PF_CHAOS = AF_CHAOS; +enum PF_NETBIOS = AF_NETBIOS; +enum PF_ISO = AF_ISO; +enum PF_OSI = AF_ISO; +enum PF_ECMA = AF_ECMA; +enum PF_DATAKIT = AF_DATAKIT; +enum PF_CCITT = AF_CCITT; +enum PF_SNA = AF_SNA; +enum PF_DECnet = AF_DECnet; +enum PF_DLI = AF_DLI; +enum PF_LAT = AF_LAT; +enum PF_HYLINK = AF_HYLINK; +enum PF_APPLETALK = AF_APPLETALK; +enum PF_ROUTE = AF_ROUTE; +enum PF_LINK = AF_LINK; +enum PF_XTP = pseudo_AF_XTP; +enum PF_COIP = AF_COIP; +enum PF_CNT = AF_CNT; +enum PF_SIP = AF_SIP; +enum PF_IPX = AF_IPX; +enum PF_RTIP = pseudo_AF_RTIP; +enum PF_PIP = pseudo_AF_PIP; +enum PF_ISDN = AF_ISDN; +enum PF_KEY = pseudo_AF_KEY; +enum PF_INET6 = AF_INET6; +enum PF_NATM = AF_NATM; +enum PF_ATM = AF_ATM; +enum PF_NETGRAPH = AF_NETGRAPH; +enum PF_BLUETOOTH = AF_BLUETOOTH; diff --git a/libphobos/libdruntime/core/sys/freebsd/string.d b/libphobos/libdruntime/core/sys/freebsd/string.d new file mode 100644 index 0000000..3602ea8 --- /dev/null +++ b/libphobos/libdruntime/core/sys/freebsd/string.d @@ -0,0 +1,21 @@ +/** + * D header file for FreeBSD string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.freebsd.string; + +public import core.stdc.string; +import core.sys.freebsd.sys.cdefs; + +version (FreeBSD): +extern (C): +nothrow: +@nogc: + +static if (__BSD_VISIBLE) +{ + pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); +} diff --git a/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d b/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d index 29c6e3c..f208b01 100644 --- a/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d +++ b/libphobos/libdruntime/core/sys/freebsd/sys/elf64.d @@ -43,6 +43,15 @@ struct Elf64_Ehdr Elf64_Half e_shstrndx; } +struct Elf64_Lib +{ + Elf64_Word l_name; + Elf64_Word l_time_stamp; + Elf64_Word l_checksum; + Elf64_Word l_version; + Elf64_Word l_flags; +} + struct Elf64_Shdr { Elf64_Word sh_name; diff --git a/libphobos/libdruntime/core/sys/freebsd/sys/elf_common.d b/libphobos/libdruntime/core/sys/freebsd/sys/elf_common.d index 6188d0e..455de95 100644 --- a/libphobos/libdruntime/core/sys/freebsd/sys/elf_common.d +++ b/libphobos/libdruntime/core/sys/freebsd/sys/elf_common.d @@ -852,3 +852,105 @@ enum R_X86_64_DTPOFF32 = 21; enum R_X86_64_GOTTPOFF = 22; enum R_X86_64_TPOFF32 = 23; enum R_X86_64_IRELATIVE = 37; + +version (PPC64) +{ +enum __ELF_WORD_SIZE = 64; +enum ELF_ARCH = EM_PPC64; +enum ELF_MACHINE_OK(x) = ((x) == EM_PPC64); +} +version (PPC) +{ +enum __ELF_WORD_SIZE = 32; +enum ELF_ARCH = EM_PPC; +enum ELF_ARCH32 = EM_PPC; +enum ELF_MACHINE_OK(x) = ((x) == EM_PPC); +} + +/** + * Auxiliary vector entries for passing information to the interpreter. + * + * The PowerPC supplement to the SVR4 ABI specification names this "auxv_t", + * but POSIX lays claim to all symbols ending with "_t". + */ + +struct Elf32_Auxinfo +{ + int a_type; + union a_un + { + long a_val; + void *a_ptr; + void function(void* a) a_fcn; + } +} + +struct Elf64_Auxinfo +{ + long a_type; + union a_un + { + long a_val; + void *a_ptr; + void function(void* a) a_fcn; + } +} + +// __ElfType(Auxinfo); + +/** + * Values for a_type. + */ + +enum AT_NULL = 0; +enum AT_IGNORE = 1; +enum AT_EXECFD = 2; +enum AT_PHDR = 3; +enum AT_PHENT = 4; +enum AT_PHNUM = 5; +enum AT_PAGESZ = 6; +enum AT_BASE = 7; +enum AT_FLAGS = 8; +enum AT_ENTRY = 9; +enum AT_DCACHEBSIZE = 10; +enum AT_ICACHEBSIZE = 11; +enum AT_UCACHEBSIZE = 12; +enum AT_EXECPATH = 13; +enum AT_CANARY = 14; +enum AT_CANARYLEN = 15; +enum AT_OSRELDATE = 16; +enum AT_NCPUS = 17; +enum AT_PAGESIZES = 18; +enum AT_PAGESIZESLEN = 19; +enum AT_STACKPROT = 21; +enum AT_TIMEKEEP = 22; +enum AT_COUNT = 23; + +/** + * Relocation types. + */ + +enum R_PPC_COUNT = 37; +enum R_PPC_EMB_COUNT = (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1); + +/** + * Define "machine" characteristics + */ + +version (PPC64) +{ +enum ELF_TARG_CLASS = ELFCLASS64; +enum ELF_TARG_DATA = ELFDATA2MSB; +enum ELF_TARG_MACH = EM_PPC64; +enum ELF_TARG_VER = 1; +} + +version (PPC) +{ +enum ELF_TARG_CLASS = ELFCLASS32; +enum ELF_TARG_DATA = ELFDATA2MSB; +enum ELF_TARG_MACH = EM_PPC; +enum ELF_TARG_VER = 1; +} + +enum ET_DYN_LOAD_ADDR = 0x01010000; diff --git a/libphobos/libdruntime/core/sys/linux/sched.d b/libphobos/libdruntime/core/sys/linux/sched.d index b53fa04..53cd0ef 100644 --- a/libphobos/libdruntime/core/sys/linux/sched.d +++ b/libphobos/libdruntime/core/sys/linux/sched.d @@ -1,9 +1,11 @@ /******************************************************************************* - D binding for Linux specific scheduler control methods. + D binding for Linux specific scheduler control and thread spawning + methods. - Defines functions sched_setaffinity and sched_getaffinity and the data - types they operate on. + Defines functions sched_setaffinity and sched_getaffinity and the data + types they operate on, as well as clone and unshare and their related + constants. Copyright: Copyright (c) 2016 Sociomantic Labs. All rights reserved. License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). @@ -100,6 +102,24 @@ int CPU_COUNT(cpu_set_t* cpusetp) pure return __CPU_COUNT_S(cpu_set_t.sizeof, cpusetp); } -/* Functions */ +/* Scheduler control functions */ int sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask); int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask); + +/* Clone and related functions and constants */ +int clone(int function(void*), void* child_stack, int flags, void* arg, ...); +int unshare(int flags) @trusted; + +enum CLONE_FILES = 0x400; +enum CLONE_FS = 0x200; +enum CLONE_NEWCGROUP = 0x2000000; +enum CLONE_NEWIPC = 0x8000000; +enum CLONE_NEWNET = 0x40000000; +enum CLONE_NEWNS = 0x20000; +enum CLONE_NEWPID = 0x20000000; +enum CLONE_NEWUSER = 0x10000000; +enum CLONE_NEWUTS = 0x4000000; +enum CLONE_SIGHAND = 0x800; +enum CLONE_SYSVSEM = 0x40000; +enum CLONE_THREAD = 0x10000; +enum CLONE_VM = 0x100; diff --git a/libphobos/libdruntime/core/sys/linux/string.d b/libphobos/libdruntime/core/sys/linux/string.d new file mode 100644 index 0000000..a388c8b --- /dev/null +++ b/libphobos/libdruntime/core/sys/linux/string.d @@ -0,0 +1,21 @@ +/** + * D header file for Linux string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.linux.string; + +public import core.stdc.string; +import core.sys.linux.config; + +version (linux): +extern (C): +nothrow: +@nogc: + +static if (__USE_GNU) +{ + pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); +} diff --git a/libphobos/libdruntime/core/sys/netbsd/string.d b/libphobos/libdruntime/core/sys/netbsd/string.d new file mode 100644 index 0000000..ab9ced8 --- /dev/null +++ b/libphobos/libdruntime/core/sys/netbsd/string.d @@ -0,0 +1,21 @@ +/** + * D header file for NetBSD string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.netbsd.string; + +public import core.stdc.string; +import core.sys.netbsd.sys.featuretest; + +version (NetBSD): +extern (C): +nothrow: +@nogc: + +static if (_NETBSD_SOURCE) +{ + pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); +} diff --git a/libphobos/libdruntime/core/sys/netbsd/sys/featuretest.d b/libphobos/libdruntime/core/sys/netbsd/sys/featuretest.d new file mode 100644 index 0000000..3901ea9 --- /dev/null +++ b/libphobos/libdruntime/core/sys/netbsd/sys/featuretest.d @@ -0,0 +1,12 @@ +/** + * D header file for NetBSD featuretest;. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.netbsd.sys.featuretest; + +version (NetBSD): + +enum _NETBSD_SOURCE = true; diff --git a/libphobos/libdruntime/core/sys/openbsd/string.d b/libphobos/libdruntime/core/sys/openbsd/string.d new file mode 100644 index 0000000..8d35b9c --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/string.d @@ -0,0 +1,21 @@ +/** + * D header file for OpenBSD string. + * + * Copyright: Copyright © 2019, The D Language Foundation + * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. + * Authors: Ernesto Castellotti + */ +module core.sys.openbsd.string; + +public import core.stdc.string; +import core.sys.openbsd.sys.cdefs; + +version (OpenBSD): +extern (C): +nothrow: +@nogc: + +static if (__BSD_VISIBLE) +{ + pure void* memmem(return const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); +} diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/cdefs.d b/libphobos/libdruntime/core/sys/openbsd/sys/cdefs.d new file mode 100644 index 0000000..63d136c --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/cdefs.d @@ -0,0 +1,15 @@ +/** + * D header file for OpenBSD + * + * Authors: Iain Buclaw + */ +module core.sys.openbsd.sys.cdefs; + +version (OpenBSD): + +public import core.sys.posix.config; + +enum __XPG_VISIBLE = 700; +enum __POSIX_VISIBLE = 200809; +enum __ISO_C_VISIBLE = 1999; +enum __BSD_VISIBLE = true; diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/elf.d b/libphobos/libdruntime/core/sys/openbsd/sys/elf.d new file mode 100644 index 0000000..61bb746 --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/elf.d @@ -0,0 +1,12 @@ +/** + * D header file for OpenBSD. + * + * Authors: Iain Buclaw + * Based-on: core/sys/freebsd/sys + */ +module core.sys.openbsd.sys.elf; + +version (OpenBSD): + +public import core.sys.openbsd.sys.elf32; +public import core.sys.openbsd.sys.elf64; diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/elf32.d b/libphobos/libdruntime/core/sys/openbsd/sys/elf32.d new file mode 100644 index 0000000..cefee38 --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/elf32.d @@ -0,0 +1,187 @@ +/** + * D header file for OpenBSD. + * + * Authors: Iain Buclaw + * Based-on: core/sys/freebsd/sys + */ +module core.sys.openbsd.sys.elf32; + +version (OpenBSD): + +extern (C): + +import core.stdc.stdint; +public import core.sys.openbsd.sys.elf_common; + +alias uint16_t Elf32_Half; +alias uint32_t Elf32_Word; +alias int32_t Elf32_Sword; +alias uint64_t Elf32_Lword; +alias uint32_t Elf32_Addr; +alias uint32_t Elf32_Off; +alias Elf32_Word Elf32_Hashelt; +alias Elf32_Word Elf32_Size; +alias Elf32_Sword Elf32_Ssize; + +struct Elf32_Ehdr +{ + char[EI_NIDENT] e_ident = 0; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; +} + +struct Elf32_Shdr +{ + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; +} + +struct Elf32_Phdr +{ + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; +} + +struct Elf32_Dyn +{ + Elf32_Sword d_tag; + union _d_un + { + Elf32_Word d_val; + Elf32_Addr d_ptr; + } _d_un d_un; +} + +struct Elf32_Rel +{ + Elf32_Addr r_offset; + Elf32_Word r_info; +} + +struct Elf32_Rela +{ + Elf32_Addr r_offset; + Elf32_Word r_info; + Elf32_Sword r_addend; +} + +extern (D) pure @safe +{ + auto ELF32_R_SYM(V)(V val) { return val >> 8; } + auto ELF32_R_TYPE(V)(V val) { return val & 0xff; } + auto ELF32_R_INFO(S, T)(S sym, T type) { return (sym << 8) + (type & 0xff); } +} + +alias Elf_Note Elf32_Nhdr; + +struct Elf32_Move +{ + Elf32_Lword m_value; + Elf32_Word m_info; + Elf32_Word m_poffset; + Elf32_Half m_repeat; + Elf32_Half m_stride; +} + +extern (D) pure +{ + auto ELF32_M_SYM(I)(I info) @safe { return info >> 8; } + auto ELF32_M_SIZE(I)(I info) { return cast(ubyte)info; } + auto ELF32_M_INFO(S, SZ)(S sym, SZ size) { return (sym << 8) + cast(ubye)size; } +} + +struct Elf32_Cap +{ + Elf32_Word c_tag; + union _c_un + { + Elf32_Word c_val; + Elf32_Addr c_ptr; + } _c_un c_un; +} + +struct Elf32_Sym +{ + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + ubyte st_info; + ubyte st_other; + Elf32_Half st_shndx; +} + +extern (D) pure +{ + auto ELF32_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; } + auto ELF32_ST_TYPE(T)(T val) @safe { return val & 0xf; } + auto ELF32_ST_INFO(B, T)(B bind, T type) @safe { return (bind << 4) + (type & 0xf); } + auto ELF32_ST_VISIBILITY(O)(O o) @safe { return o & 0x03; } +} + +struct Elf32_Verdef +{ + Elf32_Half vd_version; + Elf32_Half vd_flags; + Elf32_Half vd_ndx; + Elf32_Half vd_cnt; + Elf32_Word vd_hash; + Elf32_Word vd_aux; + Elf32_Word vd_next; +} + +struct Elf32_Verdaux +{ + Elf32_Word vda_name; + Elf32_Word vda_next; +} + +struct Elf32_Verneed +{ + Elf32_Half vn_version; + Elf32_Half vn_cnt; + Elf32_Word vn_file; + Elf32_Word vn_aux; + Elf32_Word vn_next; +} + +struct Elf32_Vernaux +{ + Elf32_Word vna_hash; + Elf32_Half vna_flags; + Elf32_Half vna_other; + Elf32_Word vna_name; + Elf32_Word vna_next; +} + +alias Elf32_Half Elf32_Versym; + +struct Elf32_Syminfo +{ + Elf32_Half si_boundto; + Elf32_Half si_flags; +} diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/elf64.d b/libphobos/libdruntime/core/sys/openbsd/sys/elf64.d new file mode 100644 index 0000000..d5e15fc --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/elf64.d @@ -0,0 +1,193 @@ +/** + * D header file for OpenBSD. + * + * Authors: Iain Buclaw + * Based-on: core/sys/freebsd/sys + */ +module core.sys.openbsd.sys.elf64; + +version (OpenBSD): + +extern (C): + +import core.stdc.stdint; +public import core.sys.openbsd.sys.elf_common; + +alias uint16_t Elf64_Half; +alias uint32_t Elf64_Word; +alias int32_t Elf64_Sword; +alias uint64_t Elf64_Lword; +alias uint64_t Elf64_Xword; +alias int64_t Elf64_Sxword; +alias uint64_t Elf64_Addr; +alias uint64_t Elf64_Off; +alias Elf64_Word Elf64_Hashelt; +alias Elf64_Xword Elf64_Size; +alias Elf64_Sxword Elf64_Ssize; + +struct Elf64_Ehdr +{ + char[EI_NIDENT] e_ident = 0; + Elf64_Half e_type; + Elf64_Half e_machine; + Elf64_Word e_version; + Elf64_Addr e_entry; + Elf64_Off e_phoff; + Elf64_Off e_shoff; + Elf64_Word e_flags; + Elf64_Half e_ehsize; + Elf64_Half e_phentsize; + Elf64_Half e_phnum; + Elf64_Half e_shentsize; + Elf64_Half e_shnum; + Elf64_Half e_shstrndx; +} + +struct Elf64_Shdr +{ + Elf64_Word sh_name; + Elf64_Word sh_type; + Elf64_Xword sh_flags; + Elf64_Addr sh_addr; + Elf64_Off sh_offset; + Elf64_Xword sh_size; + Elf64_Word sh_link; + Elf64_Word sh_info; + Elf64_Xword sh_addralign; + Elf64_Xword sh_entsize; +} + +struct Elf64_Phdr +{ + Elf64_Word p_type; + Elf64_Word p_flags; + Elf64_Off p_offset; + Elf64_Addr p_vaddr; + Elf64_Addr p_paddr; + Elf64_Xword p_filesz; + Elf64_Xword p_memsz; + Elf64_Xword p_align; +} + +struct Elf64_Dyn +{ + Elf64_Sxword d_tag; + union _d_un + { + Elf64_Xword d_val; + Elf64_Addr d_ptr; + } _d_un d_un; +} + +struct Elf64_Rel +{ + Elf64_Addr r_offset; + Elf64_Xword r_info; +} + +struct Elf64_Rela +{ + Elf64_Addr r_offset; + Elf64_Xword r_info; + Elf64_Sxword r_addend; +} + +extern (D) pure +{ + auto ELF64_R_SYM(I)(I i) @safe { return i >> 32; } + auto ELF64_R_TYPE(I)(I i) @safe { return i & 0xffffffff; } + auto ELF64_R_INFO(S, T)(S sym, T type) @safe { return (sym << 32) + (type & 0xffffffff); } + + auto ELF64_R_TYPE_DATA(I)(I i) { return (cast(Elf64_Xword) i << 32) >> 40; } + auto ELF64_R_TYPE_ID(I)(I i) { return (cast(Elf64_Xword) i << 56 ) >> 56; } + auto ELF64_R_TYPE_INFO(D, T)(D d, T t) { return cast(Elf64_Xword) d << 8 + cast(Elf64_Xword) t; } +} + +alias Elf_Note Elf64_Nhdr; + +struct Elf64_Move +{ + Elf64_Lword m_value; + Elf64_Xword m_info; + Elf64_Xword m_poffset; + Elf64_Half m_repeat; + Elf64_Half m_stride; +} + +extern (D) pure +{ + auto ELF64_M_SYM(I)(I info) @safe { return info >> 8; } + auto ELF64_M_SIZE(I)(I info) { return cast(ubyte)info; } + auto ELF64_M_INFO(S, SZ)(S sym, SZ size) @safe { return (sym << 8) + cast(ubye)size; } +} + +struct Elf64_Cap +{ + Elf64_Xword c_tag; + union _c_un + { + Elf64_Xword c_val; + Elf64_Addr c_ptr; + } _c_un c_un; +} + +struct Elf64_Sym +{ + Elf64_Word st_name; + ubyte st_info; + ubyte st_other; + Elf64_Half st_shndx; + Elf64_Addr st_value; + Elf64_Xword st_size; +} + +extern (D) pure +{ + auto ELF64_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; } + auto ELF64_ST_TYPE(T)(T val) @safe { return val & 0xf; } + auto ELF64_ST_INFO(B, T)(B bind, T type) @safe { return (bind << 4) + (type & 0xf); } + auto ELF64_ST_VISIBILITY(O)(O o) @safe { return o & 0x03; } +} + +struct Elf64_Verdef +{ + Elf64_Half vd_version; + Elf64_Half vd_flags; + Elf64_Half vd_ndx; + Elf64_Half vd_cnt; + Elf64_Word vd_hash; + Elf64_Word vd_aux; + Elf64_Word vd_next; +} + +struct Elf64_Verdaux +{ + Elf64_Word vda_name; + Elf64_Word vda_next; +} + +struct Elf64_Verneed +{ + Elf64_Half vn_version; + Elf64_Half vn_cnt; + Elf64_Word vn_file; + Elf64_Word vn_aux; + Elf64_Word vn_next; +} + +struct Elf64_Vernaux +{ + Elf64_Word vna_hash; + Elf64_Half vna_flags; + Elf64_Half vna_other; + Elf64_Word vna_name; + Elf64_Word vna_next; +} + +alias Elf64_Half Elf64_Versym; + +struct Elf64_Syminfo +{ + Elf64_Half si_boundto; + Elf64_Half si_flags; +} diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/elf_common.d b/libphobos/libdruntime/core/sys/openbsd/sys/elf_common.d new file mode 100644 index 0000000..bcd2701 --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/elf_common.d @@ -0,0 +1,676 @@ +/** + * D header file for OpenBSD. + * + * Authors: Iain Buclaw + * Based-on: core/sys/freebsd/sys + */ +module core.sys.openbsd.sys.elf_common; + +version (OpenBSD): + +extern (C): + +import core.stdc.stdint; + +struct Elf_Note +{ + uint32_t n_namesz; + uint32_t n_descsz; + uint32_t n_type; +} + +struct Elf_GNU_Hash_Header +{ + uint32_t gh_nbuckets; + uint32_t gh_symndx; + uint32_t gh_maskwords; + uint32_t gh_shift2; +} + +enum EI_MAG0 = 0; +enum EI_MAG1 = 1; +enum EI_MAG2 = 2; +enum EI_MAG3 = 3; +enum EI_CLASS = 4; +enum EI_DATA = 5; +enum EI_VERSION = 6; +enum EI_OSABI = 7; +enum EI_ABIVERSION = 8; +enum OLD_EI_BRAND = 8; +enum EI_PAD = 9; +enum EI_NIDENT = 16; + +enum ELFMAG0 = 0x7f; +enum ELFMAG1 = 'E'; +enum ELFMAG2 = 'L'; +enum ELFMAG3 = 'F'; +enum ELFMAG = "\177ELF"; +enum SELFMAG = 4; + +enum EV_NONE = 0; +enum EV_CURRENT = 1; + +enum ELFCLASSNONE = 0; +enum ELFCLASS32 = 1; +enum ELFCLASS64 = 2; + +enum ELFDATANONE = 0; +enum ELFDATA2LSB = 1; +enum ELFDATA2MSB = 2; + +enum ELFOSABI_NONE = 0; +enum ELFOSABI_SYSV = 0; +enum ELFOSABI_HPUX = 1; +enum ELFOSABI_NETBSD = 2; +enum ELFOSABI_LINUX = 3; +enum ELFOSABI_HURD = 4; +enum ELFOSABI_86OPEN = 5; +enum ELFOSABI_SOLARIS = 6; +enum ELFOSABI_AIX = 7; +enum ELFOSABI_MONTEREY = 7; +enum ELFOSABI_IRIX = 8; +enum ELFOSABI_FREEBSD = 9; +enum ELFOSABI_TRU64 = 10; +enum ELFOSABI_MODESTO = 11; +enum ELFOSABI_OPENBSD = 12; +enum ELFOSABI_OPENVMS = 13; +enum ELFOSABI_NSK = 14; +enum ELFOSABI_AROS = 15; +enum ELFOSABI_ARM = 97; +enum ELFOSABI_STANDALONE = 255; + +// just a pointer +enum ELFOSABI_DRAGONFLYBSD = ELFOSABI_NONE; + +extern (D) pure @safe +{ + auto IS_ELF(T)(T ehdr) { return ehdr.e_ident[EI_MAG0] == ELFMAG0 && + ehdr.e_ident[EI_MAG1] == ELFMAG1 && + ehdr.e_ident[EI_MAG2] == ELFMAG2 && + ehdr.e_ident[EI_MAG3] == ELFMAG3; } +} + +enum ET_NONE = 0; +enum ET_REL = 1; +enum ET_EXEC = 2; +enum ET_DYN = 3; +enum ET_CORE = 4; +enum ET_LOOS = 0xfe00; +enum ET_HIOS = 0xfeff; +enum ET_LOPROC = 0xff00; +enum ET_HIPROC = 0xffff; + +enum EM_NONE = 0; +enum EM_M32 = 1; +enum EM_SPARC = 2; +enum EM_386 = 3; +enum EM_68K = 4; +enum EM_88K = 5; +enum EM_860 = 7; +enum EM_MIPS = 8; +enum EM_S370 = 9; +enum EM_MIPS_RS3_LE = 10; +enum EM_PARISC = 15; +enum EM_VPP500 = 17; +enum EM_SPARC32PLUS = 18; +enum EM_960 = 19; +enum EM_PPC = 20; +enum EM_PPC64 = 21; +enum EM_S390 = 22; +enum EM_V800 = 36; +enum EM_FR20 = 37; +enum EM_RH32 = 38; +enum EM_RCE = 39; +enum EM_ARM = 40; +enum EM_SH = 42; +enum EM_SPARCV9 = 43; +enum EM_TRICORE = 44; +enum EM_ARC = 45; +enum EM_H8_300 = 46; +enum EM_H8_300H = 47; +enum EM_H8S = 48; +enum EM_H8_500 = 49; +enum EM_IA_64 = 50; +enum EM_MIPS_X = 51; +enum EM_COLDFIRE = 52; +enum EM_68HC12 = 53; +enum EM_MMA = 54; +enum EM_PCP = 55; +enum EM_NCPU = 56; +enum EM_NDR1 = 57; +enum EM_STARCORE = 58; +enum EM_ME16 = 59; +enum EM_ST100 = 60; +enum EM_TINYJ = 61; +enum EM_X86_64 = 62; +enum EM_AMD64 = 62; +enum EM_PDSP = 63; +enum EM_FX66 = 66; +enum EM_ST9PLUS = 67; +enum EM_ST7 = 68; +enum EM_68HC16 = 69; +enum EM_68HC11 = 70; +enum EM_68HC08 = 71; +enum EM_68HC05 = 72; +enum EM_SVX = 73; +enum EM_ST19 = 74; +enum EM_VAX = 75; +enum EM_CRIS = 76; +enum EM_JAVELIN = 77; +enum EM_FIREPATH = 78; +enum EM_ZSP = 79; +enum EM_MMIX = 80; +enum EM_HUANY = 81; +enum EM_PRISM = 82; +enum EM_AVR = 83; +enum EM_FR30 = 84; +enum EM_D10V = 85; +enum EM_D30V = 86; +enum EM_V850 = 87; +enum EM_M32R = 88; +enum EM_MN10300 = 89; +enum EM_MN10200 = 90; +enum EM_PJ = 91; +enum EM_OPENRISC = 92; +enum EM_ARC_A5 = 93; +enum EM_XTENSA = 94; +enum EM_VIDEOCORE = 95; +enum EM_TMM_GPP = 96; +enum EM_NS32K = 97; +enum EM_TPC = 98; +enum EM_SNP1K = 99; +enum EM_ST200 = 100; +enum EM_IP2K = 101; +enum EM_MAX = 102; +enum EM_CR = 103; +enum EM_F2MC16 = 104; +enum EM_MSP430 = 105; +enum EM_BLACKFIN = 106; +enum EM_SE_C33 = 107; +enum EM_SEP = 108; +enum EM_ARCA = 109; +enum EM_UNICORE = 110; +enum EM_DXP = 112; +enum EM_ALTERA_NIOS2 =113; +enum EM_CRX = 114; +enum EM_XGATE = 115; +enum EM_C166 = 116; +enum EM_M16C = 117; +enum EM_DSPIC30F = 118; +enum EM_CE = 119; +enum EM_M32C = 120; +enum EM_res121 = 121; +enum EM_res122 = 122; +enum EM_res123 = 123; +enum EM_res124 = 124; +enum EM_res125 = 125; +enum EM_res126 = 126; +enum EM_res127 = 127; +enum EM_res128 = 128; +enum EM_res129 = 129; +enum EM_res130 = 130; +enum EM_TSK3000 = 131; +enum EM_RS08 = 132; +enum EM_res133 = 133; +enum EM_ECOG2 = 134; +enum EM_SCORE = 135; +enum EM_SCORE7 = 135; +enum EM_DSP24 = 136; +enum EM_VIDEOCORE3 = 137; +enum EM_LATTICEMICO32 = 138; +enum EM_SE_C17 = 139; +enum EM_TI_C6000 = 140; +enum EM_TI_C2000 = 141; +enum EM_TI_C5500 = 142; +enum EM_res143 = 143; +enum EM_res144 = 144; +enum EM_res145 = 145; +enum EM_res146 = 146; +enum EM_res147 = 147; +enum EM_res148 = 148; +enum EM_res149 = 149; +enum EM_res150 = 150; +enum EM_res151 = 151; +enum EM_res152 = 152; +enum EM_res153 = 153; +enum EM_res154 = 154; +enum EM_res155 = 155; +enum EM_res156 = 156; +enum EM_res157 = 157; +enum EM_res158 = 158; +enum EM_res159 = 159; +enum EM_MMDSP_PLUS = 160; +enum EM_CYPRESS_M8C = 161; +enum EM_R32C = 162; +enum EM_TRIMEDIA = 163; +enum EM_QDSP6 = 164; +enum EM_8051 = 165; +enum EM_STXP7X = 166; +enum EM_NDS32 = 167; +enum EM_ECOG1 = 168; +enum EM_ECOG1X = 168; +enum EM_MAXQ30 = 169; +enum EM_XIMO16 = 170; +enum EM_MANIK = 171; +enum EM_CRAYNV2 = 172; +enum EM_RX = 173; +enum EM_METAG = 174; +enum EM_MCST_ELBRUS = 175; +enum EM_ECOG16 = 176; +enum EM_CR16 = 177; +enum EM_ETPU = 178; +enum EM_SLE9X = 179; +enum EM_L1OM = 180; +enum EM_K1OM = 181; +enum EM_INTEL182 = 182; +enum EM_res183 = 183; +enum EM_res184 = 184; +enum EM_AVR32 = 185; +enum EM_STM8 = 186; +enum EM_TILE64 = 187; +enum EM_TILEPRO = 188; +enum EM_MICROBLAZE = 189; +enum EM_CUDA = 190; +enum EM_TILEGX = 191; + +enum EM_486 = 6; +enum EM_MIPS_RS4_BE = 10; +enum EM_ALPHA_STD = 41; +enum EM_ALPHA = 0x9026; + +enum SHN_UNDEF = 0; +enum SHN_LORESERVE = 0xff00; +enum SHN_LOPROC = 0xff00; +enum SHN_HIPROC = 0xff1f; +enum SHN_LOOS = 0xff20; +enum SHN_HIOS = 0xff3f; +enum SHN_ABS = 0xfff1; +enum SHN_COMMON = 0xfff2; +enum SHN_XINDEX = 0xffff; +enum SHN_HIRESERVE = 0xffff; + +enum PT_NULL = 0; +enum PT_LOAD = 1; +enum PT_DYNAMIC = 2; +enum PT_INTERP = 3; +enum PT_NOTE = 4; +enum PT_SHLIB = 5; +enum PT_PHDR = 6; +enum PT_TLS = 7; +enum PT_LOOS = 0x60000000; +enum PT_HIOS = 0x6fffffff; +enum PT_LOPROC = 0x70000000; +enum PT_HIPROC = 0x7fffffff; + +enum PT_GNU_EH_FRAME = PT_LOOS + 0x474e550; /* Frame unwind information */ +enum PT_SUNW_EH_FRAME = PT_GNU_EH_FRAME; /* Solaris uses the same value */ +enum PT_GNU_STACK = PT_LOOS + 0x474e551; /* Stack flags */ +enum PT_GNU_RELRO = PT_LOOS + 0x474e552; /* Read-only after relocation */ + +enum PF_X = 0x1; +enum PF_W = 0x2; +enum PF_R = 0x4; +enum PF_MASKOS = 0x0ff00000; +enum PF_MASKPROC = 0xf0000000; + +enum PN_XNUM = 0xffff; + +enum SHT_NULL = 0; +enum SHT_PROGBITS = 1; +enum SHT_SYMTAB = 2; +enum SHT_STRTAB = 3; +enum SHT_RELA = 4; +enum SHT_HASH = 5; +enum SHT_DYNAMIC = 6; +enum SHT_NOTE = 7; +enum SHT_NOBITS = 8; +enum SHT_REL = 9; +enum SHT_SHLIB = 10; +enum SHT_DYNSYM = 11; + +enum SHT_INIT_ARRAY = 14; +enum SHT_FINI_ARRAY = 15; +enum SHT_PREINIT_ARRAY = 16; +enum SHT_GROUP = 17; +enum SHT_SYMTAB_SHNDX = 18; + +enum SHT_LOOS = 0x60000000; +enum SHT_LOSUNW = 0x6ffffff4; + +enum SHT_GNU_INCREMENTAL_INPUTS = 0x6fff4700; +enum SHT_GNU_ATTRIBUTES = 0x6ffffff5; +enum SHT_GNU_HASH = 0x6ffffff6; +enum SHT_GNU_LIBLIST = 0x6ffffff7; + +//enum SHT_SUNW_dof = 0x6ffffff4; +//enum SHT_SUNW_cap = 0x6ffffff5; +//enum SHT_SUNW_SIGNATURE = 0x6ffffff6; +enum SHT_SUNW_verdef = 0x6ffffffd; +enum SHT_SUNW_verneed = 0x6ffffffe; +enum SHT_SUNW_versym = 0x6fffffff; + +enum SHT_GNU_verdef = SHT_SUNW_verdef; +enum SHT_GNU_verneed = SHT_SUNW_verneed; +enum SHT_GNU_versym = SHT_SUNW_versym; + +enum SHT_LOPROC = 0x70000000; +enum SHT_HIPROC = 0x7fffffff; +enum SHT_LOUSER = 0x80000000; +enum SHT_HIUSER = 0x8fffffff; + +/* +enum SHT_GNU_HASH = 0x6ffffff6; +enum SHT_SUNW_ANNOTATE = 0x6ffffff7; +enum SHT_SUNW_DEBUGSTR = 0x6ffffff8; +enum SHT_SUNW_DEBUG = 0x6ffffff9; +enum SHT_SUNW_move = 0x6ffffffa; +enum SHT_SUNW_COMDAT = 0x6ffffffb; +enum SHT_SUNW_syminfo = 0x6ffffffc; +enum SHT_HISUNW = 0x6fffffff; +enum SHT_HIOS = 0x6fffffff; +enum SHT_AMD64_UNWIND = 0x70000001; +enum SHT_ARM_EXIDX = 0x70000001; +enum SHT_ARM_PREEMPTMAP = 0x70000002; +enum SHT_ARM_ATTRIBUTES = 0x70000003; +enum SHT_ARM_DEBUGOVERLAY = 0x70000004; +enum SHT_ARM_OVERLAYSECTION = 0x70000005; +enum SHT_MIPS_REGINFO = 0x70000006; +enum SHT_MIPS_OPTIONS = 0x7000000d; +enum SHT_MIPS_DWARF = 0x7000001e; +*/ + +enum SHF_WRITE = (1 << 0); +enum SHF_ALLOC = (1 << 1); +enum SHF_EXECINSTR = (1 << 2); +enum SHF_MERGE = (1 << 4); +enum SHF_STRINGS = (1 << 5); +enum SHF_INFO_LINK = (1 << 6); +enum SHF_LINK_ORDER = (1 << 7); +enum SHF_OS_NONCONFORMING = (1 << 8); +enum SHF_GROUP = (1 << 9); +enum SHF_TLS = (1 << 10); +enum SHF_COMPRESSED = (1 << 11); + +enum SHF_MASKOS = 0x0ff00000; +enum SHF_MASKPROC = 0xf0000000; + +enum NT_PRSTATUS = 1; +enum NT_FPREGSET = 2; +enum NT_PRPSINFO = 3; +enum NT_TASKSTRUCT = 4; +enum NT_AUXV = 6; + +/* +enum NT_THRMISC = 7; +enum NT_PROCSTAT_PROC = 8; +enum NT_PROCSTAT_FILES = 9; +enum NT_PROCSTAT_VMMAP = 10; +enum NT_PROCSTAT_GROUPS = 11; +enum NT_PROCSTAT_UMASK = 12; +enum NT_PROCSTAT_RLIMIT = 13; +enum NT_PROCSTAT_OSREL = 14; +enum NT_PROCSTAT_PSSTRINGS = 15; +enum NT_PROCSTAT_AUXV = 16; +*/ + +enum STN_UNDEF = 0; + +enum STB_LOCAL = 0; +enum STB_GLOBAL = 1; +enum STB_WEAK = 2; +enum STB_NUM = 3; +enum STB_LOOS = 10; +enum STB_HIOS = 12; +enum STB_LOPROC = 13; +enum STB_HIPROC = 15; + +enum STT_NOTYPE = 0; +enum STT_OBJECT = 1; +enum STT_FUNC = 2; +enum STT_SECTION = 3; +enum STT_FILE = 4; +enum STT_COMMON = 5; +enum STT_TLS = 6; +enum STT_NUM = 7; +enum STT_LOOS = 10; +enum STT_GNU_IFUNC = 10; +enum STT_HIOS = 12; +enum STT_LOPROC = 13; +enum STT_HIPROC = 15; + +enum STV_DEFAULT = 0; +enum STV_INTERNAL = 1; +enum STV_HIDDEN = 2; +enum STV_PROTECTED = 3; +/* +enum STV_EXPORTED = 4; +enum STV_SINGLETON = 5; +enum STV_ELIMINATE = 6; +*/ + +enum DT_NULL = 0; +enum DT_NEEDED = 1; +enum DT_PLTRELSZ = 2; +enum DT_PLTGOT = 3; +enum DT_HASH = 4; +enum DT_STRTAB = 5; +enum DT_SYMTAB = 6; +enum DT_RELA = 7; +enum DT_RELASZ = 8; +enum DT_RELAENT = 9; +enum DT_STRSZ = 10; +enum DT_SYMENT = 11; +enum DT_INIT = 12; +enum DT_FINI = 13; +enum DT_SONAME = 14; +enum DT_RPATH = 15; +enum DT_SYMBOLIC = 16; +enum DT_REL = 17; +enum DT_RELSZ = 18; +enum DT_RELENT = 19; +enum DT_PLTREL = 20; +enum DT_DEBUG = 21; +enum DT_TEXTREL = 22; +enum DT_JMPREL = 23; +enum DT_BIND_NOW = 24; +enum DT_INIT_ARRAY = 25; +enum DT_FINI_ARRAY = 26; +enum DT_INIT_ARRAYSZ = 27; +enum DT_FINI_ARRAYSZ = 28; +enum DT_RUNPATH = 29; +enum DT_FLAGS = 30; + +enum DT_ENCODING = 32; +enum DT_PREINIT_ARRAY = 32; +enum DT_PREINIT_ARRAYSZ = 33; +//enum DT_MAXPOSTAGS = 34; +enum DT_LOOS = 0x6000000d; +enum DT_HIOS = 0x6ffff000; +/* +enum DT_SUNW_AUXILIARY = 0x6000000d; +enum DT_SUNW_RTLDINF = 0x6000000e; +enum DT_SUNW_FILTER = 0x6000000f; +enum DT_SUNW_CAP = 0x60000010; +*/ + +enum DT_VALRNGLO = 0x6ffffd00; +enum DT_GNU_PRELINKED = 0x6ffffdf5; +enum DT_GNU_CONFLICTSZ =0x6ffffdf6; +enum DT_GNU_LIBLISTSZ = 0x6ffffdf7; +enum DT_CHECKSUM = 0x6ffffdf8; +enum DT_PLTPADSZ = 0x6ffffdf9; +enum DT_MOVEENT = 0x6ffffdfa; +enum DT_MOVESZ = 0x6ffffdfb; +enum DT_FEATURE_1 = 0x6ffffdfc; +enum DT_POSFLAG_1 = 0x6ffffdfd; +enum DT_SYMINSZ = 0x6ffffdfe; +enum DT_SYMINENT = 0x6ffffdff; +enum DT_VALRNGHI = 0x6ffffdff; +enum DT_ADDRRNGLO = 0x6ffffe00; +enum DT_GNU_HASH = 0x6ffffef5; +enum DT_TLSDESC_PLT = 0x6ffffef6; +enum DT_TLSDESC_GOT = 0x6ffffef7; +enum DT_GNU_CONFLICT = 0x6ffffef8; +enum DT_GNU_LIBLIST = 0x6ffffef9; +enum DT_CONFIG = 0x6ffffefa; +enum DT_DEPAUDIT = 0x6ffffefb; +enum DT_AUDIT = 0x6ffffefc; +enum DT_PLTPAD = 0x6ffffefd; +enum DT_MOVETAB = 0x6ffffefe; +enum DT_SYMINFO = 0x6ffffeff; +enum DT_ADDRRNGHI = 0x6ffffeff; +enum DT_RELACOUNT = 0x6ffffff9; +enum DT_RELCOUNT = 0x6ffffffa; +enum DT_FLAGS_1 = 0x6ffffffb; +enum DT_VERDEF = 0x6ffffffc; +enum DT_VERDEFNUM = 0x6ffffffd; +enum DT_VERNEED = 0x6ffffffe; +enum DT_VERNEEDNUM = 0x6fffffff; +enum DT_VERSYM = 0x6ffffff0; +enum DT_LOPROC = 0x70000000; +//enum DT_DEPRECATED_SPARC_REGISTER = 0x7000001; +enum DT_AUXILIARY = 0x7ffffffd; +enum DT_USED = 0x7ffffffe; +enum DT_FILTER = 0x7fffffff; +enum DT_HIPROC = 0x7fffffff; + +enum DTF_1_PARINIT = 0x00000001; +enum DTF_1_CONFEXP = 0x00000002; + +enum DF_P1_LAZYLOAD = 0x00000001; +enum DF_P1_GROUPPERM= 0x00000002; + +enum DF_1_NOW = 0x00000001; +enum DF_1_BIND_NOW = 0x00000001; +enum DF_1_GLOBAL = 0x00000002; +enum DF_1_GROUP = 0x00000004; +enum DF_1_NODELETE = 0x00000008; +enum DF_1_LOADFLTR = 0x00000010; +enum DF_1_INITFIRST = 0x00000020; +enum DF_1_NOOPEN = 0x00000040; +enum DF_1_ORIGIN = 0x00000080; +enum DF_1_DIRECT = 0x00000100; +enum DF_1_TRANS = 0x00000200; +enum DF_1_INTERPOSE = 0x00000400; +enum DF_1_NODEFLIB = 0x00000800; +enum DF_1_NODUMP = 0x00001000; +enum DF_1_CONLFAT = 0x00002000; + +enum DF_ORIGIN = 0x00000001; +enum DF_SYMBOLIC = 0x00000002; +enum DF_TEXTREL = 0x00000004; +enum DF_BIND_NOW = 0x00000008; +enum DF_STATIC_TLS = 0x00000010; + +enum VER_DEF_NONE = 0; +enum VER_DEF_CURRENT = 1; +alias VER_NDX VER_DEF_IDX; + +enum VER_FLG_BASE = 0x1; +enum VER_FLG_WEAK = 0x2; +enum VER_FLG_INFO = 0x4; + +enum VER_NDX_LOCAL = 0; +enum VER_NDX_GLOBAL = 1; +enum VER_NDX_GIVEN = 2; +enum VER_NDX_HIDDEN = 32768; +extern (D) pure @safe +{ + auto VER_NDX(V)(V v) { return v & ~(1u << 15); } +} + +enum VER_NEED_NONE = 0; +enum VER_NEED_CURRENT = 1; +enum VER_NEED_WEAK = 32768; +enum VER_NEED_HIDDEN = VER_NDX_HIDDEN; +alias VER_NDX VER_NEED_IDX; + +/* +enum CA_SUNW_NULL = 0; +enum CA_SUNW_HW_1 = 1; +enum CA_SUNW_SF_1 = 2; +*/ + +enum VERSYM_HIDDEN = 0x8000; +enum VERSYM_VERSION = 0x7fff; +enum ELF_VER_CHR = '@'; + +enum SYMINFO_BT_SELF = 0xffff; +enum SYMINFO_BT_PARENT = 0xfffe; +//enum SYMINFO_BT_NONE = 0xfffd; +//enum SYMINFO_BT_EXTERN = 0xfffc; +enum SYMINFO_BT_LOWRESERVE = 0xff00; + +enum SYMINFO_FLG_DIRECT = 0x0001; +enum SYMINFO_FLG_PASSTHRU = 0x0002; +enum SYMINFO_FLG_COPY = 0x0004; +enum SYMINFO_FLG_LAZYLOAD = 0x0008; +//enum SYMINFO_FLG_DIRECTBIND = 0x0010; +//enum SYMINFO_FLG_NOEXTDIRECT = 0x0020; +//enum SYMINFO_FLG_FILTER = 0x0002; +//enum SYMINFO_FLG_AUXILIARY = 0x0040; + +enum SYMINFO_NONE = 0; +enum SYMINFO_CURRENT = 1; +enum SYMINFO_NUM = 2; + +enum GRP_COMDAT = 0x1; + +enum R_386_NONE = 0; +enum R_386_32 = 1; +enum R_386_PC32 = 2; +enum R_386_GOT32 = 3; +enum R_386_PLT32 = 4; +enum R_386_COPY = 5; +enum R_386_GLOB_DAT = 6; +enum R_386_JMP_SLOT = 7; +enum R_386_RELATIVE = 8; +enum R_386_GOTOFF = 9; +enum R_386_GOTPC = 10; +enum R_386_TLS_TPOFF = 14; +enum R_386_TLS_IE = 15; +enum R_386_TLS_GOTIE = 16; +enum R_386_TLS_LE = 17; +enum R_386_TLS_GD = 18; +enum R_386_TLS_LDM = 19; +enum R_386_TLS_GD_32 = 24; +enum R_386_TLS_GD_PUSH = 25; +enum R_386_TLS_GD_CALL = 26; +enum R_386_TLS_GD_POP = 27; +enum R_386_TLS_LDM_32 = 28; +enum R_386_TLS_LDM_PUSH = 29; +enum R_386_TLS_LDM_CALL = 30; +enum R_386_TLS_LDM_POP = 31; +enum R_386_TLS_LDO_32 = 32; +enum R_386_TLS_IE_32 = 33; +enum R_386_TLS_LE_32 = 34; +enum R_386_TLS_DTPMOD32 = 35; +enum R_386_TLS_DTPOFF32 = 36; +enum R_386_TLS_TPOFF32 = 37; +enum R_386_IRELATIVE = 42; + +enum R_X86_64_NONE = 0; +enum R_X86_64_64 = 1; +enum R_X86_64_PC32 = 2; +enum R_X86_64_GOT32 = 3; +enum R_X86_64_PLT32 = 4; +enum R_X86_64_COPY = 5; +enum R_X86_64_GLOB_DAT = 6; +enum R_X86_64_JMP_SLOT = 7; +enum R_X86_64_RELATIVE = 8; +enum R_X86_64_GOTPCREL = 9; +enum R_X86_64_32 = 10; +enum R_X86_64_32S = 11; +enum R_X86_64_16 = 12; +enum R_X86_64_PC16 = 13; +enum R_X86_64_8 = 14; +enum R_X86_64_PC8 = 15; +enum R_X86_64_DTPMOD64 = 16; +enum R_X86_64_DTPOFF64 = 17; +enum R_X86_64_TPOFF64 = 18; +enum R_X86_64_TLSGD = 19; +enum R_X86_64_TLSLD = 20; +enum R_X86_64_DTPOFF32 = 21; +enum R_X86_64_GOTTPOFF = 22; +enum R_X86_64_TPOFF32 = 23; +enum R_X86_64_IRELATIVE = 37; diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/link_elf.d b/libphobos/libdruntime/core/sys/openbsd/sys/link_elf.d new file mode 100644 index 0000000..3582b4c --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/link_elf.d @@ -0,0 +1,65 @@ +/** + * D header file for OpenBSD. + * + * Authors: Iain Buclaw + * Based-on: core/sys/freebsd/sys + */ +module core.sys.openbsd.sys.link_elf; + +version (OpenBSD): + +extern (C) nothrow @system: + +import core.sys.posix.config; +import core.sys.posix.sys.types; +import core.sys.openbsd.sys.elf; + +version (D_LP64) + enum __ELF_NATIVE_CLASS = 64; +else + enum __ELF_NATIVE_CLASS = 32; + +template ElfW(string type) +{ + mixin("alias Elf"~__ELF_NATIVE_CLASS.stringof~"_"~type~" ElfW;"); +} + +struct link_map +{ + caddr_t l_addr; + char* l_name; + void* l_ld; + link_map* l_next; + link_map* l_prev; +} + +enum +{ + RT_CONSISTENT, + RT_ADD, + RT_DELETE, +} + +struct r_debug +{ + int r_version; + link_map* r_map; + void function(r_debug*, link_map*) r_brk; + typeof(RT_CONSISTENT) r_state; + c_ulong r_ldbase; +} + +struct dl_phdr_info +{ + ElfW!"Addr" dlpi_addr; + char* dlpi_name; + ElfW!"Phdr"* dlpi_phdr; + ElfW!"Half" dlpi_phnum; +}; + + +private alias int function(dl_phdr_info*, size_t, void *) dl_iterate_phdr_cb; +private alias int function(dl_phdr_info*, size_t, void *) @nogc dl_iterate_phdr_cb_ngc; + +int dl_iterate_phdr(dl_iterate_phdr_cb __callback, void*__data); +int dl_iterate_phdr(dl_iterate_phdr_cb_ngc __callback, void*__data) @nogc; diff --git a/libphobos/libdruntime/core/sys/openbsd/sys/mman.d b/libphobos/libdruntime/core/sys/openbsd/sys/mman.d new file mode 100644 index 0000000..0e88207 --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/sys/mman.d @@ -0,0 +1,51 @@ +/** + * D header file for OpenBSD + * + * Authors: Iain Buclaw + * Based-on: core/sys/freebsd/sys + */ +module core.sys.openbsd.sys.mman; + +version (OpenBSD): +extern (C): +nothrow: + +public import core.sys.posix.sys.mman; +import core.sys.openbsd.sys.cdefs; +import core.sys.posix.sys.types; + +// already in core.sys.posix.sys.mman +// enum MAP_SHARED = 0x0001; +// enum MAP_PRIVATE = 0x0002; +// enum MAP_FIXED = 0x0010; +// enum MAP_ANON = 0x1000; + +alias MAP_ANONYMOUS = MAP_ANON; +enum MAP_STACK = 0x4000; + +enum MAP_FLAGMASK = 0x7ff7; + +alias MAP_COPY = MAP_PRIVATE; +enum MAP_FILE = 0; +enum MAP_HASSEMAPHORE = 0; +enum MAP_INHERIT = 0; +enum MAP_NOEXTEND = 0; +enum MAP_NORESERVE = 0; +enum MAP_RENAME = 0; +enum MAP_TRYFIXED = 0; + +static if (__BSD_VISIBLE) +{ + alias MADV_NORMAL = POSIX_MADV_NORMAL; + alias MADV_RANDOM = POSIX_MADV_RANDOM; + alias MADV_SEQUENTIAL = POSIX_MADV_SEQUENTIAL; + alias MADV_WILLNEED = POSIX_MADV_WILLNEED; + alias MADV_DONTNEED = POSIX_MADV_DONTNEED; + enum MADV_SPACEAVAIL = 5; + enum MADV_FREE = 6; + + int madvise(void *, size_t, int); + int mincore(const(void) *, size_t, char *); + int minherit(void *, size_t, int); + void* mquery(void *, size_t, int, int, int, off_t); +} diff --git a/libphobos/libdruntime/core/sys/openbsd/time.d b/libphobos/libdruntime/core/sys/openbsd/time.d new file mode 100644 index 0000000..43573f3 --- /dev/null +++ b/libphobos/libdruntime/core/sys/openbsd/time.d @@ -0,0 +1,21 @@ +//Written in the D programming language + +/++ + D header file for OpenBSD's extensions to POSIX's time.h. + + Copyright: Copyright 2019 + License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). + Authors: Iain Buclaw + +/ +module core.sys.openbsd.time; + +public import core.sys.posix.time; + +version (OpenBSD): + +enum CLOCK_REALTIME = 0; +enum CLOCK_PROCESS_CPUTIME_ID = 2; +enum CLOCK_MONOTONIC = 3; +enum CLOCK_THREAD_CPUTIME_ID = 4; +enum CLOCK_UPTIME = 5; +enum CLOCK_BOOTTIME = 6; diff --git a/libphobos/libdruntime/core/sys/posix/aio.d b/libphobos/libdruntime/core/sys/posix/aio.d index 954d2c3..1165446 100644 --- a/libphobos/libdruntime/core/sys/posix/aio.d +++ b/libphobos/libdruntime/core/sys/posix/aio.d @@ -72,6 +72,10 @@ version (CRuntime_Glibc) } } } +else version (CRuntime_Bionic) +{ + // Bionic does not define aiocb. +} else version (CRuntime_Musl) { // https://git.musl-libc.org/cgit/musl/tree/include/aio.h @@ -203,6 +207,10 @@ else version (NetBSD) version = BSD_Posix; } +else version (OpenBSD) +{ + // OpenBSD does not define aiocb. +} else version (DragonFlyBSD) { struct aiocb @@ -442,7 +450,11 @@ version (CRuntime_Glibc) int lio_listio(int mode, const(aiocb*)* aiocb_list, int nitems, sigevent* sevp); } } -version (CRuntime_UClibc) +else version (CRuntime_Bionic) +{ + // Bionic does not implement aio.h +} +else version (CRuntime_UClibc) { static if (__USE_LARGEFILE64) { @@ -476,6 +488,10 @@ version (CRuntime_UClibc) int lio_listio(int mode, const(aiocb*)* aiocb_list, int nitems, sigevent* sevp); } } +else version (OpenBSD) +{ + // OpenBSD does not implement aio.h +} else { int aio_read(aiocb* aiocbp); @@ -509,7 +525,7 @@ version (CRuntime_Glibc) void aio_init(const(aioinit)* init); } } -version (CRuntime_UClibc) +else version (CRuntime_UClibc) { static if (__USE_GNU) { diff --git a/libphobos/libdruntime/core/sys/posix/arpa/inet.d b/libphobos/libdruntime/core/sys/posix/arpa/inet.d index c7dc07f..ac8e3eb 100644 --- a/libphobos/libdruntime/core/sys/posix/arpa/inet.d +++ b/libphobos/libdruntime/core/sys/posix/arpa/inet.d @@ -158,6 +158,47 @@ else version (NetBSD) const(char)* inet_ntop(int, in void*, char*, socklen_t); int inet_pton(int, in char*, void*); } +else version (OpenBSD) +{ + alias uint16_t in_port_t; + alias uint32_t in_addr_t; + + struct in_addr + { + in_addr_t s_addr; + } + + enum INET_ADDRSTRLEN = 16; + + @safe pure extern (D) + { + private + { + uint32_t __swap32( uint32_t x ) + { + uint32_t byte32_swap = (x & 0xff) << 24 | (x &0xff00) << 8 | + (x & 0xff0000) >> 8 | (x & 0xff000000) >> 24; + return byte32_swap; + } + + uint16_t __swap16( uint16_t x ) + { + uint16_t byte16_swap = (x & 0xff) << 8 | (x & 0xff00) >> 8; + return byte16_swap; + } + } + + uint32_t htonl(uint32_t x) { return __swap32(x); } + uint16_t htons(uint16_t x) { return __swap16(x); } + uint32_t ntohl(uint32_t x) { return __swap32(x); } + uint16_t ntohs(uint16_t x) { return __swap16(x); } + } + + in_addr_t inet_addr(in char*); + char* inet_ntoa(in_addr); + const(char)* inet_ntop(int, in void*, char*, socklen_t); + int inet_pton(int, in char*, void*); +} else version (DragonFlyBSD) { alias uint16_t in_port_t; @@ -324,6 +365,10 @@ else version (NetBSD) { enum INET6_ADDRSTRLEN = 46; } +else version (OpenBSD) +{ + enum INET6_ADDRSTRLEN = 46; +} else version (DragonFlyBSD) { enum INET6_ADDRSTRLEN = 46; diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d index 61de958..38a75d6 100644 --- a/libphobos/libdruntime/core/sys/posix/config.d +++ b/libphobos/libdruntime/core/sys/posix/config.d @@ -111,6 +111,59 @@ else version (CRuntime_Bionic) { enum __USE_GNU = false; } +else version (OpenBSD) +{ + version (Alpha) + { + enum _ALIGNBYTES = 7; + enum _STACKALIGNBYTES = 7; + enum _MAX_PAGE_SHIFT = 13; + } + else version (X86_64) + { + enum _ALIGNBYTES = c_long.sizeof - 1; + enum _STACKALIGNBYTES = 15; + enum _MAX_PAGE_SHIFT = 12; + } + else version (AArch64) + { + enum _ALIGNBYTES = c_long.sizeof - 1; + enum _STACKALIGNBYTES = 15; + enum _MAX_PAGE_SHIFT = 12; + } + else version (ARM) + { + enum _ALIGNBYTES = 7; + enum _STACKALIGNBYTES = 7; + enum _MAX_PAGE_SHIFT = 12; + } + else version (HPPA) + { + enum _ALIGNBYTES = 7; + enum _STACKALIGNBYTES = 7; + enum _MAX_PAGE_SHIFT = 12; + } + else version (X86) + { + enum _ALIGNBYTES = 3; + enum _STACKALIGNBYTES = 15; + enum _MAX_PAGE_SHIFT = 12; + } + else version (PPC) + { + enum _ALIGNBYTES = 7; + enum _STACKALIGNBYTES = 15; + enum _MAX_PAGE_SHIFT = 12; + } + else version (SPARC64) + { + enum _ALIGNBYTES = 15; + enum _STACKALIGNBYTES = 15; + enum _MAX_PAGE_SHIFT = 13; + } + else + static assert(false, "Architecture not supported."); +} else version (Solaris) { enum _FILE_OFFSET_BITS = 64; diff --git a/libphobos/libdruntime/core/sys/posix/dirent.d b/libphobos/libdruntime/core/sys/posix/dirent.d index 95246fc..cea22d2 100644 --- a/libphobos/libdruntime/core/sys/posix/dirent.d +++ b/libphobos/libdruntime/core/sys/posix/dirent.d @@ -506,7 +506,7 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - + int readdir_r(DIR*, dirent*, dirent**); } else version (CRuntime_UClibc) { @@ -591,6 +591,8 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + void seekdir(DIR*, c_long); + c_long telldir(DIR*); } else version (CRuntime_UClibc) { diff --git a/libphobos/libdruntime/core/sys/posix/net/if_.d b/libphobos/libdruntime/core/sys/posix/net/if_.d index b7ea859..e6eb57b 100644 --- a/libphobos/libdruntime/core/sys/posix/net/if_.d +++ b/libphobos/libdruntime/core/sys/posix/net/if_.d @@ -106,6 +106,21 @@ else version (NetBSD) if_nameindex_t* if_nameindex(); void if_freenameindex(if_nameindex_t*); } +else version (OpenBSD) +{ + struct if_nameindex_t + { + uint if_index; + char* if_name; + } + + enum IF_NAMESIZE = 16; + + uint if_nametoindex(in char*); + char* if_indextoname(uint, char*); + if_nameindex_t* if_nameindex(); + void if_freenameindex(if_nameindex_t*); +} else version (DragonFlyBSD) { struct if_nameindex_t diff --git a/libphobos/libdruntime/core/sys/posix/netinet/in_.d b/libphobos/libdruntime/core/sys/posix/netinet/in_.d index 82da6c7..ef20a8f 100644 --- a/libphobos/libdruntime/core/sys/posix/netinet/in_.d +++ b/libphobos/libdruntime/core/sys/posix/netinet/in_.d @@ -246,6 +246,40 @@ else version (NetBSD) //enum INET_ADDRSTRLEN = 16; } +else version (OpenBSD) +{ + struct sockaddr_in + { + ubyte sin_len; + sa_family_t sin_family; + in_port_t sin_port; + in_addr sin_addr; + ubyte[8] sin_zero; + } + + enum + { + IPPROTO_IP = 0, + IPPROTO_ICMP = 1, + IPPROTO_IGMP = 2, + IPPROTO_GGP = 3, + IPPROTO_TCP = 6, + IPPROTO_PUP = 12, + IPPROTO_UDP = 17, + IPPROTO_IDP = 22, + IPPROTO_MAX = 256 + } + + enum : uint + { + INADDR_ANY = 0x00000000, + INADDR_BROADCAST = 0xffffffff, + INADDR_LOOPBACK = 0x7f000001, + INADDR_NONE = 0xffffffff + } + + enum INET_ADDRSTRLEN = 16; +} else version (DragonFlyBSD) { //alias uint16_t in_port_t; @@ -991,6 +1025,145 @@ else version (NetBSD) __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL; } } +else version (OpenBSD) +{ + struct in6_addr + { + union + { + uint8_t[16] s6_addr; + uint16_t[8] s6_addr16; + uint32_t[4] s6_addr32; + } + } + + struct sockaddr_in6 + { + uint8_t sin6_len; + sa_family_t sin6_family; + in_port_t sin6_port; + uint32_t sin6_flowinfo; + in6_addr sin6_addr; + uint32_t sin6_scope_id; + } + + extern __gshared immutable in6_addr in6addr_any; + extern __gshared immutable in6_addr in6addr_loopback; + + struct ipv6_mreq + { + in6_addr ipv6mr_multiaddr; + uint ipv6mr_interface; + } + + enum : uint + { + IPPROTO_IPV6 = 41, + + INET6_ADDRSTRLEN = 46, + + IPV6_JOIN_GROUP = 12, + IPV6_LEAVE_GROUP = 13, + IPV6_MULTICAST_HOPS = 10, + IPV6_MULTICAST_IF = 9, + IPV6_MULTICAST_LOOP = 11, + IPV6_UNICAST_HOPS = 4, + IPV6_V6ONLY = 27, + } + + private enum + { + __IPV6_ADDR_SCOPE_NODELOCAL = 0x01, + __IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01, + __IPV6_ADDR_SCOPE_LINKLOCAL = 0x02, + __IPV6_ADDR_SCOPE_SITELOCAL = 0x05, + __IPV6_ADDR_SCOPE_ORGLOCAL = 0x08, + __IPV6_ADDR_SCOPE_GLOBAL = 0x0e, + } + + // macros + extern (D) int IN6_IS_ADDR_UNSPECIFIED( in in6_addr* a ) pure + { + return (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[0]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[4]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[8]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[12]) == 0); + } + + extern (D) int IN6_IS_ADDR_LOOPBACK( in in6_addr* a ) pure + { + return (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[0]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[4]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[8]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[12]) == ntohl(1)); + } + + extern (D) int IN6_IS_ADDR_V4COMPAT( in in6_addr* a ) pure + { + return (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[0]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[4]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[8]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[12]) != 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[12]) != ntohl(1)); + } + + extern (D) int IN6_IS_ADDR_V4MAPPED( in in6_addr* a ) pure + { + return (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[0]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[4]) == 0) && + (*cast(const uint32_t*) cast(const void*) (&a.s6_addr[8]) == ntohl(0x0000ffff)); + } + + extern (D) int IN6_IS_ADDR_LINKLOCAL( in in6_addr* a ) pure + { + return a.s6_addr[0] == 0xfe && (a.s6_addr[1] & 0xc0) == 0x80; + } + + extern (D) int IN6_IS_ADDR_SITELOCAL( in in6_addr* a ) pure + { + return a.s6_addr[0] == 0xfe && (a.s6_addr[1] & 0xc0) == 0xc0; + } + + extern (D) int IN6_IS_ADDR_MULTICAST( in in6_addr* a ) pure + { + return a.s6_addr[0] == 0xff; + } + + extern (D) uint8_t __IPV6_ADDR_MC_SCOPE( in in6_addr* a ) pure + { + return a.s6_addr[1] & 0x0f; + } + + extern (D) int IN6_IS_ADDR_MC_NODELOCAL( in in6_addr* a ) pure + { + return IN6_IS_ADDR_MULTICAST(a) && + __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL; + } + + extern (D) int IN6_IS_ADDR_MC_LINKLOCAL( in in6_addr* a ) pure + { + return IN6_IS_ADDR_MULTICAST(a) && + __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL; + } + + extern (D) int IN6_IS_ADDR_MC_SITELOCAL( in in6_addr* a ) pure + { + return IN6_IS_ADDR_MULTICAST(a) && + __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL; + } + + extern (D) int IN6_IS_ADDR_MC_ORGLOCAL( in in6_addr* a ) pure + { + return IN6_IS_ADDR_MULTICAST(a) && + __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL; + } + + extern (D) int IN6_IS_ADDR_MC_GLOBAL( in in6_addr* a ) pure + { + return IN6_IS_ADDR_MULTICAST(a) && + __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL; + } +} else version (DragonFlyBSD) { struct in6_addr @@ -1576,6 +1749,10 @@ else version (NetBSD) { enum uint IPPROTO_RAW = 255; } +else version (OpenBSD) +{ + enum uint IPPROTO_RAW = 255; +} else version (DragonFlyBSD) { enum uint IPPROTO_RAW = 255; diff --git a/libphobos/libdruntime/core/sys/posix/netinet/tcp.d b/libphobos/libdruntime/core/sys/posix/netinet/tcp.d index 7c16812..134e133 100644 --- a/libphobos/libdruntime/core/sys/posix/netinet/tcp.d +++ b/libphobos/libdruntime/core/sys/posix/netinet/tcp.d @@ -51,6 +51,10 @@ else version (NetBSD) { enum TCP_NODELAY = 1; } +else version (OpenBSD) +{ + enum TCP_NODELAY = 1; +} else version (DragonFlyBSD) { enum TCP_NODELAY = 1; diff --git a/libphobos/libdruntime/core/sys/posix/pthread.d b/libphobos/libdruntime/core/sys/posix/pthread.d index 8c9df37..1d0d294 100644 --- a/libphobos/libdruntime/core/sys/posix/pthread.d +++ b/libphobos/libdruntime/core/sys/posix/pthread.d @@ -854,7 +854,15 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + enum PTHREAD_BARRIER_SERIAL_THREAD = -1; + int pthread_barrier_destroy(pthread_barrier_t*); + int pthread_barrier_init(pthread_barrier_t*, in pthread_barrierattr_t*, uint); + int pthread_barrier_wait(pthread_barrier_t*); + int pthread_barrierattr_destroy(pthread_barrierattr_t*); + int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, int*); + int pthread_barrierattr_init(pthread_barrierattr_t*); + int pthread_barrierattr_setpshared(pthread_barrierattr_t*, int); } else version (CRuntime_UClibc) { @@ -880,6 +888,55 @@ else int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); */ +version (CRuntime_Glibc) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (FreeBSD) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (DragonFlyBSD) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (NetBSD) +{ + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (OpenBSD) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (Darwin) +{ +} +else version (Solaris) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (CRuntime_Bionic) +{ +} +else version (CRuntime_Musl) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else version (CRuntime_UClibc) +{ + int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*); + int pthread_condattr_setclock(pthread_condattr_t*, clockid_t); +} +else +{ + static assert(false, "Unsupported platform"); +} // // Spinlock (SPI) @@ -948,7 +1005,11 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - + int pthread_spin_destroy(pthread_spinlock_t*); + int pthread_spin_init(pthread_spinlock_t*, int); + int pthread_spin_lock(pthread_spinlock_t*); + int pthread_spin_trylock(pthread_spinlock_t*); + int pthread_spin_unlock(pthread_spinlock_t*); } else version (CRuntime_UClibc) { @@ -1187,7 +1248,7 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - + int pthread_getcpuclockid(pthread_t, clockid_t*); } else version (CRuntime_UClibc) { @@ -1256,7 +1317,9 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - + int pthread_mutex_timedlock(pthread_mutex_t*, in timespec*); + int pthread_rwlock_timedrdlock(pthread_rwlock_t*, in timespec*); + int pthread_rwlock_timedwrlock(pthread_rwlock_t*, in timespec*); } else version (CRuntime_UClibc) { @@ -1693,7 +1756,12 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - + int pthread_condattr_getpshared(pthread_condattr_t*, int*); + int pthread_condattr_setpshared(pthread_condattr_t*, int); + int pthread_mutexattr_getpshared(pthread_mutexattr_t*, int*); + int pthread_mutexattr_setpshared(pthread_mutexattr_t*, int); + int pthread_rwlockattr_getpshared(pthread_rwlockattr_t*, int*); + int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int); } else version (CRuntime_UClibc) { diff --git a/libphobos/libdruntime/core/sys/posix/pwd.d b/libphobos/libdruntime/core/sys/posix/pwd.d index a90c940..9d9aaa3 100644 --- a/libphobos/libdruntime/core/sys/posix/pwd.d +++ b/libphobos/libdruntime/core/sys/posix/pwd.d @@ -172,7 +172,8 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - struct passwd { + struct passwd + { char *pw_name; char *pw_passwd; uid_t pw_uid; @@ -257,6 +258,8 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + int getpwnam_r(in char*, passwd*, char*, size_t, passwd**); + int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**); } else version (CRuntime_UClibc) { @@ -325,8 +328,9 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - int getpwnam_r(in char*, passwd*, char*, size_t, passwd**); - int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**); + void endpwent(); + passwd* getpwent(); + void setpwent(); } else version (CRuntime_UClibc) { diff --git a/libphobos/libdruntime/core/sys/posix/setjmp.d b/libphobos/libdruntime/core/sys/posix/setjmp.d index fcdbca4..38d4f70 100644 --- a/libphobos/libdruntime/core/sys/posix/setjmp.d +++ b/libphobos/libdruntime/core/sys/posix/setjmp.d @@ -22,6 +22,8 @@ extern (C) nothrow @nogc: version (RISCV32) version = RISCV_Any; version (RISCV64) version = RISCV_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; // // Required @@ -210,6 +212,11 @@ else version (FreeBSD) // __int128_t struct _jmp_buf { long[2][_JBLEN + 1] _jb; }; } + else version (PPC_Any) + { + enum _JBLEN = 100; + struct _jmp_buf { long[_JBLEN + 1] _jb; } + } else static assert(0); alias _jmp_buf[1] jmp_buf; @@ -417,6 +424,10 @@ else version (FreeBSD) // __int128_t struct _sigjmp_buf { long[2][_JBLEN + 1] _jb; }; } + else version (PPC_Any) + { + struct _sigjmp_buf { long[_JBLEN + 1] _sjb; } + } else static assert(0); alias _sigjmp_buf[1] sigjmp_buf; diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d index e795a21..ed3985e 100644 --- a/libphobos/libdruntime/core/sys/posix/signal.d +++ b/libphobos/libdruntime/core/sys/posix/signal.d @@ -1136,55 +1136,57 @@ else version (NetBSD) enum SIG_UNBLOCK = 2; enum SIG_SETMASK = 3; - union sigval_t { - int sival_int; - void *sival_ptr; - }; - struct _rt{ - pid_t _pid; - uid_t _uid; - sigval_t _value; - }; - struct _child{ - pid_t _pid; - uid_t _uid; - int _status; - clock_t _utime; - clock_t _stime; - }; - struct _fault{ - void *_addr; - int _trap; - int _trap2; - int _trap3; - }; - struct _poll{ - long _band; - int _fd; - }; - union _reason{ - _rt rt; - _child child; - _fault fault; - _poll poll; - }; - struct _ksiginfo { + union sigval_t + { + int sival_int; + void* sival_ptr; + } + + struct _ksiginfo + { int _signo; int _code; int _errno; -/+#ifdef _LP64 - /* In _LP64 the union starts on an 8-byte boundary. */ - int _pad; -#endif+/ - _reason reason; - }; + version (D_LP64) + int _pad; + union reason_t + { + struct rt_t + { + pid_t _pid; + uid_t _uid; + sigval_t _value; + } rt_t _rt; + struct child_t + { + pid_t _pid; + uid_t _uid; + int _status; + clock_t _utime; + clock_t _stime; + } child_t _child; + struct fault_t + { + void* _addr; + int _trap; + int _trap2; + int _trap3; + } fault_t fault; + struct poll_t + { + c_long _band; + int _fd; + } poll_t _poll; + } + reason_t _reason; + } union siginfo_t { - ubyte[128] si_pad;/* Total size; for future expansion */ + ubyte[128] si_pad; _ksiginfo _info; - @property ref c_long si_band() return { return _info.reason.poll._band; } + @property ref c_long si_band() return { return _info._reason._poll._band; } } enum SI_USER = 0; @@ -1589,27 +1591,53 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - struct sigset_t { - ulong[128/long.sizeof] __bits; + struct sigset_t + { + c_ulong[128/c_long.sizeof] __bits; } - enum SIG_BLOCK = 0; - enum SIG_UNBLOCK = 1; - enum SIG_SETMASK = 2; + version (MIPS_Any) + { + enum SIG_BLOCK = 1; + enum SIG_UNBLOCK = 2; + enum SIG_SETMASK = 3; + } + else + { + enum SIG_BLOCK = 0; + enum SIG_UNBLOCK = 1; + enum SIG_SETMASK = 2; + } - struct siginfo_t { - int si_signo, si_errno, si_code; - union __si_fields_t { - char[128 - 2*int.sizeof - long.sizeof] __pad = 0; - struct __si_common_t { - union __first_t { - struct __piduid_t { + struct siginfo_t + { + int si_signo; + version (MIPS_Any) // __SI_SWAP_ERRNO_CODE + { + int si_code; + int si_errno; + } + else + { + int si_errno; + int si_code; + } + union __si_fields_t + { + char[128 - 2*int.sizeof - c_long.sizeof] __pad = 0; + struct __si_common_t + { + union __first_t + { + struct __piduid_t + { pid_t si_pid; uid_t si_uid; } __piduid_t __piduid; - struct __timer_t { + struct __timer_t + { int si_timerid; int si_overrun; } @@ -1617,11 +1645,14 @@ else version (CRuntime_Musl) } __first_t __first; - union __second_t { + union __second_t + { sigval si_value; - struct __sigchld_t { + struct __sigchld_t + { int si_status; - clock_t si_utime, si_stime; + clock_t si_utime; + clock_t si_stime; } __sigchld_t __sigchld; } @@ -1629,11 +1660,14 @@ else version (CRuntime_Musl) } __si_common_t __si_common; - struct __sigfault_t { + struct __sigfault_t + { void *si_addr; short si_addr_lsb; - union __first_t { - struct __addr_bnd_t { + union __first_t + { + struct __addr_bnd_t + { void *si_lower; void *si_upper; } @@ -1644,13 +1678,15 @@ else version (CRuntime_Musl) } __sigfault_t __sigfault; - struct __sigpoll_t { - long si_band; + struct __sigpoll_t + { + c_long si_band; int si_fd; } __sigpoll_t __sigpoll; - struct __sigsys_t { + struct __sigsys_t + { void *si_call_addr; int si_syscall; uint si_arch; @@ -3030,7 +3066,177 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { - enum SA_RESTART = 0x10000000; + version (MIPS_Any) + { + enum SIGPOLL = 22; + enum SIGPROF = 29; + enum SIGSYS = 12; + enum SIGTRAP = 5; + enum SIGVTALRM = 28; + enum SIGXCPU = 30; + enum SIGXFSZ = 31; + + enum SA_ONSTACK = 0x08000000; + enum SA_RESETHAND = 0x80000000; + enum SA_RESTART = 0x10000000; + enum SA_SIGINFO = 8; + enum SA_NOCLDWAIT = 0x10000; + enum SA_NODEFER = 0x40000000; + } + else + { + enum SIGPOLL = 29; + enum SIGPROF = 27; + enum SIGSYS = 31; + enum SIGTRAP = 5; + enum SIGVTALRM = 26; + enum SIGXCPU = 24; + enum SIGXFSZ = 25; + + enum SA_ONSTACK = 0x08000000; + enum SA_RESETHAND = 0x80000000; + enum SA_RESTART = 0x10000000; + enum SA_SIGINFO = 4; + enum SA_NOCLDWAIT = 2; + enum SA_NODEFER = 0x40000000; + } + + enum SS_ONSTACK = 1; + enum SS_DISABLE = 2; + + version (ARM) + { + enum MINSIGSTKSZ = 2048; + enum SIGSTKSZ = 8192; + } + else version (AArch64) + { + enum MINSIGSTKSZ = 6144; + enum SIGSTKSZ = 12288; + } + else version (IBMZ_Any) + { + enum MINSIGSTKSZ = 4096; + enum SIGSTKSZ = 10240; + } + else version (MIPS_Any) + { + enum MINSIGSTKSZ = 2048; + enum SIGSTKSZ = 8192; + } + else version (PPC_Any) + { + enum MINSIGSTKSZ = 4096; + enum SIGSTKSZ = 10240; + } + else version (X86_Any) + { + enum MINSIGSTKSZ = 2048; + enum SIGSTKSZ = 8192; + } + else + static assert(0, "unimplemented"); + + //ucontext_t (defined in core.sys.posix.ucontext) + //mcontext_t (defined in core.sys.posix.ucontext) + + version (MIPS_Any) + { + struct stack_t + { + void* ss_sp; + size_t ss_size; + int ss_flags; + } + } + else + { + struct stack_t + { + void* ss_sp; + int ss_flags; + size_t ss_size; + } + } + + enum + { + ILL_ILLOPC = 1, + ILL_ILLOPN, + ILL_ILLADR, + ILL_ILLTRP, + ILL_PRVOPC, + ILL_PRVREG, + ILL_COPROC, + ILL_BADSTK + } + + enum + { + FPE_INTDIV = 1, + FPE_INTOVF, + FPE_FLTDIV, + FPE_FLTOVF, + FPE_FLTUND, + FPE_FLTRES, + FPE_FLTINV, + FPE_FLTSUB + } + + enum + { + SEGV_MAPERR = 1, + SEGV_ACCERR + } + + enum + { + BUS_ADRALN = 1, + BUS_ADRERR, + BUS_OBJERR + } + + enum + { + TRAP_BRKPT = 1, + TRAP_TRACE + } + + enum + { + CLD_EXITED = 1, + CLD_KILLED, + CLD_DUMPED, + CLD_TRAPPED, + CLD_STOPPED, + CLD_CONTINUED + } + + enum + { + POLL_IN = 1, + POLL_OUT, + POLL_MSG, + POLL_ERR, + POLL_PRI, + POLL_HUP + } + + sigfn_t bsd_signal(int sig, sigfn_t func); + sigfn_t sigset(int sig, sigfn_t func); + + nothrow: + @nogc: + sigfn_t2 bsd_signal(int sig, sigfn_t2 func); + sigfn_t2 sigset(int sig, sigfn_t2 func); + + int killpg(pid_t, int); + int sigaltstack(const scope stack_t*, stack_t*); + int sighold(int); + int sigignore(int); + int siginterrupt(int, int); + int sigpause(int); + int sigrelse(int); } else version (CRuntime_UClibc) { @@ -3393,6 +3599,8 @@ else version (NetBSD) } else version (OpenBSD) { + // OpenBSD does not implement sigevent. + alias sigevent = void; } else version (DragonFlyBSD) { @@ -3483,7 +3691,7 @@ else version (CRuntime_Musl) int sigev_notify; void function(sigval) sigev_notify_function; pthread_attr_t *sigev_notify_attributes; - char[56 - 3 * long.sizeof] __pad = void; + char[56 - 3 * c_long.sizeof] __pad = void; } } else version (CRuntime_UClibc) diff --git a/libphobos/libdruntime/core/sys/posix/sys/ioccom.d b/libphobos/libdruntime/core/sys/posix/sys/ioccom.d index 5d6aa08..424c8a8 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/ioccom.d +++ b/libphobos/libdruntime/core/sys/posix/sys/ioccom.d @@ -66,3 +66,64 @@ version (OSX) return _IOC!(T)(IOC_INOUT, cast(uint)g, cast(uint)n, T.sizeof); } } +else version (FreeBSD) +{ + /* FreeBSD ioctl's encode the command in the lower 16-bits + * and the size of any in/out parameters in the lower 13 bits of the upper + * 16-bits of a 32 bit unsigned integer. The high 3 bits of the upper + * 16-bits encode the in/out status of the parameter. + */ + enum uint IOCPARM_SHIFT = 13; // number of bits for ioctl size + enum uint IOCPARM_MASK = ((1 << IOCPARM_SHIFT) - 1); // parameter length mask + uint IOCPARM_LEN(uint x) // to extract the encoded parameter length + { + return ((x >> 16) & IOCPARM_MASK); + } + uint IOCBASECMD(uint x) // to extract the encoded command + { + return (x & ~(IOCPARM_MASK << 16)); + } + uint IOCGROUP(uint x) // to extract the encoded group + { + return ((x >> 8) & 0xff); + } + + enum uint IOCPARM_MAX = (1 << IOCPARM_SHIFT); // max size of ioctl args + + enum uint IOC_VOID = 0x20000000; // no parameters + enum uint IOC_OUT = 0x40000000; // copy parameters back + enum uint IOC_IN = 0x80000000; // copy parameters into + enum uint IOC_INOUT = (IOC_IN | IOC_OUT); + enum uint IOC_DIRMASK = (IOC_VOID|IOC_OUT|IOC_IN); + + // encode the ioctl info into 32 bits + uint _IOC(uint inorout, uint group, uint num, size_t len) + { + return (inorout | ((len & IOCPARM_MASK) << 16) | (group << 8) | num); + } + + // encode a command with no parameters + uint _IO(char g, int n) + { + return _IOC(IOC_VOID, cast(uint)g, cast(uint)n, cast(size_t)0); + } + uint _IOWINT(char g, int n) + { + return _IOC(IOC_VOID, cast(uint)g, cast(uint)n, int.sizeof); + } + // encode a command that returns info + uint _IOR(T)(char g, int n) + { + return _IOC(IOC_OUT, cast(uint)g, cast(uint)n, T.sizeof); + } + // encode a command that takes info + uint _IOW(T)(char g, int n) + { + return _IOC(IOC_IN, cast(uint)g, cast(uint)n, T.sizeof); + } + // encode a command that takes info and returns info + uint _IOWR(T)(char g, int n) + { + return _IOC(IOC_INOUT, cast(uint)g, cast(uint)n, T.sizeof); + } +} diff --git a/libphobos/libdruntime/core/sys/posix/sys/ioctl.d b/libphobos/libdruntime/core/sys/posix/sys/ioctl.d index 63d3019..7c77e80 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/ioctl.d +++ b/libphobos/libdruntime/core/sys/posix/sys/ioctl.d @@ -15,6 +15,7 @@ module core.sys.posix.sys.ioctl; import core.stdc.config; +public import core.sys.posix.sys.ttycom; version (OSX) version = Darwin; @@ -357,6 +358,10 @@ else version (FreeBSD) void* buf; } + int ioctl(int, c_ulong, ...); +} +else version (NetBSD) +{ struct winsize { ushort ws_row; @@ -367,7 +372,7 @@ else version (FreeBSD) int ioctl(int, c_ulong, ...); } -else version (NetBSD) +else version (OpenBSD) { struct winsize { diff --git a/libphobos/libdruntime/core/sys/posix/sys/ipc.d b/libphobos/libdruntime/core/sys/posix/sys/ipc.d index 095c81b..04601f2 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/ipc.d +++ b/libphobos/libdruntime/core/sys/posix/sys/ipc.d @@ -149,6 +149,31 @@ else version (NetBSD) key_t ftok(in char*, int); } +else version (OpenBSD) +{ + struct ipc_perm + { + uid_t cuid; + gid_t cgid; + uid_t uid; + gid_t gid; + mode_t mode; + ushort seq; + key_t key; + } + + enum IPC_CREAT = 0x0200; // 01000 + enum IPC_EXCL = 0x0400; // 02000 + enum IPC_NOWAIT = 0x0800; // 04000 + + enum key_t IPC_PRIVATE = 0; + + enum IPC_RMID = 0; + enum IPC_SET = 1; + enum IPC_STAT = 2; + + key_t ftok(in char*, int); +} else version (DragonFlyBSD) { struct ipc_perm diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d index c0bee55..f682320 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/mman.d +++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d @@ -111,6 +111,15 @@ else version (NetBSD) enum POSIX_MADV_DONTNEED = 4; int posix_madvise(void *addr, size_t len, int advice); } +else version (OpenBSD) +{ + enum POSIX_MADV_NORMAL = 0; + enum POSIX_MADV_RANDOM = 1; + enum POSIX_MADV_SEQUENTIAL = 2; + enum POSIX_MADV_WILLNEED = 3; + enum POSIX_MADV_DONTNEED = 4; + int posix_madvise(void *addr, size_t len, int advice); +} else version (DragonFlyBSD) { enum POSIX_MADV_NORMAL = 0; @@ -128,6 +137,15 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + enum + { + POSIX_MADV_NORMAL = 0, + POSIX_MADV_RANDOM = 1, + POSIX_MADV_SEQUENTIAL = 2, + POSIX_MADV_WILLNEED = 3, + POSIX_MADV_DONTNEED = 4, + } + int posix_madvise(void *, size_t, int); } else version (CRuntime_UClibc) { @@ -184,6 +202,13 @@ else version (NetBSD) enum PROT_WRITE = 0x02; enum PROT_EXEC = 0x04; } +else version (OpenBSD) +{ + enum PROT_NONE = 0x00; + enum PROT_READ = 0x01; + enum PROT_WRITE = 0x02; + enum PROT_EXEC = 0x04; +} else version (DragonFlyBSD) { enum PROT_NONE = 0x00; @@ -256,6 +281,11 @@ else version (NetBSD) void* mmap(void*, size_t, int, int, int, off_t); int munmap(void*, size_t); } +else version (OpenBSD) +{ + void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); +} else version (DragonFlyBSD) { void* mmap(void*, size_t, int, int, int, off_t); @@ -423,6 +453,21 @@ else version (NetBSD) int __msync13(void*, size_t, int); alias msync = __msync13; } +else version (OpenBSD) +{ + enum MAP_SHARED = 0x0001; + enum MAP_PRIVATE = 0x0002; + enum MAP_FIXED = 0x0010; + enum MAP_ANON = 0x1000; + + enum MAP_FAILED = cast(void*)-1; + + enum MS_SYNC = 0x0002; + enum MS_ASYNC = 0x0001; + enum MS_INVALIDATE = 0x0004; + + int msync(void*, size_t, int); +} else version (DragonFlyBSD) { enum MAP_SHARED = 0x0001; @@ -585,6 +630,14 @@ else version (NetBSD) int mlockall(int); int munlockall(); } +else version (OpenBSD) +{ + enum MCL_CURRENT = 0x0001; + enum MCL_FUTURE = 0x0002; + + int mlockall(int); + int munlockall(); +} else version (DragonFlyBSD) { enum MCL_CURRENT = 0x0001; @@ -611,6 +664,14 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + enum + { + MCL_CURRENT = 1, + MCL_FUTURE = 2, + } + + int mlockall(int); + int munlockall(); } else version (CRuntime_UClibc) { @@ -657,6 +718,11 @@ else version (NetBSD) int mlock(in void*, size_t); int munlock(in void*, size_t); } +else version (OpenBSD) +{ + int mlock(in void*, size_t); + int munlock(in void*, size_t); +} else version (DragonFlyBSD) { int mlock(in void*, size_t); @@ -674,6 +740,8 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + int mlock(in void*, size_t); + int munlock(in void*, size_t); } else version (CRuntime_UClibc) { @@ -708,6 +776,10 @@ else version (NetBSD) { int mprotect(void*, size_t, int); } +else version (OpenBSD) +{ + int mprotect(void*, size_t, int); +} else version (DragonFlyBSD) { int mprotect(void*, size_t, int); @@ -761,6 +833,11 @@ else version (NetBSD) int shm_open(in char*, int, mode_t); int shm_unlink(in char*); } +else version (OpenBSD) +{ + int shm_open(in char*, int, mode_t); + int shm_unlink(in char*); +} else version (DragonFlyBSD) { int shm_open(in char*, int, mode_t); @@ -776,6 +853,8 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + int shm_open(in char*, int, mode_t); + int shm_unlink(in char*); } else version (CRuntime_UClibc) { diff --git a/libphobos/libdruntime/core/sys/posix/sys/resource.d b/libphobos/libdruntime/core/sys/posix/sys/resource.d index 87491fa..27a7ed2 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/resource.d +++ b/libphobos/libdruntime/core/sys/posix/sys/resource.d @@ -301,6 +301,65 @@ else version (NetBSD) RLIMIT_AS = 10, } } +else version (OpenBSD) +{ + enum + { + PRIO_PROCESS = 0, + PRIO_PGRP = 1, + PRIO_USER = 2, + } + + alias ulong rlim_t; + + enum + { + RLIM_INFINITY = (cast(rlim_t)((cast(ulong) 1 << 63) - 1)), + RLIM_SAVED_MAX = RLIM_INFINITY, + RLIM_SAVED_CUR = RLIM_INFINITY, + } + + enum + { + RUSAGE_SELF = 0, + RUSAGE_CHILDREN = -1, + RUSAGE_THREAD = 1, + } + + struct rusage + { + timeval ru_utime; + timeval ru_stime; + c_long ru_maxrss; + alias ru_ixrss ru_first; + c_long ru_ixrss; + c_long ru_idrss; + c_long ru_isrss; + c_long ru_minflt; + c_long ru_majflt; + c_long ru_nswap; + c_long ru_inblock; + c_long ru_oublock; + c_long ru_msgsnd; + c_long ru_msgrcv; + c_long ru_nsignals; + c_long ru_nvcsw; + c_long ru_nivcsw; + alias ru_nivcsw ru_last; + } + + enum + { + RLIMIT_CORE = 4, + RLIMIT_CPU = 0, + RLIMIT_DATA = 2, + RLIMIT_FSIZE = 1, + RLIMIT_NOFILE = 8, + RLIMIT_STACK = 3, + // OpenBSD does not define the following: + //RLIMIT_AS, + } +} else version (DragonFlyBSD) { enum @@ -652,6 +711,12 @@ else version (NetBSD) int getrusage(int, rusage*); int setrlimit(int, in rlimit*); } +else version (OpenBSD) +{ + int getrlimit(int, rlimit*); + int getrusage(int, rusage*); + int setrlimit(int, in rlimit*); +} else version (DragonFlyBSD) { int getrlimit(int, rlimit*); diff --git a/libphobos/libdruntime/core/sys/posix/sys/select.d b/libphobos/libdruntime/core/sys/posix/sys/select.d index e2d2824..2508366 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/select.d +++ b/libphobos/libdruntime/core/sys/posix/sys/select.d @@ -270,6 +270,53 @@ else version (NetBSD) int pselect(int, fd_set*, fd_set*, fd_set*, in timespec*, in sigset_t*); int select(int, fd_set*, fd_set*, fd_set*, timeval*); } +else version (OpenBSD) +{ + private + { + alias uint __fd_mask; + enum _NFDBITS = __fd_mask.sizeof * 8; + } + + enum uint FD_SETSIZE = 1024; + + struct fd_set + { + __fd_mask[(FD_SETSIZE + (_NFDBITS - 1)) / _NFDBITS] __fds_bits; + } + + extern (D) __fd_mask __fdset_mask(uint n) pure + { + return cast(__fd_mask) 1 << (n % _NFDBITS); + } + + extern (D) void FD_CLR(int n, fd_set* p) pure + { + p.__fds_bits[n / _NFDBITS] &= ~__fdset_mask(n); + } + + extern (D) bool FD_ISSET(int n, const(fd_set)* p) pure + { + return (p.__fds_bits[n / _NFDBITS] & __fdset_mask(n)) != 0; + } + + extern (D) void FD_SET(int n, fd_set* p) pure + { + p.__fds_bits[n / _NFDBITS] |= __fdset_mask(n); + } + + extern (D) void FD_ZERO(fd_set* p) pure + { + fd_set *_p = p; + size_t _n = (FD_SETSIZE + (_NFDBITS - 1)) / _NFDBITS; + + while (_n > 0) + _p.__fds_bits[--_n] = 0; + } + + int pselect(int, fd_set*, fd_set*, fd_set*, in timespec*, in sigset_t*); + int select(int, fd_set*, fd_set*, fd_set*, timeval*); +} else version (DragonFlyBSD) { private diff --git a/libphobos/libdruntime/core/sys/posix/sys/shm.d b/libphobos/libdruntime/core/sys/posix/sys/shm.d index 7c229bd..8902451 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/shm.d +++ b/libphobos/libdruntime/core/sys/posix/sys/shm.d @@ -156,6 +156,35 @@ else version (NetBSD) int shmdt(in void*); int shmget(key_t, size_t, int); } +else version (OpenBSD) +{ + enum SHM_RDONLY = 0x01000; // 010000 + enum SHM_RND = 0x02000; // 020000 + enum SHMLBA = 1 << _MAX_PAGE_SHIFT; + + alias short shmatt_t; + + struct shmid_ds + { + ipc_perm shm_perm; + int shm_segsz; + pid_t shm_lpid; + pid_t shm_cpid; + shmatt_t shm_nattch; + time_t shm_atime; + c_long __shm_atimensec; + time_t shm_dtime; + c_long __shm_dtimensec; + time_t shm_ctime; + c_long __shm_ctimensec; + void* shm_internal; + } + + void* shmat(int, in void*, int); + int shmctl(int, int, shmid_ds*); + int shmdt(in void*); + int shmget(key_t, size_t, int); +} else version (DragonFlyBSD) { enum SHM_RDONLY = 0x01000; // 010000 diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d index 197f1d6..791a593 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/socket.d +++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d @@ -1119,6 +1119,179 @@ else version (NetBSD) int sockatmark(int) @safe; int socketpair(int, int, int, ref int[2]) @safe; } +else version (OpenBSD) +{ + alias uint socklen_t; + alias ubyte sa_family_t; + + struct sockaddr + { + ubyte sa_len; + sa_family_t sa_family; + byte[14] sa_data; + } + + struct sockaddr_storage + { + ubyte ss_len; + sa_family_t ss_family; + byte[6] __ss_pad1; + long __ss_align; + byte[240] __ss_pad2; + } + + struct msghdr + { + void* msg_name; + socklen_t msg_namelen; + iovec* msg_iov; + uint msg_iovlen; + void* msg_control; + socklen_t msg_controllen; + int msg_flags; + } + + struct cmsghdr + { + socklen_t cmsg_len; + int cmsg_level; + int cmsg_type; + } + + enum : uint + { + SCM_RIGHTS = 0x01 + } + + private // <sys/_types.h> + { + extern (D) size_t _ALIGN(size_t p) { return (p + _ALIGNBYTES) & ~_ALIGNBYTES; } + } + + extern (D) ubyte* CMSG_DATA(cmsghdr* cmsg) + { + return cast(ubyte*) cmsg + _ALIGN(cmsghdr.sizeof); + } + + extern (D) cmsghdr* CMSG_NXTHDR(msghdr* mhdr, cmsghdr* cmsg) + { + if (cast(ubyte*) cmsg + _ALIGN(cmsg.cmsg_len) + _ALIGN(cmsghdr.sizeof) > + cast(ubyte*) mhdr.msg_control + mhdr.msg_controllen) + return null; + else + return cast(cmsghdr*) (cast(ubyte*) cmsg + _ALIGN(cmsg.cmsg_len)); + } + + extern (D) cmsghdr* CMSG_FIRSTHDR(msghdr* mhdr) + { + return mhdr.msg_controllen >= cmsghdr.sizeof ? cast(cmsghdr*) mhdr.msg_control : null; + } + + struct linger + { + int l_onoff; + int l_linger; + } + + enum + { + SOCK_DGRAM = 2, + SOCK_RDM = 4, + SOCK_SEQPACKET = 5, + SOCK_STREAM = 1 + } + + enum : uint + { + SOL_SOCKET = 0xffff + } + + enum : uint + { + SO_DEBUG = 0x0001, + SO_ACCEPTCONN = 0x0002, + SO_REUSEADDR = 0x0004, + SO_KEEPALIVE = 0x0008, + SO_DONTROUTE = 0x0010, + SO_BROADCAST = 0x0020, + SO_USELOOPBACK = 0x0040, + SO_LINGER = 0x0080, + SO_OOBINLINE = 0x0100, + SO_REUSEPORT = 0x0200, + SO_TIMESTAMP = 0x0800, + SO_BINDANY = 0x1000, + SO_ZEROSIZE = 0x2000, + + SO_SNDBUF = 0x1001, + SO_RCVBUF = 0x1002, + SO_SNDLOWAT = 0x1003, + SO_RCVLOWAT = 0x1004, + SO_SNDTIMEO = 0x1005, + SO_RCVTIMEO = 0x1006, + SO_ERROR = 0x1007, + SO_TYPE = 0x1008, + SO_NETPROC = 0x1020, + SO_RTABLE = 0x1021, + SO_PEERCRED = 0x1022, + SO_SPLICE = 0x1023, + } + + enum + { + SOMAXCONN = 128 + } + + enum : uint + { + MSG_OOB = 0x001, + MSG_PEEK = 0x002, + MSG_DONTROUTE = 0x004, + MSG_EOR = 0x008, + MSG_TRUNC = 0x010, + MSG_CTRUNC = 0x020, + MSG_WAITALL = 0x040, + MSG_DONTWAIT = 0x080, + MSG_BCAST = 0x100, + MSG_MCAST = 0x200, + MSG_NOSIGNAL = 0x400, + MSG_CMSG_CLOEXEC = 0x800, + } + + enum + { + AF_APPLETALK = 16, + AF_INET = 2, + AF_IPX = 23, + AF_UNIX = 1, + AF_UNSPEC = 0 + } + + enum + { + SHUT_RD = 0, + SHUT_WR = 1, + SHUT_RDWR = 2 + } + + int accept(int, scope sockaddr*, scope socklen_t*); + int bind(int, const scope sockaddr*, socklen_t); + int connect(int, const scope sockaddr*, socklen_t); + int getpeername(int, scope sockaddr*, scope socklen_t*); + int getsockname(int, scope sockaddr*, scope socklen_t*); + int getsockopt(int, int, int, scope void*, scope socklen_t*); + int listen(int, int) @safe; + ssize_t recv(int, scope void*, size_t, int); + ssize_t recvfrom(int, scope void*, size_t, int, scope sockaddr*, scope socklen_t*); + ssize_t recvmsg(int, scope msghdr*, int); + ssize_t send(int, const scope void*, size_t, int); + ssize_t sendmsg(int, const scope msghdr*, int); + ssize_t sendto(int, const scope void*, size_t, int, const scope sockaddr*, socklen_t); + int setsockopt(int, int, int, const scope void*, socklen_t); + int shutdown(int, int) @safe; + int socket(int, int, int) @safe; + int sockatmark(int) @safe; + int socketpair(int, int, int, ref int[2]) @safe; +} else version (DragonFlyBSD) { alias uint socklen_t; @@ -1186,41 +1359,8 @@ else version (DragonFlyBSD) AF_LOCAL = 1, AF_UNIX = AF_LOCAL, AF_INET = 2, - AF_IMPLINK = 3, - AF_PUP = 4, - AF_CHAOS = 5, - AF_NETBIOS = 6, - AF_ISO = 7, - AF_OSI = AF_ISO, - AF_ECMA = 8, - AF_DATAKIT = 9, - AF_CCITT = 10, - AF_SNA = 11, - AF_DECnet = 12, - AF_DLI = 13, - AF_LAT = 14, - AF_HYLINK = 15, AF_APPLETALK = 16, - AF_ROUTE = 17, - AF_LINK = 18, - pseudo_AF_XTP = 19, - AF_COIP = 20, - AF_CNT = 21, - pseudo_AF_RTIP = 22, AF_IPX = 23, - AF_SIP = 24, - pseudo_AF_PIP = 25, - AF_ISDN = 26, - AF_E164 = AF_ISDN, - pseudo_AF_KEY = 27, - //AF_INET6 = 28, // defined below - AF_NATM = 29, - AF_ATM = 30, - pseudo_AF_HDRCMPLT = 31, - AF_NETGRAPH = 32, - AF_BLUETOOTH = 33, - AF_MPLS = 34, - AF_IEEE80211 = 35, } struct sockaddr @@ -1254,43 +1394,6 @@ else version (DragonFlyBSD) byte[_SS_PAD2SIZE] __ss_pad2; } - /* protocol families */ - enum PF_UNSPEC = AF_UNSPEC; - enum PF_LOCAL = AF_LOCAL; - enum PF_UNIX = PF_LOCAL; - enum PF_INET = AF_INET; - enum PF_IMPLINK = AF_IMPLINK; - enum PF_PUP = AF_PUP; - enum PF_CHAOS = AF_CHAOS; - enum PF_NETBIOS = AF_NETBIOS; - enum PF_ISO = AF_ISO; - enum PF_OSI = AF_ISO; - enum PF_ECMA = AF_ECMA; - enum PF_DATAKIT = AF_DATAKIT; - enum PF_CCITT = AF_CCITT; - enum PF_SNA = AF_SNA; - enum PF_DECnet = AF_DECnet; - enum PF_DLI = AF_DLI; - enum PF_LAT = AF_LAT; - enum PF_HYLINK = AF_HYLINK; - enum PF_APPLETALK = AF_APPLETALK; - enum PF_ROUTE = AF_ROUTE; - enum PF_LINK = AF_LINK; - enum PF_XTP = pseudo_AF_XTP; - enum PF_COIP = AF_COIP; - enum PF_CNT = AF_CNT; - enum PF_SIP = AF_SIP; - enum PF_IPX = AF_IPX; - enum PF_RTIP = pseudo_AF_RTIP; - enum PF_PIP = pseudo_AF_PIP; - enum PF_ISDN = AF_ISDN; - enum PF_KEY = pseudo_AF_KEY; - enum PF_INET6 = AF_INET6; - enum PF_NATM = AF_NATM; - enum PF_ATM = AF_ATM; - enum PF_NETGRAPH = AF_NETGRAPH; - enum PF_BLUETOOTH = AF_BLUETOOTH; - struct msghdr { void* msg_name; @@ -1755,10 +1858,10 @@ else version (CRuntime_Musl) c_ulong __ss_align; } - enum { + enum + { SOCK_STREAM = 1, SOCK_DGRAM = 2, - SOCK_RAW = 3, SOCK_RDM = 4, SOCK_SEQPACKET = 5, SOCK_DCCP = 6, @@ -2092,6 +2195,13 @@ else version (NetBSD) AF_INET6 = 24 } } +else version (OpenBSD) +{ + enum + { + AF_INET6 = 24 + } +} else version (DragonFlyBSD) { enum @@ -2164,6 +2274,13 @@ else version (NetBSD) SOCK_RAW = 3 } } +else version (OpenBSD) +{ + enum + { + SOCK_RAW = 3 + } +} else version (DragonFlyBSD) { enum @@ -2187,6 +2304,10 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + enum + { + SOCK_RAW = 3 + } } else version (CRuntime_UClibc) { diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d index 76e4460..8692014 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/stat.d +++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d @@ -1200,6 +1200,83 @@ else version (NetBSD) extern (D) bool S_ISLNK( mode_t mode ) { return S_ISTYPE( mode, S_IFLNK ); } extern (D) bool S_ISSOCK( mode_t mode ) { return S_ISTYPE( mode, S_IFSOCK ); } } +else version (OpenBSD) +{ + import core.sys.openbsd.sys.cdefs; + + struct stat_t + { + mode_t st_mode; + dev_t st_dev; + ino_t st_ino; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + static if (__POSIX_VISIBLE >= 200809 || __BSD_VISIBLE) + { + timespec st_atim; + timespec st_mtim; + timespec st_ctim; + extern(D) + { + @property ref time_t st_atime() { return st_atim.tv_sec; } + @property ref time_t st_mtime() { return st_mtim.tv_sec; } + @property ref time_t st_ctime() { return st_ctim.tv_sec; } + } + } + else + { + time_t st_atime; + long st_atimensec; + time_t st_mtime; + long st_mtimensec; + time_t st_ctime; + long st_ctimensec; + } + off_t st_size; + blkcnt_t st_blocks; + blksize_t st_blksize; + uint32_t st_flags; + uint32_t st_gen; + static if (__POSIX_VISIBLE >= 200809 || __BSD_VISIBLE) + { + timespec __st_birthtim; + } + else + { + time_t __st_birthtime; + long __st_birthtimensec; + } + } + + enum S_IRUSR = 0x100; // octal 0000400 + enum S_IWUSR = 0x080; // octal 0000200 + enum S_IXUSR = 0x040; // octal 0000100 + enum S_IRWXU = 0x1C0; // octal 0000700 + + enum S_IRGRP = 0x020; // octal 0000040 + enum S_IWGRP = 0x010; // octal 0000020 + enum S_IXGRP = 0x008; // octal 0000010 + enum S_IRWXG = 0x038; // octal 0000070 + + enum S_IROTH = 0x4; // 0000004 + enum S_IWOTH = 0x2; // 0000002 + enum S_IXOTH = 0x1; // 0000001 + enum S_IRWXO = 0x7; // 0000007 + + enum S_ISUID = 0x800; // octal 0004000 + enum S_ISGID = 0x400; // octal 0002000 + enum S_ISVTX = 0x200; // octal 0001000 + + extern (D) bool S_ISBLK(mode_t mode) { return (mode & S_IFMT) == S_IFBLK; } + extern (D) bool S_ISCHR(mode_t mode) { return (mode & S_IFMT) == S_IFCHR; } + extern (D) bool S_ISDIR(mode_t mode) { return (mode & S_IFMT) == S_IFDIR; } + extern (D) bool S_ISFIFO(mode_t mode) { return (mode & S_IFMT) == S_IFIFO; } + extern (D) bool S_ISREG(mode_t mode) { return (mode & S_IFMT) == S_IFREG; } + extern (D) bool S_ISLNK(mode_t mode) { return (mode & S_IFMT) == S_IFLNK; } + extern (D) bool S_ISSOCK(mode_t mode) { return (mode & S_IFMT) == S_IFSOCK; } +} else version (DragonFlyBSD) { struct stat_t { @@ -1948,6 +2025,12 @@ else version (NetBSD) alias __lstat50 lstat; alias __stat50 stat; } +else version (OpenBSD) +{ + int fstat(int, stat_t*); + int lstat(in char*, stat_t*); + int stat(in char*, stat_t*); +} else version (DragonFlyBSD) { int fstat(int, stat_t*); @@ -2066,6 +2149,19 @@ else version (NetBSD) int mknod(in char*, mode_t, dev_t); } +else version (OpenBSD) +{ + enum S_IFMT = 0xF000; // octal 0170000 + enum S_IFBLK = 0x6000; // octal 0060000 + enum S_IFCHR = 0x2000; // octal 0020000 + enum S_IFIFO = 0x1000; // octal 0010000 + enum S_IFREG = 0x8000; // octal 0100000 + enum S_IFDIR = 0x4000; // octal 0040000 + enum S_IFLNK = 0xA000; // octal 0120000 + enum S_IFSOCK = 0xC000; // octal 0140000 + + int mknod(in char*, mode_t, dev_t); +} else version (DragonFlyBSD) { enum S_IFMT = 0xF000; // octal 0170000 diff --git a/libphobos/libdruntime/core/sys/posix/sys/statvfs.d b/libphobos/libdruntime/core/sys/posix/sys/statvfs.d index 9828c7b..795d96d 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/statvfs.d +++ b/libphobos/libdruntime/core/sys/posix/sys/statvfs.d @@ -133,6 +133,29 @@ else version (NetBSD) int statvfs (const char * file, statvfs_t* buf); int fstatvfs (int fildes, statvfs_t *buf) @trusted; } +else version (OpenBSD) +{ + struct statvfs_t + { + c_ulong f_bsize; + c_ulong f_frsize; + fsblkcnt_t f_blocks; + fsblkcnt_t f_bfree; + fsblkcnt_t f_bavail; + fsfilcnt_t f_files; + fsfilcnt_t f_ffree; + fsfilcnt_t f_favail; + c_ulong f_fsid; + c_ulong f_flag; + c_ulong f_namemax; + } + + enum uint ST_RDONLY = 1; + enum uint ST_NOSUID = 2; + + int statvfs (const char* file, statvfs_t* buf); + int fstatvfs (int fildes, statvfs_t* buf) @trusted; +} else version (FreeBSD) { import core.sys.freebsd.sys.mount; diff --git a/libphobos/libdruntime/core/sys/posix/sys/time.d b/libphobos/libdruntime/core/sys/posix/sys/time.d index edfd2ec..4c82930 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/time.d +++ b/libphobos/libdruntime/core/sys/posix/sys/time.d @@ -163,6 +163,32 @@ else version (NetBSD) int setitimer(int, in itimerval*, itimerval*); int utimes(in char*, ref const(timeval)[2]); } +else version (OpenBSD) +{ + struct timeval + { + time_t tv_sec; + suseconds_t tv_usec; + } + + struct itimerval + { + timeval it_interval; + timeval it_value; + } + + // non-standard + struct timezone_t + { + int tz_minuteswest; + int tz_dsttime; + } + + int getitimer(int, itimerval*); + int gettimeofday(timeval*, timezone_t*); + int setitimer(int, in itimerval*, itimerval*); + int utimes(in char*, ref const(timeval)[2]); +} else version (DragonFlyBSD) { struct timeval diff --git a/libphobos/libdruntime/core/sys/posix/sys/ttycom.d b/libphobos/libdruntime/core/sys/posix/sys/ttycom.d index a559b1e..d153097 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/ttycom.d +++ b/libphobos/libdruntime/core/sys/posix/sys/ttycom.d @@ -108,3 +108,99 @@ version (OSX) enum uint SLIPDISC = 4; // serial IP discipline enum uint PPPDISC = 5; // PPP discipline } +else version (FreeBSD) +{ + struct winsize { + ushort ws_row; // rows, in characters + ushort ws_col; // columns, in characters + ushort ws_xpixel; // horizontal size, pixels + ushort ws_ypixel; // vertical size, pixels + } + + // Serial/TTY ioctl's + // 0-2 compat + // 3-7 unused + // 8-10 compat + // 11-12 unused + enum uint TIOCEXCL = _IO('t', 13); // set exclusive use of tty + enum uint TIOCNXCL = _IO('t', 14); // reset exclusive use of tty + enum uint TIOCGPTN = _IOR!(int)('t', 15); // get pts number + enum uint TIOCFLUSH = _IOW!(int)('t', 16); // flush buffers + // 17-18 compat + enum uint TIOCGETA = _IOR!(termios)('t', 19); // get termios struct + enum uint TIOCSETA = _IOW!(termios)('t', 20); // set termios struct + enum uint TIOCSETAW = _IOW!(termios)('t', 21); // drain output, set + enum uint TIOCSETAF = _IOW!(termios)('t', 22); // drn out, fls in, set + // 23-25 unused + enum uint TIOCGETD = _IOR!(int)('t', 26); // get line discipline + enum uint TIOCSETD = _IOW!(int)('t', 27); // set line discipline + enum uint TIOCPTMASTER = _IO('t', 28); // pts master validation + // 29-85 unused + enum uint TIOCGDRAINWAIT = _IOR!(int)('t', 86); // get ttywait timeout + enum uint TIOCSDRAINWAIT = _IOW!(int)('t', 87); // set ttywait timeout + // 88 unused + // 89-91 conflicts: tun and tap + enum uint TIOCTIMESTAMP = _IOR!(timeval)('t', 89); // enable/get timestamp of last input event + enum uint TIOCMGDTRWAIT = _IOR!(int)('t', 90); // modem: get wait on close + enum uint TIOCMSDTRWAIT = _IOW!(int)('t', 91); // modem: set wait on close + // 92-93 tun and tap + // 94-97 conflicts: tun and tap + enum uint TIOCDRAIN = _IO('t', 94); // wait till output drained + enum uint TIOCSIG = _IOWINT('t', 95); // pty: generate signal + enum uint TIOCEXT = _IOW!(int)('t', 96); // pty: external processing + enum uint TIOCSCTTY = _IO('t', 97); // become controlling tty + enum uint TIOCCONS = _IOW!(int)('t', 98); // become virtual console + enum uint TIOCGSID = _IOR!(int)('t', 99); // get session id + // 100 unused + enum uint TIOCSTAT = _IO('t', 101); // simulate ^T status message + enum uint TIOCUCNTL = _IOW!(int)('t', 102); // pty: set/clr usr cntl mode + enum uint UIOCCMD(n) = _IO('u', n); // usr cntl op "n" + enum uint TIOCSWINSZ = _IOW!(winsize)('t', 103); // set window size + enum uint TIOCGWINSZ = _IOR!(winsize)('t', 104); // get window size + // 105 unused + enum uint TIOCMGET = _IOR!(int)('t', 106); // get all modem bits + enum uint TIOCM_LE = 0x01; // line enable + enum uint TIOCM_DTR = 0x02; // data terminal ready + enum uint TIOCM_RTS = 0x04; // request to send + enum uint TIOCM_ST = 0x08; // secondary transmit + enum uint TIOCM_SR = 0x10; // secondary receive + enum uint TIOCM_CTS = 0x20; // clear to send + enum uint TIOCM_DCD = 0x40; // data carrier detect + enum uint TIOCM_RI = 0x80; // ring indicate + enum uint TIOCM_DSR = 0x100; // data set ready + enum uint TIOCM_CD = TIOCM_DCD; + enum uint TIOCM_CAR = TIOCM_DCD; + enum uint TIOCM_RNG = TIOCM_RI; + enum uint TIOCMBIC = _IOW!(int)('t', 107); // bic modem bits + enum uint TIOCMBIS = _IOW!(int)('t', 108); // bis modem bits + enum uint TIOCMSET = _IOW!(int)('t', 109); // set all modem bits + enum uint TIOCSTART = _IO('t', 110); // start output like ^Q + enum uint TIOCSTOP = _IO('t', 111); // stop output like ^S + enum uint TIOCPKT = _IOW!(int)('t', 112); // pty: set/clr packet mode + enum uint TIOCPKT_DATA = 0x00; // data packet + enum uint TIOCPKT_FLUSHREAD = 0x01; // flush packet + enum uint TIOCPKT_FLUSHWRITE = 0x02; // flush packet + enum uint TIOCPKT_STOP = 0x04; // stop output + enum uint TIOCPKT_START = 0x08; // start output + enum uint TIOCPKT_NOSTOP = 0x10; // no more ^S, ^Q + enum uint TIOCPKT_DOSTOP = 0x20; // now do ^S, ^Q + enum uint TIOCPKT_IOCTL = 0x40; // state change of pty driver + enum uint TIOCNOTTY = _IO('t', 113); // void tty association + enum uint TIOCSTI = _IOW!(char)('t', 114); // simulate terminal input + enum uint TIOCOUTQ = _IOR!(int)('t', 115); // output queue size + // 116-117 compat + enum uint TIOCSPGRP = _IOW!(int)('t', 118); // set pgrp of tty + enum uint TIOCGPGRP = _IOR!(int)('t', 119); // get pgrp of tty + + enum uint TIOCCDTR = _IO('t', 120); // clear data terminal ready + enum uint TIOCSDTR = _IO('t', 121); // set data terminal ready + enum uint TIOCCBRK = _IO('t', 122); // clear break bit + enum uint TIOCSBRK = _IO('t', 123); // set break bit + // 124-127 compat + + enum uint TTYDISC = 0; // termios tty line discipline + enum uint SLIPDISC = 4; // serial IP discipline + enum uint PPPDISC = 5; // PPP discipline + enum uint NETGRAPHDISC = 6; // Netgraph tty node discipline + enum uint H4DISC = 7; // Netgraph Blutooth H4 discipline +} diff --git a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d index 060b56f..6188047 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/types.d +++ b/libphobos/libdruntime/core/sys/posix/sys/types.d @@ -112,20 +112,25 @@ version (CRuntime_Glibc) } else version (CRuntime_Musl) { - alias long blksize_t; - alias ulong nlink_t; - alias long dev_t; - alias long blkcnt_t; - alias ulong ino_t; - alias long off_t; - alias long _Addr; - alias int pid_t; - alias uint uid_t; - alias uint gid_t; - alias long time_t; - alias long clock_t; - alias ulong pthread_t; - alias _Addr ssize_t; + alias c_long blksize_t; + alias c_ulong nlink_t; + alias long dev_t; + alias long blkcnt_t; + alias ulong ino_t; + alias long off_t; + alias int pid_t; + alias uint uid_t; + alias uint gid_t; + version (D_X32) + alias long time_t; + else + alias c_long time_t; + alias c_long clock_t; + alias c_ulong pthread_t; + version (D_LP64) + alias c_long ssize_t; + else + alias int ssize_t; } else version (Darwin) { @@ -177,6 +182,23 @@ else version (NetBSD) alias c_long time_t; alias uint uid_t; } +else version (OpenBSD) +{ + alias char* caddr_t; + alias long blkcnt_t; + alias int blksize_t; + alias int dev_t; + alias uint gid_t; + alias ulong ino_t; + alias uint mode_t; + alias uint nlink_t; + alias long off_t; + alias int pid_t; + //size_t (defined in core.stdc.stddef) + alias c_long ssize_t; + alias long time_t; + alias uint uid_t; +} else version (DragonFlyBSD) { alias long blkcnt_t; @@ -361,6 +383,16 @@ else version (NetBSD) alias c_long suseconds_t; alias uint useconds_t; } +else version (OpenBSD) +{ + alias ulong fsblkcnt_t; + alias ulong fsfilcnt_t; + alias long clock_t; + alias uint id_t; + alias c_long key_t; + alias c_long suseconds_t; + alias uint useconds_t; +} else version (DragonFlyBSD) { alias ulong fsblkcnt_t; @@ -420,7 +452,10 @@ else version (CRuntime_Musl) } alias uint mode_t; alias uint id_t; - alias long suseconds_t; + version (D_X32) + alias long susseconds_t; + else + alias c_long suseconds_t; } else version (CRuntime_UClibc) { @@ -723,40 +758,77 @@ version (CRuntime_Glibc) } else version (CRuntime_Musl) { - version (X86_64) { + version (D_LP64) + { union pthread_attr_t { int[14] __i; ulong[7] __s; } + union pthread_cond_t { int[12] __i; void*[6] __p; } + union pthread_mutex_t { int[10] __i; void*[5] __p; } + union pthread_rwlock_t { int[14] __i; void*[7] __p; } - struct pthread_rwlockattr_t + } + else + { + union pthread_attr_t + { + int[9] __i; + uint[9] __s; + } + + union pthread_cond_t + { + int[12] __i; + void*[12] __p; + } + + union pthread_mutex_t { - uint[2] __attr; + int[6] __i; + void*[6] __p; + } + + union pthread_rwlock_t + { + int[8] __i; + void*[8] __p; } - alias uint pthread_key_t; - alias uint pthread_condattr_t; - alias uint pthread_mutexattr_t; - alias int pthread_once_t; } - else + + struct pthread_rwlockattr_t { - static assert (false, "Architecture unsupported"); + uint[2] __attr; } + + alias uint pthread_key_t; + + struct pthread_condattr_t + { + uint __attr; + } + + struct pthread_mutexattr_t + { + uint __attr; + } + + alias int pthread_once_t; } else version (Darwin) { @@ -934,6 +1006,26 @@ else version (NetBSD) alias uint pthread_key_t; alias void* pthread_t; } +else version (OpenBSD) +{ + alias void* pthread_attr_t; + alias void* pthread_cond_t; + alias void* pthread_condattr_t; + alias int pthread_key_t; + alias void* pthread_mutex_t; + alias void* pthread_mutexattr_t; + + private struct pthread_once + { + int state; + pthread_mutex_t mutex; + } + alias pthread_once pthread_once_t; + + alias void* pthread_rwlock_t; + alias void* pthread_rwlockattr_t; + alias void* pthread_t; +} else version (DragonFlyBSD) { alias int lwpid_t; @@ -1270,6 +1362,11 @@ else version (NetBSD) alias void* pthread_barrier_t; alias void* pthread_barrierattr_t; } +else version (OpenBSD) +{ + alias void* pthread_barrier_t; + alias void* pthread_barrierattr_t; +} else version (DragonFlyBSD) { alias void* pthread_barrier_t; @@ -1300,6 +1397,27 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + version (D_LP64) + { + union pthread_barrier_t + { + int[8] __i; + void*[4] __p; + } + } + else + { + union pthread_barrier_t + { + int[5] __i; + void*[5] __p; + } + } + + struct pthread_barrierattr_t + { + uint __attr; + } } else version (CRuntime_UClibc) { @@ -1339,6 +1457,10 @@ else version (NetBSD) { //already defined } +else version (OpenBSD) +{ + alias void* pthread_spinlock_t; +} else version (DragonFlyBSD) { alias void* pthread_spinlock_t; @@ -1351,6 +1473,10 @@ else version (CRuntime_UClibc) { alias int pthread_spinlock_t; // volatile } +else version (CRuntime_Musl) +{ + alias int pthread_spinlock_t; +} // // Timer (TMR) diff --git a/libphobos/libdruntime/core/sys/posix/sys/uio.d b/libphobos/libdruntime/core/sys/posix/sys/uio.d index 91dd896..c115bf1 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/uio.d +++ b/libphobos/libdruntime/core/sys/posix/sys/uio.d @@ -90,6 +90,17 @@ else version (NetBSD) ssize_t readv(int, in iovec*, int); ssize_t writev(int, in iovec*, int); } +else version (OpenBSD) +{ + struct iovec + { + void* iov_base; + size_t iov_len; + } + + ssize_t readv(int, in iovec*, int); + ssize_t writev(int, in iovec*, int); +} else version (DragonFlyBSD) { struct iovec diff --git a/libphobos/libdruntime/core/sys/posix/sys/un.d b/libphobos/libdruntime/core/sys/posix/sys/un.d index c3cd683..11e98a7 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/un.d +++ b/libphobos/libdruntime/core/sys/posix/sys/un.d @@ -78,6 +78,15 @@ else version (NetBSD) byte[104] sun_path; } } +else version (OpenBSD) +{ + struct sockaddr_un + { + ubyte sun_len; + sa_family_t sun_family; + byte[104] sun_path; + } +} else version (DragonFlyBSD) { struct sockaddr_un diff --git a/libphobos/libdruntime/core/sys/posix/sys/utsname.d b/libphobos/libdruntime/core/sys/posix/sys/utsname.d index 8a5dd05..5de50ac 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/utsname.d +++ b/libphobos/libdruntime/core/sys/posix/sys/utsname.d @@ -89,6 +89,21 @@ else version (NetBSD) int uname(utsname* __name); } +else version (OpenBSD) +{ + private enum utsNameLength = 256; + + struct utsname + { + char[utsNameLength] sysname = 0; + char[utsNameLength] nodename = 0; + char[utsNameLength] release = 0; + char[utsNameLength] version_ = 0; + char[utsNameLength] machine = 0; + } + + int uname(utsname* __name); +} else version (DragonFlyBSD) { private enum utsNameLength = 32; diff --git a/libphobos/libdruntime/core/sys/posix/sys/wait.d b/libphobos/libdruntime/core/sys/posix/sys/wait.d index 123dd14..322326d 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/wait.d +++ b/libphobos/libdruntime/core/sys/posix/sys/wait.d @@ -144,6 +144,29 @@ else version (NetBSD) extern (D) int WSTOPSIG( int status ) { return status >> 8; } extern (D) int WTERMSIG( int status ) { return _WSTATUS( status ); } } +else version (OpenBSD) +{ + enum WNOHANG = 1; + enum WUNTRACED = 2; + + private + { + enum _WSTOPPED = 0x7F; // octal 0177 + enum _WCONTINUED = 0xFFFF; // octal 0177777 + } + + extern (D) int _WSTATUS(int status) { return (status & 0x7F); } + extern (D) int WEXITSTATUS(int status) { return (status >> 8) & 0xFF; } + extern (D) int WIFCONTINUED(int status) { return (status & _WCONTINUED) == _WCONTINUED; } + extern (D) bool WIFEXITED(int status) { return _WSTATUS(status) == 0; } + extern (D) bool WIFSIGNALED(int status) + { + return _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0; + } + extern (D) bool WIFSTOPPED(int status) { return (status & 0xFF) == _WSTOPPED; } + extern (D) int WSTOPSIG(int status) { return (status >> 8) & 0xFF; } + extern (D) int WTERMSIG(int status) { return _WSTATUS(status); } +} else version (DragonFlyBSD) { enum WNOHANG = 1; @@ -312,6 +335,13 @@ else version (NetBSD) //enum WCONTINUED = 4; enum WNOWAIT = 0x00010000; } +else version (OpenBSD) +{ + enum WCONTINUED = 8; + // OpenBSD does not define the following: + //enum WSTOPPED + //enum WNOWAIT +} else version (DragonFlyBSD) { enum WSTOPPED = WUNTRACED; @@ -362,6 +392,19 @@ else version (CRuntime_Bionic) } else version (CRuntime_Musl) { + enum WEXITED = 4; + enum WSTOPPED = 2; + enum WCONTINUED = 8; + enum WNOWAIT = 0x01000000; + + enum idtype_t + { + P_ALL, + P_PID, + P_PGID + } + + int waitid(idtype_t, id_t, siginfo_t*, int); } else version (CRuntime_UClibc) { diff --git a/libphobos/libdruntime/core/sys/posix/syslog.d b/libphobos/libdruntime/core/sys/posix/syslog.d index f02ec4c..64548fb 100644 --- a/libphobos/libdruntime/core/sys/posix/syslog.d +++ b/libphobos/libdruntime/core/sys/posix/syslog.d @@ -276,6 +276,73 @@ else version (NetBSD) void syslog (int __pri, const char *__fmt, ...); void closelog(); } +else version (OpenBSD) +{ + //PRIORITY + enum + { + LOG_EMERG = 0, /* system is unusable */ + LOG_ALERT = 1, /* action must be taken immediately */ + LOG_CRIT = 2, /* critical conditions */ + LOG_ERR = 3, /* error conditions */ + LOG_WARNING = 4, /* warning conditions */ + LOG_NOTICE = 5, /* normal but significant condition */ + LOG_INFO = 6, /* informational */ + LOG_DEBUG = 7, /* debug-level messages */ + } + + //OPTIONS + enum + { + LOG_PID = 0x01, /* log the pid with each message */ + LOG_CONS = 0x02, /* log on the console if errors in sending */ + LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */ + LOG_NDELAY = 0x08, /* don't delay open */ + LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */ + LOG_PERROR = 0x20, /* log to stderr as well */ + } + + //FACILITY + enum + { + LOG_KERN = (0<<3), /* kernel messages */ + LOG_USER = (1<<3), /* random user-level messages */ + LOG_MAIL = (2<<3), /* mail system */ + LOG_DAEMON = (3<<3), /* system daemons */ + LOG_AUTH = (4<<3), /* security/authorization messages */ + LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */ + LOG_LPR = (6<<3), /* line printer subsystem */ + LOG_NEWS = (7<<3), /* network news subsystem */ + LOG_UUCP = (8<<3), /* UUCP subsystem */ + LOG_CRON = (9<<3), /* clock daemon */ + LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */ + LOG_FTP = (11<<3), /* ftp daemon */ + // OpenBSD does not define the following: + //LOG_NTP + //LOG_SECURITY + //LOG_CONSOLE + + /* other codes through 15 reserved for system use */ + LOG_LOCAL0 = (16<<3), /* reserved for local use */ + LOG_LOCAL1 = (17<<3), /* reserved for local use */ + LOG_LOCAL2 = (18<<3), /* reserved for local use */ + LOG_LOCAL3 = (19<<3), /* reserved for local use */ + LOG_LOCAL4 = (20<<3), /* reserved for local use */ + LOG_LOCAL5 = (21<<3), /* reserved for local use */ + LOG_LOCAL6 = (22<<3), /* reserved for local use */ + LOG_LOCAL7 = (23<<3), /* reserved for local use */ + + LOG_NFACILITIES = 24, /* current number of facilities */ + } + + extern(D) int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */ + extern(D) int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */ + + void openlog(const char *, int, int); + int setlogmask(int); + void syslog(int, const char *, ...); + void closelog(); +} else version (DragonFlyBSD) { //PRIORITY diff --git a/libphobos/libdruntime/core/sys/posix/termios.d b/libphobos/libdruntime/core/sys/posix/termios.d index 1fdb552..f296a7f 100644 --- a/libphobos/libdruntime/core/sys/posix/termios.d +++ b/libphobos/libdruntime/core/sys/posix/termios.d @@ -683,6 +683,114 @@ else version (NetBSD) int tcsendbreak(int, int); int tcsetattr(int, int, in termios*); } +else version (OpenBSD) +{ + alias uint tcflag_t; + alias ubyte cc_t; + alias uint speed_t; + + enum NCCS = 20; + + struct termios + { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t[NCCS] c_cc; + int c_ispeed; + int c_ospeed; + } + + enum VEOF = 0; + enum VEOL = 1; + enum VERASE = 3; + enum VINTR = 8; + enum VKILL = 5; + enum VMIN = 16; + enum VQUIT = 9; + enum VSTART = 12; + enum VSTOP = 13; + enum VSUSP = 10; + enum VTIME = 17; + + enum BRKINT = 0x0000002; + enum ICRNL = 0x0000100; + enum IGNBRK = 0x0000001; + enum IGNCR = 0x0000080; + enum IGNPAR = 0x0000004; + enum INLCR = 0x0000040; + enum INPCK = 0x0000010; + enum ISTRIP = 0x0000020; + enum IXOFF = 0x0000400; + enum IXON = 0x0000200; + enum PARMRK = 0x0000008; + + enum OPOST = 0x0000001; + + enum B0 = 0; + enum B50 = 50; + enum B75 = 75; + enum B110 = 110; + enum B134 = 134; + enum B150 = 150; + enum B200 = 200; + enum B300 = 300; + enum B600 = 600; + enum B1200 = 1200; + enum B1800 = 1800; + enum B2400 = 2400; + enum B4800 = 4800; + enum B9600 = 9600; + enum B19200 = 19200; + enum B38400 = 38400; + + enum CSIZE = 0x0000300; + enum CS5 = 0x0000000; + enum CS6 = 0x0000100; + enum CS7 = 0x0000200; + enum CS8 = 0x0000300; + enum CSTOPB = 0x0000400; + enum CREAD = 0x0000800; + enum PARENB = 0x0001000; + enum PARODD = 0x0002000; + enum HUPCL = 0x0004000; + enum CLOCAL = 0x0008000; + + enum ECHO = 0x00000008; + enum ECHOE = 0x00000002; + enum ECHOK = 0x00000004; + enum ECHONL = 0x00000010; + enum ICANON = 0x00000100; + enum IEXTEN = 0x00000400; + enum ISIG = 0x00000080; + enum NOFLSH = 0x80000000; + enum TOSTOP = 0x00400000; + + enum TCSANOW = 0; + enum TCSADRAIN = 1; + enum TCSAFLUSH = 2; + + enum TCIFLUSH = 1; + enum TCOFLUSH = 2; + enum TCIOFLUSH = 3; + + enum TCIOFF = 3; + enum TCION = 4; + enum TCOOFF = 1; + enum TCOON = 2; + + speed_t cfgetispeed(in termios*); + speed_t cfgetospeed(in termios*); + int cfsetispeed(termios*, speed_t); + int cfsetospeed(termios*, speed_t); + int tcdrain(int); + int tcflow(int, int); + int tcflush(int, int); + int tcgetattr(int, termios*); + int tcsendbreak(int, int); + int tcsetattr(int, int, in termios*); +} else version (Solaris) { alias tcflag_t = uint; @@ -1141,6 +1249,40 @@ else version (NetBSD) pid_t tcgetsid(int); } +else version (OpenBSD) +{ + enum IXANY = 0x00000800; + + enum ONLCR = 0x00000002; + enum OCRNL = 0x00000010; + enum ONOCR = 0x00000040; + enum ONLRET = 0x00000080; + //enum OFILL + //enum NLDLY + //enum NL0 + //enum NL1 + //enum CRDLY + //enum CR0 + //enum CR1 + //enum CR2 + //enum CR3 + //enum TABDLY + //enum TAB0 + //enum TAB1 + //enum TAB2 + //enum TAB3 + //enum BSDLY + //enum BS0 + //enum BS1 + //enum VTDLY + //enum VT0 + //enum VT1 + //enum FFDLY + //enum FF0 + //enum FF1 + + pid_t tcgetsid(int); +} else version (Solaris) { enum IXANY = 0x0000800; diff --git a/libphobos/libdruntime/core/sys/posix/time.d b/libphobos/libdruntime/core/sys/posix/time.d index d6a9314..2859558 100644 --- a/libphobos/libdruntime/core/sys/posix/time.d +++ b/libphobos/libdruntime/core/sys/posix/time.d @@ -65,6 +65,10 @@ else version (NetBSD) { time_t timegm(tm*); // non-standard } +else version (OpenBSD) +{ + time_t timegm(tm*); // non-standard +} else version (DragonFlyBSD) { time_t timegm(tm*); // non-standard @@ -123,37 +127,24 @@ CLOCK_MONOTONIC version (linux) { enum CLOCK_MONOTONIC = 1; - // To be removed in December 2015. - static import core.sys.linux.time; - deprecated("Please import it from core.sys.linux.time instead.") - alias CLOCK_MONOTONIC_RAW = core.sys.linux.time.CLOCK_MONOTONIC_RAW; // non-standard - deprecated("Please import it from core.sys.linux.time instead.") - alias CLOCK_MONOTONIC_COARSE = core.sys.linux.time.CLOCK_MONOTONIC_COARSE; // non-standard } else version (FreeBSD) { // time.h enum CLOCK_MONOTONIC = 4; - // To be removed in December 2015. - static import core.sys.freebsd.time; - deprecated("Please import it from core.sys.freebsd.time instead.") - alias CLOCK_MONOTONIC_PRECISE = core.sys.freebsd.time.CLOCK_MONOTONIC_PRECISE; - deprecated("Please import it from core.sys.freebsd.time instead.") - alias CLOCK_MONOTONIC_FAST = core.sys.freebsd.time.CLOCK_MONOTONIC_FAST; } else version (NetBSD) { // time.h enum CLOCK_MONOTONIC = 3; } +else version (OpenBSD) +{ + // time.h + enum CLOCK_MONOTONIC = 3; +} else version (DragonFlyBSD) { // time.h enum CLOCK_MONOTONIC = 4; - // To be removed in December 2015. - static import core.sys.dragonflybsd.time; - deprecated("Please import it from core.sys.dragonflybsd.time instead.") - alias CLOCK_MONOTONIC_PRECISE = core.sys.dragonflybsd.time.CLOCK_MONOTONIC_PRECISE; - deprecated("Please import it from core.sys.dragonflybsd.time instead.") - alias CLOCK_MONOTONIC_FAST = core.sys.dragonflybsd.time.CLOCK_MONOTONIC_FAST; } else version (Darwin) { @@ -227,10 +218,6 @@ version (CRuntime_Glibc) } enum CLOCK_REALTIME = 0; - // To be removed in December 2015. - static import core.sys.linux.time; - deprecated("Please import it from core.sys.linux.time instead.") - alias CLOCK_REALTIME_COARSE = core.sys.linux.time.CLOCK_REALTIME_COARSE; // non-standard enum TIMER_ABSTIME = 0x01; alias int clockid_t; @@ -335,6 +322,30 @@ else version (NetBSD) int timer_getoverrun(timer_t); int timer_settime(timer_t, int, in itimerspec*, itimerspec*); } +else version (OpenBSD) +{ + struct itimerspec + { + timespec it_interval; + timespec it_value; + } + + enum CLOCK_REALTIME = 0; + enum TIMER_ABSTIME = 0x1; + + alias int clockid_t; // <sys/_types.h> + alias int timer_t; + + int clock_getres(clockid_t, timespec*); + int clock_gettime(clockid_t, timespec*); + int clock_settime(clockid_t, in timespec*); + int nanosleep(in timespec*, timespec*); + int timer_create(clockid_t, sigevent*, timer_t*); + int timer_delete(timer_t); + int timer_gettime(timer_t, itimerspec*); + int timer_getoverrun(timer_t); + int timer_settime(timer_t, int, in itimerspec*, itimerspec*); +} else version (Solaris) { enum CLOCK_PROCESS_CPUTIME_ID = 5; // <sys/time_impl.h> @@ -499,6 +510,13 @@ else version (NetBSD) tm* gmtime_r(in time_t*, tm*); tm* localtime_r(in time_t*, tm*); } +else version (OpenBSD) +{ + char* asctime_r(in tm*, char*); + char* ctime_r(in time_t*, char*); + tm* gmtime_r(in time_t*, tm*); + tm* localtime_r(in time_t*, tm*); +} else version (DragonFlyBSD) { char* asctime_r(in tm*, char*); @@ -578,6 +596,11 @@ else version (NetBSD) tm* getdate(in char*); char* strptime(in char*, in char*, tm*); } +else version (OpenBSD) +{ + //tm* getdate(in char*); + char* strptime(in char*, in char*, tm*); +} else version (DragonFlyBSD) { //tm* getdate(in char*); diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d index d664f2e..49a7c3e 100644 --- a/libphobos/libdruntime/core/sys/posix/ucontext.d +++ b/libphobos/libdruntime/core/sys/posix/ucontext.d @@ -23,6 +23,10 @@ extern (C): nothrow: @nogc: +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; version (RISCV32) version = RISCV_Any; version (RISCV64) version = RISCV_Any; version (S390) version = IBMZ_Any; @@ -770,6 +774,139 @@ version (CRuntime_Glibc) else static assert(0, "unimplemented"); } +else version (CRuntime_Musl) +{ + version (AArch64) + { + struct mcontext_t + { + real[18+256] __regs; + } + + struct ucontext_t + { + c_ulong uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + sigset_t uc_sigmask; + mcontext_t uc_mcontext; + } + } + else version (ARM) + { + struct mcontext_t + { + c_ulong[21] __regs; + } + + struct ucontext_t + { + c_ulong uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + ulong[64] uc_regspace; + } + } + else version (IBMZ_Any) + { + struct mcontext_t + { + c_ulong[18] __regs1; + uint[18] __regs2; + double[16] __regs3; + } + + struct ucontext_t + { + c_ulong uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + } + } + else version (MIPS_Any) + { + version (MIPS_N32) + { + struct mcontext_t + { + ulong[32] __mc1; + double[32] __mc2; + ulong[9] __mc3; + uint[4] __mc4; + } + } + else version (MIPS64) + { + struct mcontext_t + { + ulong[32] __mc1; + double[32] __mc2; + ulong[9] __mc3; + uint[4] __mc4; + } + } + else + { + struct mcontext_t + { + uint[2] __mc1; + ulong[65] __mc2; + uint[5] __mc3; + ulong[2] __mc4; + uint[6] __mc5; + } + } + + struct ucontext_t + { + c_ulong uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + } + } + else version (X86) + { + struct mcontext_t + { + uint[22] __space; + } + + struct ucontext_t + { + c_ulong uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + c_ulong[28] __fpregs_mem; + } + } + else version (X86_64) + { + struct mcontext_t + { + ulong[32] __space; + } + + struct ucontext_t + { + c_ulong uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + ulong[64] __fpregs_mem; + } + } + else + static assert(0, "unimplemented"); +} else version (FreeBSD) { // <machine/ucontext.h> @@ -897,6 +1034,26 @@ else version (FreeBSD) ulong[8] mc_spare; } } + else version (PPC_Any) + { + alias size_t __register_t; + alias uint __uint32_t; + alias ulong __uint64_t; + + struct mcontext_t { + int mc_vers; + int mc_flags; + enum _MC_FP_VALID = 0x01; + enum _MC_AV_VALID = 0x02; + int mc_onstack; + int mc_len; + __uint64_t[32 * 2] mc_avec; + __uint32_t[2] mc_av; + __register_t[42] mc_frame; + __uint64_t[33] mc_fpreg; + __uint64_t[32] mc_vsxfpreg; + } + } // <ucontext.h> enum UCF_SWAPPED = 0x00000001; @@ -914,44 +1071,57 @@ else version (FreeBSD) } else version (NetBSD) { - version (X86_64) { - enum { NGREG = 26 }; - alias __greg_t = ulong; - alias __gregset_t = __greg_t[NGREG]; - alias __fpregset_t = align(8)ubyte[512]; + private + { + enum _NGREG = 26; + alias __greg_t = c_ulong; + alias __gregset_t = __greg_t[_NGREG]; + alias __fpregset_t = align(8) ubyte[512]; + } - struct mcontext_t { - __gregset_t __gregs; - __greg_t _mc_tlsbase; - __fpregset_t __fpregs; - } + struct mcontext_t + { + __gregset_t __gregs; + __greg_t _mc_tlsbase; + __fpregset_t __fpregs; + } } else version (X86) { - enum { NGREG = 19 }; - alias __greg_t = ulong; - alias __gregset_t = __greg_t[_NGREG]; - struct __fpregset_t{ - union __fp_reg_set{ - struct __fpchip_state{ - int[27] __fp_state; /* Environment and registers */ - } ; /* x87 regs in fsave format */ - struct __fp_xmm_state{ + private + { + enum _NGREG = 19; + alias __greg_t = int; + alias __gregset_t = __greg_t[_NGREG]; + struct __fpregset_t + { + union fp_reg_set_t + { + struct fpchip_state_t + { + int[27] __fp_state; + } + struct fp_xmm_state_t + { ubyte[512] __fp_xmm; - } ; /* x87 and xmm regs in fxsave format */ - int[128] __fp_fpregs; - }; - __fpregset_t __fp_reg_set; - int[33] __fp_pad; /* Historic padding */ - }; + } + fpchip_state_t __fpchip_state; + fp_xmm_state_t __fp_xmm_state; + int[128] __fp_fpregs; + } + fp_reg_set_t __fp_reg_set; + int[33] __fp_pad; + } + } - struct mcontext_t { - __gregset_t __gregs; - __fpregset_t __fpregs; - __greg_t _mc_tlsbase; - } + struct mcontext_t + { + __gregset_t __gregs; + __fpregset_t __fpregs; + __greg_t _mc_tlsbase; + } } struct ucontext_t @@ -965,8 +1135,190 @@ else version (NetBSD) long __uc_pad[_UC_MACHINE_PAD]; #endif +/ + } +} +else version (OpenBSD) +{ + version (Alpha) + { + struct sigcontext + { + c_long sc_cookie; + c_long sc_mask; + c_long sc_pc; + c_long sc_ps; + c_ulong[32] sc_regs; + c_long sc_ownedfp; + c_ulong[32] sc_fpregs; + c_ulong sc_fpcr; + c_ulong sc_fp_control; + c_long[2] sc_reserved; + c_long[8] sc_xxx; + } + } + else version (X86_64) + { + struct sigcontext + { + c_long sc_rdi; + c_long sc_rsi; + c_long sc_rdx; + c_long sc_rcx; + c_long sc_r8; + c_long sc_r9; + c_long sc_r10; + c_long sc_r11; + c_long sc_r12; + c_long sc_r13; + c_long sc_r14; + c_long sc_r15; + c_long sc_rbp; + c_long sc_rbx; + c_long sc_rax; + c_long sc_gs; + c_long sc_fs; + c_long sc_es; + c_long sc_ds; + c_long sc_trapno; + c_long sc_err; + c_long sc_rip; + c_long sc_cs; + c_long sc_rflags; + c_long sc_rsp; + c_long sc_ss; + void* sc_fpstate; // struct fxsave64* + int __sc_unused; + int sc_mask; + c_long sc_cookie; + } + } + else version (AArch64) + { + struct sigcontext + { + int __sc_unused; + int sc_mask; + c_ulong sc_sp; + c_ulong sc_lr; + c_ulong sc_elr; + c_ulong sc_spsr; + c_ulong[30] sc_x; + c_long sc_cookie; + } + } + else version (ARM) + { + struct sigcontext + { + c_long sc_cookie; + int sc_mask; + uint sc_spsr; + uint sc_r0; + uint sc_r1; + uint sc_r2; + uint sc_r3; + uint sc_r4; + uint sc_r5; + uint sc_r6; + uint sc_r7; + uint sc_r8; + uint sc_r9; + uint sc_r10; + uint sc_r11; + uint sc_r12; + uint sc_usr_sp; + uint sc_usr_lr; + uint sc_svc_lr; + uint sc_pc; + uint sc_fpused; + uint sc_fpscr; + ulong[32] sc_fpreg; + } + } + else version (HPPA) + { + struct sigcontext + { + c_ulong __sc_unused; + c_long sc_mask; + c_ulong sc_ps; + c_ulong sc_fp; + c_ulong sc_pcoqh; + c_ulong sc_pcoqt; + c_ulong[2] sc_resv; + c_ulong[32] sc_regs; + c_ulong[64] sc_fpregs; + c_long sc_cookie; + } + } + else version (X86) + { + struct sigcontext + { + int sc_gs; + int sc_fs; + int sc_es; + int sc_ds; + int sc_edi; + int sc_esi; + int sc_ebp; + int sc_ebx; + int sc_edx; + int sc_ecx; + int sc_eax; + int sc_eip; + int sc_cs; + int sc_eflags; + int sc_esp; + int sc_ss; + c_long sc_cookie; + int sc_mask; + int sc_trapno; + int sc_err; + void* sc_fpstate; // union savefpu* + }; + } + else version (PPC) + { + private struct trapframe + { + c_long[32] fixreg; + c_long lr; + c_long cr; + c_long xer; + c_long ctr; + int srr0; + int srr1; + int dar; + int dsisr; + c_long exc; + } + struct sigcontext + { + c_long sc_cookie; + int sc_mask; + trapframe sc_frame; + } } + else version (SPARC64) + { + struct sigcontext + { + c_long sc_cookie; + c_long sc_sp; + c_long sc_pc; + c_long sc_npc; + c_long sc_tstate; + c_long sc_g1; + c_long sc_o0; + int sc_mask; + } + } + else + static assert(false, "Architecture not supported."); + + alias ucontext_t = sigcontext; } else version (DragonFlyBSD) { diff --git a/libphobos/libdruntime/core/sys/posix/unistd.d b/libphobos/libdruntime/core/sys/posix/unistd.d index e5e2183..6e035e5 100644 --- a/libphobos/libdruntime/core/sys/posix/unistd.d +++ b/libphobos/libdruntime/core/sys/posix/unistd.d @@ -131,6 +131,11 @@ else version (NetBSD) off_t lseek(int, off_t, int) @trusted; int ftruncate(int, off_t) @trusted; } +else version (OpenBSD) +{ + off_t lseek(int, off_t, int) @trusted; + int ftruncate(int, off_t) @trusted; +} else version (DragonFlyBSD) { off_t lseek(int, off_t, int) @trusted; @@ -993,6 +998,188 @@ else version (NetBSD) _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 14, } } +else version (OpenBSD) +{ + enum F_OK = 0; + enum R_OK = 0x04; + enum W_OK = 0x02; + enum X_OK = 0x01; + + enum F_ULOCK = 0; + enum F_LOCK = 1; + enum F_TLOCK = 2; + enum F_TEST = 3; + + enum + { + _SC_ARG_MAX = 1, + _SC_CHILD_MAX = 2, + _O_SC_CLK_TCK = 3, + _SC_NGROUPS_MAX = 4, + _SC_OPEN_MAX = 5, + _SC_JOB_CONTROL = 6, + _SC_SAVED_IDS = 7, + _SC_VERSION = 8, + _SC_BC_BASE_MAX = 9, + _SC_BC_DIM_MAX = 10, + _SC_BC_SCALE_MAX = 11, + _SC_BC_STRING_MAX = 12, + _SC_COLL_WEIGHTS_MAX = 13, + _SC_EXPR_NEST_MAX = 14, + _SC_LINE_MAX = 15, + _SC_RE_DUP_MAX = 16, + _SC_2_VERSION = 17, + _SC_2_C_BIND = 18, + _SC_2_C_DEV = 19, + _SC_2_CHAR_TERM = 20, + _SC_2_FORT_DEV = 21, + _SC_2_FORT_RUN = 22, + _SC_2_LOCALEDEF = 23, + _SC_2_SW_DEV = 24, + _SC_2_UPE = 25, + _SC_STREAM_MAX = 26, + _SC_TZNAME_MAX = 27, + _SC_PAGESIZE = 28, + _SC_FSYNC = 29, + _SC_XOPEN_SHM = 30, + _SC_SEM_NSEMS_MAX = 31, + _SC_SEM_VALUE_MAX = 32, + _SC_HOST_NAME_MAX = 33, + _SC_MONOTONIC_CLOCK = 34, + _SC_2_PBS = 35, + _SC_2_PBS_ACCOUNTING = 36, + _SC_2_PBS_CHECKPOINT = 37, + _SC_2_PBS_LOCATE = 38, + _SC_2_PBS_MESSAGE = 39, + _SC_2_PBS_TRACK = 40, + _SC_ADVISORY_INFO = 41, + _SC_AIO_LISTIO_MAX = 42, + _SC_AIO_MAX = 43, + _SC_AIO_PRIO_DELTA_MAX = 44, + _SC_ASYNCHRONOUS_IO = 45, + _SC_ATEXIT_MAX = 46, + _SC_BARRIERS = 47, + _SC_CLOCK_SELECTION = 48, + _SC_CPUTIME = 49, + _SC_DELAYTIMER_MAX = 50, + _SC_IOV_MAX = 51, + _SC_IPV6 = 52, + _SC_MAPPED_FILES = 53, + _SC_MEMLOCK = 54, + _SC_MEMLOCK_RANGE = 55, + _SC_MEMORY_PROTECTION = 56, + _SC_MESSAGE_PASSING = 57, + _SC_MQ_OPEN_MAX = 58, + _SC_MQ_PRIO_MAX = 59, + _SC_PRIORITIZED_IO = 60, + _SC_PRIORITY_SCHEDULING = 61, + _SC_RAW_SOCKETS = 62, + _SC_READER_WRITER_LOCKS = 63, + _SC_REALTIME_SIGNALS = 64, + _SC_REGEXP = 65, + _SC_RTSIG_MAX = 66, + _SC_SEMAPHORES = 67, + _SC_SHARED_MEMORY_OBJECTS = 68, + _SC_SHELL = 69, + _SC_SIGQUEUE_MAX = 70, + _SC_SPAWN = 71, + _SC_SPIN_LOCKS = 72, + _SC_SPORADIC_SERVER = 73, + _SC_SS_REPL_MAX = 74, + _SC_SYNCHRONIZED_IO = 75, + _SC_SYMLOOP_MAX = 76, + _SC_THREAD_ATTR_STACKADDR = 77, + _SC_THREAD_ATTR_STACKSIZE = 78, + _SC_THREAD_CPUTIME = 79, + _SC_THREAD_DESTRUCTOR_ITERATIONS = 80, + _SC_THREAD_KEYS_MAX = 81, + _SC_THREAD_PRIO_INHERIT = 82, + _SC_THREAD_PRIO_PROTECT = 83, + _SC_THREAD_PRIORITY_SCHEDULING = 84, + _SC_THREAD_PROCESS_SHARED = 85, + _SC_THREAD_ROBUST_PRIO_INHERIT = 86, + _SC_THREAD_ROBUST_PRIO_PROTECT = 87, + _SC_THREAD_SPORADIC_SERVER = 88, + _SC_THREAD_STACK_MIN = 89, + _SC_THREAD_THREADS_MAX = 90, + _SC_THREADS = 91, + _SC_TIMEOUTS = 92, + _SC_TIMER_MAX = 93, + _SC_TIMERS = 94, + _SC_TRACE = 95, + _SC_TRACE_EVENT_FILTER = 96, + _SC_TRACE_EVENT_NAME_MAX = 97, + _SC_TRACE_INHERIT = 98, + _SC_TRACE_LOG = 99, + _SC_GETGR_R_SIZE_MAX = 100, + _SC_GETPW_R_SIZE_MAX = 101, + _SC_LOGIN_NAME_MAX = 102, + _SC_THREAD_SAFE_FUNCTIONS = 103, + _SC_TRACE_NAME_MAX = 104, + _SC_TRACE_SYS_MAX = 105, + _SC_TRACE_USER_EVENT_MAX = 106, + _SC_TTY_NAME_MAX = 107, + _SC_TYPED_MEMORY_OBJECTS = 108, + _SC_V6_ILP32_OFF32 = 109, + _SC_V6_ILP32_OFFBIG = 110, + _SC_V6_LP64_OFF64 = 111, + _SC_V6_LPBIG_OFFBIG = 112, + _SC_V7_ILP32_OFF32 = 113, + _SC_V7_ILP32_OFFBIG = 114, + _SC_V7_LP64_OFF64 = 115, + _SC_V7_LPBIG_OFFBIG = 116, + _SC_XOPEN_CRYPT = 117, + _SC_XOPEN_ENH_I18N = 118, + _SC_XOPEN_LEGACY = 119, + _SC_XOPEN_REALTIME = 120, + _SC_XOPEN_REALTIME_THREADS = 121, + _SC_XOPEN_STREAMS = 122, + _SC_XOPEN_UNIX = 123, + _SC_XOPEN_UUCP = 124, + _SC_XOPEN_VERSION = 125, + _SC_PHYS_PAGES = 500, + _SC_AVPHYS_PAGES = 501, + _SC_NPROCESSORS_CONF = 502, + _SC_NPROCESSORS_ONLN = 503, + } + + enum _SC_PAGE_SIZE = _SC_PAGESIZE; + + enum + { + _CS_PATH = 1, + _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 2, + _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 3, + _CS_POSIX_V6_ILP32_OFF32_LIBS = 4, + _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 5, + _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 6, + _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 7, + _CS_POSIX_V6_LP64_OFF64_CFLAGS = 8, + _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 9, + _CS_POSIX_V6_LP64_OFF64_LIBS = 10, + _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 11, + _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 12, + _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 13, + _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 14, + _CS_V6_ENV = 15, + _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 16, + _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 17, + _CS_POSIX_V7_ILP32_OFF32_LIBS = 18, + _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 19, + _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 20, + _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 21, + _CS_POSIX_V7_LP64_OFF64_CFLAGS = 22, + _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 23, + _CS_POSIX_V7_LP64_OFF64_LIBS = 24, + _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 25, + _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 26, + _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 27, + _CS_POSIX_V7_THREADS_CFLAGS = 28, + _CS_POSIX_V7_THREADS_LDFLAGS = 29, + _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 30, + _CS_V7_ENV = 31, + } +} else version (DragonFlyBSD) { enum F_OK = 0; @@ -2007,6 +2194,10 @@ else version (NetBSD) { int fsync(int) @trusted; } +else version (OpenBSD) +{ + int fsync(int) @trusted; +} else version (DragonFlyBSD) { int fsync(int) @trusted; @@ -2208,6 +2399,31 @@ else version (NetBSD) int usleep(useconds_t) @trusted; pid_t vfork(); } +else version (OpenBSD) +{ + char* crypt(in char*, in char*); + //char* ctermid(char*); + void encrypt(ref char[64], int) @trusted; + int fchdir(int) @trusted; + c_long gethostid() @trusted; + pid_t getpgid(pid_t) @trusted; + pid_t getsid(pid_t) @trusted; + char* getwd(char*); + int lchown(in char*, uid_t, gid_t); + int lockf(int, int, off_t) @trusted; + int nice(int) @trusted; + ssize_t pread(int, void*, size_t, off_t); + ssize_t pwrite(int, in void*, size_t, off_t); + int setpgrp(pid_t, pid_t) @trusted; + int setregid(gid_t, gid_t) @trusted; + int setreuid(uid_t, uid_t) @trusted; + void swab(in void*, void*, ssize_t); + void sync() @trusted; + int truncate(in char*, off_t); + useconds_t ualarm(useconds_t, useconds_t) @trusted; + int usleep(useconds_t) @trusted; + pid_t vfork(); +} else version (DragonFlyBSD) { char* crypt(in char*, in char*); diff --git a/libphobos/libdruntime/core/sys/posix/utime.d b/libphobos/libdruntime/core/sys/posix/utime.d index d1a41f5..ae54c20 100644 --- a/libphobos/libdruntime/core/sys/posix/utime.d +++ b/libphobos/libdruntime/core/sys/posix/utime.d @@ -94,6 +94,16 @@ else version (NetBSD) int utime(in char*, in utimbuf*); } +else version (OpenBSD) +{ + struct utimbuf + { + time_t actime; + time_t modtime; + } + + int utime(in char*, in utimbuf*); +} else version (DragonFlyBSD) { struct utimbuf diff --git a/libphobos/libdruntime/core/sys/windows/winnt.d b/libphobos/libdruntime/core/sys/windows/winnt.d index abb65f8..f378a17 100644 --- a/libphobos/libdruntime/core/sys/windows/winnt.d +++ b/libphobos/libdruntime/core/sys/windows/winnt.d @@ -49,6 +49,9 @@ alias void* PVOID64; alias const(char)* PCCH, LPCCH, PCSTR, LPCSTR; alias const(wchar)* LPCWCH, PCWCH, LPCWSTR, PCWSTR; +alias PSTR* PZPSTR; +alias PWSTR* PZPWSTR; + version (Unicode) { alias WCHAR TCHAR, _TCHAR; } else { diff --git a/libphobos/libdruntime/core/thread.d b/libphobos/libdruntime/core/thread.d index 3e9802d..fb5f942 100644 --- a/libphobos/libdruntime/core/thread.d +++ b/libphobos/libdruntime/core/thread.d @@ -1190,8 +1190,8 @@ class Thread } else { - // NOTE: pthread_setschedprio is not implemented on Darwin, FreeBSD or DragonFlyBSD, so use - // the more complicated get/set sequence below. + // NOTE: pthread_setschedprio is not implemented on Darwin, FreeBSD, OpenBSD, + // or DragonFlyBSD, so use the more complicated get/set sequence below. int policy; sched_param param; @@ -3205,6 +3205,7 @@ extern (C) @nogc nothrow version (CRuntime_Glibc) int pthread_getattr_np(pthread_t thread, pthread_attr_t* attr); version (FreeBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr); version (NetBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr); + version (OpenBSD) int pthread_stackseg_np(pthread_t thread, stack_t* sinfo); version (DragonFlyBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr); version (Solaris) int thr_stksegment(stack_t* stk); version (CRuntime_Bionic) int pthread_getattr_np(pthread_t thid, pthread_attr_t* attr); @@ -3298,6 +3299,13 @@ private void* getStackBottom() nothrow @nogc addr += size; return addr; } + else version (OpenBSD) + { + stack_t stk; + + pthread_stackseg_np(pthread_self(), &stk); + return stk.ss_sp; + } else version (DragonFlyBSD) { pthread_attr_t attr; @@ -4612,6 +4620,7 @@ private: version (Posix) import core.sys.posix.sys.mman; // mmap version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON; version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON; + version (OpenBSD) import core.sys.openbsd.sys.mman : MAP_ANON; version (DragonFlyBSD) import core.sys.dragonflybsd.sys.mman : MAP_ANON; version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON; version (Darwin) import core.sys.darwin.sys.mman : MAP_ANON; diff --git a/libphobos/libdruntime/core/time.d b/libphobos/libdruntime/core/time.d index a7640ec..e7744c8 100644 --- a/libphobos/libdruntime/core/time.d +++ b/libphobos/libdruntime/core/time.d @@ -164,7 +164,7 @@ version (CoreDdoc) enum ClockType normal = 0, /++ - $(BLUE Linux-Only) + $(BLUE Linux,OpenBSD-Only) Uses $(D CLOCK_BOOTTIME). +/ @@ -214,7 +214,7 @@ version (CoreDdoc) enum ClockType precise = 3, /++ - $(BLUE Linux,Solaris-Only) + $(BLUE Linux,OpenBSD,Solaris-Only) Uses $(D CLOCK_PROCESS_CPUTIME_ID). +/ @@ -251,14 +251,14 @@ version (CoreDdoc) enum ClockType second = 6, /++ - $(BLUE Linux,Solaris-Only) + $(BLUE Linux,OpenBSD,Solaris-Only) Uses $(D CLOCK_THREAD_CPUTIME_ID). +/ threadCPUTime = 7, /++ - $(BLUE FreeBSD-Only) + $(BLUE DragonFlyBSD,FreeBSD,OpenBSD-Only) Uses $(D CLOCK_UPTIME). +/ @@ -320,6 +320,17 @@ else version (NetBSD) enum ClockType precise = 3, second = 6, } +else version (OpenBSD) enum ClockType +{ + normal = 0, + bootTime = 1, + coarse = 2, + precise = 3, + processCPUTime = 4, + second = 6, + threadCPUTime = 7, + uptime = 8, +} else version (DragonFlyBSD) enum ClockType { normal = 0, @@ -396,6 +407,21 @@ version (Posix) case second: assert(0); } } + else version (OpenBSD) + { + import core.sys.openbsd.time; + with(ClockType) final switch (clockType) + { + case bootTime: return CLOCK_BOOTTIME; + case coarse: return CLOCK_MONOTONIC; + case normal: return CLOCK_MONOTONIC; + case precise: return CLOCK_MONOTONIC; + case processCPUTime: return CLOCK_PROCESS_CPUTIME_ID; + case threadCPUTime: return CLOCK_THREAD_CPUTIME_ID; + case uptime: return CLOCK_UPTIME; + case second: assert(0); + } + } else version (DragonFlyBSD) { import core.sys.dragonflybsd.time; diff --git a/libphobos/libdruntime/gc/os.d b/libphobos/libdruntime/gc/os.d index cfef7f3..337f134 100644 --- a/libphobos/libdruntime/gc/os.d +++ b/libphobos/libdruntime/gc/os.d @@ -43,6 +43,7 @@ else version (Posix) version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON; version (DragonFlyBSD) import core.sys.dragonflybsd.sys.mman : MAP_ANON; version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON; + version (OpenBSD) import core.sys.openbsd.sys.mman : MAP_ANON; version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON; version (Darwin) import core.sys.darwin.sys.mman : MAP_ANON; version (CRuntime_UClibc) import core.sys.linux.sys.mman : MAP_ANON; diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE index cfac5c6..6a1e008 100644 --- a/libphobos/src/MERGE +++ b/libphobos/src/MERGE @@ -1,4 +1,4 @@ -3dc363783ea7b1e82336983486a14f3f44bbeadd +66ae77ac3f97a007a12738e4bc02b3bbfef99bba The first line of this file holds the git revision number of the last merge done from the dlang/phobos repository. diff --git a/libphobos/src/std/experimental/allocator/building_blocks/region.d b/libphobos/src/std/experimental/allocator/building_blocks/region.d index 43dfdb7..835d093 100644 --- a/libphobos/src/std/experimental/allocator/building_blocks/region.d +++ b/libphobos/src/std/experimental/allocator/building_blocks/region.d @@ -580,6 +580,12 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment) assert(a.length == 2001); } +version(CRuntime_Musl) +{ + // sbrk and brk are disabled in Musl: + // https://git.musl-libc.org/cgit/musl/commit/?id=7a995fe706e519a4f55399776ef0df9596101f93 + // https://git.musl-libc.org/cgit/musl/commit/?id=863d628d93ea341b6a32661a1654320ce69f6a07 +} else: private extern(C) void* sbrk(long); private extern(C) int brk(shared void*); diff --git a/libphobos/src/std/socket.d b/libphobos/src/std/socket.d index 2853dbd..a4ba39c 100644 --- a/libphobos/src/std/socket.d +++ b/libphobos/src/std/socket.d @@ -163,47 +163,7 @@ string formatSocketError(int err) @trusted { cs = strerror_r(err, buf.ptr, buf.length); } - else version (OSX) - { - auto errs = strerror_r(err, buf.ptr, buf.length); - if (errs == 0) - cs = buf.ptr; - else - return "Socket error " ~ to!string(err); - } - else version (FreeBSD) - { - auto errs = strerror_r(err, buf.ptr, buf.length); - if (errs == 0) - cs = buf.ptr; - else - return "Socket error " ~ to!string(err); - } - else version (NetBSD) - { - auto errs = strerror_r(err, buf.ptr, buf.length); - if (errs == 0) - cs = buf.ptr; - else - return "Socket error " ~ to!string(err); - } - else version (DragonFlyBSD) - { - auto errs = strerror_r(err, buf.ptr, buf.length); - if (errs == 0) - cs = buf.ptr; - else - return "Socket error " ~ to!string(err); - } - else version (Solaris) - { - auto errs = strerror_r(err, buf.ptr, buf.length); - if (errs == 0) - cs = buf.ptr; - else - return "Socket error " ~ to!string(err); - } - else version (CRuntime_Bionic) + else { auto errs = strerror_r(err, buf.ptr, buf.length); if (errs == 0) @@ -211,8 +171,6 @@ string formatSocketError(int err) @trusted else return "Socket error " ~ to!string(err); } - else - static assert(0); auto len = strlen(cs); diff --git a/libphobos/src/std/stdio.d b/libphobos/src/std/stdio.d index 63bc32e..4c1ad0b 100644 --- a/libphobos/src/std/stdio.d +++ b/libphobos/src/std/stdio.d @@ -44,38 +44,38 @@ version (CRuntime_Glibc) version = GCC_IO; version = HAS_GETDELIM; } - -version (OSX) +else version (CRuntime_Bionic) { version = GENERIC_IO; version = HAS_GETDELIM; } - -version (FreeBSD) +else version (CRuntime_Musl) { version = GENERIC_IO; version = HAS_GETDELIM; } -version (NetBSD) +version (OSX) { version = GENERIC_IO; version = HAS_GETDELIM; } - -version (DragonFlyBSD) +else version (FreeBSD) { version = GENERIC_IO; version = HAS_GETDELIM; } - -version (Solaris) +else version (NetBSD) { version = GENERIC_IO; - version = NO_GETDELIM; + version = HAS_GETDELIM; } - -version (CRuntime_Bionic) +else version (DragonFlyBSD) +{ + version = GENERIC_IO; + version = HAS_GETDELIM; +} +else version (Solaris) { version = GENERIC_IO; version = NO_GETDELIM; diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 086966a..d1c651d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2019-08-20 Jonathan Wakely <jwakely@redhat.com> + + * doc/doxygen/user.cfg.in (INPUT): Remove profile mode headers. + + * include/std/numeric (reduce): Fix Doxygen markup. + + PR libstdc++/91371 + * include/std/type_traits (is_function): Simplify definition. Remove + partial specializations for function types. + (__is_referenceable): Simplify definition. + * testsuite/20_util/bind/91371.cc: New test. + * testsuite/20_util/is_function/91371.cc: New test. + * testsuite/20_util/is_function/value.cc: Check more pointer types. + * testsuite/20_util/is_member_function_pointer/91371.cc: New test. + * testsuite/20_util/is_object/91371.cc: New test. + 2019-08-16 Uros Bizjak <ubizjak@gmail.com> * config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update. diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 4ac5a0e..dc49399 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -886,17 +886,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/debug/unordered_map \ include/debug/unordered_set \ include/debug/vector \ - include/profile \ - include/profile/impl \ - include/profile/bitset \ - include/profile/deque \ - include/profile/forward_list \ - include/profile/list \ - include/profile/map \ - include/profile/set \ - include/profile/unordered_map \ - include/profile/unordered_set \ - include/profile/vector \ include/ext/algorithm \ include/ext/cmath \ include/ext/functional \ diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric index 2f94621..2392769 100644 --- a/libstdc++-v3/include/std/numeric +++ b/libstdc++-v3/include/std/numeric @@ -288,7 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @return The final sum. * * Reduce the values in the range `[first,last)` using addition. - * Equivalent to calling std::reduce(first, last, init, std::plus<>())`. + * Equivalent to calling `std::reduce(first, last, init, std::plus<>())`. */ template<typename _InputIterator, typename _Tp> inline _Tp @@ -304,7 +304,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Reduce the values in the range `[first,last)` using addition, with * an initial value of `T{}`, where `T` is the iterator's value type. - * Equivalent to calling std::reduce(first, last, T{}, std::plus<>())`. + * Equivalent to calling `std::reduce(first, last, T{}, std::plus<>())`. */ template<typename _InputIterator> inline typename iterator_traits<_InputIterator>::value_type diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 44db2ca..4432088 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -223,12 +223,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __failure_type { }; - // Primary type categories. - template<typename> struct remove_cv; template<typename> + struct is_const; + + // Primary type categories. + + template<typename> struct __is_void_helper : public false_type { }; @@ -481,105 +484,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { }; /// is_function - template<typename> + template<typename _Tp> struct is_function - : public false_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) const _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) const & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) const && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; + : public __bool_constant<!is_const<const _Tp>::value> { }; - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) const _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) const & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) const && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) volatile _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) volatile & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) volatile && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) volatile _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) volatile & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) volatile && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) const volatile _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) const volatile & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes...) const volatile && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) const volatile _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; - - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) const volatile & _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; + template<typename _Tp> + struct is_function<_Tp&> + : public false_type { }; - template<typename _Res, typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM> - struct is_function<_Res(_ArgTypes......) const volatile && _GLIBCXX_NOEXCEPT_QUAL> - : public true_type { }; + template<typename _Tp> + struct is_function<_Tp&&> + : public false_type { }; #define __cpp_lib_is_null_pointer 201309 @@ -706,20 +621,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >; + // __void_t (std::void_t for C++11) + template<typename...> using __void_t = void; + // Utility to detect referenceable types ([defns.referenceable]). - template<typename _Tp> + template<typename _Tp, typename = void> struct __is_referenceable - : public __or_<is_object<_Tp>, is_reference<_Tp>>::type - { }; - - template<typename _Res, typename... _Args _GLIBCXX_NOEXCEPT_PARM> - struct __is_referenceable<_Res(_Args...) _GLIBCXX_NOEXCEPT_QUAL> - : public true_type + : public false_type { }; - template<typename _Res, typename... _Args _GLIBCXX_NOEXCEPT_PARM> - struct __is_referenceable<_Res(_Args......) _GLIBCXX_NOEXCEPT_QUAL> + template<typename _Tp> + struct __is_referenceable<_Tp, __void_t<_Tp&>> : public true_type { }; @@ -2261,9 +2174,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct conditional<false, _Iftrue, _Iffalse> { typedef _Iffalse type; }; - // __void_t (std::void_t for C++11) - template<typename...> using __void_t = void; - /// common_type template<typename... _Tp> struct common_type; diff --git a/libstdc++-v3/testsuite/20_util/bind/91371.cc b/libstdc++-v3/testsuite/20_util/bind/91371.cc new file mode 100644 index 0000000..1c6f55e --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/bind/91371.cc @@ -0,0 +1,37 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-require-effective-target c++11 } + +#include <functional> + +int bar(int) __attribute__((ms_abi)); +int baz(int) __attribute__((sysv_abi)); + +void +test01() +{ + // PR libstdc++/91371 + std::bind(bar, 5)(); + std::bind(baz, 5)(); + + static_assert(std::is_function<decltype(bar)>::value, ""); + static_assert(std::is_function<decltype(baz)>::value, ""); + static_assert(std::is_pointer<std::decay_t<decltype(bar)>>::value, ""); + static_assert(std::is_pointer<std::decay_t<decltype(baz)>>::value, ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_function/91371.cc b/libstdc++-v3/testsuite/20_util/is_function/91371.cc new file mode 100644 index 0000000..c51d373 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_function/91371.cc @@ -0,0 +1,47 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-require-effective-target c++11 } + +#include <type_traits> + +using std::is_function; + +#ifdef __i386__ +static_assert(is_function<void __attribute__((thiscall)) ()>::value, ""); +static_assert(is_function<void __attribute__((thiscall)) () const>::value, ""); +static_assert(is_function<void __attribute__((fastcall)) ()>::value, ""); +static_assert(is_function<void __attribute__((fastcall)) () const>::value, ""); +static_assert(is_function<void __attribute__((stdcall)) ()>::value, ""); +static_assert(is_function<void __attribute__((stdcall)) () const>::value, ""); +#endif +static_assert(is_function<void __attribute__((ms_abi)) ()>::value, ""); +static_assert(is_function<void __attribute__((ms_abi)) () const>::value, ""); +static_assert(is_function<void __attribute__((ms_abi)) () const &>::value, ""); +static_assert(is_function<void __attribute__((ms_abi)) () &&>::value, ""); +static_assert(is_function<void __attribute__((sysv_abi)) ()>::value, ""); +static_assert(is_function<void __attribute__((sysv_abi)) () const>::value, ""); + +struct X { operator X*(); }; +static_assert(!is_function<X>::value, ""); +static_assert(!is_function<X&>::value, ""); +static_assert(!is_function<X*>::value, ""); +union Y { operator Y*(); int i; long l;}; +static_assert(!is_function<Y>::value, ""); +static_assert(!is_function<Y&>::value, ""); +static_assert(!is_function<Y*>::value, ""); diff --git a/libstdc++-v3/testsuite/20_util/is_function/value.cc b/libstdc++-v3/testsuite/20_util/is_function/value.cc index 7b94b58b..4a3bb7c 100644 --- a/libstdc++-v3/testsuite/20_util/is_function/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_function/value.cc @@ -37,12 +37,18 @@ void test01() char (int, ClassType) const volatile &&>(true), ""); // Negative tests. + static_assert(test_category<is_function, int*>(false), ""); static_assert(test_category<is_function, int&>(false), ""); static_assert(test_category<is_function, void>(false), ""); static_assert(test_category<is_function, const void>(false), ""); + static_assert(test_category<is_function, void*>(false), ""); + static_assert(test_category<is_function, const void*>(false), ""); + static_assert(test_category<is_function, void**>(false), ""); + static_assert(test_category<is_function, std::nullptr_t>(false), ""); static_assert(test_category<is_function, AbstractClass>(false), ""); static_assert(test_category<is_function, int(&)(int)>(false), ""); + static_assert(test_category<is_function, int(*)(int)>(false), ""); // Sanity check. static_assert(test_category<is_function, ClassType>(false), ""); diff --git a/libstdc++-v3/testsuite/20_util/is_member_function_pointer/91371.cc b/libstdc++-v3/testsuite/20_util/is_member_function_pointer/91371.cc new file mode 100644 index 0000000..25fecc1 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_member_function_pointer/91371.cc @@ -0,0 +1,35 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-require-effective-target c++11 } + +#include <type_traits> + +struct Z +{ + void __attribute__((ms_abi)) f() const { } + void __attribute__((sysv_abi)) g() const { } +#ifdef __i386__ + void __attribute__((thiscall)) h() const { } +#endif +}; +static_assert( std::is_member_function_pointer<decltype(&Z::f)>::value, "" ); +static_assert( std::is_member_function_pointer<decltype(&Z::g)>::value, "" ); +#ifdef __i386__ +static_assert( std::is_member_function_pointer<decltype(&Z::h)>::value, "" ); +#endif diff --git a/libstdc++-v3/testsuite/20_util/is_object/91371.cc b/libstdc++-v3/testsuite/20_util/is_object/91371.cc new file mode 100644 index 0000000..3520d76 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_object/91371.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-require-effective-target c++11 } + +#include <type_traits> + +using std::is_object; + +#ifdef __i386__ +static_assert(!is_object<void __attribute__((thiscall)) ()>::value, ""); +static_assert(!is_object<void __attribute__((thiscall)) () const>::value, ""); +static_assert(!is_object<void __attribute__((fastcall)) ()>::value, ""); +static_assert(!is_object<void __attribute__((fastcall)) () const>::value, ""); +static_assert(!is_object<void __attribute__((stdcall)) ()>::value, ""); +static_assert(!is_object<void __attribute__((stdcall)) () const>::value, ""); +#endif +static_assert(!is_object<void __attribute__((ms_abi)) ()>::value, ""); +static_assert(!is_object<void __attribute__((ms_abi)) () const>::value, ""); +static_assert(!is_object<void __attribute__((ms_abi)) () const &>::value, ""); +static_assert(!is_object<void __attribute__((ms_abi)) () &&>::value, ""); +static_assert(!is_object<void __attribute__((sysv_abi)) ()>::value, ""); +static_assert(!is_object<void __attribute__((sysv_abi)) () const>::value, ""); |