Skip to content

Commit 4435b7d

Browse files
[flang] Migrate away from PointerUnion::{is,get} (NFC) (#122585)
Note that PointerUnion::{is,get} have been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T>
1 parent 35e8989 commit 4435b7d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

flang/include/flang/Optimizer/Dialect/CUF/CUFOps.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ def cuf_KernelLaunchOp : cuf_Op<"kernel_launch", [CallOpInterface,
222222
}
223223

224224
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
225-
(*this)->setAttr(getCalleeAttrName(), callee.get<mlir::SymbolRefAttr>());
225+
(*this)->setAttr(getCalleeAttrName(),
226+
llvm::cast<mlir::SymbolRefAttr>(callee));
226227
}
227228
mlir::FunctionType getFunctionType();
228229

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,8 +2488,9 @@ def fir_CallOp : fir_Op<"call",
24882488
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
24892489
if (auto calling =
24902490
(*this)->getAttrOfType<mlir::SymbolRefAttr>(getCalleeAttrName()))
2491-
(*this)->setAttr(getCalleeAttrName(), callee.get<mlir::SymbolRefAttr>());
2492-
setOperand(0, callee.get<mlir::Value>());
2491+
(*this)->setAttr(getCalleeAttrName(),
2492+
llvm::cast<mlir::SymbolRefAttr>(callee));
2493+
setOperand(0, llvm::cast<mlir::Value>(callee));
24932494
}
24942495
}];
24952496
}

0 commit comments

Comments
 (0)