This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Generate parser/printers for enums
ClosedPublic

Authored by rriddle on Oct 20 2022, 5:57 PM.

Details

Summary

This greatly simplifies composing enums in attribute/type printers,
which currently reimplement these functions as needed.

Diff Detail

Event Timeline

rriddle created this revision.Oct 20 2022, 5:57 PM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Oct 20 2022, 5:57 PM
Mogball accepted this revision.Oct 20 2022, 6:29 PM
Mogball added inline comments.
mlir/test/mlir-tblgen/enums-gen.td
47

Can you add a test for a non keyword case?

mlir/tools/mlir-tblgen/EnumsGen.cpp
79

You can use structured bindings on enumerate now, I'm pretty sure

This revision is now accepted and ready to land.Oct 20 2022, 6:29 PM
jpienaar accepted this revision.Oct 20 2022, 7:43 PM
jpienaar added a subscriber: jpienaar.

Nice!

rriddle marked 2 inline comments as done.Oct 21 2022, 10:56 AM
rriddle added inline comments.
mlir/tools/mlir-tblgen/EnumsGen.cpp
79

nice!!

This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.