]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Move Incomplete_View from node to entity field
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 19 Feb 2025 15:32:43 +0000 (16:32 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:07 +0000 (10:37 +0200)
commita90094505584cae5d3c813bf955b194d60785e87
tree6295234b63df6422efd3b4547c98aff16b6bf504
parentac2d8941f51d1280e1bf88274b1b4cf0c56e653b
ada: Move Incomplete_View from node to entity field

The Incomplete_View property of a type was attached to its full type
declaration as a semantic field, but retrieving it from there required
low-level tree navigation and caused code duplication. In one case we
relied on internal class-wide type being attached to the corresponding
full type declaration, which is an undocumented assumption.

It seems better to attach this field to entities, just like we do with
Full_View and many other type properties. Ideally, this field should be
present just in type entities, but currently we set it before setting
the proper entity kind.

Behavior is unaffected. This is rather a code cleanup, originating from the
need to use Incomplete_View in GNATprove.

gcc/ada/ChangeLog:

* einfo.ads (Incomplete_View): Move from Sinfo; adapt wording.
* exp_ch3.adb (Build_Record_Init_Proc): Adapt retrieval of
Incomplete_View.
* gen_il-fields.ads (Opt_Field_Enum): Move Incomplete_View from node
to entity field.
* gen_il-gen-gen_entities.adb (Gen_Entities): Add field.
* gen_il-gen-gen_nodes.adb (Gen_Nodes): Remove field.
* sem_ch3.adb (Analyze_Full_Type_Declaration,
Check_Anonymous_Access_Component): Adapt setting of Incomplete_View.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Adapt retrieval of
Incomplete_View for class-wide types; no longer rely on class-wide
type being attached to non-classwide type declaration.
* sem_util.adb (Collect_Primitive_Operations): Adapt retrieval of
Incomplete_View.
* sinfo.ads (Incomplete_View): Move to Einfo.
gcc/ada/einfo.ads
gcc/ada/exp_ch3.adb
gcc/ada/gen_il-fields.ads
gcc/ada/gen_il-gen-gen_entities.adb
gcc/ada/gen_il-gen-gen_nodes.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_util.adb
gcc/ada/sinfo.ads