[mlir] Move constBuidlerCall from to ArrayAttrBase
authorAlex Zinenko <zinenko@google.com>
Mon, 7 Feb 2022 09:28:09 +0000 (10:28 +0100)
committerAlex Zinenko <zinenko@google.com>
Tue, 8 Feb 2022 08:31:11 +0000 (09:31 +0100)
This makes it applicable to both ArrayAttr and its typed subclasses instead of
only the latter. There is no good reason why ArrayAttr shouldn't be
const-buildable while its typed subclasses are, this was likely just an
omission.

Depends On D119113

Reviewed By: rriddle, nicolasvasilache

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

mlir/include/mlir/IR/OpBase.td

index 80a0949..0641457 100644 (file)
@@ -1655,6 +1655,7 @@ class ArrayAttrBase<Pred condition, string summary> : Attr<condition, summary> {
   let returnType = [{ ::mlir::ArrayAttr }];
   let valueType = NoneType;
   let convertFromStorage = "$_self";
+  let constBuilderCall = "$_builder.getArrayAttr($0)";
 }
 
 def ArrayAttr : ArrayAttrBase<CPred<"$_self.isa<::mlir::ArrayAttr>()">,
@@ -1672,7 +1673,6 @@ class TypedArrayAttrBase<Attr element, string summary>: ArrayAttrBase<
                                SubstLeaves<"$_self", "attr", element.predicate>,
                             "; })">]>,
     summary> {
-  let constBuilderCall = "$_builder.getArrayAttr($0)";
 
   Attr elementAttr = element;
 }