[flang][hlfir] Emit hlfir.declare inside internal procedures
authorJean Perier <jperier@nvidia.com>
Tue, 7 Feb 2023 14:29:35 +0000 (15:29 +0100)
committerJean Perier <jperier@nvidia.com>
Tue, 7 Feb 2023 14:29:49 +0000 (15:29 +0100)
commit0fc42b38a2d907d76098cf8a30ebc5f444ea586a
tree77b65e6487538d9b013433bcc632e177933f828b
parent92e5234f696e8a1a2f3242a9d24711005b44a6fc
[flang][hlfir] Emit hlfir.declare inside internal procedures

Captured variables inside internal procedure do not go though
Fortran::lower::instantiateVar because the specification expressions
should no be lowered again, and instead, all the information must be
taken from the host link argument.

There is nothing very special to do for HLFIR, but the hlfir.declare
should be emitted for the instantiated captured variable and mapped
to the symbol.

Differential Revision: https://reviews.llvm.org/D143481
flang/lib/Lower/HostAssociations.cpp
flang/test/Lower/HLFIR/internal-procedures.f90 [new file with mode: 0644]