โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdaygcc/ada history

ada: Adapt Ada.Command_Line to work on configurable runtimes

18 November 2023 at 00:39
ada: Adapt Ada.Command_Line to work on configurable runtimes

The behaviour of the binder when handling command line arguments and exit
codes is simplified so that references to the corresponding runtime symbols
are always generated when the runtime is configured with command line
argument and exit code support. This allows Ada.Command_Line to work with
all runtimes, which was not the case previously.

As a result of this change, configurable runtimes that do not include
Ada.Command_Line and it support files, but are configured with
Command_Line_Args and/or Exit_Status_Supported set to True will need to
provide the symbols required by the binder, as these symbols will no longer
be defined in the binder generated file.

argv.c includes a small change to exclude adaint.h when compiling for a
light runtime, since this header is not required.

gcc/ada/

	* argv.c: Do not include adaint.h if LIGHT_RUNTIME is defined.
	* bindgen.adb (Gen_Main): Simplify command line argument and exit
	handling by requiring the runtime to always provide the required
	symbols if command line argument and exit code is enabled.
	* targparm.ads: Update comments to reflect changes to gnatbind.
  • [DBH] gcc/ada/argv.c
  • [DBH] gcc/ada/bindgen.adb
  • [DBH] gcc/ada/targparm.ads
  • 18 November 2023 at 00:39

ada: Deep delta aggregates

22 September 2023 at 18:54
ada: Deep delta aggregates

Add support for "deep" delta aggregates, a GNAT-defined language extension
conditionally enabled via the -gnatX0 switch. In a deep delta aggregate, a
delta choice may specify a subcomponent (as opposed to just a component).

gcc/ada/

	* par.adb: Add new Boolean variable Inside_Delta_Aggregate.
	* par-ch4.adb (P_Simple_Expression): Add support for a deep delta
	aggregate choice. We turn a sequence of selectors into a peculiar
	tree. We build a component (Indexed or Selected) whose prefix is
	another such component, etc. The leftmost prefix at the bottom of
	the tree has a "name" which is the first selector, without any
	further prefix. For something like "with delta (1)(2) => 3" where
	the type of the aggregate is an array of arrays of integers, we'll
	build an N_Indexed_Component whose prefix is an integer literal 1.
	This is consistent with the trees built for "regular"
	(Ada-defined) delta aggregates.
	* sem_aggr.adb (Is_Deep_Choice, Is_Root_Prefix_Of_Deep_Choice):
	New queries.
	(Resolve_Deep_Delta_Assoc): new procedure.
	(Resolve_Delta_Array_Aggregate): call Resolve_Deep_Delta_Assoc in
	deep case.
	(Resolve_Delta_Record_Aggregate): call Resolve_Deep_Delta_Assoc in
	deep case.
	(Get_Component_Type): new function replaces old Get_Component
	function.
	* sem_aggr.ads (Is_Deep_Choice, Is_Root_Prefix_Of_Deep_Choice):
	New queries.
	* exp_aggr.adb (Expand_Delta_Array_Aggregate): add nested function
	Make_Array_Delta_Assignment_LHS; call it instead of
	Make_Indexed_Component.
	(Expand_Delta_Record_Aggregate): add nested function
	Make_Record_Delta_Assignment_LHS; call it instead of
	Make_Selected_Component.
	* exp_spark.adb (Expand_SPARK_Delta_Or_Update): Insert range
	checks for indexes in deep delta aggregates.
  • [DBH] gcc/ada/exp_aggr.adb
  • [DBH] gcc/ada/exp_spark.adb
  • [DBH] gcc/ada/par-ch4.adb
  • [DBH] gcc/ada/par.adb
  • [DBH] gcc/ada/sem_aggr.adb
  • [DBH] gcc/ada/sem_aggr.ads
  • 22 September 2023 at 18:54

ada: Clean up scope depth and related code (tech debt)

By: Bob Duff
5 September 2023 at 18:40
ada: Clean up scope depth and related code (tech debt)

The main point of this patch is to remove the special case
for Atree.F_Scope_Depth_Value in the Assert that Field_Present
in Get_Field_Value. Pulling on that thread leads to lots
of related cleanup.

