summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/impunit.adb2
-rw-r--r--gcc/ada/sem_aggr.adb24
-rw-r--r--gcc/ada/sem_ch3.adb6
4 files changed, 40 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 65cd4e8e5dd..6a2a01201ff 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,17 @@
+2009-04-20 Jerome Lambourg <lambourg@adacore.com>
+
+ * impunit.adb: Add i-cil and i-cilobj packages, now needed by the
+ generated bindings for cil.
+
+2009-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_aggr.adb (Resolve_Record_Aggregate): If the type has unknown
+ discriminants, collect components from the Underlying_Record_View,
+ which will be used in the expansion of the aggregate into assignments.
+
+ * sem_ch3.adb: Do not label derived type with unknown discriminants as
+ having a private declaration.
+
2009-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb (Expand_Subtype_From_Expr): use the
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb
index 0b8cdd5b9c0..4c308baeea5 100644
--- a/gcc/ada/impunit.adb
+++ b/gcc/ada/impunit.adb
@@ -300,6 +300,8 @@ package body Impunit is
------------------------------------------
"i-cexten", -- Interfaces.C.Extensions
+ "i-cil ", -- Interfaces.CIL
+ "i-cilobj", -- Interfaces.CIL.Object
"i-cpp ", -- Interfaces.CPP
"i-cstrea", -- Interfaces.C.Streams
"i-java ", -- Interfaces.Java
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 5078bc3deb8..2e7ba8ee63b 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3100,11 +3100,22 @@ package body Sem_Aggr is
end if;
end loop;
- -- Now collect components from all other ancestors
+ -- Now collect components from all other ancestors, beginning
+ -- with the current type. If the type has unknown discriminants
+ -- use the component list of the underlying_record_view, which
+ -- needs to be used for the subsequent expansion of the aggregate
+ -- into assignments.
Parent_Elmt := First_Elmt (Parent_Typ_List);
while Present (Parent_Elmt) loop
Parent_Typ := Node (Parent_Elmt);
+
+ if Has_Unknown_Discriminants (Parent_Typ)
+ and then Present (Underlying_Record_View (Typ))
+ then
+ Parent_Typ := Underlying_Record_View (Parent_Typ);
+ end if;
+
Record_Def := Type_Definition (Parent (Base_Type (Parent_Typ)));
Gather_Components (Empty,
Component_List (Record_Extension_Part (Record_Def)),
@@ -3120,12 +3131,21 @@ package body Sem_Aggr is
if Null_Present (Record_Def) then
null;
- else
+
+ elsif not Has_Unknown_Discriminants (Typ) then
Gather_Components (Base_Type (Typ),
Component_List (Record_Def),
Governed_By => New_Assoc_List,
Into => Components,
Report_Errors => Errors_Found);
+
+ else
+ Gather_Components
+ (Base_Type (Underlying_Record_View (Typ)),
+ Component_List (Record_Def),
+ Governed_By => New_Assoc_List,
+ Into => Components,
+ Report_Errors => Errors_Found);
end if;
end if;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index a7ffd892648..be87d0c8793 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -5557,7 +5557,8 @@ package body Sem_Ch3 is
(N, Parent_Type, Derived_Type, Derive_Subps);
-- Build anonymous completion, as a derivation from the full
- -- view of the parent.
+ -- view of the parent. This is not a completion in the usual
+ -- sense, because the current type is not private.
Decl :=
Make_Full_Type_Declaration (Loc,
@@ -5569,9 +5570,6 @@ package body Sem_Ch3 is
(Subtype_Indication (Type_Definition (N))),
Record_Extension_Part => New_Ext));
- Set_Has_Private_Declaration (Full_Der);
- Set_Has_Private_Declaration (Derived_Type);
-
-- If the parent type has an underlying record view, use it
-- here to build the new underlying record view.