[flang-commits] [flang] 740633f - [flang] Add TODO for derived types with final procedure

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Mon Jul 4 04:09:06 PDT 2022


Author: Valentin Clement
Date: 2022-07-04T13:05:14+02:00
New Revision: 740633ff08ff2d84d1f06088a12d9381b4c83c1b

URL: https://github.com/llvm/llvm-project/commit/740633ff08ff2d84d1f06088a12d9381b4c83c1b
DIFF: https://github.com/llvm/llvm-project/commit/740633ff08ff2d84d1f06088a12d9381b4c83c1b.diff

LOG: [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 at nvidia.com>

Added: 
    

Modified: 
    flang/lib/Lower/ConvertType.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/ConvertType.cpp b/flang/lib/Lower/ConvertType.cpp
index 783019dfdb479..0ab9d2d1b48e0 100644
--- a/flang/lib/Lower/ConvertType.cpp
+++ b/flang/lib/Lower/ConvertType.cpp
@@ -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.


        


More information about the flang-commits mailing list