[all-commits] [llvm/llvm-project] 133314: Make OpOperand constructor private (NFC)

Mehdi Amini via All-commits all-commits at lists.llvm.org
Mon Jun 15 13:28:38 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 13331477c0d1aeb8f3c9f24b3d0487bc6fcaa225
      https://github.com/llvm/llvm-project/commit/13331477c0d1aeb8f3c9f24b3d0487bc6fcaa225
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M mlir/include/mlir/IR/UseDefLists.h

  Log Message:
  -----------
  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




More information about the All-commits mailing list