[flang-commits] [flang] [flang] Retrieve shape from selector when generating assoc sym type (PR #137117)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Wed Apr 30 00:53:13 PDT 2025


================
@@ -279,6 +279,23 @@ struct TypeBuilderImpl {
     bool isPolymorphic = (Fortran::semantics::IsPolymorphic(symbol) ||
                           Fortran::semantics::IsUnlimitedPolymorphic(symbol)) &&
                          !Fortran::semantics::IsAssumedType(symbol);
+    if (const auto *assocDetails =
----------------
ergawy wrote:

Thanks for the review and sorry for the late respond, was busy other stuff. This is because it calls `Symbol::GetShape` and `Symbol::GetShape` returns the shape only in the case of `ObjectEntityDetails`. For `AssocEntityDetails` (and other variants), it returns null. See https://github.com/llvm/llvm-project/blob/main/flang/lib/Semantics/symbol.cpp#L401.

Do you think we should extend `GetShape` to work with `AssocEntityDetails` as well instead of what I am doing here?

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


More information about the flang-commits mailing list