]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Tweak definition of Modulus field of entities
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 18 Feb 2025 10:24:15 +0000 (11:24 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:06 +0000 (10:37 +0200)
The compiler may build modular integer subtypes whose base type is private
in the context of instantiations, but we want to be able to get the Modulus.

gcc/ada/ChangeLog:

* einfo.ads (Modulus): Change to implementation base type only.
* gen_il-gen-gen_entities.adb (Modular_Integer_Kind): Change type
of Modulus field to Impl_Base_Type_Only.

gcc/ada/einfo.ads
gcc/ada/gen_il-gen-gen_entities.adb

index c07de681045af0b8ac93ed3ed7af0a7154d2c9c0..05ce8beca764a9a7d01105e9c73e20a405863f5b 100644 (file)
@@ -3626,7 +3626,7 @@ package Einfo is
 --       subprogram or the formal's Extra_Accessibility - whichever one is
 --       lesser. The Minimum_Accessibility field then points to this object.
 
---    Modulus [base type only]
+--    Modulus [implementation base type only]
 --       Defined in modular types. Contains the modulus. For the binary case,
 --       this will be a power of 2, but if Non_Binary_Modulus is set, then it
 --       will not be a power of 2.
index 4548789383e21070c3c208ff1cf81a685b0b2944..2dc255c78c8a6c3aa7046ed20f8ebc8d78300239 100644 (file)
@@ -572,7 +572,7 @@ begin -- Gen_IL.Gen.Gen_Entities
        --  created for the base type, and this is the first named subtype).
 
    Ab (Modular_Integer_Kind, Integer_Kind,
-       (Sm (Modulus, Uint, Base_Type_Only),
+       (Sm (Modulus, Uint, Impl_Base_Type_Only),
         Sm (Original_Array_Type, Node_Id)));
 
    Cc (E_Modular_Integer_Type, Modular_Integer_Kind);