]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Get rid of Sy/Sm mixing (Default_Expression)
authorBob Duff <duff@adacore.com>
Tue, 7 Oct 2025 14:35:03 +0000 (10:35 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 3 Nov 2025 14:15:15 +0000 (15:15 +0100)
commitcc2a4ebe88e434c879fc84fcf8b82e49da966125
tree0891c53894a758cd6525e877ea2444020459b4e2
parentbd03df4cac5af997df9668a533fa23b1c867d5d0
ada: Get rid of Sy/Sm mixing (Default_Expression)

We should not mix "syntactic" and "semantic" for the same field
in different node kinds.

Change the name of Default_Expression (a syntactic field) on
N_Formal_Object_Declaration to be Expression. This avoids
the conflict with the name-named semantic field of
N_Parameter_Specification.

It is also more uniform with other syntactic categories that
use default_expression in the syntax rules.  See, for example,
COMPONENT_DECLARATION in sinfo.ads, which is presumably intended
to be uniform with OBJECT_DECLARATION.

Fix the comment on N_Formal_Object_Declaration to refer
to the new field name Expression.

gcc/ada/ChangeLog:

* gen_il-gen-gen_nodes.adb: Rename Default_Expression to be
Expression.
* gen_il-gen.adb (Check_For_Syntactic_Field_Mismatch): Do not
exempt Default_Expression from the rule.
* par-ch12.adb (P_Formal_Object_Declarations): Use renamed setter.
* sem_ch12.adb (Default): Use renamed getter.
(Analyze_Formal_Object_Declaration): Likewise.
* sprint.adb (Sprint_Node_Actual): Use renamed getter.
* sinfo.ads: Fix comments.
gcc/ada/gen_il-gen-gen_nodes.adb
gcc/ada/gen_il-gen.adb
gcc/ada/par-ch12.adb
gcc/ada/sem_ch12.adb
gcc/ada/sinfo.ads
gcc/ada/sprint.adb