Fortran: Scalar descriptor type creation moved to a public function
Fortran scalar descriptor type creation logic moved to a public function for broader use.
The get_scalar_to_descriptor_type function, responsible for creating the type for scalar array descriptors, has been moved from trans-expr.cc to trans-types.cc and declared in trans-types.h. This change, addressing PR122521, makes the function publicly available for use in other parts of the Fortran front-end.
In Details
The Fortran front-end moves the gfc_get_scalar_to_descriptor_type function (formerly get_scalar_to_descriptor_type) to trans-types.cc and declares it in trans-types.h. This makes the type creation logic for scalar descriptors accessible to callers like gfc_conv_scalar_to_descriptor, gfc_conv_derived_to_class, and gfc_conv_class_to_class, supporting refactoring efforts related to PR122521.
- scalar descriptor
- A specific type of array descriptor used in Fortran to represent a scalar value as if it were an array of one element.
- array descriptor
- A data structure used in Fortran to represent an array, containing information about its base address, dimensions, strides, and other properties.
- trans-expr.cc
- A GCC source file containing code for translating Fortran expressions into intermediate representation.
- trans-types.cc
- A GCC source file responsible for handling type-related operations in the Fortran front-end.
- trans-types.h
- The header file declaring functions and data structures related to type handling in the Fortran front-end.