From e4273c488f957bc60961ddd476adf7a71dc254a7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 15 Apr 2025 02:56:40 -0700 Subject: [PATCH] [mlir] Migrate away from PointerUnion::dyn_cast (NFC) Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa, cast and the llvm::dyn_cast Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we have a call to dyn_cast earlier in the function, implying that attrOrProp is nonnull. --- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp index 2431807ce463d..edcb2f507ae50 100644 --- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -1828,7 +1828,7 @@ void OpEmitter::genPropertiesSupportForBytecode( name, tgfmt(namedProperty->prop.getWriteToMlirBytecodeCall(), &fctx)); continue; } - const auto *namedAttr = attrOrProp.dyn_cast(); + const auto *namedAttr = dyn_cast(attrOrProp); StringRef name = namedAttr->attrName; if (namedAttr->isRequired) { readPropertiesMethod << formatv(R"(