[flang-commits] [flang] [flang][debug] Support complex types. (PR #92559)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Mon May 20 03:51:53 PDT 2024
================
@@ -57,6 +57,16 @@ DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr,
mlir::StringAttr::get(context, logTy.getMnemonic()),
kindMapping.getLogicalBitsize(logTy.getFKind()),
llvm::dwarf::DW_ATE_boolean);
+ } else if (fir::isa_complex(Ty)) {
+ unsigned bitWidth;
+ if (auto cplxTy = mlir::dyn_cast_or_null<mlir::ComplexType>(Ty)) {
+ auto floatTy = mlir::cast<mlir::FloatType>(cplxTy.getElementType());
+ bitWidth = floatTy.getWidth();
+ } else if (auto cplxTy = mlir::dyn_cast_or_null<fir::ComplexType>(Ty))
----------------
tblah wrote:
nit: I think this would be clearer to read if you used braces on the else if branch to match the if branch. There is a similar example advocating braces here https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
https://github.com/llvm/llvm-project/pull/92559
More information about the flang-commits
mailing list