[Mlir-commits] [mlir] 0b05908 - [mlir] Remove some rarely used OpState members and use Operation members instead.

Christian Sigg llvmlistbot at llvm.org
Thu Feb 25 23:37:20 PST 2021


Author: Christian Sigg
Date: 2021-02-26T08:37:11+01:00
New Revision: 0b05908feb0117dcfa18485a6c9df5229e32bd7a

URL: https://github.com/llvm/llvm-project/commit/0b05908feb0117dcfa18485a6c9df5229e32bd7a
DIFF: https://github.com/llvm/llvm-project/commit/0b05908feb0117dcfa18485a6c9df5229e32bd7a.diff

LOG: [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

Added: 
    

Modified: 
    mlir/include/mlir/IR/BuiltinOps.td
    mlir/include/mlir/IR/OpDefinition.h
    mlir/lib/IR/BuiltinDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/BuiltinOps.td b/mlir/include/mlir/IR/BuiltinOps.td
index 2c4d47d61cbe..163c4870891e 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<NamedAttribute> attrs = {});
     static FuncOp create(Location location, StringRef name, FunctionType type,
-                         iterator_range<dialect_attr_iterator> attrs);
+                         Operation::dialect_attr_range attrs);
     static FuncOp create(Location location, StringRef name, FunctionType type,
                          ArrayRef<NamedAttribute> attrs,
                          ArrayRef<DictionaryAttr> argAttrs);

diff  --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index 6e380d146fa4..8bd5bb524913 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -121,7 +121,6 @@ class OpState {
 
   /// 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 @@ class OpState {
     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 <typename DialectAttrs>
-  void setDialectAttrs(DialectAttrs &&attrs) {
-    state->setDialectAttrs(std::forward<DialectAttrs>(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 2749c8271022..b19d541e5045 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<FuncOp>(Operation::create(state));
 }
 FuncOp FuncOp::create(Location location, StringRef name, FunctionType type,
-                      iterator_range<dialect_attr_iterator> attrs) {
+                      Operation::dialect_attr_range attrs) {
   SmallVector<NamedAttribute, 8> attrRef(attrs);
   return create(location, name, type, llvm::makeArrayRef(attrRef));
 }


        


More information about the Mlir-commits mailing list