[flang-commits] [flang] 52cb953 - [flang] Update calls to isa/dyn_cast/dyn_cast_or_null
Kazu Hirata via flang-commits
flang-commits at lists.llvm.org
Tue Apr 30 12:06:25 PDT 2024
Author: Kazu Hirata
Date: 2024-04-30T12:06:18-07:00
New Revision: 52cb9537896992e0fa689c45469bccb36970c0c7
URL: https://github.com/llvm/llvm-project/commit/52cb9537896992e0fa689c45469bccb36970c0c7
DIFF: https://github.com/llvm/llvm-project/commit/52cb9537896992e0fa689c45469bccb36970c0c7.diff
LOG: [flang] Update calls to isa/dyn_cast/dyn_cast_or_null
Added:
Modified:
flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp b/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
index 5108469cb6c84a..908c8fc96f633e 100644
--- a/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+++ b/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
@@ -145,7 +145,7 @@ void AddDebugInfoPass::runOnOperation() {
subprogramFlags | mlir::LLVM::DISubprogramFlags::Definition;
}
unsigned line = 1;
- if (auto funcLoc = l.dyn_cast<mlir::FileLineColLoc>())
+ if (auto funcLoc = mlir::dyn_cast<mlir::FileLineColLoc>(l))
line = funcLoc.getLine();
auto spAttr = mlir::LLVM::DISubprogramAttr::get(
diff --git a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
index 0f4ebf9507b124..227dc978897de7 100644
--- a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
+++ b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
@@ -45,10 +45,10 @@ 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 (Ty.isa<mlir::FloatType>() || Ty.isa<fir::RealType>()) {
+ } else if (mlir::isa<mlir::FloatType>(Ty) || mlir::isa<fir::RealType>(Ty)) {
return genBasicType(context, mlir::StringAttr::get(context, "real"),
Ty.getIntOrFloatBitWidth(), llvm::dwarf::DW_ATE_float);
- } else if (auto logTy = Ty.dyn_cast_or_null<fir::LogicalType>()) {
+ } else if (auto logTy = mlir::dyn_cast_or_null<fir::LogicalType>(Ty)) {
return genBasicType(context,
mlir::StringAttr::get(context, logTy.getMnemonic()),
kindMapping.getLogicalBitsize(logTy.getFKind()),
More information about the flang-commits
mailing list