aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2024-07-17 15:21:01 -0700
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-11-04 16:57:58 +0100
commit0935f20b635c6b27b0fb56dcd3aecf4e39f872d6 (patch)
tree4d260816b424f9c4301d85293c7c1ace5b1c0de4 /gcc/fortran
parent19367d7d8fb94f4157f6c1406473de7cff5ca149 (diff)
downloadgcc-0935f20b635c6b27b0fb56dcd3aecf4e39f872d6.zip
gcc-0935f20b635c6b27b0fb56dcd3aecf4e39f872d6.tar.gz
gcc-0935f20b635c6b27b0fb56dcd3aecf4e39f872d6.tar.bz2
ada: Initial implementation of Extended_Access aspect (FE portion only)
The Extended_Access aspect can be specified to be True for certain access-to-unconstrained-array-subtype types. Such extended access types can designate objects that a normal general access type (with the same designated subtype) cannot, such as a slice of an aliased array object or an object that is represented without contiguous bounds information. gcc/ada/ChangeLog: * aspects.ads: Add Aspect_Extended_Access to Aspect_Id enumeration. * par-prag.adb: Add Pragma_Extended_Access to list of pragmas that get no interesting processing in the parser. * sem_attr.adb: Relax legality checks on Access/Unchecked_Access attribute references if access type is Extended_Access. * sem_ch12.adb (Validate_Access_Type_Instance): For an instance of a generic with a formal access type, check that formal and actual agree with with respect to Extended_Access aspect. * sem_prag.adb (Analyze_Pragma): Add analysis code for pragma Extended_Access. Set Pragma_Extended_Access element in Sig_Flags aggregate. * sem_prag.ads: Set Pragma_Extended_Access element in Aspect_Specifying_Pragma aggregate. * sem_res.adb (Valid_Conversion): Disallow extended-to-not-extended access conversion. * sem_util.adb (Is_Extended_Access_Access_Type): Implement new function. (Is_Aliased_View): If (and only if) the new Boolean For_Extended parameter is True, then a slice of an aliased non-bitpacked array is aliased, a constrained nominal subtype does not force a result of False, and a dereference of an extended access value is aliased. The last point is somewhat subtle. This is how we prevent covert fat-to-nonfat type conversions via things like "Not_Extended_Type'(Extended_Ptr.all'Access)" or passing Extended_Ptr.all as an actual parameter corresponding to an explicitly aliased formal parameter. * sem_util.ads (Is_Extended_Access_Type): Declare new function. (Is_Aliased_View): Add new defaults-False parameter For_Extended. * snames.ads-tmpl: Declare Name_Extended_Access Name_Id constant and Pragma_Extended_Access Pragma_Id enumeration literal.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions