This set of changes implements the GNAT front end's support for the new aspects Storage_Model_Type and Designated_Storage_Model. It also defines a set of functions intended to provide an interface for back ends to call to retrieve operations and other entities associated with types that specify the new aspects.
Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * aspects.ads (type Aspect_Id): Add Aspect_Designated_Storage_Model and Aspect_Storage_Model_Type. (Aspect_Argument): Add associations for the above new aspects. (Is_Representation_Aspect): Likewise. (Aspect_Names, Aspect_Delay): Likewise. * exp_ch4.adb (Expand_N_Allocator): Call Find_Storage_Op rather than Find_Prim_Op. * exp_intr.adb (Expand_Unc_Deallocation): Likewise. * exp_util.ads (Find_Storage_Op): New function that locates either a primitive operation of a storage pool or an operation of a storage-model type specified in its Storage_Model_Type aspect. * exp_util.adb (Find_Storage_Op): New function that calls either Find_Prim_Op or Get_Storage_Model_Type_Entity to locate a storage-related operation that is associated with a type. * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Analyzes, resolves, and validates the arguments of aspect Designated_Storage_Model_Type. (Analyze_Aspect_Specifications): Sets delay-related flags on storage-model aspects when Delay_Required. Checks that aspect Designated_Storage_Model is only specified for an access type and that aspect Storage_Model_Type is only specified on an immutably limited type. Also records such aspects for their associated types. (Check_Aspect_At_Freeze_Point): Resolve each of the argument associations given for a Storage_Model_Type aspect. (Resolve_Storage_Model_Type_Argument): New procedure that resolves an argument given in the association for a given entity name associated with a type with aspect Storage_Model_Type, ensuring that it has the proper kind or profile. (Validate_Storage_Model_Type_Aspect): New procedure that checks the legality and completeness of the entity associations given in a Storage_Model_Type aspect. * sem_util.ads (package Storage_Model_Support): New nested package that encapsulates a set of convenient utility functions for retrieving entities, etc. associated with storage-model-related types and objects. (Get_Storage_Model_Type_Entity): New function to return a specified entity associated with a type that has aspect Storage_Model_Type. (Has_Designated_Storage_Model_Aspect): New function that returns whether a type has aspect Designated_Storage_Model. (Has_Storage_Model_Type_Aspect): New function that returns whether a type has aspect Storage_Model_Type. (Storage_Model_Object): New function that returns the object Entity_Id associated with a type's Designated_Storage_Model aspect. (Storage_Model_Type): New function that returns the type associated with a storage-model object (when the object's type specifies Storage_Model_Type). (Storage_Model_Address_Type): New function that returns the Address_Type associated with a type that has aspect Storage_Model_Type. (Storage_Model_Null_Address): New function that returns the Null_Address constant associated with a type that has aspect Storage_Model_Type. (Storage_Model_Allocate): New function that returns the Allocate procedure associated with a type that has aspect Storage_Model_Type. (Storage_Model_Deallocate): New function that returns the Deallocate procedure associated with a type that has aspect Storage_Model_Type. (Storage_Model_Copy_From): New function that returns the Copy_From procedure associated with a type that has aspect Storage_Model_Type. (Storage_Model_Copy_To): New function that returns the Copy_To procedure associated with a type that has aspect Storage_Model_Type. (Storage_Model_Storage_Size): New function that returns the Storage_Size function associated with a type that has aspect Storage_Model_Type. * sem_util.adb (package Storage_Model_Support): Body of new nested package that contains the implementations the utility functions declared in the spec of this package. * snames.ads-tmpl: Add new names Name_Designated_Storage_Pool, Name_Storage_Model, Name_Storage_Model_Type, Name_Address_Type, Name_Copy_From, Name_Copy_To, and Name_Null_Address for the new aspects and associated aspect arguments.
patch.diff.gz
Description: application/gzip