fortran: Add a setter for the token field of array descriptors
Adds a setter function for the token field in Fortran array descriptors, crucial for coarray support.
A new setter function, gfc_conv_descriptor_token_set, has been added to manage the token field within Fortran array descriptors. Unlike other fields, the token field’s address is directly used by library functions for coarray implementation, making this setter essential for correctly initializing and modifying it.
In Details
This commit introduces gfc_conv_descriptor_token_set in trans-descriptor.cc and its declaration in trans-descriptor.h. This function is specifically designed to set the token field of Fortran array descriptors. The token field is unique because it often holds a pointer that is passed directly to runtime library functions, particularly for implementing the coarray Fortran language feature. This change ensures proper handling of this critical field.
- coarray
- A Fortran language feature that provides support for parallel programming by allowing images (processes) to communicate directly through special array-like variables called coarrays.
- token field
- A specific field within a Fortran array descriptor that can be used to identify or manage the array, particularly relevant for coarray support where it may hold a pointer to runtime communication information.
- array descriptor
- A data structure used in Fortran to describe the properties of an array, such as its base address, dimensions, and data type. It allows for dynamic array sizing and passing arrays by reference.