[flang] Initial support of allocate statement with source
authorPeixin Qiao <qiaopeixin@huawei.com>
Fri, 13 Jan 2023 12:40:51 +0000 (20:40 +0800)
committerPeixin Qiao <qiaopeixin@huawei.com>
Fri, 13 Jan 2023 12:40:51 +0000 (20:40 +0800)
commit8c77c011c193eba6f0c45cbf5cba6ea7d6a147fe
treef5d45f26ce3795215efca098b92a2b2ded618dd1
parent6f9ff1beee9d12aca0c9caa9ae0051dc6d0a718c
[flang] Initial support of allocate statement with source

Support allocate statement with source in runtime version. The source
expression is evaluated only once for each allocate statement. When the
source expression has shape-spec, uses it for bounds. Otherwise, get
the bounds from the source expression. Get the length if the source
expression has deferred length parameter.

Reviewed By: clementval, jeanPerier

Differential Revision: https://reviews.llvm.org/D137812
flang/include/flang/Runtime/assign.h
flang/lib/Lower/Allocatable.cpp
flang/runtime/allocatable.cpp
flang/runtime/assign.cpp
flang/runtime/assign.h [new file with mode: 0644]
flang/runtime/pointer.cpp
flang/test/Lower/allocate-source-allocatables.f90 [new file with mode: 0644]
flang/test/Lower/allocate-source-pointers.f90 [new file with mode: 0644]