diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -105,24 +105,40 @@ 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 getOperation()->getDialect(); + } /// Return the parent Region of this operation. - Region *getParentRegion() { return getOperation()->getParentRegion(); } + LLVM_ATTRIBUTE_DEPRECATED( + Region *getParentRegion(), + "Use Operation::getParentRegion() instead (replace '.' with '->').") { + return getOperation()->getParentRegion(); + } /// 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 getOperation()->getParentOp(); + } /// Return the closest surrounding parent operation that is of type 'OpTy'. template - OpTy getParentOfType() { + LLVM_ATTRIBUTE_DEPRECATED( + OpTy getParentOfType(), + "Use Operation::getParentOfType() instead (replace '.' with '->').") { return getOperation()->getParentOfType(); } /// Returns the closest surrounding parent operation with trait `Trait`. template