gcc/ada/ChangeLog:

	* atree.adb (Node_Kind_Table): Specify parameter explicitly in
	GNAT.Table instantiations. Use fully qualified references instead
	of relying on use clauses.
	(Get_Field_Value): Remove special case for F_Scope_Depth_Value.
	That is, enable the Field_Present check in that case.
	(It was already enabled for all other fields.) Violations of this
	check were already fixed.
	(Print_Node_Statistics): Sort the output in decreasing order of
	frequencies.
	(Print_Field_Statistics): Likewise (sort).
	* accessibility.adb (Accessibility_Level): Pass Allow_Alt_Model in
	recursive calls. Apparently, an oversight.
	(Innermost_Master_Scope_Depth): Need to special-case the 'Old
	attribute and allocators.
	* einfo-utils.ads (Scope_Depth): Use Scope_Kind_Id to get
	predicate checks.
	(Scope_Depth_Set): Likewise.
	(Scope_Depth_Default_0): Likewise.
	* einfo-utils.adb: As for spec.
	* frontend.adb (Frontend): Remove unnecessary "return;".
	* gen_il-types.ads (Scope_Kind): New union type.
	* gen_il-gen-gen_entities.adb (Scope_Kind): New union type.
	* sem.ads: Move "with Einfo.Entities;" from body to spec.
	(Scope_Stack_Entry): Declare Entity to be of Scope_Kind_Id to get
	predicate checks. We had previously been putting non-scopes on the
	scope stack; this prevents such anomalies.
	* sem.adb: Move "with Einfo.Entities;" from body to spec.
	* sem_ch8.ads: Move "with Einfo.Entities;" from body to spec. Add
	"with Types;".
	(Push_Scope): Use Scope_Kind_Id to get predicate checks.
	* sem_ch8.adb: Move "with Einfo.Entities;" from body to spec. Add
	"with Types;".
	(Push_Scope): Use Scope_Kind_Id to get predicate checks.
	(Pop_Scope): Use Scope_Kind_Id on popped entity to get predicate
	checks. This prevents anomalies where a scope pushed onto the
	stack is later mutated to a nonscope before being popped.
	* sem_util.ads (Find_Enclosing_Scope): Add postcondition to ensure
	that the enclosing scope of a node N is not the same node N.
	Clearly, N does not enclose itself.
	* sem_util.adb (Find_Enclosing_Scope): There were several bugs
	where Find_Enclosing_Scope(N) = N. For example, if N is an entity,
	then we would typically go up to its declaration, and then back
	down to the Defining_Entity of the declaration, which is N itself.
	There were other cases where Find_Enclosing_Scope of an entity
	disagreed with Scope. Clearly, Find_Enclosing_Scope and Scope
	should agree (when both are defined). Such bugs caused latent bugs
	in accessibility.adb related to 'Old, and fixing bugs here caused
	such bugs to be revealed. These are fixed by calling Scope when N
	is an entity.

Co-authored-by: Ronan Desplanques <[email protected]>
  • [DBH] gcc/ada/accessibility.adb
  • [DBH] gcc/ada/atree.adb
  • [DBH] gcc/ada/einfo-utils.adb
  • [DBH] gcc/ada/einfo-utils.ads
  • [DBH] gcc/ada/frontend.adb
  • [DBH] gcc/ada/gen_il-gen-gen_entities.adb
  • [DBH] gcc/ada/gen_il-types.ads
  • [DBH] gcc/ada/sem.adb
  • [DBH] gcc/ada/sem.ads
  • [DBH] gcc/ada/sem_ch8.adb
  • [DBH] gcc/ada/sem_ch8.ads
  • [DBH] gcc/ada/sem_util.adb
  • [DBH] gcc/ada/sem_util.ads
  • 5 September 2023 at 18:40

ada: Crash on creation of extra formals on type extension

5 September 2023 at 06:57
ada: Crash on creation of extra formals on type extension

Revert previous patch and fix the pending issue.

gcc/ada/

	* accessibility.ads (Needs_Result_Accessibility_Extra_Formal):
	Removed.
	* accessibility.adb (Needs_Result_Accessibility_Level_Param):
	Removed.
	(Needs_Result_Accessibility_Extra_Formal): Removed.
	(Needs_Result_Accessibility_Level): Revert previous patch.
	* sem_ch6.adb (Parent_Subprogram): Handle function overriding an
	enumeration literal.
	(Create_Extra_Formals): Ensure that the parent subprogram has all
	its extra formals.
  • [DBH] gcc/ada/accessibility.adb
  • [DBH] gcc/ada/accessibility.ads
  • [DBH] gcc/ada/sem_ch6.adb
  • 5 September 2023 at 06:57

ada: Crash on creation of extra formals on type extension

19 August 2023 at 16:50
ada: Crash on creation of extra formals on type extension

The compiler blows up processing an overriding dispatching function
of a derived tagged type that returns a private tagged type that
has an access type discriminant.

gcc/ada/

	* accessibility.ads (Needs_Result_Accessibility_Extra_Formal): New
	subprogram.
	* accessibility.adb (Needs_Result_Accessibility_Level_Param): New
	subprogram.
	(Needs_Result_Accessibility_Extra_Formal): New subprogram,
	temporarily keep the previous behavior of the frontend.
	* sem_ch6.adb (Create_Extra_Formals): Replace occurrences of
	function Needs_Result_Accessibility_Level_Param by calls to
	function Needs_Result_Accessibility_Extra_Formal.
	(Extra_Formals_OK): Ditto.
  • [DBH] gcc/ada/accessibility.adb
  • [DBH] gcc/ada/accessibility.ads
  • [DBH] gcc/ada/sem_ch6.adb
  • 19 August 2023 at 16:50
โŒ
โŒ