This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Make Attr/Type def accessors match the dialect
ClosedPublic

Authored by Mogball on Jun 13 2022, 1:14 PM.

Details

Summary

The generated attribute and type def accessors are changed to match the setting on the dialect. Most importantly, "prefixed" will now correctly convert snake case to camel case (e.g. weight_zp -> getWeightZp)

Diff Detail

Event Timeline

Mogball created this revision.Jun 13 2022, 1:14 PM
Mogball requested review of this revision.Jun 13 2022, 1:14 PM
jpienaar accepted this revision.Jun 13 2022, 1:31 PM

Yay thanks Jeff! (of course now I wish I had flipped more of these to _Both or _Prefixed already ;-))

This revision is now accepted and ready to land.Jun 13 2022, 1:31 PM
rriddle requested changes to this revision.Jun 13 2022, 1:36 PM

This looks like a regression to me in many cases. We are trying to remove snake case, but this seems to be adding more uses of it.

This revision now requires changes to proceed.Jun 13 2022, 1:36 PM

I don't see a reason to regress from Attr/TypeDef using prefixed always, can we instead just fix the emission there to properly convert snake case?

Are we trying to get rid of snake case or are we providing the option of either?

csigg added a comment.Jun 13 2022, 2:32 PM

Are we trying to get rid of snake case or are we providing the option of either?

We want to get rid of snake case in C++, according to this paragraph.

Okay that makes sense. I'll fix the "regression". Nice catch river lol

Mogball updated this revision to Diff 436646.Jun 13 2022, 10:05 PM

just fix camel case

Mogball updated this revision to Diff 436647.Jun 13 2022, 10:07 PM

remove ununsed include

This revision was not accepted when it landed; it landed in state Needs Review.Jun 13 2022, 10:13 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.

LG, but please do not land patches that are marked as "Requested Changes".

Yeah, my bad