[all-commits] [llvm/llvm-project] 2b2d79: [flang][runtime] Establish derived type desc prope...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu Sep 28 14:06:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b2d79fbdf4a69061136ded875ec18b057ba7b2f
      https://github.com/llvm/llvm-project/commit/2b2d79fbdf4a69061136ded875ec18b057ba7b2f
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-09-28 (Thu, 28 Sep 2023)

  Changed paths:
    M flang/include/flang/Runtime/descriptor.h
    M flang/runtime/descriptor.cpp

  Log Message:
  -----------
  [flang][runtime] Establish derived type desc properly. (#67623)

Example:
```
module types
  type t
     real,allocatable :: c
  end type t
contains
  function h(x)
    class(t),allocatable :: h
    ...
  end function h
  subroutine test
    type(t),allocatable :: b(:)
    allocate(b(2),source=h(2.5))
  end subroutine test7
end module type
```

`DoFromSourceAssign` creates two descriptors for initializing
`b(1)` and `b(2)` from the result of `h`. This Create call
creates a descriptor without properly initialized addendum,
so the Assign just does shallow copies of the descriptor
representing result of `h` into `b(1)` and `b(2)`.

I modified Create code to properly establish the descriptor
for derived type case.

I had to keep the `addendum` argument to keep the testing
in `flang/unittests/Runtime/TemporaryStack.cpp`.




More information about the All-commits mailing list