[flang-commits] [flang] [flang][debug] Support ClassType. (PR #114809)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Wed Nov 13 13:28:20 PST 2024


================
@@ -628,8 +633,13 @@ DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr,
     return genBasicType(context, mlir::StringAttr::get(context, "integer"),
                         llvmTypeConverter.getIndexTypeBitwidth(),
                         llvm::dwarf::DW_ATE_signed);
-  } else if (auto boxTy = mlir::dyn_cast_or_null<fir::BoxType>(Ty)) {
-    auto elTy = boxTy.getElementType();
+  } else if (auto boxTy = mlir::dyn_cast_or_null<fir::BaseBoxType>(Ty)) {
+    if (mlir::isa<fir::ClassType>(Ty))
+      return convertPointerLikeType(boxTy.unwrapInnerType(), fileAttr, scope,
+                                    declOp, /*genAllocated=*/false,
+                                    /*genAssociated=*/true);
----------------
abidh wrote:

I have changed the code so that `ClassType` is handled like any other `BaseBoxType`. As its underlying type can be a `RecordType` which was not being handled inside that if, I modified the default inside that if to be a pointer to underlying type instead of a place holder type.

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


More information about the flang-commits mailing list