This is an archive of the discontinued LLVM Phabricator instance.

[mlir:ODS] Generate unwrapped operation attribute setters
ClosedPublic

Authored by rriddle on Oct 12 2022, 6:01 PM.

Details

Summary

This allows for setting an attribute using the underlying C++ type,
which is generally much nicer to interact with than the attribute type.

Diff Detail

Event Timeline

rriddle created this revision.Oct 12 2022, 6:01 PM
rriddle requested review of this revision.Oct 12 2022, 6:01 PM
lattner accepted this revision.Oct 14 2022, 11:42 AM
lattner added a subscriber: lattner.

This will remove so much boilerplate, thank you!

This revision is now accepted and ready to land.Oct 14 2022, 11:42 AM
jpienaar accepted this revision.Oct 14 2022, 11:46 AM

Nice, thanks! Yeah UnitAttr is unfortunately special.

Mogball accepted this revision.Oct 14 2022, 11:50 AM
Mogball added a subscriber: Mogball.
Mogball added inline comments.
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
1120

Is this the best way we have for detecting UnitAttr?

This revision was automatically updated to reflect the committed changes.
ayzhuang added inline comments.
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
1155

*attrValue => (*attrValue)