[mlir][ODS] Change `get...Mutable` to return `OpOperand &` for single operands (#66519)
The TableGen code generator now generates C++ code that returns a single `OpOperand &` for `get...Mutable` of operands that are not variadic and not optional. `OpOperand::set`/`assign` can be used to set a value (same as `MutableOperandRange::assign`). This is safer than `MutableOperandRange` because only single values (and no longer `ValueRange`) can be assigned. E.g.: ``` // Assignment of multiple values to non-variadic operand. // Before: Compiles, but produces invalid op. // After: Compilation error. extractSliceOp.getSourceMutable().assign({v1, v2}); ```
Loading
Please sign in to comment