From c1b7e9c96200a0972a64ee2d2611ea42a2088f32 Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Thu, 24 Nov 2022 20:33:15 +0100 Subject: [flang] Adapt descriptor codegen to support unlimited polymorphic entities Code generation to create and populate the descriptor (element size and type code) is based on the boxed result type. This does not work well with unlimited polymorphic entities since the fir type does not represent what is actually emboxed or reboxed. In the case of emboxing, the input type will be used to populate the descriptor element size and type code. When reboxing an unlimited polymorphic to a unlimited polymorphic entities, the element size and type code is retrieve from the input box. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D138587 --- flang/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index f0f070e..f5f7ea4 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -951,6 +951,7 @@ void CompilerInvocation::setLoweringOptions() { // Lower TRANSPOSE as a runtime call under -O0. loweringOpts.setOptimizeTranspose(codegenOpts.OptimizationLevel > 0); + loweringOpts.setPolymorphicTypeImpl(true); const LangOptions &langOptions = getLangOpts(); Fortran::common::MathOptionsBase &mathOpts = loweringOpts.getMathOptions(); -- cgit v1.1