โŒ About FreshRSS

Reading view

There are new articles available, click to refresh the page.

ada: Remove unreferenced utility routine Get_Logical_Line_Number_Img

ada: Remove unreferenced utility routine Get_Logical_Line_Number_Img

Routine Get_Logical_Line_Number_Img was introduced for splitting of
Pre/Post contracts, but subsequent patch for that feature removed its
only use. It was then used by GNATprove, but that use is now removed
as well.

gcc/ada/

	* sinput.adb, sinput.ads (Get_Logical_Line_Number_Img): Remove.
  • [DBH] gcc/ada/sinput.adb
  • [DBH] gcc/ada/sinput.ads

ada: Fix expansion of type aspects with handling of aspects

ada: Fix expansion of type aspects with handling of aspects

The new handling of aspects stores the aspect expression as the
Expression_Copy of the aspect and not as the Entity of the aspect
identified. This has been changed for most of the aspects, but not for
Type_Invariant and Default_Initial_Condition, which have custom
expansion. Apparently this change only affects GNATprove and not GNAT.

gcc/ada/

	* exp_util.adb (Add_Own_DIC, Add_Own_Invariants): Store the aspect
	expression in Expression_Copy.
  • [DBH] gcc/ada/exp_util.adb

ada: Cleanup more "not Present"

ada: Cleanup more "not Present"

We had a GNATcheck rule that suggests replacing "not Present (...)" with
"No (...)", but it only detected calls with a parameter of type Node_Id.
Now this rules also detects parameters of type Elist_Id.

gcc/ada/

	* sem_ch3.adb, sem_ch4.adb, sem_eval.adb: Fix newly detected
	violations.
  • [DBH] gcc/ada/sem_ch3.adb
  • [DBH] gcc/ada/sem_ch4.adb
  • [DBH] gcc/ada/sem_eval.adb

ada: Avoid extra conversion in expansion of packed array assignments

ada: Avoid extra conversion in expansion of packed array assignments

Expansion of assignments to packed array objects with string literals on
the right-hand side, created an unnecessary conversion, i.e.:

  ... :=
    component_type
      (declare
         temp : component_type := "string_literal";
       begin
         temp)

Now the expansion omits the outer type conversion.

Cleanup; behavior is unaffected.

gcc/ada/

	* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Simplify handling of
	assignments with string literals.
  • [DBH] gcc/ada/exp_pakd.adb

ada: Simplify expansion of packed array assignments

ada: Simplify expansion of packed array assignments

When expanding assignment to a packed array object, e.g. a formal
parameter with mode OUT that might have unconstrained type, we took the
component type and component size from the constrained actual subtype.
It is simpler to take these properties from the nominal type of the
assigned object.

Semantics is unaffected, because constraining the array doesn't change
the type or size of the array components.

gcc/ada/

	* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Change Ctyp and Csiz
	from variables to constants and compute them using the nominal type
	of the assigned array object.
  • [DBH] gcc/ada/exp_pakd.adb

ada: Fix extra whitespace after END keywords

ada: Fix extra whitespace after END keywords

Style cleanup.

gcc/ada/

	* exp_pakd.adb, libgnarl/s-osinte__android.ads,
	libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__qnx.ads,
	libgnarl/s-osinte__rtems.ads, libgnat/s-gearop.adb,
	libgnat/s-poosiz.adb, sem_util.adb: Fix style.
  • [DBH] gcc/ada/exp_pakd.adb
  • [DBH] gcc/ada/libgnarl/s-osinte__android.ads
  • [DBH] gcc/ada/libgnarl/s-osinte__linux.ads
  • [DBH] gcc/ada/libgnarl/s-osinte__qnx.ads
  • [DBH] gcc/ada/libgnarl/s-osinte__rtems.ads
  • [DBH] gcc/ada/libgnat/s-gearop.adb
  • [DBH] gcc/ada/libgnat/s-poosiz.adb
  • [DBH] gcc/ada/sem_util.adb

ada: Explicitly analyze and expand null array aggregates

ada: Explicitly analyze and expand null array aggregates

Null array aggregates have present but empty lists of expressions and
component associations. This confuses the previous code for ordinary
array aggregates, which assumes that if a list of either expressions or
component associations is present, then it is non-empty.

This patch adds explicit handling for null array aggregates to avoid
assertion failures in code for ordinary array aggregates.

gcc/ada/

	* exp_aggr.adb (Build_Array_Aggr_Code): Don't build aggregate code
	for null array aggregates.
	* sem_aggr.adb (Resolve_Array_Aggregate): Don't examine formatting
	of a null array aggregate.
  • [DBH] gcc/ada/exp_aggr.adb
  • [DBH] gcc/ada/sem_aggr.adb

ada: Remove redundant protection against empty list

ada: Remove redundant protection against empty list

Calls to First on No_List intentionally return Empty, so explicit guards
against No_List are unnecessary. Code cleanup; semantics is unaffected.

gcc/ada/

	* sem_type.adb (Interface_Present_In_Ancestor): Remove guard against no
	list of interfaces; fix style in comments (trailing dots).
  • [DBH] gcc/ada/sem_type.adb

ada: Add guard before querying the type for its interfaces

ada: Add guard before querying the type for its interfaces

Fix crash on illegal code, when routine Iface_Present_In_Ancestor is
called on the predefined String type and attempts to examine the list of
interfaces.

gcc/ada/

	* sem_type.adb (Iface_Present_In_Ancestor): Only look at the list of
	interfaces for types that allow it. The guard is a high-level equivalent
	of the entity kinds listed in the preconditon of the Interfaces query.
  • [DBH] gcc/ada/sem_type.adb
โŒ