Age | Commit message (Collapse) | Author | Files | Lines |
|
gcc/ada/ChangeLog:
* gcc-interface/gigi.h (create_var_decl): Add LINKONCE_FLAG boolean
parameter.
(create_subprog_decl): Likewise.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Adjust calls to
create_var_decl and create_subprog_decl.
(elaborate_expression_1): Likewise.
* gcc-interface/trans.cc (gigi): Likewise.
(build_raise_check): Likewise.
(Subprogram_Body_to_gnu): Likewise.
(create_temporary): Likewise.
(Exception_Handler_to_gnu): Likewise.
(Compilation_Unit_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
(use_alias_for_thunk_p): Return false for a one-only target.
* gcc-interface/utils.cc (maybe_pad_type): Adjust call to
create_var_decl.
(create_var_decl): Add LINKONCE_FLAG boolean parameter.
(create_subprog_decl): Likewise.
|
|
This change introduces the support for the new GNAT specific
Extended_Access aspect for access to unconstrained array type :
type Ext_Access is access all Some_Array_Type with Extended_Access;
This new kind of access type does not use the existing "fat" layout with
a record of two pointers: one to the actual data, one to a record with the
bounds of the array. Instead, it removes the second indirection and extends
the record to contain the pointer to the actual data followed by the bounds.
This mainly allows the following features:
- have access to slice of array
- easier interface when allocation is done in a foreign language
gcc/ada/ChangeLog:
* gcc-interface/ada-tree.h (TYPE_EXTENDED_POINTER_P): New.
(TYPE_IS_EXTENDED_POINTER_P): New.
(TYPE_EXTENDED_UNCONSTRAINED_ARRAY): New.
(SET_TYPE_EXTENDED_UNCONSTRAINED_ARRAY): New.
(TYPE_DUMMY_EXT_POINTER_TO): New.
(SET_TYPE_DUMMY_EXT_POINTER_TO): New.
* gcc-interface/decl.cc (get_extended_unconstrained_array): New.
(gnat_to_gnu_entity): Handle extended access type.
(get_unpadded_extended_type): New.
(gnat_to_gnu_component_type): Handle extended access type.
(build_template_type): New.
(gnat_to_gnu_field): Handle extended access type.
(validate_size): Likewise.
(set_rm_size): Likewise.
(copy_and_substitute_in_layout): Likewise.
(rm_size): Likewise.
* gcc-interface/gigi.h (get_unpadded_extended_type): New.
(build_template_type): New.
(build_dummy_unc_pointer_types_ext): New.
(finish_extended_pointer_type): New.
(build_unc_object_type_from_ptr): Rename first parameter.
* gcc-interface/misc.cc (gnat_print_type): Handle extended access type.
* gcc-interface/trans.cc (Identifier_to_gnu): Likewise.
(Attribute_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
* gcc-interface/utils.cc (convert_to_fat_pointer): Assert if converting an
extended pointer.
(build_dummy_unc_pointer_types_ext): New.
(finish_extended_pointer_type): New.
(finish_record_type): Handle extended access type.
(build_unc_object_type_from_ptr): Likewise.
(convert_to_extended_pointer): New.
(convert): Handle extended access type.
(gnat_pushdecl): Likewise.
(maybe_pad_type): Likewise.
* gcc-interface/utils2.cc (build_unary_op): Likewise.
(build_binary_op): Likewise.
(build_allocator): Likewise.
(gnat_save_expr): Likewise.
(gnat_protect_expr): Likewise.
(gnat_stabilize_reference_1): Likewise.
|
|
This adds a guard for the case of a selected component whose prefix is an
illegal structural generic instance.
gcc/ada/ChangeLog:
* sem_ch4.adb (Analyze_Selected_Component): Bail out if the prefix
has Void_Type.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* sem_ch4.adb (Analyze_User_Defined_Binary_Op): Remove declare block.
|
|
It contains the changes to the parser required for the new syntax, as well
as the mechanism to instantiate generics implicitly. The implementation is
strictly structural, in the sense that if the implicit instantiation cannot
be made structural for semantic dependence reasons, then it is rejected.
gcc/ada/ChangeLog:
* doc/gnat_rm/gnat_language_extensions.rst (Structural Generic
Instantiation): New entry
* einfo.ads (Is_Link_Once): New flag defined in entities.
* sinfo.ads (Is_Structural): New flag defined in instantiations.
* gen_il-fields.ads (Opt_Field_Enum): Add Is_Link_Once and
Is_Structural.
* gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Link_Once
semantic flag.
* gen_il-gen-gen_nodes.adb (N_Generic_Instantiation): Move up
Parent_Spec field and add Is_Structural semantic flag.
* frontend.adb: Add with clause for Sem_Ch12.
(Frontend): After analysis is complete and bodies are instantiated,
call Sem_Ch12.Mark_Link_Once on the declarations of the main unit.
* par.adb (P_Qualified_Simple_Name): Delete.
(P_Qualified_Simple_Name_Resync): Likewise
(P_Exception_Name): New function declaration.
(P_Label_Name): Likewise.
(P_Loop_Name): Likewise.
(P_Generic_Unit_Name): Likewise.
(P_Library_Unit_Name): Likewise.
(P_Package_Name): Likewise.
(P_Parent_Unit_Name): Likewise.
(P_Subtype_Name): Likewise.
(P_Subtype_Name_Resync): Likewise.
* par-ch3.adb (P_Subtype_Mark_Resync): Replace call to
P_Qualified_Simple_Name_Resync by P_Subtype_Name_Resync.
(P_Identifier_Declarations): Replace call to
P_Qualified_Simple_Name_Resync by P_Exception_Name.
(P_Derived_Type_Def_Or_Private_Ext_Decl): Replace call to
P_Qualified_Simple_Name by P_Subtype_Name.
(P_Interface_Type_Definition): Replace calls to
P_Qualified_Simple_Name by P_Subtype_Name.
* par-ch4.adb (P_Reduction_Attribute_Reference): Move around and
change name of parameter.
(P_Name): Document new grammar rule and make a couple of tweaks.
(P_Exception_Name): New function.
(P_Label_Name): Likewise.
(P_Loop_Name): Likewise.
(P_Generic_Unit_Name): Likewise.
(P_Library_Unit_Name): Likewise.
(P_Package_Name): Likewise.
(P_Parent_Unit_Name): Likewise.
(P_Subtype_Name): Likewise.
(P_Subtype_Name_Resync): Likewise.
(P_Qualified_Simple_Name): Rename into...
(P_Simple_Name): ...this.
(P_Qualified_Simple_Name_Resync): Rename into...
(P_Simple_Name_Resync): ...this. Accept left parenthesis and
dot as name extensions.
(P_Allocator): Replace call to P_Qualified_Simple_Name_Resync
by P_Subtype_Name_Resync.
* par-ch5.adb (P_Goto_Statement): Replace call to
P_Qualified_Simple_Name by P_Label_Name.
(Parse_Loop_Flow_Statement): Replace call to
P_Qualified_Simple_Name by P_Loop_Name.
* par-ch6.adb (P_Subprogram): Replace call to
P_Qualified_Simple_Name by P_Generic_Unit_Name.
* par-ch7.adb (P_Package): Replace calls to
P_Qualified_Simple_Name by P_Package_Name and P_Generic_Unit_Name.
* par-ch8.adb (P_Use_Package_Clause): Replace calls to
P_Qualified_Simple_Name by P_Package_Name.
* par-ch9.adb (P_Task): Replace call to
P_Qualified_Simple_Name by P_Subtype_Name.
(P_Protected): Likewise.
* par-ch10.adb (P_Context_Clause): Replace call to
P_Qualified_Simple_Name by P_Library_Unit_Name.
(P_Subunit): Replace call to P_Qualified_Simple_Name by
P_Parent_Unit_Name.
* par-ch12.adb (P_Generic): Replace call to
P_Qualified_Simple_Name by P_Generic_Unit_Name.
(P_Formal_Derived_Type_Definition): Replace call to
P_Qualified_Simple_Name by P_Subtype_Name.
(P_Formal_Package_Declaration): Replace call to
P_Qualified_Simple_Name by P_Generic_Unit_Name.
* sem_ch4.adb: Add with and use clauses for Sem_Ch12.
(Analyze_Call): Accept implicit instantiations with -gnatX0.
(Analyze_Indexed_Component_Form): Likewise.
* sem_ch8.adb (Analyze_Use_Package): Add guard before inserting
a with clause automatically when there is a use clause.
(Check_In_Previous_With_Clause): Retrieve original names.
(Check_Library_Unit_Renaming): Deal with structural instances.
(End_Use_Type): Minor tweak.
* sem_ch10.adb (Analyze_With_Clause): Remove useless test and
call Defining_Entity_Of_Instance.
* sem_ch12.ads (Build_Structural_Instantiation): New function.
(Mark_Link_Once): New procedure.
* sem_ch12.adb: Add with and use clauses for Exp_Dbug.
(Analyze_Associations): Add support for structural instantiations.
(Analyze_Package_Instantiation): Likewise.
(Analyze_Subprogram_Instantiation): Likewise.
(Analyze_Structural_Associations): New procedure.
(Need_Subprogram_Instance_Body): Return True for instantiation is
in the auxiliary declarations of the main unit.
(Build_Structural_Instantiation): New function.
(Mark_Link_Once): New procedure.
* sem_util.ads (Add_Local_Declaration): New procedure.
(Defining_Entity_Of_Instance): New function.
* sem_util.adb (Add_Local_Declaration): New procedure.
(Defining_Entity_Of_Instance): New function.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
|
|
The comment this patch changes claimed that operational aspects are
"view-specific". The following excerpt from ARM 13.1 (11/5) indicates
that the set of view-specific aspects is in fact much more restricted:
If a type-related aspect is defined for the partial view of a type,
then it has the same definition for the full view of the type, except
for certain Boolean-valued operational aspects where the language
specifies that the partial view can have the value False even when
the full view has the value True.
On the other hand, a feature of operational aspects is that they can be
specified on partial views, unlike representation aspects. That's stated
by AARM 13.1 (9.c/1):
Unlike representation items, operational items can be specified on
partial views.
So this patch changes the comment to be about that instead.
gcc/ada/ChangeLog:
* aspects.ads: Fix comment.
|
|
The comment this patch removes was about representation aspects but it
was placed above Operational_Aspect. The comment in itself was not very
helpful either since operational aspects, for example, are also needed
during expansion and code generation.
gcc/ada/ChangeLog:
* aspects.ads: Remove comment.
|
|
Add the Put_Image_Extended_Access_Pointer procedure for supporting
Ext_Access'Image.
gcc/ada/ChangeLog:
* libgnat/s-putima.ads (Ext_Access_Pointer): New.
(Put_Image_Extended_Access_Pointer): New.
* libgnat/s-putima.adb (Ext_Acc_Instance): New.
(Put_Image_Extended_Access_Pointer): New.
* rtsfind.ads (RE_Id, RE_Unit_Table): Set value for
RE_Put_Image_Extended_Access_Pointer.
* exp_put_image.adb (Build_Elementary_Put_Image_Call): Handle extended
access.
|
|
gcc/ada/ChangeLog:
* fe.h (Is_Extended_Access_Type): Add C bindings.
* sem_util.ads (Is_Extended_Access_Type): Add comment that any
change to the function must take care of the C binding.
|
|
The size of an extended access is unknown at this stage, so leave Esize
empty.
gcc/ada/ChangeLog:
* layout.adb (Layout_Type): Adjust comment and code extended
accesses.
|
|
This patch removes two occurrences of the following pattern:
Analyze_Component_Declaration (N);
Mutate_Ekind (Defining_Identifier (N), E_Component);
The second statement here has absolutely no effect, so its presence can
be confusing to the reader.
gcc/ada/ChangeLog:
* sem_ch3.adb (Add_Tag): Remove superfluous statements.
|
|
When necessary, the compiler builds subprograms to implement the streaming
attributes (or the Put_Image attribute) for a type. In some cases involving
separate subunits, these compiler-generated subprograms were inserted at the
wrong point in the tree, resulting in internal compiler errors.
gcc/ada/ChangeLog:
* exp_attr.adb (Interunit_Ref_OK): Treat a subunit like a body.
(Build_And_Insert_Type_Attr_Subp): When climbing up the
tree, go from an N_Subunit node to its stub (instead of to the
subunit's N_Compilation_Unit node).
|
|
The compiler fails, either with an Assert_Failure (for a compiler with
assertions enabled) or by producing a bad value, when processing a VADS_Size
attribute (or a Size attribute when pragma Use_VADS_Size is in force),
in the case where the prefix denotes a composite type or subtype whose
object size (Esise) is not known by the front end. The bug is due to
Eval_Attribute attempting to fold a VADS-related size attribute even
when Esize is not yet known for the type.
gcc/ada/ChangeLog:
* sem_attr.adb (Eval_Attribute): In the case of a VADS-specific
size attribute, only fold to the object size when the Esize field
is known.
|
|
|
|
Before this patch, confirming Stream_Size aspect specifications on
elementary types were incorrectly rejected when the stream size was 128,
and the error messages emitted for Stream_Size aspect errors gave
incorrect possible values.
This patch fixes this. The most significant part of the fix is a new
subprogram in Exp_Strm, Get_Primitives, that makes it possible to
retrieve a precise list of supported stream sizes, but also to select
the right runtime streaming primitives for a given type. Using the
latter, this patch factorizes code that was present in both
Build_Elementary_Input_Call and Build_Elementary_Write_Call.
gcc/ada/ChangeLog:
* exp_strm.ads (Get_Primitives): New function.
* exp_strm.adb (Get_Primitives): Likewise.
(Build_Elementary_Input_Call, Build_Elementary_Write_Call): use
Get_Primitives.
(Has_Stream_Standard_Rep): Add formal parameter and rename to...
(Is_Stream_Standard_Rep): New function.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Fix error
emission.
|
|
component"
This reverts commit 91b51fc42b167eedaaded6360c490a4306bc5c55.
|
|
Recent changes to Ada have produced a new diagnostic:
s-osinte.adb:34:18: warning: unit "Interfaces.C.Extensions"...
which causes a bootstrap fail on Darwin when Ada is enabled.
Fixed thus.
PR ada/114065
gcc/ada/ChangeLog:
* libgnarl/s-osinte__darwin.adb: Add and reference clause
for Interfaces.C, remove clause for Interfaces.C.Extensions.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
|
|
|
|
gcc/ada
PR ada/114065
PR ada/121953
* Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x32-linux]: Replace
libgnarl/s-osinte__x32.adb with libgnarl/s-osinte__posix.adb.
* libgnarl/s-osinte__x32.adb: Delete.
|
|
The sufficient conditions are that the aspect be deferred and the object be
rewritten as a renaming because of the complex initialization expression.
gcc/ada/ChangeLog:
* gcc-interface/trans.cc (gnat_to_gnu)
<N_Object_Renaming_Declaration>: Deal with objects whose elaboration
is deferred.
(process_freeze_entity): Deal with renamed objects whose elaboration
is deferred.
|
|
There are cases where GNAT introduces a dependence on the secondary stack
in a build-in-place function with a result subtype that is definite, when
this dependence could be avoided. In particular this is done for record
types that requires finalization due to having a controlled component.
At one time such functions required the secondary stack in order to
properly handle cases where the function might raise an exception
(to avoid improper finalization in the caller), but that is no longer
necessary. We remove the dependence of these functions on the SS,
along with the BIPalloc formal and the generation of the big if_statement
that uses that formal.
An additional small change is to revise the condition for determining when
to generate SS mark/release within functions.
gcc/ada/ChangeLog:
* exp_ch6.ads (Make_Build_In_Place_Call_In_Allocator): Simplify comment.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Remove obsolete
comment about not being able to allocate fixed-size controlled results
on the caller side, and replace another obsolete comment with a simpler
comment. Call Build_Allocate_Deallocate_Proc when the function doesn't
need a BIPalloc formal to ensure that function results with controlled
parts allocated on the caller side will be chained for finalization.
(Make_Build_In_Place_Call_In_Object_Declaration): Call Needs_BIP_Collection
on the function's Entity_Id rather than the function call.
(Needs_BIP_Collection): If a BIP function doesn't need a BIPalloc formal
then it doesn't need a BIP collection either; return False in that case.
(Needs_BIP_Alloc_Form): Remove test of Needs_BIP_Collection.
* exp_ch7.adb (Expand_Cleanup_Actions): Move test of Uses_Sec_Stack
to be the first conjunct in setting of Needs_Sec_Stack_Mark, and put
the other tests in a disjunction subsidiary to that. Improve preceding
comment.
|
|
The problem is that Apply_Discriminant_Check introduces an unnecessary
temporary for an assignment where both sides have the same constrained
subtype but the left-hand side is an aliased component.
This comes from an approximation in the implementation introduced long
time ago to deal with aliased unconstrained objects in Ada 95, more
specifically to still generate a check when both sides have the same
unconstrained subtype in this case; it is replaced by an explicit test
that the common subtype is constrained.
gcc/ada/ChangeLog:
* checks.adb (Apply_Discriminant_Check): Remove undocumented test
on Is_Aliased_View applied to the left-hand side to skip the check
in the case where the subtypes are the same, and replace it with a
test that the subtypes are constrained.
|
|
gcc/ada/ChangeLog:
* doc/gnat_rm/security_hardening_features.rst:
clarify that hardening options are not supported by the
LLVM back end.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
|
|
gcc/ada/ChangeLog:
* sem_prag.adb (Analyze_Pragma): Disable context checks for
the preanalysis of the expression for Loop_Invariant pragmas
as the ghost region for the pragma has not been set up yet.
|
|
Since Assertion_Levels cannot be named after valid assertion names
we no longer need the policies to be matched by entity.
gcc/ada/ChangeLog:
* sem_prag.adb (Get_Applicable_Policy): Match assertion levels
by name.
|
|
In some cases involving a convention-C anonymous access-to-subprogram type
with a parameter whose type has a convention of C_Pass_By_Copy, that
C_Pass_By_Copy convention is incorrectly ignored.
gcc/ada/ChangeLog:
* freeze.adb (Freeze_Entity): In the case of an anonymous
access-to-subprogram type where Do_Freeze_Profile is True, freeze
the designated subprogram type.
(Should_Freeze_Type): Do not call Unit_Declaration_Node with
a parentless argument.
* sem_ch3.adb (Analyze_Object_Declaration): When calling
Freeze_Before, override the default value for Do_Freeze_Profile.
This is needed in some cases to prevent premature freezing in the
case of an object of an anonymous access-to-subprogram type.
|
|
Implement SPARK RM 6.9(19) check:
An Assertion_Policy pragma specifying an Assertion_Level policy shall not occur
within a ghost subprogram or package associated to an assertion level which depends
on this level.
gcc/ada/ChangeLog:
* sem_prag.adb (Analyze_Pragma): Add ghost level check to
Assertion_Policy.
|
|
gcc/ada/ChangeLog:
* ghost.adb (Check_Assignment_Policies): The level of the assignee
should depend on the level of the region.
|
|
This rule was removed. This can scenario can be detected by Rule 18.
gcc/ada/ChangeLog:
* ghost.adb (Is_Ok_Pragma): Remove calls to Check_Policies.
|
|
gcc/ada/ChangeLog:
* contracts.adb: Update SPARK RM reference numbers.
* freeze.adb: Likewise.
* ghost.adb: Likewise.
* ghost.ads: Likewise.
* sem_ch12.adb: Likewise.
* sem_ch3.adb: Likewise.
* sem_ch6.adb: Likewise.
* sem_prag.adb: Likwise.
* sem_res.adb: Likewise.
|
|
Create a new method for checking and emitting errors on pragmas
Unused, Unrefefrenced, Unreferenced_Objects, Inline and No_Return
that support specifying multiple entities as arguments.
Emit an error when one argument is ghost and the other is not and
when one argument has a ghost policy check and the other has ghost
policy ignore.
Update the Suppressed_Ghost_Policy_Check_Pragma list pragma Inline
that should be there to avoid an incorrect invalid pragma context
error.
gcc/ada/ChangeLog:
* sem_prag.adb (Check_Inconsistent_Argument_Ghostliness):
new method for handling the ghost constency errors between
different arguments. Use this method in the processing for
pragmas Unused, Unrefefrenced, Unreferenced_Objects, Inline and
No_Return.
* sem_prag.ads (Suppressed_Ghost_Policy_Check_Pragma): add
missing entry for pragma Inline.
|
|
The assignee should depend on the level of all of the ghost entiies
with the assignment.
gcc/ada/ChangeLog:
* ghost.adb (Check_Assignee_Levels): Fix the condition and improve
error message handling.
|
|
The first unit provides the time_t, timeval and timespec types corresponding
to the C types defined by the OS, as well as various conversion functions.
The second unit is a mere renaming of the first under the GNAT hierarchy.
This removes C time types and conversions under System, and from bodies and
private parts under GNAT, while keeping visible types and conversions under
GNAT as Obsolescent.
gcc/ada/ChangeLog:
PR ada/114065
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-c_time$(objext) and
s-c_time$(objext).
(Aarch64/Android): Do not use s-osinte__android.adb.
(SPARC/Solaris): Do not use s-osprim__solaris.adb.
(x86/Solaris): Likewise.
(LynxOS178): Do not use s-parame__posix2008.ads.
(RTEMS): Likewise.
(x32/Linux): Likewise, as well as s-linux__x32.ads. Replace
s-osprim__x32.adb with s-osprim__posix.adb.
(LIBGNAT_OBJS): Remove cal.o.
* cal.c: Delete.
* doc/gnat_rm/the_gnat_library.rst (GNAT.C_Time): New entry.
(GNAT.Calendar): Do not mention the obsolete conversion functions.
* impunit.adb (Non_Imp_File_Names_95): Add g-c_time.
* libgnarl/a-exetim__posix.adb: Add with clause for System.C_Time
(Clock): Use type and functions from System.C_Time.
* libgnarl/s-linux.ads: Remove with clause for System.Parameters.
Remove declarations of C time types.
* libgnarl/s-linux__alpha.ads: Likewise.
* libgnarl/s-linux__android-aarch64.ads: Likewise.
* libgnarl/s-linux__android-arm.ads: Likewise.
* libgnarl/s-linux__hppa.ads: Likewise.
* libgnarl/s-linux__loongarch.ads: Likewise.
* libgnarl/s-linux__mips.ads: Likewise.
* libgnarl/s-linux__riscv.ads: Likewise.
* libgnarl/s-linux__sparc.ads: Likewise.
* libgnarl/s-osinte__aix.ads: Likewise.
* libgnarl/s-osinte__android.ads: Likewise.
* libgnarl/s-osinte__cheribsd.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.ads: Likewise.
* libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise.
* libgnarl/s-osinte__linux.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.
* libgnarl/s-qnx.ads: Likewise.
* libgnarl/s-linux__x32.ads: Delete.
* libgnarl/s-osinte__darwin.adb (To_Duration): Remove.
(To_Timespec): Likewise.
* libgnarl/s-osinte__aix.adb: Likewise.
* libgnarl/s-osinte__dragonfly.adb: Likewise.
* libgnarl/s-osinte__freebsd.adb: Likewise.
* libgnarl/s-osinte__gnu.adb: Likewise.
* libgnarl/s-osinte__lynxos178.adb: Likewise.
* libgnarl/s-osinte__posix.adb: Likewise.
* libgnarl/s-osinte__qnx.adb: Likewise.
* libgnarl/s-osinte__rtems.adb: Likewise.
* libgnarl/s-osinte__solaris.adb: Likewise.
* libgnarl/s-osinte__vxworks.adb: Likewise.
* libgnarl/s-osinte__x32.adb: Likewise.
* libgnarl/s-taprop__solaris.adb: Add with clause for System.C_Time.
(Monotonic_Clock): Use type and functions from System.C_Time.
(RT_Resolution): Likewise.
(Timed_Sleep): Likewise.
(Timed_Delay): Likewise.
* libgnarl/s-taprop__vxworks.adb: Likewise.
* libgnarl/s-tpopmo.adb: Likewise.
* libgnarl/s-osinte__android.adb: Delete.
* libgnat/g-c_time.ads: New file.
* libgnat/g-calend.adb: Delegate to System.C_Time.
* libgnat/g-calend.ads: Likewise.
* libgnat/g-socket.adb: Likewise.
* libgnat/g-socthi.adb: Likewise.
* libgnat/g-socthi__vxworks.adb: Likewise.
* libgnat/g-sothco.ads: Likewise.
* libgnat/g-spogwa.adb: Likewise.
* libgnat/s-c_time.adb: New file.
* libgnat/s-c_time.ads: Likewise.
* libgnat/s-optide.adb: Import nanosleep here.
* libgnat/s-os_lib.ads (time_t): Remove.
(To_Ada): Adjust.
(To_C): Likewise.
* libgnat/s-os_lib.adb: Likewise.
* libgnat/s-osprim__darwin.adb: Delegate to System.C_Time.
* libgnat/s-osprim__posix.adb: Likewise.
* libgnat/s-osprim__posix2008.adb: Likewise.
* libgnat/s-osprim__rtems.adb: Likewise.
* libgnat/s-osprim__unix.adb: Likewise.
* libgnat/s-osprim__solaris.adb: Delete.
* libgnat/s-osprim__x32.adb: Likewise.
* libgnat/s-parame.ads (time_t_bits): Remove.
* libgnat/s-parame__hpux.ads: Likewise.
* libgnat/s-parame__vxworks.ads: Likewise.
* libgnat/s-parame__posix2008.ads: Delete.
* s-oscons-tmplt.c (SIZEOF_tv_nsec): New constant.
* gnat_rm.texi: Regenerate.
|
|
This happens when the type returned by the indexing function is a private
type whose completion is derived from another private type, because the
Finalize_Address routine cannot correctly fetch the actual root type.
gcc/ada/ChangeLog:
* exp_util.adb (Finalize_Address): In an untagged derivation, call
Root_Type on the full view of the base type if the partial view is
itself not a derived type.
(Is_Untagged_Derivation): Minor formatting tweak.
|
|
A qualified expression around a function call may cause a temporary to be
created and, therefore, cannot be bypassed in Expand_Ctrl_Function_Call.
gcc/ada/ChangeLog:
* exp_util.ads (Unqualified_Unconditional_Parent): New function.
* exp_util.adb (Unconditional_Parent): Do not look through qualified
expressions.
(Unqualified_Unconditional_Parent): New function identical to the
original Unconditional_Parent.
* exp_aggr.adb (Convert_To_Assignments): Replace Unconditional_Parent
with Unqualified_Unconditional_Parent.
(Expand_Array_Aggregate): Likewse.
* exp_ch4.adb (Expand_N_Case_Expression): Likewise.
(Expand_N_If_Expression): Likewise.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Do not bypass an enclosing
qualified expression in the parent chain.
|
|
The generalized finalization extension was awarded the title of curated
extension some time ago, but this wasn't reflected in the GNAT
reference manual before this patch, which moves the documentation for
generalized finalization in the curated extension section.
gcc/ada/ChangeLog:
* doc/gnat_rm/gnat_language_extensions.rst: Fix section of Finalizable.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
|
|
We freeze the expression for expression functions that complete
before we have set up the ghost region from both the existing spec
and body. Avoid triggering the ghost context checks during the
analysis for this early freeze as the expression will be reanalyzed
when we analyze the new function body created for the expression
function.
gcc/ada/ChangeLog:
* sem_ch6.adb (Analyze_Expression_Function): Disable ghost
checks during the early freeze.
|
|
Implement the GNAT-defined Super aspect (which should not be confused with
with the Super attribute). For a two-part constructor procedure declaration,
an Initialize aspect specification is permitted on the subprogram body,
and not on the subprogram specification (this reverses was what was previously
implemented). Improve the implementation of the Make attribute.
gcc/ada/ChangeLog:
* aspects.ads: Define Super aspect; allow Initialize aspect
specification on a subprogram body.
* exp_attr.adb (Expand_N_Attribute_Reference): Rewrite Make
attribute implementation.
* exp_ch3.adb (Initialization_Control): Delete Initialization_Mode
and Make_Mode_Literal (those declarations were moved to the spec).
(Build_Record_Init_Proc): For a constructor type, component
initialization (other than for the tag component, if any) must be
performed by calling the single-argument constructor procedure.
(Requires_Init_Proc): Return True for a constructor type.
* exp_ch3.ads (Make_Mode_Literal, Initialization_Mode): New, moved
from the body of this package.
* exp_ch6.adb (Expand_N_Subprogram_Body): Declare, implement, and
call a new local procedure, Prepend_Constructor_Procedure_Prologue
in order to generate component initialization for a constructor
procedure.
* sem_attr.adb (Analyze_Attribute): Improve the error message
generated for a 'Make attribute reference if GNAT extensions are
not all allowed.
* sem_ch13.adb (Analyze_One_Aspect): Improved implementation of
aspect specifications for Initialize, Constructor, and Super
aspects. For Super, there was no previous implementation.
|
|
gcc/ada/ChangeLog:
* atree.adb (Mark_New_Ghost_Node): Set Is_Implicit_Ghost for
all newly created nodes.
* gen_il-fields.ads (Is_Implicit_Ghost): New attribute.
* gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Implicit_Ghost
attribute.
* ghost.adb (Ghost_Policy_In_Effect): Implicit_Ghost_Entities inside
pragmas get the ghost mode from the region isntead of the global
ghost policy.
(Ghost_Assertion_Level_In_Effect): New function that returns the
applicable assertion level for the given entity in a similar manner
as Ghost_Policy_In_Effect.
(Install_Ghost_Region): Set Is_Inside_Statement_Or_Pragma attribute.
(Mark_And_Set_Ghost_Body): Update the logic for deriving the ghost
region.
(Set_Ghost_Mode): Ignored pragmas attached to checked ghost entities
now create an ignored ghost region. Pragmas attached to non-ghost
entities create the ghost region based on the policy applied to the
given pragma.
* opt.ads (Ghost_Config_Type): add new attribute
Is_Inside_Statement_Or_Pragama to track whether we should take the
active ghost mode from the ghost region for implicit ghost entities.
* sem_prag.adb (Analyze_Pragma): Mark entities that have an explicit
ghost pragma as non-implicit ghost.
|
|
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Remove the note on light runtimes.
|
|
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move
recommendation of Toolchain_Name up.
* gnat_ugn.texi: Regenerate.
|
|
`adafinal` is not available on targets without standard library.
gcc/ada/ChangeLog:
* bindgen.adb (Gen_Adafinal): Don't generate call of adafinal
when use of standard library suppressed.
|
|
Check whether library is elaborated is not generated when there is not
standard library available on target.
gcc/ada/ChangeLog:
* bindgen.adb (Gen_Adafinal): Don't generate code when
use of standard library suppressed.
|
|
gcc/ada/ChangeLog:
* libgnat/a-swunau.ads (Set_Wide_String): New subprogram.
* libgnat/a-swunau.adb (Set_Wide_String): Likewise.
* libgnat/a-swunau__shared.adb (Set_Wide_String): Likewise.
* libgnat/a-szunau.ads (Set_Wide_Wide_String): Likewise.
* libgnat/a-szunau.adb (Set_Wide_Wide_String): Likewise.
* libgnat/a-szunau__shared.adb (Set_Wide_Wide_String): Likewise.
|
|
There are cases where we need to analyze the argument of the pragma
in order to determine the ghostliness of the pragma. However during
that analysis the ghost region of the pragma is not set yet so we
cannot perform the ghost context checks at that moment.
This patch provides the mechanism for disabling ghost context checks
and disables them for pragma arguments that determine the ghostliness
of the pragma.
gcc/ada/ChangeLog:
* ghost.adb (Check_Ghost_Context): Avoid context checks when they
are globally disabled.
* sem.ads (Ghost_Context_Checks_Disabled): New flag to control
whether ghost context checks are activated or not.
* sem_prag.adb (Analyze_Pragma): Disable ghost context checks for
pragmas that determine their ghostliness based on one of its arguments.
|
|
"Is_Ancestor_Package (E, E)" returns True and this patch fixes a comment
that claimed otherwise. This patch also renames an object local to
Is_Ancestor_Package that was misleadingly named "Par", a common
abbreviation of "Parent".
gcc/ada/ChangeLog:
* sem_util.ads (Is_Ancestor_Package): Fix documentation comment.
* sem_util.adb (Is_Ancestor_Package): Rename local object.
|
|
|
|
BACKLOG_MAX represents the number of outstanding connections in the
socket's listen queue.
gcc/ada/ChangeLog:
* libgnat/g-socket.adb (Listen_Socket): Change default value.
* libgnat/g-socket.ads (Listen_Socket): Likewise.
* s-oscons-tmplt.c (BACKLOG_MAX): New.
|
|
gcc/ada/ChangeLog:
* env.c (__gnat_clearenv): Adjust comment.
* libgnarl/a-intnam__bsd.ads: Fix copyright date.
|
|
This is a follow-up to a recent change, where a warning was implemented
for huge library-level objects. However it is not given if the objects
are imported, although an indirection is also added for them under the
hood to match the export side.
gcc/ada/ChangeLog:
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Give a
warning for huge imported objects as well.
|