[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
================
@@ -1455,6 +1458,31 @@ fir::getTypeSizeAndAlignment(mlir::Location loc, mlir::Type ty,
compSize *= character.getLen();
return std::pair{compSize, compAlign};
}
+ if (auto boxTy = mlir::dyn_cast<fir::BoxType>(ty)) {
+ mlir::MLIRContext *context = boxTy.getContext();
+ mlir::Type ptrType = getDescFieldTypeModel<kAddrPosInBox>()(context);
+ mlir::Type dimsType = getDescFieldTypeModel<kDimsPosInBox>()(context);
+ std::uint64_t size =
+ getDescComponentOffset<kDimsPosInBox>(dl, context, dimsType);
+ unsigned rank = getBoxRank(ty);
----------------
jeanPerier wrote:
What about assumed-ranks, the descriptor size is not a compile time constant? They cannot be used as derived type components, but this generic helper would need to handle them or bail correctly.
https://github.com/llvm/llvm-project/pull/109424
More information about the flang-commits
mailing list