Index: mlir/include/mlir/TableGen/Dialect.h =================================================================== --- mlir/include/mlir/TableGen/Dialect.h +++ mlir/include/mlir/TableGen/Dialect.h @@ -107,6 +107,8 @@ // Returns whether the dialect is defined. explicit operator bool() const { return def != nullptr; } + const llvm::Record &getDef() const { return *def; } + private: const llvm::Record *def; std::vector dependentDialects; Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp =================================================================== --- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -2330,6 +2330,20 @@ return; Dialect::FolderAPI folderApi = op.getDialect().getFolderAPI(); + if (folderApi == Dialect::FolderAPI::RawAttributes) { + static bool emitted = false; + if (!emitted) { + emitted = true; + llvm::PrintWarning(op.getDialect().getDef().getLoc(), + "'useFoldAPI' of 'kEmitRawAttributesFolder' (default) " + "has been deprecated and is pending removal. Please " + "switch to 'kEmitFoldAdaptorFolder'. See " + "https://discourse.llvm.org/t/" + "psa-new-improved-fold-method-signature-has-landed-" + "please-update-your-downstream-projects/67618"); + } + } + SmallVector paramList; if (folderApi == Dialect::FolderAPI::RawAttributes) paramList.emplace_back("::llvm::ArrayRef<::mlir::Attribute>", "operands");