[all-commits] [llvm/llvm-project] 273b33: [flang] Deallocate intent(out) allocatables

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Thu Sep 8 01:16:11 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 273b3350d2700b7f2a4e367594bb4ba12e0b8e8e
      https://github.com/llvm/llvm-project/commit/273b3350d2700b7f2a4e367594bb4ba12e0b8e8e
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2022-09-08 (Thu, 08 Sep 2022)

  Changed paths:
    M flang/include/flang/Lower/Allocatable.h
    M flang/include/flang/Lower/CallInterface.h
    M flang/lib/Lower/Allocatable.cpp
    M flang/lib/Lower/CallInterface.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    A flang/test/Lower/intentout-deallocate.f90

  Log Message:
  -----------
  [flang] Deallocate intent(out) allocatables

>From Fortran 2018 standard 9.7.3.2 point 6:
When a procedure is invoked, any allocated allocatable object that is an actual
argument corresponding to an INTENT (OUT) allocatable dummy argument is
deallocated; any allocated allocatable object that is a subobject of an actual
argument corresponding to an INTENT (OUT) dummy argument is deallocated.

Deallocation is done on the callee side. For BIND(C) procedure, the deallocation
is also done on the caller side.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D133348




More information about the All-commits mailing list