[mlir] fix bugs with NamedAttrList
authorMogball <jeffniu22@gmail.com>
Tue, 19 Oct 2021 00:48:24 +0000 (00:48 +0000)
committerMogball <jeffniu22@gmail.com>
Tue, 19 Oct 2021 01:30:00 +0000 (01:30 +0000)
commit21bb463e9639719f1aae9535825a40732eda487b
tree1ac17a6545d62dd17fd58dbfe30f2749a7152374
parentbc03a9c066bf9990a1d595cb80ad51ae40fb759a
[mlir] fix bugs with NamedAttrList

- `assign` with ArrayRef was calling `append`
- `assign` with empty ArrayRef was not clearing storage

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D112043
mlir/include/mlir/IR/OperationSupport.h
mlir/lib/IR/BuiltinAttributes.cpp
mlir/unittests/IR/OperationSupportTest.cpp