aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-07-22 13:57:31 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-22 13:57:31 +0000
commitff9d220ede29dc7d0d40933733180f12cba54f17 (patch)
tree3ec00f65614d971bf36399e4d7f7e854943b7a91 /gcc/ada/sem_ch4.adb
parent78e92e11d4a96e0cd2ee9d9b1af9382133cd11b5 (diff)
downloadgcc-ff9d220ede29dc7d0d40933733180f12cba54f17.zip
gcc-ff9d220ede29dc7d0d40933733180f12cba54f17.tar.gz
gcc-ff9d220ede29dc7d0d40933733180f12cba54f17.tar.bz2
[Ada] Remove obsolete Is_For_Access_Subtype machinery
This change removes the Is_For_Access_Subtype machinery from the compiler. This machinery was devised a long time ago to deal with a peculiarity of the freezing for access-to-record subtypes but has been degenerate for quite some time now and does not seem to serve any useful purpose at this point. Morever it has an annoying side effect whereby it causes Underlying_Type to return the (unconstrained) base record type when invoked on the designated record subtype, which is very problematic for GNATprove. There should be no functional changes. 2019-07-22 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * einfo.ads (Is_For_Access_Subtype): Delete. (Set_Is_For_Access_Subtype): Likewise. * einfo.adb (Is_For_Access_Subtype): Likewise. (Set_Is_For_Access_Subtype): Likewise. (Write_Entity_Flags): Do not write Is_For_Access_Subtype. * exp_ch4.adb (Expand_N_Selected_Component): Do not deal with it. * exp_spark.adb (Expand_SPARK_N_Selected_Component): Likewise. * sem_ch4.adb (Analyze_Explicit_Dereference): Likewise. * sem_ch3.adb (Build_Discriminated_Subtype): Do not build a special private subtype for access-to-record subtypes. From-SVN: r273682
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb13
1 files changed, 2 insertions, 11 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 2b0a8ed..f7b99d4 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -2101,21 +2101,12 @@ package body Sem_Ch4 is
if not Is_Overloaded (P) then
if Is_Access_Type (Etype (P)) then
- -- Set the Etype. We need to go through Is_For_Access_Subtypes to
- -- avoid other problems caused by the Private_Subtype and it is
- -- safe to go to the Base_Type because this is the same as
- -- converting the access value to its Base_Type.
+ -- Set the Etype
declare
- DT : Entity_Id := Designated_Type (Etype (P));
+ DT : constant Entity_Id := Designated_Type (Etype (P));
begin
- if Ekind (DT) = E_Private_Subtype
- and then Is_For_Access_Subtype (DT)
- then
- DT := Base_Type (DT);
- end if;
-
-- An explicit dereference is a legal occurrence of an
-- incomplete type imported through a limited_with clause, if
-- the full view is visible, or if we are within an instance