Make OpOperand constructor private (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Mon, 15 Jun 2020 00:51:48 +0000 (00:51 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 15 Jun 2020 20:28:07 +0000 (20:28 +0000)
commit13331477c0d1aeb8f3c9f24b3d0487bc6fcaa225
tree5458ceffd0a6467ca50b9a7d00be1655b7d7a848
parent7c93a19790c499b882871b4cf432c28c43ccb1ae
Make OpOperand constructor private (NFC)

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.

Differential Revision: https://reviews.llvm.org/D81815
mlir/include/mlir/IR/UseDefLists.h