This is an archive of the discontinued LLVM Phabricator instance.

Use reference for large object passed by value at the moment in MLIR TableGen (NFC)
ClosedPublic

Authored by mehdi_amini on Jan 17 2022, 2:40 PM.

Diff Detail

Event Timeline

mehdi_amini created this revision.Jan 17 2022, 2:40 PM
mehdi_amini requested review of this revision.Jan 17 2022, 2:40 PM

Two more cases

rriddle accepted this revision.Jan 17 2022, 10:19 PM

LG, but the description is a bit off. Most of the changes here are for using const, not really about using references.

This revision is now accepted and ready to land.Jan 17 2022, 10:19 PM
mehdi_amini added a comment.EditedJan 17 2022, 10:22 PM

Should I say "const reference"? The motivation is really reference, then the "const" came up on the iterator aspect just to enable the change.

I think the "const" thing is only in Operator.h/.cpp right? I can also pre-commit this as NFC

Should I say "const reference"? The motivation is really reference, then the "const" came up on the iterator aspect just to enable the change.

I think the "const" thing is only in Operator.h/.cpp right? I can also pre-commit this as NFC

I see const sprinkled throughout the commit on existing references, e.g OpInterfacesGen.cpp:381.

I don't have a huge preference on how the description is spelled (could be two sentences). Just stuck out when I read the commit say "passed by value" and saw references already on most.

Alright, I added a longer description in the commit message!