From a8551b5f9cf959cc54c8277f3ddbd7df1842d154 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 8 Feb 2012 10:27:17 +0100 Subject: [multiple changes] 2012-02-08 Robert Dewar * a-coinve.adb, sem_util.adb, sem_ch8.adb, a-cobove.adb, a-convec.adb: Minor reformatting and code reorganization. 2012-02-08 Steve Baird * sem_cat.adb (In_Preelaborated_Unit): A child unit instantiation does not inherit preelaboration requirements from its parent. 2012-02-08 Gary Dismukes * aspects.ads (type Aspect_Id): Add Aspect_Simple_Storage_Pool. (Impl_Defined_Aspects): Add entry for Aspect_Simple_Storage_Pool. (Aspect_Argument): Add Name entry for Aspect_Simple_Storage_Pool. (Aspect_Names): Add entry for Aspect_Simple_Storage_Pool. * aspects.adb (Canonical_Aspect): Add entry for Aspect_Simple_Storage_Pool. * exp_attr.adb (Expand_N_Attribute_Reference): Handle case of Attribute_Simple_Storage_Pool in the same way as Storage_Pool (add conversion, analyze/resolve). For the Storage_Size attribute, for the simple pool case, locate and use the simple pool type's Storage_Size function (if any), otherwise evaluate to zero. * exp_ch4.adb (Expand_N_Allocator): In the case of an allocator for an access type with an associated simple storage pool, locate and use the pool type's Allocate. * exp_intr.adb (Expand_Unc_Deallocation): In the case where the access type has a simple storage pool, locate the pool type's Deallocate procedure (if present) and use it as the procedure to call on the Free operation. * freeze.adb (Freeze_Entity): In the case of a full type for a private type defined with pragma Simple_Storage_Pool, check that the full type is also appropriate for the pragma. For a simple storage pool type, validate that the operations Allocate, Deallocate (if present), and Storage_Size (if present) are defined with appropriate expected profiles. (Validate_Simple_Pool_Op_Formal): New procedure (Validate_Simple_Pool_Operation): New procedure Add with and use of Rtsfind. * par-prag.adb: Add Pragma_Simple_Storage_Pool to case statement (no action required). * sem_attr.adb (Analyze_Attribute): For the case of the Storage_Pool attribute, give a warning if the prefix type has an associated simple storage pool, and rewrite the attribute as a raise of Program_Error. In the case of the Simple_Storage_Pool attribute, check that the prefix type has an associated simple storage pool, and set the attribute type to the pool's type. * sem_ch13.adb (Analyze_Aspect_Specifications): Add Aspect_Simple_Storage_Pool case choice. (Analyze_Attribute_Definition_Clause): Add Aspect_Simple_Storage_Pool to case for Ignore_Rep_Clauses (no action). Add handling for Simple_Storage_Pool attribute definition, requiring the name to denote a simple storage pool object. (Check_Aspect_At_Freeze_Point): For a simple storage pool aspect, set the type to that of the name specified for the aspect. * sem_prag.adb (Analyze_Pragma): Add handling for pragma Simple_Storage_Pool, requiring that it applies to a library-level type declared in a package declaration that is a limited private or limited record type. * sem_res.adb (Resolve_Allocator): Flag an attempt to call a build-in-place function in an allocator for an access type with a simple storage pool as unsupported. * snames.ads-tmpl: Add Name_Simple_Storage_Pool. (type Attribute_Id): Add Attribute_Simple_Storage_Pool. (type Pragma_Id): Add Pragma_Simple_Storage_Pool. * snames.adb-tmpl (Get_Pragma_Id): Handle case of Name_Simple_Storage_Pool. (Is_Pragma_Name): Return True for Name_Simple_Storage_Pool. 2012-02-08 Cyrille Comar * projects.texi: Clarify doc for interfaces. From-SVN: r183997 --- gcc/ada/sem_res.adb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gcc/ada/sem_res.adb') diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 0fecd5b..7c8de23 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -4228,6 +4228,31 @@ package body Sem_Res is Wrong_Type (Expression (E), Etype (E)); end if; + -- Calls to build-in-place functions are not currently supported in + -- allocators for access types associated with a simple storage pool. + -- Supporting such allocators may require passing additional implicit + -- parameters to build-in-place functions (or a significant revision + -- of the current b-i-p implementation to unify the handling for + -- multiple kinds of storage pools). ??? + + if Is_Immutably_Limited_Type (Desig_T) + and then Nkind (Expression (E)) = N_Function_Call + then + declare + Pool : constant Entity_Id + := Associated_Storage_Pool (Root_Type (Typ)); + begin + if Present (Pool) + and then Present (Get_Rep_Pragma + (Etype (Pool), Name_Simple_Storage_Pool)) + then + Error_Msg_N + ("limited function calls not yet supported in simple " & + "storage pool allocators", Expression (E)); + end if; + end; + end if; + -- A special accessibility check is needed for allocators that -- constrain access discriminants. The level of the type of the -- expression used to constrain an access discriminant cannot be -- cgit v1.1