[flang] Add TODO for derived types with final procedure

Finalization is F2003 and although the runtime supports it already,
lowering is not ensuring all the derived type are finalized properly
when they should. This will require surveying the places where lowering
needs to call it. Add a hard TODO for now.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
This commit is contained in:
Valentin Clement 2022-07-04 12:56:47 +02:00
parent bf89d24f53
commit 740633ff08
No known key found for this signature in database
GPG Key ID: 086D54783C928776
1 changed files with 4 additions and 0 deletions

View File

@ -288,6 +288,10 @@ struct TypeBuilder {
const Fortran::semantics::Symbol &typeSymbol = tySpec.typeSymbol();
if (mlir::Type ty = getTypeIfDerivedAlreadyInConstruction(typeSymbol))
return ty;
if (Fortran::semantics::IsFinalizable(tySpec))
TODO(converter.genLocation(tySpec.name()), "derived type finalization");
auto rec = fir::RecordType::get(context,
Fortran::lower::mangle::mangleName(tySpec));
// Maintain the stack of types for recursive references.