[mlir][tblgen] Emit deprecation warning if `kEmitRawAttributes` is used
As discussed in https://reviews.llvm.org/D140886, emitting a warning if the old API is used may be beneficial to encourage migration to the new fold API. This reuse the existing `Deprecated` infrastructure within TableGen, and simply marks the `def` for `kEmitRawAttributesFolder` causing a use of it in a record (even if set within a base class) to emit a warning. Error message as printed in the terminal: ``` Included from C:/llvm-project/mlir/python/mlir/dialects/TensorOps.td:13: Included from C:/llvm-project/mlir/include\mlir/Dialect/Tensor/IR/TensorOps.td:12: C:/llvm-project/mlir/include\mlir/Dialect/Tensor/IR/TensorBase.td:14:5: warning: Using deprecated def `kEmitRawAttributesFolder` def Tensor_Dialect : Dialect { ^ note: '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 ``` Differential Revision: https://reviews.llvm.org/D141604
Loading
Please sign in to comment