summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-01 13:51:43 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-01 13:51:43 +0000
commite78165626493d2c5c8cebb1231e856bf67bb9020 (patch)
treeba5e6c9c4647d83134b183e67a90234297a0fc11
parent712d385ffc07480f6ed2944dfd4f446a35fc77b6 (diff)
downloadgcc-e78165626493d2c5c8cebb1231e856bf67bb9020.tar.gz
2014-08-01 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Build_Initialization_Call): Call Underlying_Type to go down the chain of private derivations. * freeze.adb (Freeze_Entity): Fix typo in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213465 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/exp_ch3.adb22
-rw-r--r--gcc/ada/freeze.adb2
3 files changed, 18 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 225c24cafa3..a7a0e2b7a3f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2014-08-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_ch3.adb (Build_Initialization_Call): Call Underlying_Type
+ to go down the chain of private derivations.
+ * freeze.adb (Freeze_Entity): Fix typo in comment.
+
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Access_Type_Declaration): If designated type is
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 48008b02998..f90c60d7fcd 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -1491,14 +1491,20 @@ package body Exp_Ch3 is
return Empty_List;
end if;
- -- Go to full view if private type. In the case of successive
- -- private derivations, this can require more than one step.
+ -- Go to full view or underlying full view if private type. In the case
+ -- of successive private derivations, this can require two steps.
- while Is_Private_Type (Full_Type)
+ if Is_Private_Type (Full_Type)
and then Present (Full_View (Full_Type))
- loop
+ then
Full_Type := Full_View (Full_Type);
- end loop;
+ end if;
+
+ if Is_Private_Type (Full_Type)
+ and then Present (Underlying_Full_View (Full_Type))
+ then
+ Full_Type := Underlying_Full_View (Full_Type);
+ end if;
-- If Typ is derived, the procedure is the initialization procedure for
-- the root type. Wrap the argument in an conversion to make it type
@@ -1583,12 +1589,6 @@ package body Exp_Ch3 is
begin
if Is_Protected_Type (T) then
T := Corresponding_Record_Type (T);
-
- elsif Is_Private_Type (T)
- and then Present (Underlying_Full_View (T))
- and then Is_Protected_Type (Underlying_Full_View (T))
- then
- T := Corresponding_Record_Type (Underlying_Full_View (T));
end if;
Arg :=
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 9af48a8622e..8963ad0c772 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -5034,7 +5034,7 @@ package body Freeze is
-- Otherwise freeze full view and patch the pointers so that
-- the freeze node will elaborate both views in the back end.
-- However, if full view is itself private, freeze underlying
- -- full view instead and patch the pointer so that the freeze
+ -- full view instead and patch the pointers so that the freeze
-- node will elaborate the three views in the back end.
else