Page MenuHomePhabricator

[mlir][OpFormatGen] Format enum attribute cases as keywords when possible

Authored by rriddle on Jan 12 2021, 6:30 PM.



In the overwhelmingly common case, enum attribute case strings represent valid identifiers in MLIR syntax. This revision updates the format generator to format as a keyword in these cases, removing the need to wrap values in a string. The parser still retains the ability to parse the string form, but the printer will use the keyword form when applicable.

Depends On D94574

Diff Detail

Event Timeline

rriddle created this revision.Jan 12 2021, 6:30 PM
rriddle requested review of this revision.Jan 12 2021, 6:30 PM
This revision is now accepted and ready to land.Jan 12 2021, 8:24 PM
lattner accepted this revision.Jan 12 2021, 11:00 PM

This is so so so awesome, thank you for doing this!

ftynse accepted this revision.Jan 13 2021, 1:14 AM