[flang-commits] [flang] 85f28cf - [flang] Fixed -g compilation issues caused by #90484. (#90683)

via flang-commits flang-commits at lists.llvm.org
Tue Apr 30 16:17:48 PDT 2024


Author: Slava Zakharin
Date: 2024-04-30T16:17:45-07:00
New Revision: 85f28cf431911ca505b759c155bb62e8be7151ae

URL: https://github.com/llvm/llvm-project/commit/85f28cf431911ca505b759c155bb62e8be7151ae
DIFF: https://github.com/llvm/llvm-project/commit/85f28cf431911ca505b759c155bb62e8be7151ae.diff

LOG: [flang] Fixed -g compilation issues caused by #90484. (#90683)

Added: 
    

Modified: 
    flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp

Removed: 
    


################################################################################
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