ada: Introduce Cannot_Be_Superflat flag on N_Range nodes
commit4b8f39b21e27919c6de00e65b0ba29222c057d26
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 18 Jan 2023 19:52:03 +0000 (18 20:52 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 16 May 2023 08:30:56 +0000 (16 10:30 +0200)
treec7f53c775f22c4b84318d66dc487d2ca560cd04e
parentb92d0c4564a2d9b942bedad3dd1fb2887239020e
ada: Introduce Cannot_Be_Superflat flag on N_Range nodes

The support of superflat arrays in the language generates an overhead that
the code generator attempts to minimize, but it cannot handle too complex
cases and it would be helpful if the front-end could lend a hand.

This change introduces the Cannot_Be_Superflat flag on N_Range nodes for
this purpose, and sets it on the result of string concatenations when it
is guaranteed to be nonnull.

gcc/ada/

* gen_il-fields.ads (Opt_Field_Enum): Add Cannot_Be_Superflat.
* gen_il-gen-gen_nodes.adb (N_Range): Add Cannot_Be_Superflat as
semantical flag and change Includes_Infinities to semantical.
* sinfo.ads (Cannot_Be_Superflat): Document it for N_Range.
* exp_ch4.adb (Expand_Concatenate): Set Cannot_Be_Superflat on the
range of the result if the result cannot be null.
gcc/ada/exp_ch4.adb
gcc/ada/gen_il-fields.ads
gcc/ada/gen_il-gen-gen_nodes.adb
gcc/ada/sinfo.ads