[flang-commits] [flang] [flang][debug] Support derived types. (PR #99476)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Fri Jul 26 07:35:11 PDT 2024


================
@@ -154,6 +156,56 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertBoxedSequenceType(
       dataLocation, /*rank=*/nullptr, allocated, associated);
 }
 
+mlir::LLVM::DITypeAttr DebugTypeGenerator::convertRecordType(
+    fir::RecordType Ty, mlir::LLVM::DIFileAttr fileAttr,
+    mlir::LLVM::DIScopeAttr scope, mlir::Location loc) {
+  mlir::MLIRContext *context = module.getContext();
+  auto result = fir::NameUniquer::deconstruct(Ty.getName());
+  if (result.first != fir::NameUniquer::NameKind::DERIVED_TYPE)
+    return genPlaceholderType(context);
+
+  std::optional<mlir::DataLayout> dl =
+      fir::support::getOrSetDataLayout(module, /*allowDefaultLayout=*/true);
----------------
abidh wrote:

Thanks for the suggestion. I have now updated the code to initialize `DataLayout` once and use it wherever needed.

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


More information about the flang-commits mailing list