aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-05-06 11:41:39 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-05-06 11:41:39 +0200
commita693f55e581e2405cd15967b2d367293938fb69c (patch)
treebed3bf7aa0e50ac242052d39c46557c63085b1d0 /gcc/ada
parente264efcc3847c1b3cfc107eade935d24dee661f6 (diff)
downloadgcc-a693f55e581e2405cd15967b2d367293938fb69c.zip
gcc-a693f55e581e2405cd15967b2d367293938fb69c.tar.gz
gcc-a693f55e581e2405cd15967b2d367293938fb69c.tar.bz2
[multiple changes]
2009-05-06 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): Revert previous change. The context clause of a generic instance declaration must be preserved until the end of the compilation, because it may have to be installed/removed repeatedly. The latest change to sem.adb ensures that the context of both spec and body of an instance is traversed before the instance itself, making this patch redundant. 2009-05-06 Robert Dewar <dewar@adacore.com> * sem_aggr.adb: Minor code clean-up From-SVN: r147164
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/sem_aggr.adb16
-rw-r--r--gcc/ada/sem_ch12.adb15
3 files changed, 27 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 53c2fad..46eb7c1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,17 @@
+2009-05-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): Revert previous
+ change. The context clause of a generic instance declaration must be
+ preserved until the end of the compilation, because it may have to be
+ installed/removed repeatedly.
+ The latest change to sem.adb ensures that the context of both spec and
+ body of an instance is traversed before the instance itself, making
+ this patch redundant.
+
+2009-05-06 Robert Dewar <dewar@adacore.com>
+
+ * sem_aggr.adb: Minor code clean-up
+
2009-05-06 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb: Fix typo.
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 3673002..b265f73 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3077,16 +3077,14 @@ package body Sem_Aggr is
if Nkind (N) = N_Extension_Aggregate then
- -- If the ancestor part is a C++ constructor we must handle
- -- here that it is a function returning a class-wide type
+ -- If the ancestor part is a C++ constructor, then it must be a
+ -- function returning a class-wide type, so check that here.
- if Is_CPP_Constructor_Call (Ancestor_Part (N)) then
- pragma Assert
- (Is_Class_Wide_Type (Etype (Ancestor_Part (N))));
- Root_Typ := Root_Type (Etype (Ancestor_Part (N)));
- else
- Root_Typ := Base_Type (Etype (Ancestor_Part (N)));
- end if;
+ pragma Assert
+ (not Is_CPP_Constructor_Call (Ancestor_Part (N))
+ or else Is_Class_Wide_Type (Etype (Ancestor_Part (N))));
+
+ Root_Typ := Base_Type (Etype (Ancestor_Part (N)));
else
Root_Typ := Root_Type (Typ);
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 9a4f1e3..b84cf1e 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -4361,18 +4361,15 @@ package body Sem_Ch12 is
begin
-- A new compilation unit node is built for the instance declaration.
- -- Place the context of the compilation this declaration, so that it
- -- it is processed before the instance in CodePeer.
Decl_Cunit :=
Make_Compilation_Unit (Sloc (N),
- Context_Items => Context_Items (Parent (N)),
+ Context_Items => Empty_List,
Unit => Act_Decl,
Aux_Decls_Node =>
Make_Compilation_Unit_Aux (Sloc (N)));
Set_Parent_Spec (Act_Decl, Parent_Spec (N));
- Set_Context_Items (Parent (N), Empty_List);
-- The new compilation unit is linked to its body, but both share the
-- same file, so we do not set Body_Required on the new unit so as not
@@ -8790,12 +8787,12 @@ package body Sem_Ch12 is
Act_Decl : constant Node_Id := Body_Info.Act_Decl;
Inst_Node : constant Node_Id := Body_Info.Inst_Node;
Loc : constant Source_Ptr := Sloc (Inst_Node);
- Gen_Id : constant Node_Id := Name (Inst_Node);
- Gen_Unit : constant Entity_Id := Get_Generic_Entity (Inst_Node);
- Gen_Decl : constant Node_Id := Unit_Declaration_Node (Gen_Unit);
- Anon_Id : constant Entity_Id :=
+ Gen_Id : constant Node_Id := Name (Inst_Node);
+ Gen_Unit : constant Entity_Id := Get_Generic_Entity (Inst_Node);
+ Gen_Decl : constant Node_Id := Unit_Declaration_Node (Gen_Unit);
+ Anon_Id : constant Entity_Id :=
Defining_Unit_Name (Specification (Act_Decl));
- Pack_Id : constant Entity_Id :=
+ Pack_Id : constant Entity_Id :=
Defining_Unit_Name (Parent (Act_Decl));
Decls : List_Id;
Gen_Body : Node_Id;