[flang-commits] [flang] [flang][debug] Support derived type components with box types. (PR #109424)

via flang-commits flang-commits at lists.llvm.org
Mon Sep 23 07:51:13 PDT 2024


================
@@ -13,6 +13,9 @@
 #include "flang/Optimizer/Dialect/FIRType.h"
 #include "flang/ISO_Fortran_binding_wrapper.h"
 #include "flang/Optimizer/Builder/Todo.h"
+#include "flang/Optimizer/CodeGen/DescriptorModel.h"
+#include "flang/Optimizer/CodeGen/DescriptorOffsets.h"
+#include "flang/Optimizer/CodeGen/TypeConverter.h"
----------------
jeanPerier wrote:

So far I was rather against handling fir.box<> into `getTypeSizeAndAlignment` because to me it is meant to be an abstract type as much possible (could be implemented as a CFI descriptor, or some descriptor compatible with existing compilers if we wanted). Instead, I was more in favor of translating type to LLVM and using `getTypeSizeAndAlignment` at that level. That way, the codegen of abstract FIR types is centralized in the type codegen and needs not to be spilled in other places.

Now I understand this is inconvenient given there are several places that needs to know about the size at different stage of the compilation.

But as far as debugging is concerned, I would still be in favor of calling translating types to LLVM and calling `getTypeSizeAndAlignment` with that.

Otherwise, we at least need to centralize all low level descriptor related tools in some flang/Optimizer/Dialect/Support/DescriptorModel.h file. The Dialect library should not depend upon Codegen.

https://github.com/llvm/llvm-project/pull/109424


More information about the flang-commits mailing list