From 0b05908feb0117dcfa18485a6c9df5229e32bd7a Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Thu, 25 Feb 2021 22:20:45 +0100 Subject: [PATCH] [mlir] Remove some rarely used OpState members and use Operation members instead. Skipping the deprecation dance here. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D97494 --- mlir/include/mlir/IR/BuiltinOps.td | 2 +- mlir/include/mlir/IR/OpDefinition.h | 11 ----------- mlir/lib/IR/BuiltinDialect.cpp | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/mlir/include/mlir/IR/BuiltinOps.td b/mlir/include/mlir/IR/BuiltinOps.td index 2c4d47d..163c487 100644 --- a/mlir/include/mlir/IR/BuiltinOps.td +++ b/mlir/include/mlir/IR/BuiltinOps.td @@ -85,7 +85,7 @@ def FuncOp : Builtin_Op<"func", [ static FuncOp create(Location location, StringRef name, FunctionType type, ArrayRef attrs = {}); static FuncOp create(Location location, StringRef name, FunctionType type, - iterator_range attrs); + Operation::dialect_attr_range attrs); static FuncOp create(Location location, StringRef name, FunctionType type, ArrayRef attrs, ArrayRef argAttrs); diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h index 6e380d1..8bd5bb5 100644 --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -121,7 +121,6 @@ public: /// The source location the operation was defined or derived from. Location getLoc() { return state->getLoc(); } - void setLoc(Location loc) { state->setLoc(loc); } /// Return all of the attributes on this operation. LLVM_ATTRIBUTE_DEPRECATED( @@ -130,16 +129,6 @@ public: return state->getAttrs(); } - /// A utility iterator that filters out non-dialect attributes. - using dialect_attr_iterator = Operation::dialect_attr_iterator; - using dialect_attr_range = Operation::dialect_attr_range; - - /// Set the dialect attributes for this operation, and preserve all dependent. - template - void setDialectAttrs(DialectAttrs &&attrs) { - state->setDialectAttrs(std::forward(attrs)); - } - /// Remove the attribute with the specified name if it exists. Return the /// attribute that was erased, or nullptr if there was no attribute with such /// name. diff --git a/mlir/lib/IR/BuiltinDialect.cpp b/mlir/lib/IR/BuiltinDialect.cpp index 2749c82..b19d541 100644 --- a/mlir/lib/IR/BuiltinDialect.cpp +++ b/mlir/lib/IR/BuiltinDialect.cpp @@ -90,7 +90,7 @@ FuncOp FuncOp::create(Location location, StringRef name, FunctionType type, return cast(Operation::create(state)); } FuncOp FuncOp::create(Location location, StringRef name, FunctionType type, - iterator_range attrs) { + Operation::dialect_attr_range attrs) { SmallVector attrRef(attrs); return create(location, name, type, llvm::makeArrayRef(attrRef)); } -- 2.7.4