diff --git a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp index 3f77547b91ae..555f354521c9 100644 --- a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp +++ b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp @@ -258,21 +258,6 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertBoxedSequenceType( dataLocation, /*rank=*/nullptr, allocated, associated); } -// If the type is a pointer or array type then gets its underlying type. -static mlir::LLVM::DITypeAttr getUnderlyingType(mlir::LLVM::DITypeAttr Ty) { - if (auto ptrTy = - mlir::dyn_cast_if_present(Ty)) { - if (ptrTy.getTag() == llvm::dwarf::DW_TAG_pointer_type) - Ty = getUnderlyingType(ptrTy.getBaseType()); - } - if (auto comTy = - mlir::dyn_cast_if_present(Ty)) { - if (comTy.getTag() == llvm::dwarf::DW_TAG_array_type) - Ty = getUnderlyingType(comTy.getBaseType()); - } - return Ty; -} - std::pair DebugTypeGenerator::getFieldSizeAndAlign(mlir::Type fieldTy) { mlir::Type llvmTy;