[mlir][NFC] Use explicit ArrayRef construction in OptionalArrayRefParameter
authorRiver Riddle <riddleriver@gmail.com>
Thu, 12 Jan 2023 22:43:32 +0000 (14:43 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 12 Jan 2023 22:58:06 +0000 (14:58 -0800)
GCC was barfing on template deduction for ArrayRef parameters in
some situations.

mlir/include/mlir/IR/AttrTypeBase.td

index dd17f08..e9c25ee 100644 (file)
@@ -368,7 +368,7 @@ class OptionalArrayRefParameter<string arrayOf, string desc = ""> :
     OptionalParameter<"::llvm::ArrayRef<" # arrayOf # ">", desc> {
   let allocator = [{$_dst = $_allocator.copyInto($_self);}];
   let cppStorageType = "::llvm::SmallVector<" # arrayOf # ">";
-  let comparator = "::llvm::ArrayRef($_lhs) == ::llvm::ArrayRef($_rhs)";
+  let comparator = cppType # "($_lhs) == " # cppType # "($_rhs)";
 }
 
 // For classes which require allocation and have their own allocateInto method.