diff options
| author | Slava Zakharin <szakharin@nvidia.com> | 2023-05-23 09:10:26 -0700 |
|---|---|---|
| committer | Slava Zakharin <szakharin@nvidia.com> | 2023-05-23 09:35:17 -0700 |
| commit | da60b9e7dc6b217ecd8f422a71ee3aa4a4022015 (patch) | |
| tree | c07aec338c0393dcfb147b1aac286db63504debb /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 4811270bac0e57ab8f5baf27eb280012817bdfe5 (diff) | |
[flang] Fixed managing copy-in/copy-out temps.
There are several observations regarding the copy-in/copy-out:
* Actual argument associated with INTENT(OUT) dummy argument that
requires finalization (7.5.6.3 p. 7) may be read by the finalization
function, so a copy-in is required.
* A temporary created for the copy-in/copy-out must be destroyed
without finalization after the call (or after the corresponding copy-out),
otherwise, memory leaks may occur.
* The copy-out assignment must not perform finalization for the LHS.
* The copy-out assignment from the temporary to the actual argument
may or may not need to initialize the LHS.
This change-set introduces new runtime methods: CopyOutAssign and
DestroyWithoutFinalization. They are called by the compiler generated
code to match the behavior described above.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D151135
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions
