diff options
author | peter klausler <pklausler@nvidia.com> | 2021-05-20 20:37:03 +0300 |
---|---|---|
committer | peter klausler <pklausler@nvidia.com> | 2021-05-20 23:22:01 +0300 |
commit | c1db35f0c232a8672d44f2531d178d4da35b5b3c (patch) | |
tree | 43763693504fa14cdd8035e155f2ee07e582526b /flang/module | |
parent | e3cf7c88c472aff8ca6c8a07ef8c6513f581c67a (diff) |
[flang] Implement more transformational intrinsic functions in runtime
Define APIs, naively implement, and add basic sanity unit tests for
the transformational intrinsic functions CSHIFT, EOSHIFT, PACK,
SPREAD, TRANSPOSE, and UNPACK. These are the remaining transformational
intrinsic functions that rearrange data without regard to type
(except for default boundary values in EOSHIFT); RESHAPE was already
in place as a stress test for the runtime's descriptor handling
facilities.
Code is in place to create copies of allocatable/automatic
components when transforming arrays of derived type, but it won't
do anything until we have derived type information being passed to the
runtime from the frontend.
Differential Revision: https://reviews.llvm.org/D102857
Diffstat (limited to 'flang/module')
-rw-r--r-- | flang/module/__fortran_type_info.f90 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/flang/module/__fortran_type_info.f90 b/flang/module/__fortran_type_info.f90 index 6fce352c162e..c2a9ed16e10b 100644 --- a/flang/module/__fortran_type_info.f90 +++ b/flang/module/__fortran_type_info.f90 @@ -30,7 +30,7 @@ module __Fortran_type_info ! applied, appear in the initial entries in the same order as they ! appear in the parent type's bindings, if any. They are followed ! by new local bindings in alphabetic order of theing binding names. - type(Binding), pointer :: binding(:) + type(Binding), pointer, contiguous :: binding(:) character(len=:), pointer :: name integer(kind=int64) :: sizeInBytes type(DerivedType), pointer :: parent @@ -38,14 +38,14 @@ module __Fortran_type_info ! component to point to the pristine original definition. type(DerivedType), pointer :: uninstantiated integer(kind=int64) :: typeHash - integer(kind=int64), pointer :: kindParameter(:) ! values of instance - integer(1), pointer :: lenParameterKind(:) ! INTEGER kinds of LEN types + integer(kind=int64), pointer, contiguous :: kindParameter(:) ! values of instance + integer(1), pointer, contiguous :: lenParameterKind(:) ! INTEGER kinds of LEN types ! Data components appear in alphabetic order. ! The parent component, if any, appears explicitly. - type(Component), pointer :: component(:) ! data components - type(ProcPtrComponent), pointer :: procptr(:) ! procedure pointers + type(Component), pointer, contiguous :: component(:) ! data components + type(ProcPtrComponent), pointer, contiguous :: procptr(:) ! procedure pointers ! Special bindings of the ancestral types are not duplicated here. - type(SpecialBinding), pointer :: special(:) + type(SpecialBinding), pointer, contiguous :: special(:) end type type :: Binding @@ -86,8 +86,8 @@ module __Fortran_type_info integer(kind=int64) :: offset type(Value) :: characterLen ! for category == Character type(DerivedType), pointer :: derived ! for category == Derived - type(Value), pointer :: lenValue(:) ! (SIZE(derived%lenParameterKind)) - type(Value), pointer :: bounds(:, :) ! (2, rank): lower, upper + type(Value), pointer, contiguous :: lenValue(:) ! (SIZE(derived%lenParameterKind)) + type(Value), pointer, contiguous :: bounds(:, :) ! (2, rank): lower, upper type(__builtin_c_ptr) :: initialization end type |