blob: 56d9baf7e7a67aa21147bcea796b6745929370cf [file] [log] [blame]
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Has_Excluded_Declaration): Remove redundant guard;
the guarded code will call First on a No_List, which is
well-defined and gives Empty.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Has_Excluded_Declaration): Rename and reduce scope
of a local variable.
2021-09-20 Bob Duff <duff@adacore.com>
* uintp.ads, uintp.adb (Present, No): New functions for
comparing with No_Uint.
* checks.adb, einfo-utils.adb, exp_aggr.adb, exp_attr.adb,
exp_ch3.adb, exp_ch4.adb, exp_dbug.adb, exp_disp.adb,
exp_util.adb, repinfo.adb, repinfo-input.adb, scn.adb,
sem_attr.adb, sem_ch13.adb, sem_eval.adb, sem_util.adb,
sinfo-utils.adb, treepr.adb: Use Present (...) instead of "...
/= No_Uint", and No (...) instead of "... = No_Uint".
2021-09-20 Claire Dross <dross@adacore.com>
* libgnat/s-ficobl.ads: The entire package has a SPARK_Mode =>
Off aspect.
2021-09-20 Doug Rupp <rupp@adacore.com>
* libgnat/a-calend.adb: Remove time_t, replace with OS_Time.
* libgnat/s-os_lib.ads: Fix comments regarding time_t conversion
functions to reflect the use of To_Ada in in Ada.Calendar
package body.
* sysdep.c (__gnat_localtime_tzoff): Use OS_Time instead of
time_t.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* sem_res.adb (Resolve_Actual): Remove
2021-09-20 Bob Duff <duff@adacore.com>
* einfo-utils.ads, einfo-utils.adb, fe.h, einfo.ads,
gen_il-fields.ads: Remove unused and no-longer-used routines.
Move related routines together. Rewrite incorrect
documentation, and documentation that will be incorrect when
e.g. Esize-related routines are fixed. Remove unused field
Normalized_Position_Max.
* cstand.adb, exp_pakd.adb, freeze.adb,
gen_il-gen-gen_entities.adb, itypes.adb, layout.adb,
sem_ch10.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb,
sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_prag.adb,
sem_util.adb, ttypes.ads: Update calls to routines removed from
or renamed in Einfo.Utils.
* uintp.ads (Upos): Fix this subtype, which was unintentionally
declared to include Uint_0.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* exp_ch7.adb (Expand_N_Package_Declaration): Fix wording in
comment.
* exp_disp.adb (Mark_DT): Remove unnecessary initialization of
I_Depth.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* contracts.adb (Add_Contract_Item): Accept volatile-related
properties on constants.
(Analyze_Object_Contract): Check external properties on
constants; accept volatile constants.
(Check_Type_Or_Object_External_Properties): Replace "variable"
with "object" in error messages; replace Decl_Kind with a local
constant.
* sem_prag.adb (Analyze_Pragma): Accept volatile-related
properties on constants.
2021-09-20 Pierre-Alexandre Bazin <bazin@adacore.com>
* libgnat/a-strfix.adb ("*"): Added loop invariants and lemmas
for proof.
(Delete): Added assertions for proof, and conditions to avoid
overflow.
(Head): Added loop invariant.
(Insert): Same as Delete.
(Move): Declared with SPARK_Mode Off.
(Overwrite): Added assertions for proof, and conditions to avoid
overflow.
(Replace_Slice): Added assertions for proof, and conditions to
avoid overflow.
(Tail): Added loop invariant and avoided overflows.
(Translate): Added loop invariants.
(Trim): Ensured empty strings returned start at 1.
* libgnat/a-strfix.ads (Index): Rewrote contract cases for
easier proof.
(Index_Non_Blank): Separated the null string case.
(Count): Specified Mapping shouldn't be null.
(Find_Token): Specified Source'First should be Positive when no
From is given.
(Translate): Specified Mapping shouldn't be null.
("*"): Rewrote postcondition for easier proof.
* libgnat/a-strsea.adb (Belongs): Added postcondition.
(Count): Rewrote loops and added loop invariants to avoid
overflows.
(Find_Token): Added loop invariants.
(Index): Rewrote loops to avoid overflows and added loop
invariants for proof.
(Index_Non_Blank): Added loop invariants.
(Is_Identity): New function isolated without SPARK_Mode.
* libgnat/a-strsea.ads: Fix starting comment as package is no
longer private.
(Match): Declared ghost expression function Match.
(Is_Identity): Described identity in the postcondition.
(Index, Index_Non_Blank, Count, Find_Token): Added contract from
a-strfix.ads.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Resolve_Aspect_Aggregate): Move comments after
specs; fix typo in header box; cleanup whitespace.
2021-09-20 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-objrea.adb (Get_Load_Address): Return 0 for ELF.
2021-09-20 Eric Botcazou <ebotcazou@adacore.com>
* adaint.c (__gnat_get_executable_load_address): Add Win32 support.
* libgnat/s-objrea.ads (Get_Xcode_Bounds): Fix typo in comment.
(Object_File): Minor reformatting.
(ELF_Object_File): Uncomment predicate.
(PECOFF_Object_File): Likewise.
(XCOFF32_Object_File): Likewise.
* libgnat/s-objrea.adb: Minor reformatting throughout.
(Get_Load_Address): Implement for PE-COFF.
* libgnat/s-dwalin.ads: Remove clause for System.Storage_Elements
and use consistent wording in comments.
(Dwarf_Context): Set type of Low, High and Load_Address to Address.
* libgnat/s-dwalin.adb (Get_Load_Displacement): New function.
(Is_Inside): Call Get_Load_Displacement.
(Low_Address): Likewise.
(Open): Adjust to type change.
(Aranges_Lookup): Change type of Addr to Address.
(Read_Aranges_Entry): Likewise for Start and adjust.
(Enable_Cach): Adjust to type change.
(Symbolic_Address): Change type of Addr to Address.
(Symbolic_Traceback): Call Get_Load_Displacement.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* exp_disp.adb (Make_DT): Move call to Set_Has_Dispatch_Table,
so it is executed regardless of the Generate_SCIL mode.
2021-09-20 Ed Schonberg <schonberg@adacore.com>
* exp_util.ads (Force_Evaluation): Add formal parameter
Discr_Number, to indicate discriminant expression for which an
external name must be created.
(Remove_Side_Effects): Ditto.
* exp_util.adb (Force_Evaluation): Call Remove_Side_Effects with
added parameter.
(Remove_Side_Effects, Build_Temporary): If Discr_Number is
positive, create an external name with suffix DISCR and the
given discriminant number, analogous to what is done for
temporaries for array type bounds.
* sem_ch3.adb (Process_Discriminant_Expressions): If the
constraint is for an object or component declaration and the
corresponding entity may be visible in another unit, invoke
Force_Evaluation with the new parameter.
2021-09-20 Arnaud Charlet <charlet@adacore.com>
* gen_il-internals.ads (Invalid_Val): Remove, unused and
generates warnings.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.adb, exp_ch4.adb, exp_ch5.adb, sprint.adb: Refine
types of local constants.
2021-09-20 Gary Dismukes <dismukes@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Fold
Preelaborable_Initialization attribute in cases where it hasn't
been folded by the analyzer.
* exp_disp.adb (Original_View_In_Visible_Part): This function is
removed and moved to sem_util.adb.
* sem_attr.adb (Attribute_22): Add
Attribute_Preelaborable_Initialization as an Ada 2022 attribute.
(Analyze_Attribute, Attribute_Preelaborable_Initialization):
Check that the prefix of the attribute is either a formal
private or derived type, or a composite type declared within the
visible part of a package or generic package.
(Eval_Attribute): Perform folding of
Preelaborable_Initialization attribute based on
Has_Preelaborable_Initialization applied to the prefix type.
* sem_ch3.adb (Resolve_Aspects): Add specialized code for
Preelaborable_Initialization used at the end of a package
visible part for setting Known_To_Have_Preelab_Init on types
that are specified with True or that have a conjunction of one
or more P_I attributes applied to formal types.
* sem_ch7.adb (Analyze_Package_Specification): On call to
Has_Preelaborable_Initialization, pass True for new formal
Formal_Types_Have_Preelab_Init, so that error checking treats
subcomponents that are declared within types in generics as
having preelaborable initialization when the subcomponents are
of formal types.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add test for
P_I to prevent calling Make_Pragma_From_Boolean_Aspect, since
this aspect is handled specially and the
Known_To_Have_Preelab_Init flag will get set on types that have
the aspect by other means.
(Analyze_Aspect_Specifications.Analyze_One_Aspect): Add test for
Aspect_Preelaborable_Initialization for allowing the aspect to
be specified on formal type declarations.
(Is_Operational_Item): Treat Attribute_Put_Image as an
operational attribute. The need for this was encountered while
working on these changes.
* sem_util.ads (Has_Preelaborable_Initialization): Add
Formal_Types_Have_Preelab_Init as a new formal parameter that
defaults to False.
(Is_Conjunction_Of_Formal_Preelab_Init_Attributes): New
function.
(Original_View_In_Visible_Part): Moved here from exp_disp.adb,
so it can be called by Analyze_Attribute.
* sem_util.adb (Has_Preelaborable_Initialization): Return True
for formal private and derived types when new formal
Formal_Types_Have_Preelab_Init is True, and pass along the
Formal_Types_Have_Preelab_Init flag in the array component case.
(Check_Components): Pass along Formal_Types_Have_Preelab_Init
flag on call to Has_Preelaborable_Initialization.
(Is_Conjunction_Of_Formal_Preelab_Init_Attributes): New function
that returns True when passed an expression that includes one or
more attributes for Preelaborable_Initialization applied to
prefixes that denote formal types.
(Is_Formal_Preelab_Init_Attribute): New utility function nested
within Is_Conjunction_Of_Formal_Preelab_Init_Attributes that
determines whether a node is a P_I attribute applied to a
generic formal type.
(Original_View_In_Visible_Part): Moved here from exp_util.adb,
so it can be called by Analyze_Attribute.
* snames.ads-tmpl: Add note near the start of spec giving
details about what needs to be done when adding a name that
corresponds to both an attribute and a pragma. Delete existing
occurrence of Name_Preelaborable_Initialization, and add a note
comment in the list of Name_* constants at that place,
indicating that it's included in type Pragma_Id, etc., echoing
other such comments for names that are both an attribute and a
pragma. Insert Name_Preelaborable_Initialization in the
alphabetized set of Name_* constants corresponding to
attributes (between First_Attribute_Name and
Last_Attribute_Name).
(type Attribute_Id): Add new literal
Attribute_Preelaborable_Initialization.
(type Pragma_Id): Move Pragma_Preelaborable_Initialization from
its current position to the end of the type, in the special set
of pragma literals that have corresponding atttributes. Add to
accompanying comment, indicating that functions Get_Pragma_Id
and Is_Pragma_Name need to be updated when adding a pragma
literal to the special set.
* snames.adb-tmpl (Get_Pragma_Id): Add case alternative for
Pragma_Preelaborable_Initialization.
(Is_Pragma_Name): Add test for
Name_Preelaborable_Initialization.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch4.adb (Finc_Non_Universal_Interpretations): Fix check.
2021-09-20 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Build_Discriminant_Constraints): Exit once a
first discriminant is found and the Discrim_Present flag is set.
2021-09-20 Bob Duff <duff@adacore.com>
* gnat1drv.adb (Gnat1drv): Avoid calling List_Rep_Info in
Generate_SCIL and GNATprove_Mode.
* repinfo.adb (List_Common_Type_Info): Fix comment.
2021-09-20 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-dwalin.ads: Remove clause for Ada.Exceptions.Traceback,
add clause for System.Traceback_Entries and alphabetize.
(AET): Delete.
(STE): New package renaming.
(Symbolic_Traceback): Adjust.
* libgnat/s-dwalin.adb: Remove clauses for Ada.Exceptions.Traceback
and System.Traceback_Entries.
(Symbolic_Traceback): Adjust.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch4.adb (Find_Non_Universal_Interpretations): Check if
types are compatible before adding interpretation.
2021-09-20 Justin Squirek <squirek@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): Add guard to protect
against calculating accessibility levels against internal
compiler-generated types.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_dim.adb (Dimensions_Msg_Of): Capitalize comment.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* adabkend.adb (Scan_Back_End_Switches): Replace switch-scanning
logic with call to Backend_Utils.Scan_Common_Back_End_Switches.
* back_end.adb (Scan_Back_End_Switches): Replace switch-scanning
logic with call to Backend_Utils.Scan_Common_Back_End_Switches.
* backend_utils.adb: New file.
* backend_utils.ads: New file.
* gcc-interface/Make-lang.in: Add ada/backend_utils.o.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* atree.adb (Get_32_Bit_Field): Declare result before returning.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* exp_ch7.adb (Expand_N_Package_Body): Replace
Build_And_Insert_Cuda_Initialization with Expand_CUDA_Package.
* gnat_cuda.adb (Expand_CUDA_Package): New procedure.
(Build_And_Insert_Cuda_Initialization): Make internal.
* gnat_cuda.ads (Expand_CUDA_Package): New procedure.
(Build_And_Insert_Cuda_Initialization): Remove from spec.
2021-09-20 Ghjuvan Lacambre <lacambre@adacore.com>
* usage.adb (Usage): Update -gnatw.c messages.
2021-09-20 Eric Botcazou <ebotcazou@adacore.com>
* sem_aux.adb (Is_By_Reference_Type): Do not test Error_Posted.
2021-09-15 Alexandre Oliva <oliva@adacore.com>
* gcc-interface/utils.c: Include opts.h.
(handle_zero_call_used_regs_attribute): New.
(gnat_internal_attribute_table): Add zero_call_used_regs.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
PR ada/101970
* exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Enum_Rep>:
Use an unchecked conversion instead of a regular conversion in the
enumeration case and remove Conversion_OK flag in the integer case.
<Attribute_Pos>: Remove superfluous test.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (validate_size): Do not issue an error if the
old size has overflowed.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): For vector types, make
the representative array the debug type.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): Turn variable
into constant. Capitalize GCC in warning message.
(intrin_arglists_compatible_p): Change parameter to pointer-to-const
Adjust warning messages. Turn warning into error for vector types.
(intrin_return_compatible_p): Likewise.
(intrin_profiles_compatible_p): Change parameter to pointer-to-const
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-atopri.ads (bool): Delete.
(Atomic_Test_And_Set): Replace bool with Boolean.
(Atomic_Always_Lock_Free): Likewise.
* libgnat/s-aoinar.adb (Is_Lock_Free): Adjust.
* libgnat/s-aomoar.adb (Is_Lock_Free): Likewise.
* libgnat/s-aotase.adb (Atomic_Test_And_Set): Likewise.
* libgnat/s-atopex.adb (Atomic_Compare_And_Exchange): Likewise.
* gcc-interface/decl.c: Include gimple-expr.h.
(intrin_types_incompatible_p): Delete.
(intrin_arglists_compatible_p): Call types_compatible_p.
(intrin_return_compatible_p): Likewise.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (update_pointer_to): Set TYPE_CANONICAL on
pointer and reference types.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
PR ada/101385
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(-Wall): Minor fixes.
(-w): Likewise.
(-Werror): Document that it also sets -gnatwe by default.
* gcc-interface/lang-specs.h (ada): Expand -gnatwe if -Werror is
passed and move expansion of -gnatw switches to before -gnatez.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (can_materialize_object_renaming_p): Do not
call UI_Is_In_Int_Range on the result of Normalized_First_Bit.
2021-09-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <is_type>: Declare new
constant. Adjust error message issued by validate_size in the case
of by-reference types.
(validate_size): Always use the error strings passed by the caller.
2021-09-08 liuhongt <hongtao.liu@intel.com>
* gcc-interface/misc.c (gnat_post_options): Issue an error for
-fexcess-precision=16.
2021-08-19 Arnaud Charlet <charlet@adacore.com>
PR ada/101924
* gcc-interface/Make-lang.in (STAGE1_LIBS): Define on hpux.
2021-08-18 Eric Botcazou <ebotcazou@gcc.gnu.org>
* gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Fix
thinko in latest change.
2021-08-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR debug/101598
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the
DECL_SOURCE_LOCATION of DECL_IGNORED_P gnu_subprog_decl to
UNKNOWN_LOCATION.
2021-07-25 Arnaud Charlet <charlet@adacore.com>
* libgnat/s-osprim__x32.adb: Add missing with clause.
2021-07-12 Pierre-Marie de Rodat <derodat@adacore.com>
* adaint.c (__gnat_number_of_cpus): Replace "#ifdef" by "#if
defined".
2021-07-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Add a
parallel type only when -fgnat-encodings=all is specified.
<E_Array_Type>: Use the PAT name and special suffixes only when
-fgnat-encodings=all is specified.
<E_Array_Subtype>: Build a special type for debugging purposes only
when -fgnat-encodings=all is specified. Add a parallel type or use
the PAT name only when -fgnat-encodings=all is specified.
<E_Record_Type>: Generate debug info for the inner record types only
when -fgnat-encodings=all is specified.
<E_Record_Subtype>: Use a debug type for an artificial subtype only
except when -fgnat-encodings=all is specified.
(elaborate_expression_1): Reset need_for_debug when possible only
except when -fgnat-encodings=all is specified.
(components_to_record): Use XV encodings for variable size only
when -fgnat-encodings=all is specified.
(associate_original_type_to_packed_array): Add a parallel type only
when -fgnat-encodings=all is specified.
* gcc-interface/misc.c (gnat_get_array_descr_info): Do not return
full information only when -fgnat-encodings=all is specified.
* gcc-interface/utils.c (make_packable_type): Add a parallel type
only when -fgnat-encodings=all is specified.
(maybe_pad_type): Make the inner type a debug type only except when
-fgnat-encodings=all is specified. Create an XVS type for variable
size only when -fgnat-encodings=all is specified.
(rest_of_record_type_compilation): Add a parallel type only when
-fgnat-encodings=all is specified.
2021-07-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Use a
fixed lower bound if the index subtype is marked so, as well as a
more efficient formula for the upper bound if the array cannot be
superflat.
(flb_cannot_be_superflat): New predicate.
(cannot_be_superflat): Rename into...
(range_cannot_be_superfla): ...this. Minor tweak.
2021-07-12 Bob Duff <duff@adacore.com>
* uintp.ads, types.h: New subtypes of Uint: Valid_Uint, Unat,
Upos, Nonzero_Uint with predicates. These correspond to new
field types in Gen_IL.
* gen_il-types.ads (Valid_Uint, Unat, Upos, Nonzero_Uint): New
field types.
* einfo-utils.ads, einfo-utils.adb, fe.h (Known_Alignment,
Init_Alignment): Use the initial zero value to represent
"unknown". This will ensure that if Alignment is called before
Set_Alignment, the compiler will blow up (if assertions are
enabled).
* atree.ads, atree.adb, atree.h, gen_il-gen.adb
(Get_Valid_32_Bit_Field): New generic low-level getter for
subtypes of Uint.
(Copy_Alignment): New procedure to copy Alignment field even
when Unknown.
(Init_Object_Size_Align, Init_Size_Align): Do not bypass the
Init_ procedures.
* exp_pakd.adb, freeze.adb, layout.adb, repinfo.adb,
sem_util.adb: Protect calls to Alignment with Known_Alignment.
Use Copy_Alignment when it might be unknown.
* gen_il-gen-gen_entities.adb (Alignment,
String_Literal_Length): Use type Unat instead of Uint, to ensure
that the field is always Set_ before we get it, and that it is
set to a nonnegative value.
(Enumeration_Pos): Unat.
(Enumeration_Rep): Valid_Uint. Can be negative, but must be
valid before fetching.
(Discriminant_Number): Upos.
(Renaming_Map): Remove.
* gen_il-gen-gen_nodes.adb (Char_Literal_Value, Reason): Unat.
(Intval, Corresponding_Integer_Value): Valid_Uint.
* gen_il-internals.ads: New functions for dealing with special
defaults and new subtypes of Uint.
* scans.ads: Correct comments.
* scn.adb (Post_Scan): Do not set Intval to No_Uint; that is no
longer allowed.
* sem_ch13.adb (Analyze_Enumeration_Representation_Clause): Do
not set Enumeration_Rep to No_Uint; that is no longer allowed.
(Offset_Value): Protect calls to Alignment with Known_Alignment.
* sem_prag.adb (Set_Atomic_VFA): Do not use Uint_0 to mean
"unknown"; call Init_Alignment instead.
* sinfo.ads: Minor comment fix.
* treepr.adb: Deal with printing of new field types.
* einfo.ads, gen_il-fields.ads (Renaming_Map): Remove.
* gcc-interface/decl.c (gnat_to_gnu_entity): Use Known_Alignment
before calling Alignment. This preserve some probably buggy
behavior: if the alignment is not set, it previously defaulted
to Uint_0; we now make that explicit. Use Copy_Alignment,
because "Set_Alignment (Y, Alignment (X));" no longer works when
the Alignment of X has not yet been set.
* gcc-interface/trans.c (process_freeze_entity): Use
Copy_Alignment.
2021-07-12 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-dwalin.ads: Adjust a few comments left and right.
(Line_Info_Register): Comment out unused components.
(Line_Info_Header): Add DWARF 5 support.
(Dwarf_Context): Likewise. Rename "prologue" into "header".
* libgnat/s-dwalin.adb: Alphabetize "with" clauses.
(DWARF constants): Add DWARF 5 support and reorder.
(For_Each_Row): Adjust.
(Initialize_Pass): Likewise.
(Initialize_State_Machine): Likewise and fix typo.
(Open): Add DWARF 5 support.
(Parse_Prologue): Rename into...
(Parse_Header): ...this and add DWARF 5 support.
(Read_And_Execute_Isn): Rename into...
(Read_And_Execute_Insn): ...this and adjust.
(To_File_Name): Change parameter name and add DWARF 5 support.
(Read_Entry_Format_Array): New procedure.
(Skip_Form): Add DWARF 5 support and reorder.
(Seek_Abbrev): Do not count entries and add DWARF 5 support.
(Debug_Info_Lookup): Add DWARF 5 support.
(Symbolic_Address.Set_Result): Likewise.
(Symbolic_Address): Adjust.
2021-07-12 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Duplicate_Clause): Add a helper routine
Check_One_Attr, with a parameter for the attribute_designator we
are looking for, and one for the attribute_designator of the
current node (which are usually the same). For Size and
Value_Size, call it twice, once for each.
* errout.ads: Fix a typo.
2021-07-12 Piotr Trojanek <trojanek@adacore.com>
* exp_imgv.adb (Expand_Image_Attribute): Move rewriting to
attribute Put_Image to the beginning of expansion of attribute
Image.
2021-07-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (finish_subprog_decl): Remove obsolete line.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* exp_put_image.adb (Make_Put_Image_Name): Fix style.
(Image_Should_Call_Put_Image): Likewise.
(Build_Image_Call): Likewise.
2021-07-09 Ghjuvan Lacambre <lacambre@adacore.com>
* par-ch6.adb (Contains_Import_Aspect): New function.
(P_Subprogram): Acknowledge `Import` aspects.
2021-07-09 Bob Duff <duff@adacore.com>
* exp_put_image.adb (Make_Component_Attributes): Use
Implementation_Base_Type to get the parent type. Otherwise,
Parent_Type_Decl is actually an internally generated subtype
declaration, so we blow up on
Type_Definition (Parent_Type_Decl).
2021-07-09 Dmitriy Anisimkov <anisimko@adacore.com>
* gsocket.h: Include net/if.h to get IF_NAMESIZE constant.
* s-oscons-tmplt.c: Define IPV6_FLOWINFO for Linux.
2021-07-09 Steve Baird <baird@adacore.com>
* libgnat/a-cdlili.adb: Reimplement
Ada.Containers.Doubly_Linked_Lists.Generic_Sorting.Sort using
Mergesort instead of the previous Quicksort variant.
2021-07-09 Justin Squirek <squirek@adacore.com>
* exp_ch6.adb (Is_Build_In_Place_Function_Call): Add check to
verify the Selector_Name of Exp_Node has been analyzed before
obtaining its entity.
2021-07-09 Gary Dismukes <dismukes@adacore.com>
* libgnarl/s-osinte__vxworks.ads: Fix typo ("release" =>
"releases") plus comment reformatting.
* libgnat/s-os_lib.ads: In a comment, fix typo ("indended" =>
"intended"), add a hyphen and semicolon, plus reformatting. In
comment for subtype time_t, fix typo ("effect" => "affect"), add
hyphens, plus reformatting.
* libgnat/s-parame.ads, libgnat/s-parame__ae653.ads,
libgnat/s-parame__hpux.ads: Remove period from one-line comment.
2021-07-09 Steve Baird <baird@adacore.com>
* exp_ch5.adb (Expand_General_Case_Statement): Add new function
Else_Statements to handle the case of invalid data analogously
to how it is handled when casing on a discrete value.
* sem_case.adb (Has_Static_Discriminant_Constraint): A new
Boolean-valued function.
(Composite_Case_Ops.Scalar_Part_Count): Include discriminants
when traversing components.
(Composite_Case_Ops.Choice_Analysis.Traverse_Discrete_Parts):
Include discriminants when traversing components; the component
range for a constrained discriminant is a single value.
(Composite_Case_Ops.Choice_Analysis.Parse_Choice): Eliminate
Done variable and modify how Next_Part is computed so that it is
always correct (as opposed to being incorrect when Done is
True). This includes changes in Update_Result (a local
procedure). Add new local procedure
Update_Result_For_Box_Component and call it not just for box
components but also for "missing" components (components
associated with an inactive variant).
(Check_Choices.Check_Composite_Case_Selector.Check_Component_Subtype):
Instead of disallowing all discriminated component types, allow
those that are unconstrained or statically constrained. Check
discriminant subtypes along with other component subtypes.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation to reflect current implementation status.
* gnat_rm.texi: Regenerate.
2021-07-09 Justin Squirek <squirek@adacore.com>
* sem_ch6.adb (Check_Pragma_Inline): Correctly use
Corresponding_Spec_Of_Stub when dealing subprogram body stubs.
2021-07-09 Doug Rupp <rupp@adacore.com>
* Makefile.rtl: Add translations for s-parame__posix2008.ads
* libgnarl/s-linux.ads: Import System.Parameters.
(time_t): Declare using System.Parameters.time_t_bits.
* libgnarl/s-linux__alpha.ads: Likewise.
* libgnarl/s-linux__android.ads: Likewise.
* libgnarl/s-linux__hppa.ads: Likewise.
* libgnarl/s-linux__mips.ads: Likewise.
* libgnarl/s-linux__riscv.ads: Likewise.
* libgnarl/s-linux__sparc.ads: Likewise.
* libgnarl/s-linux__x32.ads: Likewise.
* libgnarl/s-qnx.ads: Likewise.
* libgnarl/s-osinte__aix.ads: Likewise.
* libgnarl/s-osinte__android.ads: Likewise.
* libgnarl/s-osinte__darwin.ads: Likewise.
* libgnarl/s-osinte__dragonfly.ads: Likewise.
* libgnarl/s-osinte__freebsd.ads: Likewise.
* libgnarl/s-osinte__gnu.ads: Likewise.
* libgnarl/s-osinte__hpux-dce.ads: Likewise.
* libgnarl/s-osinte__hpux.ads: Likewise.
* libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise.
* libgnarl/s-osinte__lynxos178e.ads: Likewise.
* libgnarl/s-osinte__qnx.ads: Likewise.
* libgnarl/s-osinte__rtems.ads: Likewise.
* libgnarl/s-osinte__solaris.ads: Likewise.
* libgnarl/s-osinte__vxworks.ads: Likewise.
* libgnat/g-sothco.ads: Likewise.
* libgnat/s-osprim__darwin.adb: Likewise.
* libgnat/s-osprim__posix.adb: Likewise.
* libgnat/s-osprim__posix2008.adb: Likewise.
* libgnat/s-osprim__rtems.adb: Likewise.
* libgnat/s-osprim__x32.adb: Likewise.
* libgnarl/s-osinte__linux.ads: use type System.Linux.time_t.
* libgnat/s-os_lib.ads (time_t): Declare as subtype of
Long_Long_Integer.
* libgnat/s-parame.ads (time_t_bits): New constant.
* libgnat/s-parame__ae653.ads (time_t_bits): Likewise.
* libgnat/s-parame__hpux.ads (time_t_bits): Likewise.
* libgnat/s-parame__vxworks.ads (time_t_bits): Likewise.
* libgnat/s-parame__posix2008.ads: New file for 64 bit time_t.
2021-07-09 Bob Duff <duff@adacore.com>
* comperr.adb (Compiler_Abort): Print source file name.
2021-07-09 Joffrey Huguet <huguet@adacore.com>
* libgnat/a-strunb.ads, libgnat/a-strunb__shared.ads: Fix layout
in contracts.
2021-07-09 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.ads (JSON output format): Document adjusted key name.
* repinfo.adb (List_Record_Layout): Use Original_Record_Component
if the normalized position of the component is not known.
(List_Structural_Record_Layout): Rename Outer_Ent parameter into
Ext_End and add Ext_Level parameter. In an extension, if the parent
subtype has static discriminants, call List_Record_Layout on it.
Output "parent_" prefixes before "variant" according to Ext_Level.
Adjust recursive calls throughout the procedure.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* exp_util.ads (Map_Types): Fix typo.
2021-07-09 Fedor Rybin <frybin@adacore.com>
* krunch.adb: Add safeguards against index range violations.
2021-07-09 Arnaud Charlet <charlet@adacore.com>
* libgnat/a-strfix.adb: Take advantage of extended returns.
2021-07-09 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/implementation_defined_attributes.rst
(Scalar_Storage_Order): Add paragraph about representation
changes.
* gnat_rm.texi: Regenerate.
2021-07-09 Frederic Konrad <konrad@adacore.com>
* Makefile.rtl (LIBGNAT_TARGET_PAIRS) <aarch64*-*-rtems*>: Use
the wraplf variant of Aux_Long_Long_Float.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Initialize Orig_N
and Typ variables.
2021-07-09 Arnaud Charlet <charlet@adacore.com>
* sem_ch13.adb (Resolve_Aspect_Expressions): Use the same
processing for Predicate, Static_Predicate and
Dynamic_Predicate. Do not build the predicate function spec.
Update comments.
(Resolve_Name): Only reset Entity when necessary to avoid
spurious visibility errors.
(Check_Aspect_At_End_Of_Declarations): Handle consistently all
Predicate aspects.
* sem_ch3.adb (Analyze_Subtype_Declaration): Fix handling of
private types with predicates.
2021-07-09 Justin Squirek <squirek@adacore.com>
* sem_util.ads (Type_Access_Level): Add new optional parameter
Assoc_Ent.
* sem_util.adb (Accessibility_Level): Treat access discriminants
the same as components when the restriction
No_Dynamic_Accessibility_Checks is enabled.
(Deepest_Type_Access_Level): Remove exception for
Debug_Flag_Underscore_B when returning the result of
Type_Access_Level in the case where
No_Dynamic_Accessibility_Checks is active.
(Function_Call_Or_Allocator_Level): Correctly calculate the
level of Expr based on its containing subprogram instead of
using Current_Subprogram.
* sem_res.adb (Valid_Conversion): Add actual for new parameter
Assoc_Ent in call to Type_Access_Level, and add test of
No_Dynamic_Accessibility_Checks_Enabled to ensure that static
accessibility checks are performed for all anonymous access type
conversions.
2021-07-09 Eric Botcazou <ebotcazou@adacore.com>
* exp_dbug.ads: Update documentation of various items.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Reorder code.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Reorder code.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Add variable to
avoid repeated calls to Etype.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Fix comment.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Use Orig_N variable
instead of repeated calls to Original_Node.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Change types local
variables from Entity_Id to Node_Id.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): A local Expr
constant was shadowing a global constant with the same name and
the same value.
2021-07-09 Piotr Trojanek <trojanek@adacore.com>
* sem_res.adb (Preanalyze_And_Resolve): Only call
Set_Must_Not_Freeze when it is necessary to restore the previous
value.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* sem_ch5.adb (Analyze_Assignment): Clear Current_Assignment at
exit.
(Analyze_Target_Name): Prevent AST climbing from going too far.
2021-07-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Target_Name): Properly reject a
Target_Name when it appears outside of an assignment statement,
or within the left-hand side of one.
2021-07-08 Bob Duff <duff@adacore.com>
* einfo-utils.ads, einfo-utils.adb (Unknown_Alignment,
Unknown_Component_Bit_Offset, Unknown_Component_Size,
Unknown_Esize, Unknown_Normalized_First_Bit,
Unknown_Normalized_Position, Unknown_Normalized_Position_Max,
Unknown_RM_Size): Remove these functions.
* exp_pakd.adb, exp_util.adb, fe.h, freeze.adb, layout.adb,
repinfo.adb, sem_ch13.adb, sem_ch3.adb, sem_util.adb: Remove
calls to these functions; do "not Known_..." instead.
* gcc-interface/decl.c, gcc-interface/trans.c
(Unknown_Alignment, Unknown_Component_Size, Unknown_Esize,
Unknown_RM_Size): Remove calls to these functions; do
"!Known_..." instead.
2021-07-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_dbug.adb (Get_Encoded_Name): Do not encode names of discrete
types with custom bounds, except with -fgnat-encodings=all.
* exp_pakd.adb (Create_Packed_Array_Impl_Type): Adjust comment.
2021-07-08 Bob Duff <duff@adacore.com>
* comperr.adb (Compiler_Abort): Call Sinput.Unlock, because if
this is called late, then Source_Dump would crash otherwise.
* debug.adb: Correct documentation of the -gnatd.9 switch.
* exp_ch4.adb (Expand_Allocator_Expression): Add a comment.
* exp_ch6.adb: Minor comment fixes. Add assertion.
* exp_ch6.ads (Is_Build_In_Place_Result_Type): Correct comment.
* exp_ch7.adb, checks.ads: Minor comment fixes.
2021-07-08 Doug Rupp <rupp@adacore.com>
* sigtramp-vxworks-target.inc: Rename to...
* sigtramp-vxworks-target.h: ... this.
* sigtramp-vxworks.c, Makefile.rtl: Likewise.
2021-07-08 Ghjuvan Lacambre <lacambre@adacore.com>
* lib-writ.ads: Mention SCOs dependency as reason for duplicates.
* lib.ads (Units): Update documentation to mention duplicated
units.
2021-07-08 Ed Schonberg <schonberg@adacore.com>
* style.adb (Missing_Overriding): Do not emit message when
parent of subprogram is a full type declaration.
2021-07-08 Arnaud Charlet <charlet@adacore.com>
* par-ch5.adb (P_Iterator_Specification): Add support for access
definition in loop parameter.
* sem_ch5.adb (Check_Subtype_Indication): Renamed...
(Check_Subtype_Definition): ... into this and check for conformance
on access definitions, and improve error messages.
(Analyze_Iterator_Specification): Add support for access definition
in loop parameter.
2021-07-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.ads, sem_util.adb
(Apply_Compile_Time_Constraint_Error): New parameter
Emit_Message.
* sem_ch4.adb (Analyze_Selected_Component): Disable warning
within an instance.
2021-07-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_imgv.adb: Add with and use clause for Restrict and Rident.
(Build_Enumeration_Image_Tables): Do not generate the hash function
if the No_Implicit_Loops restriction is active.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* sem_ch12.adb, sem_ch6.adb, sem_ch9.adb, sprint.adb: Simplify
checks for non-empty lists.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* par-ch10.adb (Unit_Display): Remove redundant condition; fix
whitespace.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* lib-load.adb (Load): Replace early return with goto to properly
restore context on failure.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* lib-writ.adb (Ensure_System_Dependency): Simplify condition.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* lib-load.adb (Load_Unit): Fix style in comment.
* par-load.adb (Load): Likewise.
* scng.adb (Initialize_Scanner): Fix whitespace.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* par-load.adb (Load): Don't remove unit, but flag it as
erroneous and return.
2021-07-08 Ghjuvan Lacambre <lacambre@adacore.com>
* exp_prag.adb (Expand_Pragma_Inspection_Point): Fix error
message.
2021-07-08 Yannick Moy <moy@adacore.com>
* layout.adb (Layout_Type): Do not call Number_Dimensions if the
type does not have First_Index set.
2021-07-08 Ghjuvan Lacambre <lacambre@adacore.com>
* exp_prag.adb (Expand_Pragma_Inspection_Point): After expansion
of the Inspection_Point pragma, check if referenced entities
that have a freeze node are already frozen. If they aren't, emit
a warning and turn the pragma into a no-op.
2021-07-08 Yannick Moy <moy@adacore.com>
* layout.adb (Layout_Type): Add guard before calling Expr_Value.
2021-07-08 Yannick Moy <moy@adacore.com>
* layout.adb (Layout_Type): Special case when RM_Size and Esize
can be computed for packed arrays.
2021-07-08 Steve Baird <baird@adacore.com>
* rtsfind.ads, rtsfind.adb: Add support for finding the packages
System.Atomic_Operations and
System.Atomic_Operations.Test_And_Set and the declarations
within that latter package of the type Test_And_Set_Flag and the
function Atomic_Test_And_Set.
* exp_ch11.adb (Expand_N_Exception_Declaration): If an exception
is declared other than at library level, then we need to call
Register_Exception the first time (and only the first time) the
declaration is elaborated. In order to decide whether to
perform this call for a given elaboration of the declaration, we
used to unconditionally use a (library-level) Boolean variable.
Now we instead use a variable of type
System.Atomic_Operations.Test_And_Set.Test_And_Set_Flag unless
either that type is unavailable or a No_Tasking restriction is
in effect (in which case we use a Boolean variable as before).
2021-07-08 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/system.ads: Add No_Tasking restriction.
2021-07-08 Ed Schonberg <schonberg@adacore.com>
* libgnat/a-cohama.ads: Introduce an equality operator over
cursors.
* libgnat/a-cohase.ads: Ditto.
* libgnat/a-cohama.adb: Add body for "=" over cursors.
(Insert): Do not set the Position component of the cursor that
denotes the inserted element.
* libgnat/a-cohase.adb: Ditto.
2021-07-08 Arnaud Charlet <charlet@adacore.com>
* libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb,
libgnat/a-cborma.adb, libgnat/a-cborse.adb,
libgnat/a-cobove.adb, libgnat/a-textio.adb,
libgnat/a-witeio.adb, libgnat/a-ztexio.adb: Make code compatible
with No_Dynamic_Accessibility_Checks restriction.
2021-07-08 Arnaud Charlet <charlet@adacore.com>
* debug.adb, sem_util.adb: Revert meaning of -gnatd_b.
* sem_res.adb: Minor reformatting.
2021-07-08 Arnaud Charlet <charlet@adacore.com>
* make.adb, osint.adb: Make code compatible with
No_Dynamic_Accessibility_Checks restriction.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* lib-writ.adb (Ensure_System_Dependency): Replace search in
Lib.Units with a search in Lib.Unit_Names.
2021-07-08 Piotr Trojanek <trojanek@adacore.com>
* sinput-l.adb (Load_File): Simplify foreword manipulation with
concatenation; similar for filename with preprocessed output.
2021-07-07 Dmitriy Anisimkov <anisimko@adacore.com>
* s-oscons-tmplt.c (MSG_WAITALL): Remove wrong #ifdef
__MINWGW32__.
2021-07-07 Gary Dismukes <dismukes@adacore.com>
* einfo-utils.adb (Primitive_Operations): Default to returning
Direct_Primitive_Operations in the case of concurrent types
(when Corresponding_Record_Type not present).
* sem_ch9.adb (Analyze_Protected_Type_Declaration): Initialize
Direct_Primitive_Operations to an empty element list.
(Analyze_Task_Type_Declaration): Initialize
Direct_Primitive_Operations to an empty element list.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* sem_eval.adb (Set_Checking_Potentially_Static_Expression):
Stronger assertion.
2021-07-07 Arnaud Charlet <charlet@adacore.com>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Mark Anon_Id
intrinsic before calling Analyze_Instance_And_Renamings because
this flag may be propagated to other nodes.
2021-07-07 Dmitriy Anisimkov <anisimko@adacore.com>
* s-oscons-tmplt.c (TCP_KEEPCNT TCP_KEEPIDLE, TCP_KEEPINTVL):
Hardcode on Windows if undefined.
2021-07-07 Bob Duff <duff@adacore.com>
* checks.adb (Install_Primitive_Elaboration_Check): Do not
generate elaboration checks for primitives if pragma Pure or
Preelaborate is present. Misc comment fixes, including
referring to the correct kind of check (elaboration, not
accessibility).
* checks.ads, restrict.adb, sem_cat.ads, sinfo.ads: Minor
reformatting and comment fixes.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Simplify processing of pragma
CPP_Constructor.
2021-07-07 Arnaud Charlet <charlet@adacore.com>
* libgnat/g-debpoo.adb (Code_Address_For_Allocate_End): Default
Initialize.
2021-07-07 Arnaud Charlet <charlet@adacore.com>
* libgnat/s-atocou.ads, libgnat/s-atocou__builtin.adb: Code
cleanups.
2021-07-07 Gary Dismukes <dismukes@adacore.com>
* freeze.adb (Check_Inherited_Conditions): Setting of Ekind,
LSP_Subprogram, and Is_Wrapper needs to happen for null
procedures as well as other wrapper cases, so the code is moved
from the else part in front of the if statement. (Fixes a
latent bug encountered while working on this set of changes.)
* sem_attr.adb (Resolve_Attribute): Report an error for the case
of an Access attribute applied to a primitive of an abstract
type when the primitive has any nonstatic Pre'Class or
Post'Class expressions.
* sem_ch8.adb (Analyze_Subprogram_Renaming): Report an error for
the case of a actual subprogram associated with a nonabstract
formal subprogram when the actual is a primitive of an abstract
type and the primitive has any nonstatic Pre'Class or Post'Class
expressions.
* sem_disp.adb (Check_Dispatching_Context): Remove special
testing for null procedures, and replace it with a relaxed test
that avoids getting an error about illegal calls to abstract
subprograms in cases where RM 6.1.1(7/5) applies in
Pre/Post'Class aspects. Also, remove special test for
Postcondition, which seems to be unnecessary, update associated
comments, and fix a typo in one comment.
(Check_Dispatching_Call): Remove an unneeded return statement,
and report an error for the case of a nondispatching call to a
nonabstract subprogram of an abstract type where the subprogram
has nonstatic Pre/Post'Class aspects.
* sem_util.ads
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function.
(In_Pre_Post_Condition): Add a flag formal Class_Wide_Only,
defaulted to False, for indicating whether the function should
only test for the node being within class-wide pre- and
postconditions.
* sem_util.adb
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function
to determine whether a subprogram is a primitive of an abstract
type where the primitive has class-wide Pre/Post'Class aspects
specified with nonstatic expressions.
(In_Pre_Post_Condition): Extend testing to account for the new
formal Class_Wide_Only.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Errors
emitted via Check_Volatility_Compatibility are now emitted at
Actual, just like other errors emitted by
Check_Shared_Variable_Control_Aspects.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* uname.adb (Get_Unit_Name): Simplify with a bounded string
buffer; also, this addresses a ??? comment about the max length
being exceeded.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* uname.adb (Get_Body_Name, Get_Parent_Body_Name,
Get_Parent_Spec_Name, Get_Spec_Name, Is_Child_Name,
Is_Body_Name, Is_Spec_Name, Name_To_Unit_Name): Use a local
instead of the global buffer.
2021-07-07 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Combine
processing of Size and Value_Size clauses. Ensure that
Value_Size is treated the same as Size, in the cases where both
are allowed (i.e. the prefix denotes a first subtype). Misc
cleanup.
* einfo-utils.adb (Init_Size): Add assertions.
(Size_Clause): Return a Value_Size clause if present, instead of
just looking for a Size clause.
* einfo.ads (Has_Size_Clause, Size_Clause): Change documentation
to include Value_Size.
* sem_ch13.ads, layout.ads, layout.adb: Comment modifications.
2021-07-07 Steve Baird <baird@adacore.com>
* exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies): Add
TSS_Put_Image to list of predefined primitives that need special
treatment.
(Build_General_Calling_Stubs, Build_Subprogram_Receiving_Stubs):
Remove previous hack for dealing with TSS_Put_Image procedures.
2021-07-07 Dmitriy Anisimkov <anisimko@adacore.com>
* libgnat/g-socket.adb (Get_Socket_Option): Add 500ms only when
Minus_500ms_Windows_Timeout is True.
(Set_Socket_Option): Use "* 1000" instead of "/ 0.001" to
convert to milliseconds.
2021-07-07 Bob Duff <duff@adacore.com>
* tbuild.adb (Unchecked_Convert_To): Set the Parent of the new
node to the Parent of the old node.
* tbuild.ads (Unchecked_Convert_To): Document differences
between Convert_To and Unchecked_Convert_To. The previous
documentation claimed they are identical except for the
uncheckedness of the conversion.
2021-07-07 Yannick Moy <moy@adacore.com>
* checks.adb (Apply_Scalar_Range_Check): Remove special case for
GNATprove mode.
* sem_res.adb (Resolve_Arithmetic_Op): Same.
* sem_util.adb (Apply_Compile_Time_Constraint_Error): Same.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Check_For_Primitive_Subprogram): Move
declarations of local variables after nested subprogram bodies.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* exp_disp.adb (CPP_Num_Prims): Reuse List_Length.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb, exp_ch6.adb, sem_ch6.adb: Replace Ekind
membership test in Private_Kind with a call to Is_Private_Type.
2021-07-07 Bob Duff <duff@adacore.com>
* gen_il-gen-gen_entities.adb: Remove Linker_Section_Pragma
field from Record_Field_Kind. Minor comment improvement.
2021-07-07 Yannick Moy <moy@adacore.com>
* libgnat/a-ngelfu.ads (Cot): Fix precondition.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* par.adb (Par): A local Name variable is now a renaming of a
constant slice.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* gnat1drv.adb (Gnat1drv): Remove flagging of main unit and its
corresponding spec as requiring code generation; now the flags
are set much earlier.
* lib-load.adb (Load_Main_Source): Set Generate_Code flag on the
main unit source.
(Make_Instance_Unit): Copy Generate_Code flag from the main unit
to instance units.
* lib-writ.adb (Write_ALI): Remove redundant condition;
Generate_Code flag is always set for the main unit.
* par-load.adb (Load): Set Generate_Code flag on the main unit's
corresponding spec, if any.
2021-07-07 Dmitriy Anisimkov <anisimko@adacore.com>
* libgnat/g-socket.ads (Option_Name): Add Keep_Alive_Count,
Keep_Alive_Idle, and Keep_Alive_Interval items to enumeration.
(Option_Type): Add Keep_Alive_Count, Keep_Alive_Idle, and
Keep_Alive_Interval alternatives to the case of discriminated
record.
* libgnat/g-socket.adb (Options): Add Keep_Alive_Count,
Keep_Alive_Idle, and Keep_Alive_Interval to items enumerator to
OS constant converter.
(Set_Socket_Option): Process Keep_Alive_Count, Keep_Alive_Idle,
and Keep_Alive_Interval socket options.
(Get_Socket_Option): Idem.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* lib-writ.adb (Write_ALI): Exit from loop after seeing first
unit that violates No_Elaboration_Code restriction.
2021-07-07 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Instantiate_Bodies): Fix white in declaration.
(Remove_Dead_Instance): Change iteration from WHILE to FOR.
2021-07-07 Bob Duff <duff@adacore.com>
* checks.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb,
exp_ch9.adb, exp_disp.adb, exp_util.adb, inline.adb,
sem_res.adb: Change all calls to Make_Unchecked_Type_Conversion
to call Unchecked_Convert_To instead. This involves removing
New_Occurrence_Of on the first parameter, because
Unchecked_Convert_To expects a type entity, rather than the name
of one. Also, removed calls to Relocate_Node, because
Unchecked_Convert_To takes care of that.
* sinfo.ads: Change comment to be worded more firmly.
2021-07-07 Steve Baird <baird@adacore.com>
* libgnarl/s-tassta.adb (Free_Task): Acquire the Task_Lock
before, rather than after, querying the task's Terminated flag.
Add a corresponding Task_Unlock call.
2021-07-06 Bob Duff <duff@adacore.com>
* atree.ads (Current_Error_Node): Initialize to Empty.
2021-07-06 Steve Baird <baird@adacore.com>
* exp_put_image.adb: Eliminate references to
Debug_Flag_Underscore_Z. Change the meaning of the function
Enable_Put_Image. Previously, a result of False for a tagged
type would mean that the type does not get a Put_Image (PI)
routine at all. Now, it means that the type gets a PI routine
with very abbreviated functionality (just a call to
Unknown_Put_Image). This resolves problems in mixing code
compiled with and without the -gnat2022 switch.
* exp_ch3.adb: Enable_Put_Image no longer participates in
determining whether a tagged type gets a Put_Image procedure. A
tagged type does not get a Put_Image procedure if the type
Root_Buffer_Type is unavailable. This is needed to support cross
targets where tagged types are supported but the type
Root_Buffer_Type is not available.
* exp_dist.adb: Add workarounds for some problems that arise
when using the (obsolete?) Garlic implementation of the
distributed systems annex with Ada 2022 constructs.
* libgnat/a-sttebu.ads: Workaround a bootstrapping problem.
Older compilers do not support raise expressions, so revise the
the Pre'Class condition to meet this requirement without
changing the condition's behavior at run time.
2021-07-06 Eric Botcazou <ebotcazou@adacore.com>
* repinfo-input.adb (JSON_Entity_Kind, Read_Variant_Part): Fix
typo in comment.
2021-07-06 Steve Baird <baird@adacore.com>
* sem_ch5.adb (Analyze_Assignment): Add new nested function,
Omit_Range_Check_For_Streaming, and make call to
Apply_Scalar_Range_Check conditional on the result of this new
function.
* exp_attr.adb (Compile_Stream_Body_In_Scope): Eliminate Check
parameter, update callers. The new
Omit_Range_Check_For_Streaming parameter takes the place of the
old use of calling Insert_Action with Suppress => All_Checks,
which was insufficiently precise (it did not allow suppressing
checks for one component but not for another).
(Expand_N_Attribute_Reference): Eliminate another "Suppress =>
All_Checks" from an Insert_Action call, this one in generating
the expansion of a T'Read attribute reference for a composite
type T.
2021-07-06 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Check for
empty loops caused by constraints.
2021-07-06 Nicolas Roche <roche@adacore.com>
* rtinit.c (skip_quoted_string): Handle malformed command line
with no closing double quote.
(skip_argument): Handle case in which a null character is
encountered by skip_quote_string.
2021-07-06 Piotr Trojanek <trojanek@adacore.com>
* uname.adb (Add_Node_Name): Replace local constant whose
initial expression was evaluated even when unnecessary with just
that expression that is evaluated at most once and only when
needed.
2021-07-06 Piotr Trojanek <trojanek@adacore.com>
* lib.adb (Remove_Unit): Replace defensive code with an
assertion.
* par-load.adb (Load): Address a question mark in the comment.
2021-07-06 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Enclosing_Comp_Unit_Node): When the loop exits
the Current_Node is either an N_Compilation_Unit node or Empty,
so simply return it without redundant checks.
2021-07-06 Piotr Trojanek <trojanek@adacore.com>
* lib-load.adb (Load_Unit): Remove excessive whitespace.
* lib.adb (Is_Internal_Unit, Is_Predefined_Unit): Likewise.
* par-ch10.adb (P_Compilation_Unit): Simplify with membership
test.
* par-load.adb (Load): Likewise.
* uname.adb (Get_Unit_Name): Likewise.
2021-07-06 Piotr Trojanek <trojanek@adacore.com>
* lib-writ.adb (Ensure_System_Dependency): Simplify by reusing a
constant name.
2021-07-06 Steve Baird <baird@adacore.com>
* exp_ch5.adb
(Expand_N_Case_Statement.Expand_General_Case_Statement.Pattern_Match):
When generating an equality test for a statically known discrete
value, only generate the numeric value if the discrete type is
not an enumeration type. If it is an enumeration type, then
call Get_Enum_Lit_From_Pos instead.
2021-07-06 Justin Squirek <squirek@adacore.com>
* par-ch6.adb (Get_Return_Kind): Removed.
(Is_Extended): Created to identify simple and "when" return
statements from extended return statements.
(P_Return_Statement): Merged simple and "when" return statement
processing.
2021-07-06 Gary Dismukes <dismukes@adacore.com>
* sem_ch4.adb (Try_One_Prefix_Interpretation): Augment test of
"not Extensions_Allowed" with test for absence of Obj_Type's
primitive operations Elist, as an additional condition for early
return from this procedure.
2021-07-06 Gary Dismukes <dismukes@adacore.com>
* exp_ch4.adb (Process_Transient_In_Expression): In one comment,
fix two typos and reorder wording of one sentence, plus minor
reformatting.
2021-07-06 Justin Squirek <squirek@adacore.com>
* exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove
legacy expansion of element iterators, and use expansion form
used by unconstrained element types in the general case.
2021-07-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Process_Transient_In_Expression): Ensure that
Fin_Context, used to insert finalization code for the
expression, is a list member: the value returned by
Find_Hook_Context may be an expression node when the transient
is part of a larger expression and it has a non-boolean type.
2021-07-06 Yannick Moy <moy@adacore.com>
* sem_case.adb: Fix error message.
2021-07-06 Bob Duff <duff@adacore.com>
* tbuild.adb (Convert_To): Add assert, along with a comment.
(Make_DT_Access): Remove this function, which is not used. It
was incorrect anyway (the call to New_Occurrence_Of should not
be there).
(Unchecked_Convert_To): Add assert. The previous version's test
for unchecked conversion to the same type was redundant and
could never be true, because the previous 'if' already checked
for ANY expression of the same type. Remove that, and replace
with a test for unchecked conversion to a related type.
Otherwise, we somethings get things like
"finalize(some_type!(some_type!(x)))" in the generated code,
where x is already of type some_type, but we're converting it to
the private type and then to the full type or vice versa (so the
types aren't equal, so the previous 'if' doesn't catch it).
Avoid updating the Parent. This is not necessary; the Parent
will be updated if/when the node is attached to the tree.
* tbuild.ads: Fix comments. No need to say "this is safe" when
we just explained that a few lines earlier. Remove
Make_DT_Access.
* sinfo.ads: Add comments.
* exp_ch7.adb (Make_Finalize_Address_Stmts): Minor comment fix.
* gen_il-gen.adb, gen_il-gen.ads, gen_il-gen-gen_nodes.adb,
gen_il-internals.ads: Implement a feature where you can put:
Nmake_Assert => "expr" where expr is a boolean expression in a
call to Create_Concrete_Node_Type. It is added in a pragma
Assert in the Nmake.Make_... function for that type.
2021-07-06 Gary Dismukes <dismukes@adacore.com>
* checks.adb: Remove calls of Set_Do_Tag_Check (N, False).
* einfo.ads: Remove hanging unneeded ??? comment ("this real description
was clobbered").
* exp_util.ads (Insert_Actions_After): Remove ??? from spec comment.
* gen_il-fields.ads (Opt_Field_Enum): Remove literals
Do_Accessibility_Check and Do_Tag_Check.
* gen_il-gen-gen_nodes.adb: Remove all calls to Sm for
Do_Accessibility_Check and Do_Tag_Check.
* sem_type.ads (Is_Subtype_Of): Remove obsolete ???
comment (function is not limited to scalar subtypes).
* sem_util.ads (Is_Local_Variable_Reference): Revise comment to
mention out-mode parameters as well, and remove ???.
(Propagate_Concurrent_Flags): Minor reformatting.
(Propagate_Invariant_Attributes): Typo fix.
(Propagate_Predicate_Attributes): Indicate what is propagated
and remove ??? comment.
* sem_util.adb (Cannot_Raise_Constraint_Error): Remove unneeded
test of Do_Tag_Check.
(Is_Local_Variable_Reference): Extend function to testing for
formals of mode out as well.
* sinfo.ads: Remove ??? comment about flag
Convert_To_Return_False indicating that the flag is obsolete (in
fact it's used). Remove references to Do_Accessibility_Check and
Do_Tag_Check (and the two associated ??? comments), as these
flags are unneeded.
* sinfo-cn.adb (Change_Conversion_To_Unchecked): Remove call of
Set_Do_Tag_Check (N, False).
* targparm.ads (Support_Atomic_Primitives_On_Target): Remove ???
comment, plus minor reformatting.
2021-07-06 Justin Squirek <squirek@adacore.com>
* par-ch6.adb (Get_Return_Kind): Properly handle the case of a
"return when" statement in the procedure case.
2021-07-06 Bob Duff <duff@adacore.com>
* sem.ads (Node_To_Be_Wrapped): Minor comment fix.
* exp_ch7.adb (Establish_Transient_Scope): Misc cleanups and
comment improvements.
(Set_Node_To_Be_Wrapped): Remove -- not worth putting this code
in a separate procedure, called only once.
* sem_util.adb (Requires_Transient_Scope): Assert that our
parameter has the right Kind. It probably shouldn't be E_Void,
but that is passed in in some cases.
(Ensure_Minimum_Decoration): Move the call later, so we know Typ
is Present, and remove "if Present (Typ)" from this procedure.
* exp_aggr.adb (Convert_To_Assignments): Use membership test,
and avoid the "if False" idiom.
(Expand_Array_Aggregate): Remove a ??? comment.
* sem_ch8.adb (Push_Scope): Take advantage of the full coverage
rules for aggregates.
* sem_res.adb (Resolve_Declare_Expression): Remove test for
Is_Type -- that's all it can be. Use named notation in call to
Establish_Transient_Scope.
* libgnat/a-cdlili.adb (Adjust): Remove redundant code.
(Clear): Remove "pragma Warnings (Off);", which wasn't actually
suppressing any warnings.
2021-07-06 Bob Duff <duff@adacore.com>
* gen_il-gen-gen_nodes.adb: Change the parent of
N_Exception_Declaration to be N_Declaration. Minor comment fix.
2021-07-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): If the conversion is
the name of an assignment operation do not apply predicate check
to it prior to the assignment.
2021-07-06 Bob Duff <duff@adacore.com>
* libgnat/a-conhel.adb: Assert that tampering counts remain
between 0 and 2**31-1. This makes debugging of
finalization-related bugs easier.
2021-07-06 Doug Rupp <rupp@adacore.com>
* Makefile.rtl (LIBGNAT_TARGET_PAIRS): Use s-osprim__posix.adb
vice s-osprim__vxworks.adb for all vxworks7r2 targets.
2021-07-06 Richard Kenner <kenner@adacore.com>
* gen_il-types.ads (Void_Or_Type_Kind,
Exception_Or_Object_Kind): Declare.
* gen_il-gen-gen_entities.adb: Likewise.
2021-07-06 Gary Dismukes <dismukes@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Add a
description of the feature of prefixed-view calls for untagged
types to the section on pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
* einfo.ads: Update specification for
Direct_Primitive_Operations to reflect its use for untagged
types when Extensions_Allowed is True.
* gen_il-gen-gen_entities.adb: Allow Direct_Primitive_Operations
as a field of untagged classes of types by removing the "Pre"
test of "Is_Tagged_Type (N)", and making that field generally
available for all types and subtypes by defining it for
Type_Kind and removing its specification for individual classes
of types.
* sem_ch3.adb (Analyze_Full_Type_Declaration): Initialize the
Direct_Primitive_Operations list when not already set for the
new (sub)type and its base type (except when Ekind of the type
is E_Void, which can happen due to errors in cases where
Derived_Type_Declaration is called and perhaps in other
situations).
(Analyze_Subtype_Declaration): Inherit
Direct_Primitive_Operations list from the base type, for record
and private cases.
(Build_Derived_Record_Type): Initialize the
Direct_Primitive_Operations list for derived record and private
types.
(Build_Derived_Type): Initialize the Direct_Primitive_Operations
list for derived types (and also for their associated base types
when needed).
(Process_Full_View): For full types that are untagged record and
private types, copy the primitive operations of the partial view
to the primitives list of the full view.
* sem_ch4.adb (Analyze_Selected_Component): Allow prefixed
notation for subprogram calls in the case of untagged
types (when Extensions_Allowed is True). In the case where
Is_Private_Type (Prefix_Type) is True, call Try_Object_Operation
when a discriminant selector wasn't found. Also call
Try_Object_Operation in other type kind cases (when
Extensions_Allowed is True).
(Try_Object_Operation.Try_One_Prefixed_Interpretation): Prevent
early return in the untagged case (when Extensions_Allowed is
True). Condition main call to Try_Primitive_Operation on the
type having primitives, and after that, if Prim_Result is False,
test for case where the prefix type is a named access type with
primitive operations and in that case call
Try_Primitive_Operation after temporarily resetting Obj_Type to
denote the access type (and restore it to the designated type
after the call)
(Try_Object_Operation.Valid_First_Argument_Of): Do matching type
comparison by testing Base_Type (Obj_Type) against
Base_Type (Typ), rather than against just Typ, to properly
handle cases where the object prefix has a constrained
subtype. (Fixes a bug discovered while working on this
feature.)
* sem_ch6.adb
(New_Overloaded_Entity.Check_For_Primitive_Subprogram): Add a
primitive of an untagged type to the type's list of primitive
operations, for both explicit and implicit (derived, so
Comes_From_Source is False) subprogram declarations. In the case
where the new primitive overrides an inherited subprogram,
locate the primitives Elist that references the overridden
subprogram, and replace that element of the list with the new
subprogram (done by calling the new procedure
Add_Or_Replace_Untagged_Primitive on the result type and each
formal atype).
(Check_For_Primitive_Subprogram.Add_Or_Replace_Untagged_Primitive):
New nested procedure to either add or replace an untagged
primitive subprogram in a given type's list of primitive
operations (replacement happens in case where the new subprogram
overrides a primitive of the type).
* sem_ch7.adb (New_Private_Type): When Extensions_Allowed is
True, initialize the Direct_Primitive_Operations list of a
private type to New_Elmt_List in the case of untagged types.
* sem_ch8.adb (Find_Selected_Component): In the case where the
prefix is an entity name, relax condition that tests
Has_Components so that Analyze_Selected_Component will also be
called when Extensions_Allowed is True and the prefix type is
any type.
2021-07-06 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not perform
conformance check when the subprogram body has been created for
an expression function that is not a completion of a previous
specification, because the profile of the constructed body is
copied from the expression function itself.
2021-07-06 Steve Baird <baird@adacore.com>
* doc/gnat_rm/implementation_of_specific_ada_features.rst: Add a
warning indicating that the details of the default (i.e.,
selected by the compiler) implementation of T'Put_Image for a
nonscalar type T are subject to change.
* gnat_rm.texi: Regenerate.
2021-07-05 Pierre-Marie de Rodat <derodat@adacore.com>
* gnat-style.texi, gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-07-05 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Depends_In_Decl_Part): Reject overlays
in Depends and Refined_Depends contracts.
(Analyze_Global_In_Decl_Part): Likewise for Global and
Refined_Global.
(Analyze_Initializes_In_Decl_Part): Likewise for Initializes
(when appearing both as a single item and as a initialization
clause).
* sem_util.ads (Ultimate_Overlaid_Entity): New routine.
* sem_util.adb (Report_Unused_Body_States): Ignore overlays.
(Ultimate_Overlaid_Entity): New routine.
2021-07-05 Claire Dross <dross@adacore.com>
* libgnat/a-cfdlli.ads, libgnat/a-cfdlli.adb
libgnat/a-cfinve.ads, libgnat/a-cfinve.adb,
libgnat/a-cofove.ads, libgnat/a-cofove.adb,
libgnat/a-coboho.ads, libgnat/a-coboho.adb (Constant_Reference):
Get a read-only access to an element of the container.
(At_End): Ghost functions used to express pledges in the
postcondition of Reference.
(Reference): Get a read-write access to an element of the
container.
* libgnat/a-cfhama.ads, libgnat/a-cfhama.adb,
libgnat/a-cforma.ads, libgnat/a-cforma.adb: The full view of the
Map type is no longer a tagged type, but a wrapper over this
tagged type. This is to avoid issues with dispatching result in
At_End functions.
(Constant_Reference): Get a read-only access to an element of
the container.
(At_End): Ghost functions used to express pledges in the
postcondition of Reference.
(Reference): Get a read-write access to an element of the
container.
* libgnat/a-cfhase.ads, libgnat/a-cfhase.adb,
libgnat/a-cforse.ads, libgnat/a-cforse.adb: The full view of the
Map type is no longer a tagged type, but a wrapper over this
tagged type.
(Constant_Reference): Get a read-only access to an element of
the container.
* libgnat/a-cofuse.ads, libgnat/a-cofuve.ads (Copy_Element):
Expression function used to cause SPARK to make sure
Element_Type is copiable.
* libgnat/a-cofuma.ads (Copy_Key): Expression function used to
cause SPARK to make sure Key_Type is copiable.
(Copy_Element): Expression function used to cause SPARK to make
sure Element_Type is copiable.
2021-07-05 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Analyze_Global_Item): Adapt to update SPARK RM
rule.
2021-07-05 Arnaud Charlet <charlet@adacore.com>
* Make-generated.in: Add -f switch to ensure cp will never fail.
2021-07-05 Steve Baird <baird@adacore.com>
* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): When
building the assignment statement corresponding to the default
expression for a component, we make a copy of the expression.
When making that copy (and if we have seen a component that
requires late initialization), pass a Map parameter into the
call to New_Copy_Tree to redirect references to the type to
instead refer to the _Init formal parameter of the init proc.
This includes hoisting the declaration of Has_Late_Init_Comp out
one level so that it becomes available to Build_Assignment.
(Find_Current_Instance): Return True for other kinds of current
instance references, instead of just access-valued attribute
references such as T'Access.
* sem_util.adb (Is_Aliased_View): Return True for the _Init
formal parameter of an init procedure. The changes in
exp_ch3.adb can have the effect of replacing a "T'Access"
attribute reference in an init procedure with an "_Init'Access"
attribute reference. We want such an attribute reference to be
legal. However, we do not simply mark the formal parameter as
being aliased because that might impact callers.
(Is_Object_Image): Return True if Is_Current_Instance returns
True for the prefix of an Image (or related attribute) attribute
reference.
2021-07-05 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Stream_Operation_OK): Reuse
Is_Concurrent_Interface.
* sem_ch3.adb (Analyze_Interface_Declaration,
Build_Derived_Record_Type): Likewise.
* sem_ch6.adb (Check_Limited_Return): Likewise.
* sem_util.adb (Is_Concurrent_Interface): Don't call
Is_Interface because each of the Is_Protected_Interface,
Is_Synchronized_Interface and Is_Task_Interface calls it anyway.
2021-07-05 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch6.adb (Check_Limited_Return): Replace Comes_From_Source
with Comes_From_Extended_Return_Statement.
2021-07-05 Steve Baird <baird@adacore.com>
* libgnat/a-stobbu.adb, libgnat/a-stobbu.ads,
libgnat/a-stobfi.adb, libgnat/a-stobfi.ads,
libgnat/a-stoubu.adb, libgnat/a-stoubu.ads,
libgnat/a-stoufi.adb, libgnat/a-stoufi.ads,
libgnat/a-stoufo.adb, libgnat/a-stoufo.ads,
libgnat/a-stouut.adb, libgnat/a-stouut.ads,
libgnat/a-stteou.ads: Delete files.
* Makefile.rtl, impunit.adb: Remove references to deleted files.
2021-07-05 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Has_Compatible_Alignment_Internal): If the
prefix of the Address expression is an entire object with a
known alignment, then skip checks related to its size.
2021-07-05 Doug Rupp <rupp@adacore.com>
* libgnat/s-os_lib.ads: Import OS_Time comparison ops as
intrinsic.
* libgnat/s-os_lib.adb: Remove OS_TIme comparison ops
implementation.
2021-07-05 Doug Rupp <rupp@adacore.com>
* libgnat/s-os_lib.ads: Add some comments about time_t.
* libgnat/s-os_lib.adb (GM_Split/To_GM_Time): Rename formal to
P_OS_Time.
(GM_Time_Of/To_OS_Time): Likewise.
2021-07-05 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_res.adb (Resolve): Insert minus sign if needed.
2021-07-05 Steve Baird <baird@adacore.com>
* exp_put_image.adb:
(Enable_Put_Image, Preload_Root_Buffer_Type): Revert to querying
the -gnatd_z switch, as opposed to testing whether Ada_Version >= Ada_2022.
2021-07-05 Justin Squirek <squirek@adacore.com>
* checks.adb (Accessibility_Checks_Suppressed): Add check
against restriction No_Dynamic_Accessibility_Checks.
(Apply_Accessibility_Check): Add assertion to check restriction
No_Dynamic_Accessibility_Checks is not active.
* debug.adb: Add documentation for new debugging switch to
control which accessibility model gets employed under
restriction No_Dynamic_Accessibility_Checks.
* exp_attr.adb (Expand_N_Attribute_Reference): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
* exp_ch4.adb (Apply_Accessibility_Check): Skip check generation
when restriction No_Dynamic_Accessibility_Checks is active.
(Expand_N_Allocator): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_In): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_Type_Conversion): Disable dynamic accessibility checks
when No_Dynamic_Accessibility_Checks is active.
* exp_ch5.adb (Expand_N_Assignment_Statement): Disable
alternative accessibility model calculations when computing a
dynamic level for a SAOAAT.
* exp_ch6.adb (Add_Call_By_Copy_Code): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
(Expand_Branch): Disable alternative accessibility model
calculations.
(Expand_Call_Helper): Disable alternative accessibility model
calculations.
* restrict.adb, restrict.ads: Add new restriction
No_Dynamic_Accessibility_Checks.
(No_Dynamic_Accessibility_Checks_Enabled): Created to test when
experimental features (which are generally incompatible with
standard Ada) can be enabled.
* sem_attr.adb (Safe_Value_Conversions): Add handling of new
accessibility model under the restriction
No_Dynamic_Accessibility_Checks.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Disallow new restriction No_Dynamic_Accessibility_Checks from
being exclusively specified within a body or subunit without
being present in a specification.
* sem_res.adb (Check_Fully_Declared_Prefix): Minor comment
fixup.
(Valid_Conversion): Omit implicit conversion checks on anonymous
access types and perform static checking instead when
No_Dynamic_Accessibility_Checks is active.
* sem_util.adb, sem_util.ads (Accessibility_Level): Add special
handling of anonymous access objects, formal parameters,
anonymous access components, and function return objects.
(Deepest_Type_Access_Level): When
No_Dynamic_Accessibility_Checks is active employ an alternative
model. Add paramter Allow_Alt_Model to override the new behavior
in certain cases.
(Type_Access_Level): When No_Dynamic_Accessibility_Checks is
active employ an alternative model. Add parameter
Allow_Alt_Model to override the new behavior in certain cases.
(Typ_Access_Level): Created within Accessibility_Level for
convenience.
* libgnat/s-rident.ads, snames.ads-tmpl: Add handing for
No_Dynamic_Accessibility_Checks.
2021-07-05 Doug Rupp <rupp@adacore.com>
* adaint.h (__gnat_set_file_time_name): Use OS_Time.
* adaint.c (__gnat_set_file_time_name): Likewise.
2021-07-05 Doug Rupp <rupp@adacore.com>
* adaint.h (OS_Time): typedef as long long.
* osint.adb (Underlying_OS_Time): Declare as 64-bit signed type.
* libgnat/s-os_lib.adb ("<"): Compare OS_Time as
Long_Long_Integer.
("<="): Likewise.
(">"): Likewise.
(">="): Likewise.
* libgnat/s-os_lib.ads (OS_Time): Declare as 64-bit signed type.
2021-07-05 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch3.adb (Check_Abstract_Overriding): Post error message on
renaming node.
2021-07-05 Yannick Moy <moy@adacore.com>
* libgnat/a-uncdea.ads: Add Depends/Post to
Ada.Unchecked_Deallocation.
* sem_ch4.adb (Analyze_Allocator): Remove checking of allocator
placement.
* sem_res.adb (Flag_Object): Same.
2021-07-05 Ghjuvan Lacambre <lacambre@adacore.com>
* aspects.ads: Add GNAT_Annotate aspect.
* gnat1drv.adb (Adjust_Global_Switches): Stop defining
Name_Gnat_Annotate as an alias of Name_Annotate.
* snames.ads-tmpl: Define Gnat_Annotate.
* par-prag.adb, sem_prag.ads: Add Pragma_Gnat_Annotate to list
of pragmas.
* lib-writ.adb, sem_ch13.adb, sem_prag.adb: Handle Gnat_Annotate
like Aspect_Annotate.
2021-07-05 Piotr Trojanek <trojanek@adacore.com>
* ttypes.ads (Target_Strict_Alignment): Fix comment.
2021-07-05 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Has_Compatible_Alignment_Internal): Fix
indentation of ELSIF comments; remove explicit calls to
UI_To_Int; remove extra parens around the MOD operand.
2021-07-05 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Record_Aggregate, Step_5): Do not check
for the need to use an extension aggregate for a given component
when within an instance and the type of the component hss a
private ancestor: the instantiation is legal if the generic
compiles, and spurious errors may be generated otherwise.
2021-07-05 Ghjuvan Lacambre <lacambre@adacore.com>
* errout.adb (Output_JSON_Message): Recursively call
Output_JSON_Message for continuation messages instead of
appending their content to the initial message.
2021-07-05 Steve Baird <baird@adacore.com>
* debug.adb: Remove comments about -gnatd_z switch.
* exp_ch3.adb (Make_Predefined_Primitive_Specs): A one-line fix
for a subtle bug that took some effort to debug. Append a new
Put_Image procedure for a type extension even if it seems to
already have one, just as is done for (for example) the
streaming-related Read procedure.
* exp_put_image.adb:
(Build_Record_Put_Image_Procedure.Make_Component_Attributes): Do
not treat _Parent component like just another component, for two
reasons. 1. If the _parent component's type has a
user-specified Put_Image procedure, then we want to generate a
call to that procedure and then generate extension aggregate
syntax. 2. Otherwise, we still don't want to see any mention of
"_parent" in the generated image text.
(Build_Record_Put_Image_Procedure.Make_Component_Name): Add
assertion that we are not generating a reference to an "_parent"
component.
(Build_Record_Put_Image_Procedure): Add special treatment for
null records. Add call to Duplicate_Subexpr for image attribute
prefix in order to help with expansion needed in the class-wide
case (where the prefix is also referenced in the call to
Wide_Wide_Expanded_Name) if evaluation of the prefix has side
effects. Add new local helper function, Put_String_Exp. Add
support for case where prefix type is class-wide.
(Enable_Put_Image, Preload_Root_Buffer_Type): Query Ada_Version
> Ada_2022 instead of (indirectly) querying -gnatd_z switch.
* freeze.adb (In_Expanded_Body): A one-line change to add
TSS_Put_Image to the list of subprograms that have
expander-created bodies.
* rtsfind.ads: Add support for accessing
Ada.Tags.Wide_Wide_Expanded_Name.
* sem_ch3.ads, sem_ch3.adb: Delete Is_Null_Extension function,
as part of moving it to Sem_Util.
* sem_ch13.adb
(Analyze_Put_Image_TSS_Definition.Has_Good_Profile): Improve
diagnostic messages in cases where the result is going to be
False and the Report parameter is True. Relax overly-restrictive
checks in order to implement mode conformance.
(Analyze_Stream_TSS_Definition.Has_Good_Profile): Add similar
relaxation of parameter subtype checking for the Stream
parameter of user-defined streaming subprograms.
* sem_disp.adb (Check_Dispatching_Operation): A one-line
change (and an accompanying comment change) to add TSS_Put_Image
to the list of compiler-generated dispatching primitive
operations.
* sem_util.ads, sem_util.adb: Add Ignore_Privacy Boolean
parameter to Is_Null_Record_Type function (typically the
parameter will be False when the function is being used in the
implementation of static semantics and True for dynamic
semantics; the parameter might make a difference in the case of,
for example, a private type that is implemented as a null record
type). Add related new routines Is_Null_Extension (formerly
declared in Sem_Ch3), Is_Null_Extension_Of, and
Is_Null_Record_Definition.
2021-07-05 Justin Squirek <squirek@adacore.com>
* freeze.adb (Freeze_Profile): Use N's Sloc, F_type's chars.
2021-07-05 Bob Duff <duff@adacore.com>
* checks.adb, exp_aggr.adb, exp_ch5.adb, freeze.adb,
sem_util.adb, sem_util.ads: Change L and H to be First and Last,
to match the attributes in the RM. Change calls from procedure
to function where appropriate.
2021-07-05 Bob Duff <duff@adacore.com>
* sem_util.ads, sem_util.adb (Compute_Returns_By_Ref): New
procedure to compute Returns_By_Ref, to avoid some code
duplication. This will likely change soon, so it's good to have
the code in one place.
(CW_Or_Has_Controlled_Part): Move here from Exp_Ch7, because
it's called by Compute_Returns_By_Ref, and this is a better
place for it anyway.
(Needs_Finalization): Fix comment to be vague instead of wrong.
* exp_ch6.adb (Expand_N_Subprogram_Body, Freeze_Subprogram):
Call Compute_Returns_By_Ref.
* sem_ch6.adb (Check_Delayed_Subprogram): Call
Compute_Returns_By_Ref.
* exp_ch7.ads, exp_ch7.adb (CW_Or_Has_Controlled_Part): Move to
Sem_Util.
(Has_New_Controlled_Component): Remove unused function.
2021-07-05 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch3.adb (Check_Abstract_Overriding): Check for renamings.
2021-07-05 Boris Yakobowski <yakobowski@adacore.com>
* exp_ch4.adb (Expand_N_Op_Rem): Remove special case for rem -1
in CodePeer_Mode.
2021-07-01 Eric Botcazou <ebotcazou@adacore.com>
PR ada/101094
* exp_attr.adb (Get_Integer_Type): Return an integer type with the
same signedness as the input type.
2021-06-29 Richard Kenner <kenner@adacore.com>
* sem_util.adb (Visit_Node): Add handling for N_Block_Statement
with declarations.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* einfo-utils.adb
(Unknown_Alignment): Simply negate the Known_ counterpart.
(Unknown_Component_Bit_Offset): Likewise.
(Unknown_Esize): Likewise.
(Unknown_Normalized_First_Bit): Likewise.
(Unknown_Normalized_Position): Likewise.
(Unknown_Normalized_Position_Max): Likewise.
(Unknown_RM_Size): Likewise.
2021-06-29 Boris Yakobowski <yakobowski@adacore.com>
* exp_ch4.adb (Expand_N_Op_Mod): Remove special case for mod -1
in CodePeer_Mode.
2021-06-29 Aleksandra Pasek <pasek@adacore.com>
* libgnat/s-objrea.adb (EM_AARCH64): New Constant.
(Initialize): Handle EM_AARCH64 case.
(Read_Address): Handle AARCH64 case.
* libgnat/s-objrea.ads (Object_Arch): Add AARCH64 record
component.
2021-06-29 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Analyze_Record_Representation_Clause): Call
Set_Entity_With_Checks instead of Set_Entity, so we perform the
check for correct casing.
* style.adb (Check_Identifier): Minor comment improvement.
Cleanup overly complicated code.
2021-06-29 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Convert_Aggr_In_Object_Decl): After expansion of
the aggregate, the expression can be removed from the
declaration, except if the object is class-wide, in which case
the aggregate provides the actual type. In other cases the
presence of the expression may lead to spurious freezing issue.
* exp_ch3.adb (Expand_N_Object_Declaration): If the expression
in the declaration is an aggregate with delayed expansion (as is
the case for objects of a limited type, or a subsequent address
specification) the aggregate must be resolved at this point.
This resolution must not include expansion, because the
expansion of the enclosing declaration will construct the
necessary aggregate expansion.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* errout.ads (Adjust_Name_Case): Remove obsolete and now unused
variant.
* errout.adb (Adjust_Name_Case): Likewise; fix variant that uses
a custom buffer to also use it for names in Standard_Location.
2021-06-29 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Freeze_Subprogram_Body): Add missing "freeze".
(Install_Body): Likewise.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* adaint.c (__gnat_portable_spawn): Revert change that
introduced setting of __gnat_in_child_after_fork.
2021-06-29 Patrick Bernardi <bernardi@adacore.com>
* libgnarl/s-tasdeb.ads (Known_Tasks): Add Atomic_Components
aspect.
2021-06-29 Doug Rupp <rupp@adacore.com>
* Makefile.rtl (x86_64-vx7r2) [EXTRA_GNATRTL_TASKING_OBJS]: Move
i-vxinco.o out of RTP runtime.
2021-06-29 Claire Dross <dross@adacore.com>
* libgnat/a-cfdlli.ads: Use pragma Assertion_Policy to disable
pre and postconditions.
* libgnat/a-cfhama.ads: Likewise.
* libgnat/a-cfhase.ads: Likewise.
* libgnat/a-cfinve.ads: Likewise.
* libgnat/a-cforma.ads: Likewise.
* libgnat/a-cforse.ads: Likewise.
* libgnat/a-cofove.ads: Likewise.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* sem_util.ads (Get_Fullest_View): Refill comment; remove extra
extra after period.
* sem_util.adb (Get_Fullest_View): Fix style.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Remove explicit check for
missing, because a subsequent call to Is_Empty_List will detect
them anyway.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* freeze.adb (Freeze_All): Simplify by reusing
Is_Subprogram_Or_Entry.
* sem_ch11.adb (Analyze_Handled_Statement): Likewise.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Prevent cascaded
errors once for the subprogram call, not for every pair of
actual parameters.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Is_Local_Type): Simplify by reusing Scope_Within.
2021-06-29 Gary Dismukes <dismukes@adacore.com>
* sem_ch6.ads (Can_Override_Operator): Function declaration
moved from package body to package spec.
* sem_ch6.adb (Check_Overriding_Indicator): Now use test of
whether the subprogram's Chars is an operator name, to handle
cases of function instances whose entity is
N_Defining_Identifier rather than N_Defining_Operator_Symbol.
(Can_Override_Operator): Function declaration moved to package
spec. Now use test of whether the subprogram's Chars is an
operator name, to handle cases of function instances whose
entity is N_Defining_Identifier rather than
N_Defining_Operator_Symbol.
* sem_ch8.adb (Analyze_Renamed_Subprogram): Check for
possibility of an overridden predefined operator, and suppress
the "not overriding" message in that case.
2021-06-29 Doug Rupp <rupp@adacore.com>
* Makefile.rtl: Add a new ifeq for vx7r2 shared gnatlib.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* exp_attr.adb (Build_Array_VS_Func): Restore uses of
Validated_View.
(Build_Record_VS_Func): Likewise.
(Expand_N_Attribute_Reference): Likewise.
* sem_util.adb (Validated_View): Behave as an identity function
for arrays and scalars.
2021-06-29 Bob Duff <duff@adacore.com>
* atree.adb, atree.ads (Parent, Set_Parent): Assert node is
Present.
(Copy_Parent, Parent_Kind): New helper routines.
* gen_il-gen.adb: Add with clause.
* nlists.adb (Parent): Assert Parent of list is Present.
* aspects.adb, checks.adb, exp_aggr.adb, exp_ch6.adb,
exp_util.adb, lib-xref-spark_specific.adb, osint.ads,
sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch6.adb,
sem_dim.adb, sem_prag.adb, sem_res.adb, sem_util.adb,
treepr.adb: Do not call Parent and Set_Parent on the Empty node.
* libgnat/a-stwiun__shared.adb, libgnat/a-stzunb__shared.adb:
Minor: Fix typos in comments.
* einfo.ads: Minor comment update.
* sinfo-utils.ads, sinfo-utils.adb (Parent_Kind, Copy_Parent):
New functions.
2021-06-29 Eric Botcazou <ebotcazou@adacore.com>
* repinfo-input.adb (Read_JSON_Stream): Fix typo.
2021-06-29 Eric Botcazou <ebotcazou@adacore.com>
* rtsfind.ads (RE_Id): Change RE_Valid_Enumeration_Value_NN into
RE_Valid_Value_Enumeration_NN.
(RE_Unit_Table): Adjust to above renaming.
* exp_imgv.adb (Expand_Valid_Value_Attribute): Likewise.
* libgnat/s-valuen.ads (Invalid): Remove.
(Value_Enumeration_Pos): Move to...
* libgnat/s-valuen.adb (Value_Enumeration_Pos): ...here.
Return -1 instead of Invalid.
(Value_Enumeration): Compare against 0 instead of Invalid.
(Valid_Enumeration_Value): Likewise. Rename to...
(Valid_Value_Enumeration): ...this.
* libgnat/s-vaenu8.ads (Valid_Enumeration_Value_8): Rename into...
(Valid_Value_Enumeration_8): ...this.
* libgnat/s-vaen16.ads (Valid_Enumeration_Value_16): Rename into...
(Valid_Value_Enumeration_16): ...this.
* libgnat/s-vaen32.ads (Valid_Enumeration_Value_32): Rename into...
(Valid_Value_Enumeration_32): ...this.
2021-06-29 Bob Duff <duff@adacore.com>
* einfo.ads (Component_Bit_Offset, Component_Size): Update
documentation: Repinfo is the package where these negative
values are documented.
* einfo-utils.adb (Known_Component_Size,
Known_Static_Component_Size, Unknown_Component_Size): Remove
calls to Implementation_Base_Type, because Component_Size is an
Impl_Base_Type_Only field (see Gen_Entities).
* sem_ch13.ads, sem_ch13.adb (Check_Size): Do not set Esize and
RM_Size. This is unnecessary in the case of Size. For
Component_Size, it is wrong, because we would be setting the
Esize and RM_Size of the component type.
2021-06-29 Pascal Obry <obry@adacore.com>
* s-oscons-tmplt.c: Add some OS constants.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* sem_util.ads (Validated_View): Fix style in comment.
* sem_util.adb (Validated_View): Rewrite in recursive style.
2021-06-29 Eric Botcazou <ebotcazou@adacore.com>
* Make-generated.in (ada/stamp-gen_il): Ignore errors from
running gen_il-main.
2021-06-29 Richard Kenner <kenner@adacore.com>
* gen_il-gen-gen_entities.adb (Record_Field_Kind,
Allocatable_Kind): Add new abstract kinds.
(Constant_Or_Variable_Kind): Likewise.
(E_Constant, E_Variable, E_Loop_Parameter): Use them.
(E_Discriminant, E_Component): Likewise.
* gen_il-types.ads (type Opt_Type_Enum): Add them.
2021-06-29 Bob Duff <duff@adacore.com>
* gen_il-gen.adb (Put_C_Type_And_Subtypes): Put the correct
numbers.
* gen_il-internals.ads, gen_il-internals.adb: (Pos): Remove this
function. It was assuming that the order of the enumeration
literals in Type_Enum is the same as the order of the generated
types Node_Kind and Entity_Kind, which is not true.
2021-06-29 Piotr Trojanek <trojanek@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Explicitly use
Validated_View for record objects.
2021-06-28 Martin Sebor <msebor@redhat.com>
* gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
Replace TREE_NO_WARNING with suppress_warning.
(gnat_gimplify_expr): Same.
* gcc-interface/utils.c (gnat_pushdecl): Same.
2021-06-21 Gary Dismukes <dismukes@adacore.com>
* checks.adb (Selected_Range_Checks): In the case of a
qualified_expression where the qualifying subtype is an
unconstrained array subtype with fixed lower bounds for some of
its indexes, generate tests to check that those bounds are equal
to the corresponding lower bounds of the qualified array object.
2021-06-21 Bob Duff <duff@adacore.com>
* libgnat/s-valuen.ads (Value_Enumeration,
Valid_Enumeration_Value): Inline.
(Value_Enumeration_Pos): Add Pure_Function.
2021-06-21 Justin Squirek <squirek@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Document new
feature under pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
* errout.adb, errout.ads (Error_Msg_GNAT_Extension): Created to
issue errors when parsing extension only constructs.
* exp_ch11.adb, exp_ch11.ads (Expand_N_Raise_When_Statement):
Created to expand raise ... when constucts.
* exp_ch5.adb, exp_ch5.ads (Expand_N_Goto_When_Statement):
Created to expand goto ... when constructs.
* exp_ch6.adb, exp_ch6.ads (Expand_N_Return_When_Statement):
Created to expand return ... when constructs.
* expander.adb (Expand): Add case entries for "when" constructs.
* gen_il-gen-gen_nodes.adb, gen_il-types.ads: Add entries for
"when" constructs.
* par-ch11.adb (P_Raise_Statement): Add processing for raise ...
when.
* par-ch5.adb (Missing_Semicolon_On_Exit): Renamed to
Missing_Semicolon_On_When and moved to par-util.adb.
* par-ch6.adb (Get_Return_Kind): Renamed from Is_Simple and
processing added for "return ... when" return kind.
(Is_Simple): Renamed to Get_Return_Kind.
(P_Return_Statement): Add case for return ... when variant of
return statement.
* par-util.adb, par.adb (Missing_Semicolon_On_When): Added to
centeralize parsing of "when" keywords in the context of "when"
constructs.
* sem.adb (Analyze): Add case for "when" constructs.
* sem_ch11.adb, sem_ch11.ads (Analyze_Raise_When_Statement):
Created to analyze raise ... when constructs.
* sem_ch5.adb, sem_ch5.ads (Analyzed_Goto_When_Statement):
Created to analyze goto ... when constructs.
* sem_ch6.adb, sem_ch6.ads (Analyze_Return_When_Statement):
Created to analyze return ... when constructs.
* sprint.adb (Sprint_Node_Actual): Add entries for new "when"
nodes.
2021-06-21 Steve Baird <baird@adacore.com>
* Make-generated.in (GEN_IL_FLAGS): Keep only GNAT flags.
(ada/stamp-gen_il): Remove dependencies on libgnat/ sources. Do not
copy libgnat/ sources locally and tidy up.
* Makefile.rtl: Include object files for new Text_Buffer units
in the GNATRTL_NONTASKING_OBJS list.
* exp_put_image.ads, exp_put_image.adb: Update Rtsfind calls to
match new specs. For example, calls to RE_Sink are replaced with
calls to RE_Root_Buffer_Type. Update comments and change
subprogram names accordingly (e.g., Preload_Sink is changed to
Preload_Root_Buffer_Type).
* impunit.adb: Add 6 new predefined units (Text_Buffers and 5
child units thereof).
* rtsfind.ads, rtsfind.adb: Add interfaces for accessing the
Ada.Strings.Text_Buffers package and declarations
therein (including the Unbounded child unit). Do not (yet)
delete interfaces for accessing the old Text_Output package.
* sem_attr.adb (Check_Put_Image_Attribute): Replace RE_Sink uses
with RE_Root_Buffer_Type and update comments accordingly.
* sem_ch10.adb (Analyze_Compilation_Unit): Update call to
reflect name change of callee (that is, the former Preload_Sink
is now Preload_Root_Buffer_Type).
* sem_ch13.adb (Has_Good_Profile): Replace RE_Sink use with
RE_Root_Buffer_Type.
(Build_Spec): Update comment describing a parameter type.
* gen_il.ads: Remove clauses for the old Text_Output package and
add them for Ada.Streams.Stream_IO.
(Sink): Declare.
(Create_File): Likewise.
(Increase_Indent): Likewise.
(Decrease_Indent): Likewise.
(Put): Likewise.
(LF): Likewise.
* gen_il.adb: Add clauses for Ada.Streams.Stream_IO.
(Create_File): New procedure.
(Increase_Indent): Likewise.
(Decrease_Indent): Likewise.
(Put): New procedures.
* gen_il-gen.adb: Add clauses for Ada.Text_IO. Replace
Sink'Class with Sink throughout. Use string concatenation and
LF marker instead of formatted strings and "\n" marker. Update
Indent/Outdent calls to use new Increase_Indent/Decrease_Indent
names.
(Put_Membership_Query_Decl): Remove.
* gen_il-internals.ads: Replace Sink'Class with Sink throughout.
(Ptypes): Remove.
(Pfields): Likewise.
* gen_il-internals.adb: Remove clauses for GNAT.OS_Lib and
Ada.Strings.Text_Buffers.Files. Replace Sink'Class with Sink
throughout. Use string concatenation and LF marker instead of
formatted strings and "\n" marker.
(Stdout): Remove.
(Ptypes): Likewise.
(Pfields): Likewise.
* libgnarl/s-putaim.ads: Modify context clause, update
declaration of subtype Sink to refer to
Text_Buffers.Root_Buffer_Type instead of the old
Text_Output.Sink type.
* libgnarl/s-putaim.adb: Modify context clause and add use
clause to refer to Text_Buffers package.
* libgnat/a-cbdlli.ads, libgnat/a-cbdlli.adb,
libgnat/a-cbhama.ads, libgnat/a-cbhama.adb,
libgnat/a-cbhase.ads, libgnat/a-cbhase.adb,
libgnat/a-cbmutr.ads, libgnat/a-cbmutr.adb,
libgnat/a-cborma.ads, libgnat/a-cborma.adb,
libgnat/a-cborse.ads, libgnat/a-cborse.adb,
libgnat/a-cdlili.ads, libgnat/a-cdlili.adb,
libgnat/a-cidlli.ads, libgnat/a-cidlli.adb,
libgnat/a-cihama.ads, libgnat/a-cihama.adb,
libgnat/a-cihase.ads, libgnat/a-cihase.adb,
libgnat/a-cimutr.ads, libgnat/a-cimutr.adb,
libgnat/a-ciorma.ads, libgnat/a-ciorma.adb,
libgnat/a-ciormu.ads, libgnat/a-ciormu.adb,
libgnat/a-ciorse.ads, libgnat/a-ciorse.adb,
libgnat/a-coboho.ads, libgnat/a-coboho.adb,
libgnat/a-cobove.ads, libgnat/a-cobove.adb,
libgnat/a-cohama.ads, libgnat/a-cohama.adb,
libgnat/a-cohase.ads, libgnat/a-cohase.adb,
libgnat/a-coinho.ads, libgnat/a-coinho.adb,
libgnat/a-coinho__shared.ads, libgnat/a-coinho__shared.adb,
libgnat/a-coinve.ads, libgnat/a-coinve.adb,
libgnat/a-comutr.ads, libgnat/a-comutr.adb,
libgnat/a-convec.ads, libgnat/a-convec.adb,
libgnat/a-coorma.ads, libgnat/a-coorma.adb,
libgnat/a-coormu.ads, libgnat/a-coormu.adb,
libgnat/a-coorse.ads, libgnat/a-coorse.adb,
libgnat/a-nbnbin.ads, libgnat/a-nbnbin.adb,
libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.ads,
libgnat/a-nbnbre.adb, libgnat/a-strunb.ads,
libgnat/a-strunb.adb, libgnat/a-strunb__shared.ads,
libgnat/a-strunb__shared.adb, libgnat/s-rannum.ads,
libgnat/s-rannum.adb: Modify Put_Image procedure used in
Put_Image aspect specification to conform to Ada profile
rules (in particular, the first parameter shall be of type
Ada.Strings.Text_Buffers.Root_Buffer_Type'Class).
* libgnat/a-sttebu.ads, libgnat/a-sttebu.adb,
libgnat/a-stbubo.ads, libgnat/a-stbubo.adb,
libgnat/a-stbufi.ads, libgnat/a-stbufi.adb,
libgnat/a-stbufo.ads, libgnat/a-stbufo.adb,
libgnat/a-stbuun.ads, libgnat/a-stbuun.adb,
libgnat/a-stbuut.ads, libgnat/a-stbuut.adb: A new predefined
unit, Ada.Strings.Text_Buffers, and five child units. Two of
the five are RM-defined: Bounded and Unbounded. The remaining
three are GNAT-defined: Files, Utils, and Formatting. The buffer
type corresponding to an output file, type Files.File_Buffer, is
simpler (and perhaps therefore slower) than its predecessor.
Caching similar to what was being done before could be added
later if that seems appropriate.
* libgnat/s-putima.ads: Modify context clause, update
declaration of subtype Sink to refer to
Text_Buffers.Root_Buffer_Type instead of the old
Text_Output.Sink type.
* libgnat/s-putima.adb: Modify context clause. Update
Indent/Outdent calls to use new Increase_Indent/Decrease_Indent
names; ditto for "Put_String => Put" name change.
* libgnat/a-stteou__bootstrap.ads: Delete.
2021-06-21 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch5.adb (Expand_Assign_Array_Bitfield_Fast): If big-endian
ordering is in effect for the operands and they are small,
adjust the unchecked conversions done around them.
2021-06-21 Richard Kenner <kenner@adacore.com>
* einfo.ads (Return_Statement): Add documentation.
* exp_ch6.adb (Expand_N_Extended_Return_Statement): Set it.
* gen_il-fields.ads: Add it.
* gen_il-gen-gen_entities.adb: Add it.
2021-06-21 Bob Duff <duff@adacore.com>
* rtsfind.ads, libgnat/s-bitfie.ads, libgnat/s-bituti.adb,
libgnat/s-bituti.ads (Fast_Copy_Bitfield): New run-time library
function to copy bit fields faster than Copy_Bitfield. Cannot be
called with zero-size bit fields. Remove obsolete ??? comments
from s-bituti.adb; we already do "avoid calling this if
Forwards_OK is False".
* exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield,
Expand_Assign_Array_Bitfield_Fast): Generate calls to
Fast_Copy_Bitfield when appropriate.
* sem_util.adb, sem_util.ads (Get_Index_Bounds): Two new
functions for getting the index bounds. These are more
convenient than the procedure of the same name, because they can
be used to initialize constants.
2021-06-21 Ed Schonberg <schonberg@adacore.com>
* gen_il-fields.ads: Add Default_Subtype_Mark to enumeration
type for fields.
* gen_il-gen-gen_nodes.adb: Add call to create new field for
Formal_Type_Declaration node.
* par-ch12.adb (P_Formal_Type_Declaration): in Ada_2022 mode,
recognize new syntax for default: "or use subtype_mark".
(P_Formal_Type_Definition): Ditto for the case of a formal
incomplete type.
* sinfo.ads: Add field Default_Subtype_Mark to
N_Formal_Type_Declaration.
* sem_ch12.adb (Validate_Formal_Type_Default): New procedure, to
apply legality rules to default subtypes in formal type
declarations. Some legality rules apply to all defaults, such as
the requirement that the default for a formal type that depends
on previous formal entities must itself be a previously declared
formal of the same unit. Other checks are kind- specific.
(Analyze_Associations): Use specified default if there is no
actual provided for a formal type in an instance.
(Analyze_Formal_Type_Declaration): Call
Validate_Formal_Type_Default when default subtype is present.
2021-06-21 Bob Duff <duff@adacore.com>
* libgnat/s-valuen.ads, libgnat/s-valuen.adb
(Value_Enumeration_Pos): New function to compute the 'Pos of the
enumeration literal for a given String. Return a special value
instead of raising an exception on invalid input. Called by both
Valid_Enumeration_Image and Value_Enumeration.
(Valid_Enumeration_Image): Return a Boolean indicating whether
the String is a valid Image for the given enumeration type.
(Value_Enumeration): Implement in terms of
Value_Enumeration_Pos.
* libgnat/s-vaenu8.ads, libgnat/s-vaen16.ads,
libgnat/s-vaen32.ads: Rename Valid_Enumeration_Image from the
instances.
* libgnat/s-valuti.ads: Correct documentation (it was not true
for the null string).
* libgnat/s-valuti.adb (Normalize_String): Do not raise
Constraint_Error for the null string, nor strings containing
nothing but blanks, so that Valid_Enumeration_Image can return
False in these cases, rather than raising an exception.
* rtsfind.ads (RE_Value_Enumeration_8, RE_Value_Enumeration_16,
RE_Value_Enumeration_32): New functions.
(RTE_Available): Improve comment (E doesn't have to be a
subprogram, although that's the usual case).
* sem_attr.adb (nalid_Value): Semantic analysis for new
attribute.
* exp_attr.adb: Call Expand_Valid_Value_Attribute for new
attribute.
* exp_imgv.ads, exp_imgv.adb (Expand_Valid_Value_Attribute): New
procedure to expand Valid_Value into a call to
Valid_Enumeration_Image_NN.
(Expand_Value_Attribute): Misc code cleanups. Remove two ???
mark comments. RTE_Available won't work here. For one thing,
RTE_Available (X) shouldn't be called until the compiler has
decided to make use of X (see comments on RTE_Available), and in
this case we're trying to AVOID calling something.
* snames.ads-tmpl: New attribute name.
* doc/gnat_rm/implementation_defined_attributes.rst: Document
new attribute.
* gnat_rm.texi: Regenerate.
2021-06-21 Eric Botcazou <ebotcazou@adacore.com>
* fe.h (Assume_No_Invalid_Values): Declare.
* opt.ads (Assume_No_Invalid_Values): Add warning comment.
2021-06-21 Bob Duff <duff@adacore.com>
* libgnat/s-bituti.ads (Small_Size): Do not include 0 in this
type.
* libgnat/s-bituti.adb (Copy_Bitfield): Do nothing for 0-bit
bitfields.
2021-06-21 Ghjuvan Lacambre <lacambre@adacore.com>
* exp_ch9.adb (Build_Simple_Entry_Call): Add comment.
* libgnat/s-rannum.adb (Random): Update comment.
* libgnat/s-rannum.ads (Generator): Update comment.
2021-06-21 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/representation_clauses_and_pragmas.rst (Address
Clauses): Fix unbalanced parens.
* gnat_rm.texi: Regenerate.
2021-06-21 Ghjuvan Lacambre <lacambre@adacore.com>
* errout.adb (Handle_Serious_Error): Capitalize comment.
* exp_dbug.adb (Set_Entity_Name): Capitalize sentence.
* exp_dist.adb (Expand_All_Calls_Remote_Subprogram_Call): Fix
typo.
* sem_ch3.adb (Modular_Type_Declaration): Add space after comma.
2021-06-21 Ghjuvan Lacambre <lacambre@adacore.com>
* debug.adb: Document -gnatd_U as taken.
* err_vars.ads (Warning_Doc_Switch): Set to True.
* errout.ads (Errout): Update documentation.
* gnat1drv.adb (Adjust_Global_Switches): React to -gnatd_U.
* hostparm.ads (Tag_Errors): Set to True.
* opt.ads (Unique_Error_Tag): Document -gnatd_U.
2021-06-21 Eric Botcazou <ebotcazou@adacore.com>
* urealp.ads (UR_Write_To_JSON): Declare.
* urealp.adb (Decimal_Exponent_Hi): Treat numbers in base 10
specially and rewrite handling of numbers in other bases.
(Decimal_Exponent_Lo): Likewise.
(Normalize): Minor tweak.
(UR_Write_To_JSON): New wrapper procedure around UR_Write.
* repinfo.adb (List_Type_Info): When the output is to JSON, call
UR_Write_To_JSON instead of UR_Write.
2021-06-21 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Indexed_Component_Bit_Offset): Return an unknown
offset for components within multidimensional arrays; remove
redundant parens.
2021-06-21 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Find_Overlaid_Entity): Ignore references to
components and discriminants.
2021-06-21 Doug Rupp <rupp@adacore.com>
* Makefile.rtl (aarch64-linux) [LIBGNAT_TARGET_PAIRS]: Add
$(TRASYM_DWARF_UNIX_PAIRS).
[EXTRA_GNAT_RTL_NONTASKING_OBJS]: Add $(TRASYM_DWARF_UNIX_OBJS)
2021-06-21 Gary Dismukes <dismukes@adacore.com>
* exp_util.adb (Expand_Sliding_Conversion): Only perform
expansion when Expander_Active is True. Add a comment about this
and refine existing comment regarding string literals.
2021-06-21 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Denotes_Same_Object): Simplify handling of
slices.
2021-06-21 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Object_Renaming): Rename from Is_Renaming;
simplify; adapt callers.
2021-06-21 Frederic Konrad <konrad@adacore.com>
* Makefile.rtl: Compiles both static and dynamic libgnat for
powerpc64-wrs-vxworks7r2.
2021-06-18 Gary Dismukes <dismukes@adacore.com>
* sem_ch3.adb (Constrain_Array): Add error checking for
fixed-lower-bound and constrained index ranges applied
inappropriately on subtypes of unconstrained and
fixed-lower-bound array types.
(Constrain_Index): Correct and refine comment related to
fixed-lower-bound index ranges.
2021-06-18 Bob Duff <duff@adacore.com>
* gen_il-gen.adb: Improve comments.
* snames.ads-tmpl (Convention_Id): Remove "-- Plenty of space
for expansion", because that's irrelevant now that we are no
longer laying out node fields by hand.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Denotes_Same_Object): Handle character literals
just like integer literals.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Denotes_Same_Object): Explicitly test for node
kinds being the same; deal with renamings one-by-one; adjust
numbers in references to the Ada RM.
2021-06-18 Bob Duff <duff@adacore.com>
* sprint.adb (Write_Source_Line): Check for EOF in
Line_Terminator loop. Note that when a source file is read in,
an EOF character is added to the end.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_aux.adb (Package_Specification): Add assertions to confirm
the kind of the of parameter and returned node.
* sem_ch12.adb (Remove_Parent): Reorder conditions; this change
appears to be semantically neutral, but is enough to avoid the
problematic call to Package_Specification.
* sem_util.adb (Is_Incomplete_Or_Private_Type): Replace loop
with a call to Package_Specification.
2021-06-18 Bob Duff <duff@adacore.com>
* sem_attr.adb (Eval_Attribute): For Enum_Lit'Size, use
Enum_Type'Object_Size.
2021-06-18 Olivier Hainque <hainque@adacore.com>
* sigtramp-vxworks-target.inc (__aarch64__): Sync
REGNO_PC_OFFSET with the back-end DWARF_ALT_FRAME_RETURN_COLUMN.
In CFI_COMMON_REGS, leave r18 alone, VxWorks private.
2021-06-18 Javier Miranda <miranda@adacore.com>
* contracts.adb (Process_Spec_Postconditions): Add missing
support for aliased subprograms and handle wrappers of
class-wide pre/post conditions.
(Process_Inherited_Preconditions): Add missing support for
aliased subprograms and handle wrappers of class-wide pre/post
conditions.
* einfo.ads (Class_Wide_Clone): Fix typo.
(Is_Class_Wide_Clone): Removed since it is not referenced.
(Is_Wrapper): Documenting new flag.
(LSP_Subprogram): Documenting new attribute.
* exp_ch3.adb (Make_Controlling_Function_Wrappers): Decorate
wrapper as Is_Wrapper and adjust call to
Override_Dispatching_Operation.
* freeze.adb (Build_Inherited_Condition_Pragmas): Fix typo in
documentation.
(Check_Inherited_Conditions): Handle LSP wrappers; ensure
correct decoration of LSP wrappers.
* gen_il-fields.ads (Is_Class_Wide_Clone): Removed.
(Is_Wrapper): Added.
(LSP_Subprogram): Added.
* gen_il-gen-gen_entities.adb (Is_Class_Wide_Clone): Removed.
(Is_Wrapper): Added.
(LSP_Subprogram): Added.
* gen_il-internals.adb (Image): Adding uppercase image of
LSP_Subprogram.
* sem_ch6.adb (New_Overloaded_Entity): Fix decoration of LSP
wrappers.
* sem_disp.ads (Override_Dispatching_Operation): Remove
parameter Is_Wrapper; no longer needed.
* sem_disp.adb (Check_Dispatching_Operation): Adjust assertion.
(Override_Dispatching_Operation): Remove parameter Is_Wrapper;
no longer needed.
* treepr.adb (Image): Adding uppercase image of LSP_Subprogram.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* exp_ch4.adb (Expand_N_Quantified_Expression): Ensure the type
of the name of a "for of" loop is frozen.
* exp_disp.adb (Check_Premature_Freezing): Complete condition to
take into account a private type completed by another private
type now that the freezing rule are better implemented.
* freeze.adb (Freeze_Entity.Freeze_Profile): Do not perform an
early freeze on types if not in the proper scope. Special case
expression functions that requires access to the dispatch table.
(Should_Freeze_Type): New.
* sem_ch13.adb (Resolve_Aspect_Expressions): Prevent assert
failure in case of an invalid tree (previous errors detected).
* sem_res.adb (Resolve): Remove kludge related to entities
causing incorrect premature freezing.
* sem_util.adb (Ensure_Minimum_Decoration): Add protection
against non base types.
2021-06-18 Gary Dismukes <dismukes@adacore.com>
* sem_ch3.adb (Constrain_Index): Set the High_Bound of a
fixed-lower-bound subtype's range to T (the subtype of the FLB
index being constrained) rather than Base_Type (T).
2021-06-18 Bob Duff <duff@adacore.com>
* ada_get_targ.adb, aspects.ads, checks.adb, cstand.adb,
einfo.ads, exp_attr.adb, freeze.adb, get_targ.adb,
libgnat/a-textio.ads, libgnat/g-memdum.ads,
libgnat/s-scaval__128.adb, libgnat/s-scaval.adb, make.adb,
osint.ads, par-prag.adb, sem_ch13.adb, sem_prag.adb,
sem_prag.ads, set_targ.adb, set_targ.ads, snames.ads-tmpl,
targparm.ads, types.ads: Remove AAMP-specific code.
* switch.ads: Minor reformatting.
* gen_il-fields.ads, gen_il-gen.adb,
gen_il-gen-gen_entities.adb, gen_il-types.ads, einfo-utils.adb,
einfo-utils.ads: Package Types now contains "type Float_Rep_Kind
is (IEEE_Binary);", which used to also have an enumeral AAMP.
Gen_IL can't handle fields of this type, which would be zero
sized. Therefore, we move the Float_Rep field into Einfo.Utils
as a synthesized attribute. (We do not delete the field
altogether, in case we want new floating-point representations
in the future.)
* doc/gnat_rm/implementation_defined_pragmas.rst,
doc/gnat_rm/implementation_defined_aspects.rst,
doc/gnat_ugn/building_executable_programs_with_gnat.rst,
doc/gnat_ugn/the_gnat_compilation_model.rst: Remove
AAMP-specific documentation.
* gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-06-18 Gary Dismukes <dismukes@adacore.com>
* exp_util.adb (Expand_Sliding_Conversion): Move test of
Is_Fixed_Lower_Bound_Subtype to an assertion. Exclude string
literals from sliding expansion.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Cleanup conditions
related to Ada_Version.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Address_Value): Simplify.
2021-06-18 Bob Duff <duff@adacore.com>
* sem_attr.adb (Check_Array_Or_Scalar_Type): Use Expr_Value
instead of Intval, because the latter only exists in literals.
Remove Set_Etype on E1; setting the type is done elsewhere.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Examine types of
both formal parameters; refactor a complex detection of
by-reference types.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* gnatcmd.adb: Fix handling of check and test commands.
2021-06-18 Gary Dismukes <dismukes@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Add
documentation for the array fixed-lower-bound feature.
* gnat_rm.texi: Regenerate.
2021-06-18 Bob Duff <duff@adacore.com>
* debug.adb: Document switch.
* exp_aggr.adb: If -gnatd_g was given, then do not bump the
limit to 500_000.
2021-06-18 Bob Duff <duff@adacore.com>
* sem_util.ads, sem_util.adb (Has_Access_Values): Remove
Include_Internal parameter that was added in previous change.
* sem_warn.adb (Warnings_Off_E1): Back out E_Out_Parameter ==>
Formal_Kind change made previously. Check Is_Private_Type to
avoid warnings on private types. Misc cleanup.
* sem_attr.adb (Attribute_Has_Access_Values): Remove
Include_Internal parameter.
2021-06-18 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove dead branch
for overlapping actuals in prefix notation.
2021-06-18 Eric Botcazou <ebotcazou@adacore.com>
* sem_prag.adb (Process_Import_Or_Interface): Do not
artificially record a possible modification for a constant.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Code cleanups.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* exp_aggr.adb, exp_dist.adb, exp_unst.adb, sa_messages.ads,
sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_eval.adb,
sem_util.adb, sem_util.ads, sinfo.ads: Update comments.
2021-06-18 Ghjuvan Lacambre <lacambre@adacore.com>
* back_end.adb (Scan_Back_End_Switches): Set Opt.JSON_Output to
True if -fdiagnostics-format=json option is found.
* back_end.ads (Scan_Compiler_Arguments): Mention
Opt.JSON_Output.
* errout.adb (Output_JSON_Message): New procedure.
(Output_Messages): If Opt.JSON_Output is True, print messages
with new Output_JSON_Message procedure.
* opt.ads: Declare JSON_Output variable.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Mention new -fdiagnostics-format option.
* gnat_ugn.texi: Regenerate.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* sem_ch6.adb (Null_Exclusions_Match): Relax null exclusion
mismatch check when Relaxed_RM_Semantics is set.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* fe.h, opt.adb, opt.ads, par-prag.adb, sem_prag.adb,
switch-c.adb (Extensions_Allowed): Replace by a function.
(Ada_Version_Type): Add new value Ada_With_Extensions, to
replace setting of Extensions_Allowed. Update setting of
Extensions_Allowed.
2021-06-18 Arnaud Charlet <charlet@adacore.com>
* bindgen.adb (Gen_Output_File_Ada): Generate a new constant
GNAT_Version_Address.
* libgnat/g-comver.adb (GNAT_Version_Address): New;
(GNAT_Version): Use GNAT_Version_Address to disable LTO warning.
2021-06-18 Javier Miranda <miranda@adacore.com>
* einfo.ads (Is_Ada_2022_Only): Adding documentation.
* gen_il-fields.ads (Is_Ada_2022_Only): New flag.
* gen_il-gen-gen_entities.adb (Is_Ada_2022_Only): New flag.
* itypes.adb (Create_Null_Excluding_Itype): Inherit
Is_Ada_2022_Only.
* sem_ch3.adb (Check_Abstract_Overriding): Skip reporting error
on Ada 2022 only subprograms that require overriding if we are
not in Ada 2022 mode.
(Derive_Subprogram): Inherit Is_Ada_2022_Only.
* sem_ch6.adb (Check_Overriding_Indicator): Inherit
Is_Ada_2022_Only.
(New_Overloaded_Entity): Inherit Is_Ada_2022_Only.
* sem_ch7.adb (Declare_Inherited_Private_Subprograms): Inherit
Is_Ada_2022_Only.
(Preserve_Full_Attributes): Inherit Is_Ada_2022_Only.
* sem_disp.adb (Find_Hidden_Overridden_Primitive): Inherit
Is_Ada_2022_Only.
(Override_Dispatching_Operation): Inherit Is_Ada_2022_Only.
* sem_prag.adb (Analyze_Pragma): Allow form with argument for
Ada 2022.
* sem_type.adb: (Disambiguate): Deal with Is_Ada_2022_Only
* lib-xref.adb (Generate_Reference): Error on static and
dispatching calls to Ada 2022 subprograms that require
overriding if we are not in Ada 2022 mode; warn on other
references to Ada 2022 entities when not in Ada 2022 mode.
* sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Inherit
Ada_2020_Only.
* libgnat/a-cdlili.ads (Empty): Adding pragma Ada_2022.
* libgnat/a-cidlli.ads (Empty): Adding pragma Ada_2022.
* libgnat/a-ciorma.ads (Empty): Adding pragma Ada_2022.
* libgnat/a-cobove.ads (Empty): Adding pragma Ada_2022.
* libgnat/a-coorma.ads (Empty): Adding pragma Ada_2022.
(New_Vector): Adding pragma Ada_2022.
(Insert_Vector): Adding pragma Ada_2022.
(Prepend_Vector): Adding pragma Ada_2022.
(Append_Vector): Adding pragma Ada_2022.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* sem_ch3.adb (Check_Ops_From_Incomplete_Type): Protect against
no Primitive_Operations.
2021-06-17 Vadim Godunko <godunko@adacore.com>
* libgnat/a-strunb__shared.ads (Allocate): Additional parameter
to provide additional amount of space to be allocated.
* libgnat/a-strunb__shared.adb (Aligned_Max_Length): Limit
length to Natural'Last when requested length is larger than it.
(Allocate): Merge two slightly different implementations into
one.
2021-06-17 Gary Dismukes <dismukes@adacore.com>
* checks.adb (Discrete_Range_Cond): For an index subtype that
has a fixed lower bound, require that the range's lower bound
match that of the subtype.
(Selected_Range_Checks): Warn about the case where a static
lower bound does not equal an index subtype's fixed lower bound.
* einfo.ads (Is_Fixed_Lower_Bound_Array_Subtype,
Is_Fixed_Lower_Bound_Index_Subtype): Document new entity flag.
* exp_ch4.adb (Expand_N_Type_Conversion): If the operand is of
an unconstrained array subtype with fixed lower bound, then
Expand_Sliding_Conversion is applied to the operand.
* exp_ch6.adb (Expand_Simple_Function_Return): If the result
subtype is an unconstrained array subtype with fixed lower
bound, then Expand_Sliding_Conversion is applied to the return
object.
* exp_util.ads (Expand_Sliding_Conversion): New procedure for
applying a sliding subtype conversion to an array object of a
fixed-lower-bound subtype when needed.
* exp_util.adb: Add with_clause for Freeze.
(Expand_Sliding_Conversion): New procedure for applying a
sliding subtype conversion to an array object of a
fixed-lower-bound subtype when needed. It traverses the indexes
of the unconstrained array type/subtype to create a target
constrained subtype and rewrites the array object to be a
conversion to that subtype, when there's at least one index
whose lower bound does not statically match the fixed-lower
bound of the target subtype.
* gen_il-fields.ads (type Opt_Field_Enum): Add literals
Is_Fixed_Lower_Bound_Array_Subtype and
Is_Fixed_Lower_Bound_Index_Subtype for new flags on type
entities.
* gen_il-gen-gen_entities.adb: Add calls to
Create_Semantic_Field for the new fixed-lower-bound flags on
type entities.
* par-ch3.adb (P_Array_Type_Definition): Add handling for
parsing of fixed-lower-bound index ranges in unconstrained array
types. Report an error if such an index is encountered and GNAT
language extensions are not enabled.
(P_Index_Subtype_Def_With_Fixed_Lower_Bound): Support procedure
for parsing unconstrained index ranges.
(P_Index_Or_Discriminant_Constraint): Add handling for parsing
of index constraints that specify ranges with fixed lower
bounds. Report an error if such an index is encountered and GNAT
language extensions are not enabled.
* sem_ch3.adb (Analyze_Object_Declaration): If the object's
nominal subtype is an array subtype with fixed lower bound, then
Expand_Sliding_Conversion is applied to the object.
(Array_Type_Declaration): Mark the array type and the subtypes
of any indexes that specify a fixed lower bound as being
fixed-lower-bound subtypes, and set the High_bound of the range
of such an index to the upper bound of the named subtype.
(Constrain_Array): For an array subtype with one or more index
ranges specifying a fixed lower bound, set Is_Constrained to
False and set the array subtype's
Is_Fixed_Lower_Bound_Array_Subtype flag to True.
(Constrain_Index): Mark the subtypes of an index that specifies
a fixed lower bound as being a fixed-lower-bound index subtype,
and set the High_bound of the range of such an index to the
upper bound of the base type of the array type's corresponding
index.
* sem_res.adb (Resolve_Actuals): If a formal is of an
unconstrained array subtype with fixed lower bound, then
Expand_Sliding_Conversion is applied to the actual.
* sem_util.adb (Build_Actual_Subtype): If the actual subtype
corresponds to an unconstrained array subtype having any indexes
with fixed lower bounds, then set the lower bounds of any such
indexes of the actual subtype to the appropriate fixed lower
bound of the formal subtype (rather than taking it from the
formal itself).
* sprint.adb (Sprint_Node_Actual, case N_Range): If a range's
Etype has a fixed lower bound, then print "<>" rather than the
High_Bound of the range.
2021-06-17 Bob Duff <duff@adacore.com>
* sem_util.adb, sem_util.ads (Has_Access_Values): New formal
Include_Internal to indicate whether internal types should be
included.
* sem_warn.adb (Check_References): Change E_Out_Parameter to
Formal_Kind, to match the comment about Spec_Entity. Pass
Include_Internal => False to Has_Access_Values, so that we warn
on types with access values that happen to be in internal types,
such as Unbounded_String.
* sem_attr.adb (Attribute_Has_Access_Values): Pass
Include_Internal => True to Has_Access_Values, to preserve
existing behavior.
* libgnat/g-rewdat.adb (Do_Output): Change B from 'in out' to
'in', to avoid warning enabled by the change to sem_warn.adb.
* libgnat/s-objrea.adb (Check_Read_Offset): Change S from 'in
out' to 'in', to avoid warning enabled by the change to
sem_warn.adb.
2021-06-17 Steve Baird <baird@adacore.com>
* exp_ch5.adb
(Expand_N_Case_Statement.Expand_General_Case_Statement): New
subprogram.
(Expand_N_Case_Statement): If extensions are allowed and the
case selector is not of a discrete type, then call
Expand_General_Case_Statement to generate expansion instead of
flagging the non-discrete selector as an error.
* sem_case.ads (Is_Case_Choice_Pattern): New Boolean-valued
function for testing whether a given expression occurs as part
of a case choice pattern.
* sem_case.adb (Composite_Case_Ops): New package providing
support routines for the new form of case statements. This
includes a nested package, Composite_Case_Ops.Value_Sets, which
encapsulates the "representative values" implementation of
composite value sets.
(Check_Choices.Check_Case_Pattern_Choices): New procedure for
semantic checking of non-discrete case choices. This includes
the checks pertaining to coverage and overlapping.
(Check_Choices.Check_Composite_Case_Selector): New procedure for
semantic checking of non-discrete case selectors.
(Check_Choices): If extensions are allowed then a non-discrete
selector type no longer implies that an error must have been
flagged earlier. Instead of simply returning, call
Check_Composite_Case_Selector and Check_Case_Pattern_Choices.
(Is_Case_Choice_Pattern): Body of new function declared in
sem_case.ads .
* sem_ch5.adb (Analyze_Case_Statement): If extensions are
allowed, then we can't use RM 5.4's "The selecting_expression is
expected to be of any discrete type" name resolution rule.
Handle the case where the type of the selecting expression is
not discrete, as well as the new ambiguous-name-resolution error
cases made possible by this change.
* sem_res.adb (Resolve_Entity_Name): It is ok to treat the name
of a type or subtype as an expression if it is part of a case
choice pattern, as in "(Field1 => Positive, Field2 => <>)".
* exp_aggr.adb (Expand_Record_Aggregate): Do not expand case
choice aggregates.
* gen_il-fields.ads: Define two new node attributes,
Binding_Chars and Multidefined_Bindings.
* gen_il-gen-gen_nodes.adb: The new Multidefined_Bindings
attribute is Boolean-valued and may be set on
N_Case_Statement_Alternative nodes. The new Binding_Chars
attribute is Name_Id-valued and may be set on
N_Component_Association nodes.
* par-ch4.adb (P_Record_Or_Array_Component_Association): When
parsing a component association, check for both new syntax forms
used to specify a bound value in a case-choice aggregate. In
the case of a box value, an identifier may occur within the box,
as in "Foo => <Abc>" instead of "Foo => <>". In the more general
case, an expression (or a box) may be followed by "is
<identifier>", as in
"Foo => Bar is Abc" instead of just "Foo => Bar".
* sem_aggr.adb (Resolve_Record_Aggregate): Do not transform box
component values in a case-choice aggregate.
* sinfo.ads: Provide comments for the new attributes added in
gen_il-fields.ads.
* doc/gnat_rm/implementation_defined_pragmas.rst: Describe this
new feature in documentation for pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* exp_ch4.adb (Expand_N_Expression_With_Actions.Process_Action):
Do not abandon processing on a nested N_Expression_With_Actions
or N_Loop_Statement, otherwise we may miss some transient
declarations.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* exp_util.adb (Find_Hook_Context): Do not stop on an aggregate
node.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Valid_Renaming): Check not only indexed
components, but slices too.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Analyze_Private_Extension_Declaration): Check
No_Wide_Characters restriction after rejecting illegal parent
types.
(Derived_Type_Declaration): Likewise.
(Find_Type_Of_Subtype_Indic): Remove check for
No_Wide_Characters restriction, which was done too early.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Valid_Renaming): Body moved from its nested
routine.
2021-06-17 Gary Dismukes <dismukes@adacore.com>
* sem_ch12.adb (Instantiate_Type): If the actual type for an
incomplete formal type is also incomplete, but has a Full_View,
use the Full_View of the actual type rather than the incomplete
view.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(-gnatw.I): Remove double period at the end of sentence.
* gnat_ugn.texi: Regenerate.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Denotes_Same_Object): Call Get_Index_Bounds with
the range of a slice object, not its type.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Fix style;
refactor repeated calls to Nkind; remove early RETURN.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Ignore formal of
generic types, but keep examining other parameters.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove dead code.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove repeated
code.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Overlap_Check): Replace Set_Casing with
Adjust_Name_Case and adapt surrounding code as needed.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* libgnat/s-putaim.ads, libgnat/s-putaim.adb: Move...
* libgnarl/s-putaim.ads, libgnarl/s-putaim.adb: ... here.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* uintp.ads, uintp.adb (UI_To_Unsigned_64): New.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Get_Overflow_Mode): Reword error message.
* switch-c.adb (Get_Overflow_Mode): Likewise.
2021-06-17 Richard Kenner <kenner@adacore.com>
* exp_util.adb (Expand_Static_Predicates_In_Choices): Handle
Others_Discrete_Choices in N_Others_Choice.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* atree.adb: Remove redundant comment with spec.
* sem_warn.adb: Fix typo in comment.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* atree.adb: Do not suppress checks.
2021-06-17 Justin Squirek <squirek@adacore.com>
* exp_ch3.adb (Check_Missing_Others): Add comment.
(Build_Initialization_Call): Remove inaccurate accessibility
comment.
* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Remove
test for Ada2012.
(Analyze_Package_Instantiation): Remove speculative comment.
(Inline_Instance_Body): Add comments for loops.
(Build_Subprogram_Renaming): Remove comment about fix being
partial and "ugly."
(Instantiate_Subprogram_Body): Remove comment referencing DEC
related internal issue.
(Subtypes_Match): Add comment and simplify anonymous access
test.
(Is_Global): Add test for when E is an expanded name, and
calculate the scope accordingly.
* sem_ch6.adb (Analyze_Function_Return): Update comment
regarding accessibility, and add check for
Warn_On_Ada_2012_Compatibility.
(Mask_Type_Refs): Add comments.
(Analyze_Subprogram_Declaration): Remove mysterious suppression
of elaboration checks.
* sem_ch7.adb (Preserve_Full_Attributes): Preserve Is_Atomic
value.
* sem_ch8.adb (Most_Descendant_Use_Clause): Remove comment.
(Note_Redundant_Use): Fix calls to Find_First_Use to be
Find_Most_Prev.
(Get_Object_Name): Modify error message to be more descriptive.
(Known_But_Visible): Remove mysterious special case for
GNAT_Mode.
(Find_First_Use): Removed.
(Find_Most_Prev): Renamed from Find_First_Use.
* sem_prag.adb (Check_Static_Constraint): Add comments to
routine.
2021-06-17 Bob Duff <duff@adacore.com>
* treepr.adb (Print_Node): Display the Entity or Associated_Node
fields if appropriate.
* sinfo-utils.ads (F_Associated_Node, F_Entity): Remove. These
are no longer needed.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Apply_Parameter_Aliasing_Checks): Replace calls to
Is_Object_Reference with calls to Is_Name_Reference; remove
asymmetric condition that only detected an aggregate as the
first actual (aggregate objects were just a special case of an
object reference that was not a name).
2021-06-17 Bob Duff <duff@adacore.com>
* gen_il-gen.adb, gen_il-internals.ads: Generate field
enumeration literals with "F_" prefix. Update all generated
references accordingly.
* atree.adb, einfo-utils.adb, sem_ch3.adb, sem_ch5.adb,
sem_ch6.adb, sem_ch8.adb, sinfo-cn.adb, sinfo-utils.adb,
sinfo-utils.ads, treepr.adb: Add "F_" prefix to all uses of the
field enumeration literals.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* libgnat/i-c.ads, libgnat/i-cexten.ads,
libgnat/i-cexten__128.ads: bool renamed C_bool.
2021-06-17 Piotr Trojanek <trojanek@adacore.com>
* sem_ch4.adb (Analyze_Allocator): Reject allocators in
restricted contexts.
2021-06-17 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Make-lang.in: Use libgnat.so if libgnat.a cannot
be found.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Volatile_Function): Follow the exact wording
of SPARK (regarding volatile functions) and Ada (regarding
protected functions).
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_OK_Volatile_Context): All references to
volatile objects are legal in preanalysis.
(Within_Volatile_Function): Previously it was wrongly called on
Empty entities; now it is only called on E_Return_Statement,
which allow the body to be greatly simplified.
2021-06-16 Yannick Moy <moy@adacore.com>
* sem_res.adb (Set_Slice_Subtype): Revert special-case
introduced previously, which is not needed as Itypes created for
slices are precisely always used.
2021-06-16 Eric Botcazou <ebotcazou@adacore.com>
* urealp.adb (Scale): Change first paramter to Uint and adjust.
(Equivalent_Decimal_Exponent): Pass U.Den directly to Scale.
* libgnat/s-exponr.adb (Negative): Rename to...
(Safe_Negative): ...this and change its lower bound.
(Exponr): Adjust to above renaming and deal with Integer'First.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_res.adb (Flag_Effectively_Volatile_Objects): Detect also
allocators within restricted contexts and not just entity names.
(Resolve_Actuals): Remove duplicated code for detecting
restricted contexts; it is now exclusively done in
Is_OK_Volatile_Context.
(Resolve_Entity_Name): Adapt to new parameter of
Is_OK_Volatile_Context.
* sem_util.ads, sem_util.adb (Is_OK_Volatile_Context): Adapt to
handle contexts both inside and outside of subprogram call
actual parameters.
(Within_Subprogram_Call): Remove; now handled by
Is_OK_Volatile_Context itself and its parameter.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sinput.adb (Sloc_Range): Refactor several repeated calls to
Sloc and two comparisons with No_Location.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Apply_Scalar_Range_Check): Fix handling of check depending
on the parameter passing mechanism. Grammar adjustment ("has"
=> "have").
(Parameter_Passing_Mechanism_Specified): Add a hyphen in a comment.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Build_Slice_Assignment): Remove unused
initialization.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* restrict.adb, sem_attr.adb, types.ads: Fix typos in
"occuring"; refill comment as necessary.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_util.ads (Is_Actual_Parameter): Update comment.
* sem_util.adb (Is_Actual_Parameter): Also detect entry parameters.
2021-06-16 Arnaud Charlet <charlet@adacore.com>
* rtsfind.ads, libgnarl/s-taskin.ads, exp_ch3.adb, exp_ch4.adb,
exp_ch6.adb, exp_ch9.adb, sem_ch6.adb: Move master related
entities to the expander directly.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_res.adb (Is_Assignment_Or_Object_Expression): Whitespace
cleanup.
(Is_Attribute_Expression): Prevent AST climbing from going to
the root of the compilation unit.
2021-06-16 Steve Baird <baird@adacore.com>
* doc/gnat_rm/implementation_advice.rst: Add a section for RM
A.18 .
* gnat_rm.texi: Regenerate.
2021-06-16 Justin Squirek <squirek@adacore.com>
* sem_ch13.adb (Analyze_Enumeration_Representation_Clause): Add
check for the mixing of entries.
2021-06-16 Justin Squirek <squirek@adacore.com>
* sem_ch13.adb (Make_Aitem_Pragma): Check for static expressions
in Priority aspect arguments for restriction Static_Priorities.
2021-06-16 Justin Squirek <squirek@adacore.com>
* sem_util.adb (Accessibility_Level): Take into account
renamings of loop parameters.
2021-06-16 Matthieu Eyraud <eyraud@adacore.com>
* par_sco.adb (Set_Statement_Entry): Change sloc for dominance
marker.
(Traverse_One): Fix typo.
(Output_Header): Fix comment.
2021-06-16 Richard Kenner <kenner@adacore.com>
* exp_unst.adb (Register_Subprogram): Don't look for aliases for
subprograms that are generic. Reorder tests for efficiency.
2021-06-16 Eric Botcazou <ebotcazou@adacore.com>
* sem_util.adb (Incomplete_Or_Partial_View): Retrieve the scope of
the parameter and use it to find its incomplete view, if any.
2021-06-16 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Check_No_Parts_Violations): Return earlier if the
type is elementary or does not come from source.
2021-06-16 Bob Duff <duff@adacore.com>
* ghost.adb: Add another special case where full analysis is
needed. This bug is due to quirks in the way
Mark_And_Set_Ghost_Assignment works (it happens very early,
before name resolution is done).
2021-06-16 Eric Botcazou <ebotcazou@adacore.com>
* sem_util.adb (Current_Entity_In_Scope): Reimplement.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_ch8.adb (End_Scope): Remove extra parens.
2021-06-16 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Build_Class_Wide_Check): Ensure that evaluation
of actuals is side effects free (since the check duplicates
actuals).
2021-06-16 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Raise_Expression): Apply Ada_2020 rules
concerning the need for parentheses around Raise_Expressions in
various contexts.
2021-06-16 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Validate_Unchecked_Conversion): Move detection
of generic types before switching to their private views; fix
style in using AND THEN.
2021-06-16 Arnaud Charlet <charlet@adacore.com>
* sem_ch3.adb (Analyze_Component_Declaration): Do not special
case raise expressions.
2021-06-16 Sergey Rybin <rybin@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Instead of referring to the formatting of the Ada examples in
Ada RM add use the list of checks that are actually performed.
* gnat_ugn.texi: Regenerate.
2021-06-16 Eric Botcazou <ebotcazou@adacore.com>
* initialize.c: Do not include vxWorks.h and fcntl.h from here.
(__gnat_initialize) [__MINGW32__]: Remove #ifdef and attribute
(__gnat_initialize) [init_float]: Delete.
(__gnat_initialize) [VxWorks]: Likewise.
(__gnat_initialize) [PA-RISC HP-UX 10]: Likewise.
* runtime.h: Add comment about vxWorks.h include.
2021-06-16 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-except.ads (ZCX_By_Default): Delete.
(Require_Body): Likewise.
* libgnat/s-except.adb: Replace body with pragma No_Body.
2021-06-15 Steve Baird <baird@adacore.com>
* exp_util.adb (Kill_Dead_Code): Generalize the existing
handling of if statements to handle case statements similarly.
2021-06-15 Eric Botcazou <ebotcazou@adacore.com>
* raise.h (_gnat_builtin_longjmp): Delete.
(set_gnat_exit_status): Likewise.
2021-06-15 Piotr Trojanek <trojanek@adacore.com>
* exp_util.adb (Possible_Side_Effect_In_SPARK): Handle component
declaration just like full type and subtype declarations.
2021-06-15 Yannick Moy <moy@adacore.com>
* errout.adb (First_And_Last_Node): Also apply to arbitrary late
declarations, not only subprogram specs.
2021-06-15 Bob Duff <duff@adacore.com>
* sem_ch3.adb (Make_Class_Wide_Type): Make sure all the calls to
Reinit_Field_To_Zero are for the correct Ekinds.
2021-06-15 Bob Duff <duff@adacore.com>
* aspects.ads (No_Task_Parts): New aspect.
* snames.ads-tmpl: Add the aspect name.
* exp_ch6.adb (Might_Have_Tasks): Return False if this is a
class-wide type whose specific type has No_Task_Parts.
* freeze.adb (Check_No_Parts_Violations): This is an adaptation
of the procedure formerly known as
Check_No_Controlled_Parts_Violations, which now supports both
No_Controlled_Parts and No_Task_Parts. It takes a parameter
indicating which aspect is being checked.
(Freeze_Entity): Call Check_No_Parts_Violations for both
aspects.
* sem_ch13.adb (Analyze_Aspect_Specifications): The code for
Aspect_No_Controlled_Parts already works as is with
Aspect_No_Task_Parts.
* libgnat/a-iteint.ads: Add No_Task_Parts aspect to the two
iterator iterfaces.
* doc/gnat_rm/implementation_defined_aspects.rst: Add
documentation for the No_Task_Parts aspect.
* gnat_rm.texi: Regenerate.
2021-06-15 Arnaud Charlet <charlet@adacore.com>
* exp_unst.adb (Unnest_Subprogram.Build_Table.Visit_Node): Fix
handling of scopes for subprogram calls.
2021-06-15 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb: Fix typos in comments related to access types.
* sem_util.adb (Is_Access_Variable): Stronger condition.
2021-06-15 Arnaud Charlet <charlet@adacore.com>
* Make-generated.in: Add rule to copy runtime files needed
during stage1.
* raise.c: Remove obsolete symbols used during bootstrap.
* gcc-interface/Make-lang.in: Do not use libgnat sources during
stage1.
(GNAT_ADA_OBJS, GNATBIND_OBJS): Split in two parts, the common
part and the part only used outside of stage1.
(ADA_GENERATED_FILES): Add runtime files needed during bootstrap
when recent APIs are needed.
(ada/b_gnatb.adb): Remove prerequisite.
* gcc-interface/system.ads: Remove obsolete entries.
2021-06-15 Eric Botcazou <ebotcazou@adacore.com>
* raise-gcc.c (__gnat_personality_seh0): Use PERSONALITY_FUNCTION.
2021-06-15 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Is_Confirming): Separate the handling of
Implicit_Dereference, for which no pragma is generated but which
is already checked for legality in Sem_Ch13, including renamed
discriminants in a derived type.
(Is_Confirming, Same_Name): For expanded names, only check
matching of selector, because prefix may correspond to original
and derived types with different names and/or scopes. Semantic
checks on aspect expression have already verified its legality.
Add comments regarding possible gaps in RM description of the
feature.
2021-06-15 Gary Dismukes <dismukes@adacore.com>
* freeze.adb (Freeze_Subprogram): Don't propagate conventions
Intrinsic or Entry to anonymous access-to-subprogram types
associated with subprograms having those conventions. Update
related comment.
* sem_attr.adb (Resolve_Attribute, Attribute_*Access): Remove
special-case warning code for cases where a called subprogram
has convention Intrinsic as well as its formal's type (the
expected type for the Access attribute), since this case can no
longer occur.
2021-06-15 Piotr Trojanek <trojanek@adacore.com>
* exp_imgv.adb (Expand_User_Defined_Enumeration_Image): Fix
typos.
2021-06-15 Bob Duff <duff@adacore.com>
* einfo-utils.adb (Known_Component_Size,
Known_Static_Component_Size, Unknown_Component_Size): Use
Implementation_Base_Type instead of Base_Type.
2021-06-15 Bob Duff <duff@adacore.com>
* gen_il-gen-gen_entities.adb (E_Loop_Parameter): Add
Interface_Name field.
2021-06-15 Bob Duff <duff@adacore.com>
* sem_cat.adb (Check_Non_Static_Default_Expr): Allow nonstatic
expression in predefined unit with pragma Preelaborate.
2021-06-15 Yannick Moy <moy@adacore.com>
* doc/gnat_rm/intrinsic_subprograms.rst: More details on shift
operations for signed types. Also add the missing Import and
Convention on the example.
* gnat_rm.texi: Regenerate.
2021-06-15 Eric Botcazou <ebotcazou@adacore.com>
* raise-gcc.c: Include <cstdarg> instead of <stdarg.h> in C++.
Include <stdbool.h> and unconditionally <stdlib.h> in C.
2021-06-15 Piotr Trojanek <trojanek@adacore.com>
* sem_util.ads (Find_Overlaid_Entity): Simplify comment for
spec.
* sem_util.adb (Find_Overlaid_Entity): Remove defensive code
from body.
2021-06-15 Eric Botcazou <ebotcazou@adacore.com>
* argv.c: Add include of <stdlib.h> for the runtime.
(gnat_argv): Change type to char ** and initialize to NULL.
(gnat_envp): Likewise.
* argv-lynxos178-raven-cert.c: Add include of <stdlib.h>.
(gnat_argv): Change type to char ** and initialize to NULL.
(gnat_envp): Likewise.
2021-06-15 Bob Duff <duff@adacore.com>
* gen_il-gen.adb (Setter_Needs_Parent): Add missing
Then_Actions. Fix self-contradictory comment.
* exp_util.adb (Insert_Actions): Minor comment improvments.
2021-06-15 Arnaud Charlet <charlet@adacore.com>
* sem_eval.adb (Eval_Logical_Op, Test_Expression_Is_Foldable):
Add support for folding more "and"/"or" expressions.
* exp_util.adb (Side_Effect_Free): Fix handling of membership
tests.
2021-06-15 Piotr Trojanek <trojanek@adacore.com>
* sem_res.adb (Resolve_Actual): Replace repeated calls to
"Etype (F)" with references to "F_Typ", which keeps the results
of exactly that call.
2021-06-15 Bob Duff <duff@adacore.com>
* gen_il-gen.adb (To_Bit_Offset): Use 'Base to avoid overflow in
computations in Last_Bit when Offset = 'Last.
(Choose_Offset): Give a better error message when we run out of
fields. In particular, point out that
Gen_IL.Internals.Bit_Offset'Last needs to be increased.
2021-06-15 Bob Duff <duff@adacore.com>
* atree.ads, einfo-utils.ads, einfo-utils.adb, fe.h, gen_il.adb,
gen_il.ads, gen_il-gen-gen_entities.adb,
gen_il-gen-gen_nodes.adb, sem_ch12.adb, sem_ch3.adb,
sem_util.adb, sinfo-utils.ads, treepr.adb, types.ads: Clean up
??? comments and other comments.
* atree.adb: Clean up ??? comments and other comments.
(Validate_Node): Fix bug: "Off_0 (N) < Off_L (N)"
should be "Off_0 (N) <= Off_L (N)".
* gen_il-gen.adb, gen_il-gen.ads: Clean up ???
comments and other comments. Add support for getter-specific
and setter-specific preconditions. Detect the error of putting
a field in the wrong subrange. Misc cleanup.
(Node_Field vs. Entity_Field): Clean up Nmake. Improve
comments.
* gen_il-utils.ads: Misc cleanup. Move...
* gen_il-internals.ads: ... here.
* gen_il-utils.adb: Misc cleanup. Move...
* gen_il-internals.adb: ... here.
* gen_il-fields.ads: Move Was_Default_Init_Box_Association,
which was in the wrong subrange. Add comments. Misc cleanup.
* gen_il-types.ads: Add Named_Access_Kind.
* sinfo-cn.adb: Clean up ??? comments and other comments.
Remove redundant assertions.
* einfo.ads, sinfo.ads: Clean up ??? comments and other
comments. Remove all the comments indicating field offsets.
These are obsolete now that Gen_IL computes the offsets
automatically.
2021-06-15 Arnaud Charlet <charlet@adacore.com>
* einfo.ads, errout.adb, errout.ads, exp_aggr.adb, exp_ch5.adb,
exp_ch6.adb, exp_ch8.adb, exp_ch9.adb, exp_imgv.adb,
exp_put_image.adb, fe.h, impunit.adb, impunit.ads,
libgnat/a-cobove.ads, libgnat/a-convec.ads, opt.ads,
par-ch12.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb,
par-ch6.adb, par-prag.adb, par-util.adb, scans.ads, scng.adb,
sem_aggr.adb, sem_attr.adb, sem_ch10.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
sem_ch8.adb, sem_elab.adb, sem_eval.adb, sem_prag.adb,
sem_res.adb, sem_type.adb, sem_util.adb, sem_util.ads,
sinfo.ads, snames.ads-tmpl, sprint.adb, switch-c.adb, usage.adb,
doc/gnat_ugn/building_executable_programs_with_gnat.rst,
doc/gnat_rm/implementation_defined_aspects.rst,
gcc-interface/trans.c: Update all references to Ada 2020 to Ada
2022. Rename pragma Ada_2020 to Ada_2022. Update documentation
accordingly.
* gnat_ugn.texi, gnat_rm.texi: Regenerate.
2021-06-15 Steve Baird <baird@adacore.com>
* sem_util.adb (Gather_Components): Factor the test that was