[flang-commits] [flang] [flang][debug] Add support for fixed size arrays. (PR #92568)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Sat May 18 07:38:37 PDT 2024


================
@@ -37,6 +37,44 @@ static mlir::LLVM::DITypeAttr genPlaceholderType(mlir::MLIRContext *context) {
                       llvm::dwarf::DW_ATE_signed);
 }
 
+mlir::LLVM::DITypeAttr DebugTypeGenerator::convertSequenceType(
+    fir::SequenceType seqTy, mlir::LLVM::DIFileAttr fileAttr,
+    mlir::LLVM::DIScopeAttr scope, mlir::Location loc) {
+
+  mlir::MLIRContext *context = module.getContext();
+  // FIXME: Only fixed sizes arrays handled at the moment.
+  if (seqTy.hasDynamicExtents())
+    return genPlaceholderType(context);
+
+  llvm::SmallVector<mlir::LLVM::DINodeAttr> elements;
+  auto elemTy = convertType(seqTy.getEleTy(), fileAttr, scope, loc);
+
+  for (auto dim : seqTy.getShape()) {
----------------
kiranchandramohan wrote:

Nit: Could you name the type for these two variables?

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


More information about the flang-commits mailing list