Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

[mlir][TypeDefGen] Add support for adding builders when generating a TypeDef

Authored by rriddle on Jan 7 2021, 4:31 PM.



This allows for specifying additional get/getChecked methods that should be generated on the type, and acts similarly to how OpBuilders work. TypeBuilders have two additional components though:

  • InferredContextParam
    • Bit indicating that the context parameter of a get method is inferred from one of the builder parameters
  • checkedBody
    • A code block representing the body of the equivalent getChecked method.

Depends On D94273

Diff Detail

Event Timeline

rriddle created this revision.Jan 7 2021, 4:31 PM
rriddle requested review of this revision.Jan 7 2021, 4:31 PM

+Chris as I think you also ran into a need for this.

lattner accepted this revision.Jan 9 2021, 10:51 AM

Awesome, thank you for implementing this. The documentation and implementation look really really great, I'm excited to see this River!

This revision is now accepted and ready to land.Jan 9 2021, 10:51 AM
jdd added a comment.Jan 9 2021, 1:03 PM

Nice! Was this change being discussed in a bug which can now be closed? I seem to recall that but cannot find the bug.

It looks like I didn't file a PR about this