diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-12 10:11:25 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-12 10:11:25 +0200 |
commit | 473469230a0224c19584317db7c2b9e9bb07c5c1 (patch) | |
tree | 437c2d0856bbb6a4ed19c76af7be237db1cd11ab /gcc/ada/sem_ch10.adb | |
parent | 0cc1540d55a2e7ff710588b78c0b6efc8dc6a51f (diff) | |
download | gcc-473469230a0224c19584317db7c2b9e9bb07c5c1.zip gcc-473469230a0224c19584317db7c2b9e9bb07c5c1.tar.gz gcc-473469230a0224c19584317db7c2b9e9bb07c5c1.tar.bz2 |
[multiple changes]
2015-05-12 Robert Dewar <dewar@adacore.com>
* exp_prag.adb (Expand_N_Pragma): Rewrite ignored pragma as
Null statements.
* namet.ads (Boolean3): Document this flag used for Ignore_Pragma.
* par-prag.adb (Prag): Implement Ignore_Pragma.
* sem_prag.adb: Implement Ignore_Pragma.
* snames.ads-tmpl: Add entries for pragma Ignore_Pragma.
2015-05-12 Javier Miranda <miranda@adacore.com>
* sem_ch10.adb (Build_Shadow_Entity): Link the class-wide shadow
entity with its corresponding real entity.
(Decorate_Type): Unconditionally build the class-wide shadow entity of
tagged types.
* einfo.ads, einfo.adb (Has_Non_Limited_View): New synthesized
attribute.
(Non_Limited_View): Moved from field 17 to field 19 be available
in class-wide entities.
* exp_attr.adb (Access_Cases): Code cleanup.
* exp_disp.adb (Expand_Interface_Actuals): Ditto.
* exp_util.adb (Non_Limited_Designated_Type): Ditto.
* freeze.adb (Build_Renamed_Bdody): Ditto.
* sem_aux.adb (Available_View): Ditto.
* sem_ch4.adb (Analyze_Selected_Component): Ditto.
(Try_One_Prefix_Interpretation): Ditto.
* sem_ch5.adb (Analyze_Assignment): Ditto.
* sem_ch6.adb (Detect_And_Exchange): Ditto.
* sem_ch8.adb (Find_Expanded_Name): Ditto.
* sem_disp.adb (Check_Controlling_Type): Ditto.
* sem_res.adb (Resolve_Type_Conversion): Ditto.
(Full_Designated_Type): Ditto.
* sem_type.adb (Covers): Ditto.
* sem_util.adb: Fix typo in comment.
From-SVN: r223038
Diffstat (limited to 'gcc/ada/sem_ch10.adb')
-rw-r--r-- | gcc/ada/sem_ch10.adb | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 3289f14..4973dc1 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -5604,6 +5604,11 @@ package body Sem_Ch10 is Decorate_Type (Shadow, Scop, Is_Tagged); Set_Non_Limited_View (Shadow, Ent); + if Is_Tagged then + Set_Non_Limited_View (Class_Wide_Type (Shadow), + Class_Wide_Type (Ent)); + end if; + if Is_Incomplete_Or_Private_Type (Ent) then Set_Private_Dependents (Shadow, New_Elmt_List); end if; @@ -5671,35 +5676,33 @@ package body Sem_Ch10 is Set_Is_Tagged_Type (Ent); Set_Direct_Primitive_Operations (Ent, New_Elmt_List); - if No (Class_Wide_Type (Ent)) then - CW_Typ := - New_External_Entity - (E_Void, Scope (Ent), Sloc (Ent), Ent, 'C', 0, 'T'); - - Set_Class_Wide_Type (Ent, CW_Typ); - - -- Set parent to be the same as the parent of the tagged type. - -- We need a parent field set, and it is supposed to point to - -- the declaration of the type. The tagged type declaration - -- essentially declares two separate types, the tagged type - -- itself and the corresponding class-wide type, so it is - -- reasonable for the parent fields to point to the declaration - -- in both cases. - - Set_Parent (CW_Typ, Parent (Ent)); - - Set_Ekind (CW_Typ, E_Class_Wide_Type); - Set_Etype (CW_Typ, Ent); - Set_Scope (CW_Typ, Scop); - Set_Is_Tagged_Type (CW_Typ); - Set_Is_First_Subtype (CW_Typ); - Init_Size_Align (CW_Typ); - Set_Has_Unknown_Discriminants (CW_Typ); - Set_Class_Wide_Type (CW_Typ, CW_Typ); - Set_Equivalent_Type (CW_Typ, Empty); - Set_From_Limited_With (CW_Typ, From_Limited_With (Ent)); - Set_Materialize_Entity (CW_Typ, Materialize); - end if; + CW_Typ := + New_External_Entity + (E_Void, Scope (Ent), Sloc (Ent), Ent, 'C', 0, 'T'); + + Set_Class_Wide_Type (Ent, CW_Typ); + + -- Set parent to be the same as the parent of the tagged type. + -- We need a parent field set, and it is supposed to point to + -- the declaration of the type. The tagged type declaration + -- essentially declares two separate types, the tagged type + -- itself and the corresponding class-wide type, so it is + -- reasonable for the parent fields to point to the declaration + -- in both cases. + + Set_Parent (CW_Typ, Parent (Ent)); + + Set_Ekind (CW_Typ, E_Class_Wide_Type); + Set_Etype (CW_Typ, Ent); + Set_Scope (CW_Typ, Scop); + Set_Is_Tagged_Type (CW_Typ); + Set_Is_First_Subtype (CW_Typ); + Init_Size_Align (CW_Typ); + Set_Has_Unknown_Discriminants (CW_Typ); + Set_Class_Wide_Type (CW_Typ, CW_Typ); + Set_Equivalent_Type (CW_Typ, Empty); + Set_From_Limited_With (CW_Typ, From_Limited_With (Ent)); + Set_Materialize_Entity (CW_Typ, Materialize); end if; end Decorate_Type; |