Setting attributes on operations results in an assertion failure, but
this could be missed currently by adding a null attribute to an
OperationState and building an Operation with that. This change adds
some additional assertions to make these different locations consistent
with each other.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/IR/OperationSupport.h | ||
---|---|---|
486 | If we are going to assert when adding attributes, I would instead add asserts to NamedAttrList. Asserts there would catch more cases. | |
mlir/lib/IR/Operation.cpp | ||
179 | This should be guaranteed on construction by DictionaryAttr. Is there a case that isn't being caught? |
mlir/lib/IR/Operation.cpp | ||
---|---|---|
179 | I'm removing this one. The case that was not handled was appending to a NamedAttrList and then calling NamedAttrList::getDictionary(MLIRContext *context). That is handled by your suggestion above though, so I'll remove this one. |
mlir/include/mlir/IR/OperationSupport.h | ||
---|---|---|
275 | Should we move this to push_back instead? (The method that this bottoms out to) |
Should we move this to push_back instead? (The method that this bottoms out to)