[MLIR] Check for duplicate entries in attribute dictionary during custom parsing
authorRahul Joshi <jurahul@google.com>
Tue, 3 Nov 2020 22:31:23 +0000 (14:31 -0800)
committerRahul Joshi <jurahul@google.com>
Wed, 4 Nov 2020 00:40:46 +0000 (16:40 -0800)
commitc298824f9caf407aedeb4958467fb2a18025638d
tree461907091466650a01eb94de102547aea0a853ec
parent7ba393efe5fe861fe2905bb8c09801897fecc128
[MLIR] Check for duplicate entries in attribute dictionary during custom parsing

- Verify that attributes parsed using a custom parser do not have duplicates.
- If there are duplicated in the attribute dictionary in the input, they get caught during the
  dictionary parsing.
- This check verifies that there is no duplication between the parsed dictionary and any
  attributes that might be added by the custom parser (or when the custom parsing code
  adds duplicate attributes).
- Fixes https://bugs.llvm.org/show_bug.cgi?id=48025

Differential Revision: https://reviews.llvm.org/D90502
mlir/include/mlir/IR/Attributes.h
mlir/include/mlir/IR/OperationSupport.h
mlir/lib/IR/Attributes.cpp
mlir/lib/IR/OperationSupport.cpp
mlir/lib/Parser/AttributeParser.cpp
mlir/lib/Parser/Parser.cpp
mlir/test/IR/invalid.mlir