HomePhabricator

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

Authored by rriddle on Jan 11 2021, 11:55 AM.

Description

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

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.

Differential Revision: https://reviews.llvm.org/D94274