This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: pack various parameters for lowerCall into a struct.
ClosedPublic

Authored by t.p.northover on Aug 7 2019, 1:43 AM.

Details

Reviewers
aemerson
Summary

I've now needed to add an extra parameter to this call twice recently. Not only is the signature getting extremely unwieldy, but just updating all of the callsites and implementations is a pain. Putting the parameters in a struct sidesteps both issues.

Diff Detail

Event Timeline

t.p.northover created this revision.Aug 7 2019, 1:43 AM
aemerson accepted this revision.Aug 7 2019, 8:33 PM

LGTM

This revision is now accepted and ready to land.Aug 7 2019, 8:33 PM
aemerson closed this revision.Aug 19 2019, 10:36 AM

Closing as committed.

mantognini added inline comments.
llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
252

I was wondering about this change. The previous arguments are either values or const&, but the new argument is a non-const reference. Is that intentional (i.e. is it meant that in the future, or even now, implementations of lowerCall should/can modify this argument), or can the argument be turned into a const&? The documentation doesn't say much, so I'm assuming the latter is true. Thanks.