[flang][runtime] Ensure PointerDeallocate actually deallocate pointers
authorJean Perier <jperier@nvidia.com>
Mon, 28 Mar 2022 08:21:36 +0000 (10:21 +0200)
committerJean Perier <jperier@nvidia.com>
Mon, 28 Mar 2022 08:22:08 +0000 (10:22 +0200)
commit479eed18503d1cf17fe9c0348cdb5f2968bc9969
tree6022734413999285da0b7e366e5653d9b6ae16f9
parentc0eb9b4cdef6049ebabb4018d3c9dcb0dc699868
[flang][runtime] Ensure PointerDeallocate actually deallocate pointers

PointerDeallocate was silently doing nothing because it relied on
Destroy that doe not do anything for Pointers. Add an option to Destroy
in order to destroy pointers.

Add a unit test for PointerDeallocate.

Differential Revision: https://reviews.llvm.org/D122492
flang/include/flang/Runtime/descriptor.h
flang/runtime/descriptor.cpp
flang/runtime/pointer.cpp
flang/unittests/Runtime/CMakeLists.txt
flang/unittests/Runtime/Pointer.cpp [new file with mode: 0644]