summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:02:46 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:02:46 +0000
commitd0a5c0b420f6860b493de2f9588aa875b1409ec9 (patch)
treeb8252a5759d785b023e59a4ccb542ef6464937aa /gcc/ada/sem_ch3.ads
parent660399e545ed4e2cb46306e70b4f89ea630ab147 (diff)
downloadgcc-d0a5c0b420f6860b493de2f9588aa875b1409ec9.tar.gz
2005-11-14 Ed Schonberg <schonberg@adacore.com>
Javier Miranda <miranda@adacore.com> * sem_ch3.ads, sem_ch3.adb (Build_Discriminal): Add link to original discriminant. (Build_Private_Derived_Type): The entity of the created full view of the derived type does not come from source. If after installing the private declarations of the parent scope the parent is still private, use its full view to construct the full declaration of the derived type. (Build_Derived_Record_Type): Relax the condition that controls the execution of the check that verifies that the partial view and the full view agree in the set of implemented interfaces. In addition, this test now only takes into account the progenitors. (Derive_Interface_Subprograms): No need to derive subprograms of ancestors that are interfaces. (Derive_Subprograms): Remove formal No_Predefined_Prims and the associated code. Change name Is_Package to Is_Package_Or_Generic_Package (Complete_Subprograms_Derivation): Handle the case in which the full view is a transitive derivation of the ancestor of the partial view. (Process_Full_View): Rename local subprogram Find_Interface_In_ Descendant to Find_Ancestor_Interface to leave the code more clear. Remove wrong code that avoids the generation of an error message when the immediate ancestor of the partial view is an interface. In addition some minor reorganization of the code has been done to leave it more clear. (Analyze_Type_Declaration): If type has previous incomplete tagged partial view, inherit properly its primitive operations. (Collect_Interfaces): Make public, for analysis of formal interfaces. (Analyze_Interface_Declaration): New procedure for use for regular and formal interface declarations. (Build_Derived_Record_Type): Add support for private types to the code that checks if a tagged type implements abstract interfaces. (Check_Aliased_Component_Type): The test applies in the spec of an instance as well. (Access_Type_Declaration): Clean up declaration of malformed type declared as an access to its own classwide type, to prevent cascaded crash. (Collect_Interfaces): For private extensions and for derived task types and derived protected types, the parent may be an interface that must be included in the interface list. (Access_Definition): If the designated type is an interface that may contain tasks, create Master_Id for it before analyzing the expression of the declaration, which may be an allocator. (Record_Type_Declaration): Set properly the interface kind, for use in allocators, the creation of master id's for task interfaces, etc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107000 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch3.ads')
-rw-r--r--gcc/ada/sem_ch3.ads21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch3.ads b/gcc/ada/sem_ch3.ads
index 608666d18e6..95354d60b27 100644
--- a/gcc/ada/sem_ch3.ads
+++ b/gcc/ada/sem_ch3.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -62,6 +62,9 @@ package Sem_Ch3 is
-- Called to analyze a list of declarations (in what context ???). Also
-- performs necessary freezing actions (more description needed ???)
+ procedure Analyze_Interface_Declaration (T : Entity_Id; Def : Node_Id);
+ -- Analyze an interface declaration or a formal interface declaration
+
procedure Analyze_Per_Use_Expression (N : Node_Id; T : Entity_Id);
-- Default and per object expressions do not freeze their components,
-- and must be analyzed and resolved accordingly. The analysis is
@@ -97,6 +100,15 @@ package Sem_Ch3 is
-- rather than on the declarations that require completion in the package
-- declaration.
+ procedure Collect_Interfaces
+ (N : Node_Id;
+ Derived_Type : Entity_Id);
+ -- Ada 2005 (AI-251): Subsidiary procedure to Build_Derived_Record_Type
+ -- and Analyze_Formal_Interface_Type.
+ -- Collect the list of interfaces that are not already implemented by the
+ -- ancestors. This is the list of interfaces for which we must provide
+ -- additional tag components.
+
procedure Derive_Subprogram
(New_Subp : in out Entity_Id;
Parent_Subp : Entity_Id;
@@ -114,8 +126,7 @@ package Sem_Ch3 is
(Parent_Type : Entity_Id;
Derived_Type : Entity_Id;
Generic_Actual : Entity_Id := Empty;
- No_Predefined_Prims : Boolean := False;
- Predefined_Prims_Only : Boolean := False);
+ No_Predefined_Prims : Boolean := False);
-- To complete type derivation, collect/retrieve the primitive operations
-- of the parent type, and replace the subsidiary subtypes with the derived
-- type, to build the specs of the inherited ops. For generic actuals, the
@@ -124,9 +135,7 @@ package Sem_Ch3 is
-- the derived subprograms are aliased to those of the actual, not those of
-- the ancestor. The last two params are used in case of derivation from
-- abstract interface types: No_Predefined_Prims is used to avoid the
- -- derivation of predefined primitives from the interface, and Predefined
- -- Prims_Only is used to complete the derivation predefined primitives
- -- in case of private tagged types implementing interfaces.
+ -- derivation of predefined primitives from an abstract interface.
--
-- Note: one might expect this to be private to the package body, but
-- there is one rather unusual usage in package Exp_Dist.