This is an archive of the discontinued LLVM Phabricator instance.

[mlir][python] fix constructor generation for optional operands in presence of segment attribute
ClosedPublic

Authored by ftynse on Nov 5 2021, 3:50 AM.

Details

Summary

The ODS-based Python op bindings generator has been generating incorrect
specification of the operand segment in presence if both optional and variadic
operand groups: optional groups were treated as variadic whereas they require
separate treatement. Make sure it is the case. Also harden the tests around
generated op constructors as they could hitherto accept the code for both
optional and variadic arguments.

Diff Detail

Event Timeline

ftynse created this revision.Nov 5 2021, 3:50 AM
ftynse requested review of this revision.Nov 5 2021, 3:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2021, 3:50 AM
nicolasvasilache accepted this revision.Nov 5 2021, 3:51 AM
This revision is now accepted and ready to land.Nov 5 2021, 3:51 AM
ftynse updated this revision to Diff 385016.Nov 5 2021, 4:05 AM

More tests.