Skip to content

Commit

Permalink
[flang] Update calls to isa/dyn_cast/dyn_cast_or_null
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Apr 30, 2024
1 parent 7cbaaed commit 52cb953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 52cb953

Please sign in to comment.