[mlir] Remove some rarely used OpState members and use Operation members instead.
authorChristian Sigg <csigg@google.com>
Thu, 25 Feb 2021 21:20:45 +0000 (22:20 +0100)
committerChristian Sigg <csigg@google.com>
Fri, 26 Feb 2021 07:37:11 +0000 (08:37 +0100)
Skipping the deprecation dance here.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97494

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

index 2c4d47d..163c487 100644 (file)
@@ -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);
index 6e380d1..8bd5bb5 100644 (file)
@@ -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 <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.
index 2749c82..b19d541 100644 (file)
@@ -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));
 }