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,26 +105,32 @@ 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