From c3529a5b0806843e75f0b6d9a83bb36de70b5ae6 Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Thu, 7 Jan 2021 07:52:37 +0100 Subject: [PATCH] [mlir] Mark methods from mlir::OpState that just forward to mlir::Operation as deprecated. The functions will be removed by January 20th. All call sites within MLIR have been converted in previous changes. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D94191 --- mlir/include/mlir/IR/OpDefinition.h | 83 ++++++++++++++++++++++++------------- mlir/lib/IR/Operation.cpp | 24 +++++++++++ 2 files changed, 79 insertions(+), 28 deletions(-) diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h index 11dc4b77b67..e698ced314a 100644 --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -105,26 +105,32 @@ public: Operation *getOperation() { return state; } /// Return the dialect that this refers to. - Dialect *getDialect() { return getOperation()->getDialect(); } + LLVM_ATTRIBUTE_DEPRECATED( + Dialect *getDialect(), + "Use Operation::getDialect() instead (replace '.' with '->')."); /// Return the parent Region of this operation. - Region *getParentRegion() { return getOperation()->getParentRegion(); } + LLVM_ATTRIBUTE_DEPRECATED( + Region *getParentRegion(), + "Use Operation::getParentRegion() instead (replace '.' with '->')."); /// Returns the closest surrounding operation that contains this operation /// or nullptr if this is a top-level operation. - Operation *getParentOp() { return getOperation()->getParentOp(); } + LLVM_ATTRIBUTE_DEPRECATED( + Operation *getParentOp(), + "Use Operation::getParentOp() instead (replace '.' with '->')."); /// Return the closest surrounding parent operation that is of type 'OpTy'. template - OpTy getParentOfType() { - return getOperation()->getParentOfType(); - } + LLVM_ATTRIBUTE_DEPRECATED( + OpTy getParentOfType(), + "Use Operation::getParentOfType() instead (replace '.' with '->')."); /// Returns the closest surrounding parent operation with trait `Trait`. template