[flang-commits] [flang] [flang] Fixed -g compilations caused by #90484. (PR #90683)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Tue Apr 30 16:07:12 PDT 2024


https://github.com/vzakhari created https://github.com/llvm/llvm-project/pull/90683

None

>From f807005f5ca18697363d3cb64ff1dca877e47524 Mon Sep 17 00:00:00 2001
From: Slava Zakharin <szakharin at nvidia.com>
Date: Tue, 30 Apr 2024 16:05:44 -0700
Subject: [PATCH] [flang] Fixed -g compilations caused by #90484.

---
 flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
index 227dc978897de7..e5b4050dfb2426 100644
--- a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
+++ b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
@@ -45,9 +45,13 @@ DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr,
   if (Ty.isInteger()) {
     return genBasicType(context, mlir::StringAttr::get(context, "integer"),
                         Ty.getIntOrFloatBitWidth(), llvm::dwarf::DW_ATE_signed);
-  } else if (mlir::isa<mlir::FloatType>(Ty) || mlir::isa<fir::RealType>(Ty)) {
+  } else if (mlir::isa<mlir::FloatType>(Ty)) {
     return genBasicType(context, mlir::StringAttr::get(context, "real"),
                         Ty.getIntOrFloatBitWidth(), llvm::dwarf::DW_ATE_float);
+  } else if (auto realTy = mlir::dyn_cast_or_null<fir::RealType>(Ty)) {
+    return genBasicType(context, mlir::StringAttr::get(context, "real"),
+                        kindMapping.getRealBitsize(realTy.getFKind()),
+                        llvm::dwarf::DW_ATE_float);
   } else if (auto logTy = mlir::dyn_cast_or_null<fir::LogicalType>(Ty)) {
     return genBasicType(context,
                         mlir::StringAttr::get(context, logTy.getMnemonic()),



More information about the flang-commits mailing list