This is an archive of the discontinued LLVM Phabricator instance.

Make OpOperand constructor private (NFC)
ClosedPublic

Authored by mehdi_amini on Jun 14 2020, 5:53 PM.

Details

Summary

This is intended to avoid programming mistake where a temporary OpOperand is
created, for example:

for (OpOperand user : result.getUsers()) {

It can be confusing for the user, in particular since in MLIR most classes are intended to
be copied around by value while they have reference semantics.

Diff Detail

Event Timeline

mehdi_amini created this revision.Jun 14 2020, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2020, 5:54 PM
rriddle accepted this revision.Jun 15 2020, 10:28 AM
This revision is now accepted and ready to land.Jun 15 2020, 10:28 AM
This revision was automatically updated to reflect the committed changes.