diff --git a/mlir/include/mlir/IR/UseDefLists.h b/mlir/include/mlir/IR/UseDefLists.h --- a/mlir/include/mlir/IR/UseDefLists.h +++ b/mlir/include/mlir/IR/UseDefLists.h @@ -249,8 +249,6 @@ /// contain a reference to a specific `Value`. class OpOperand : public IROperand { public: - using IROperand::IROperand; - /// Provide the use list that is attached to the given value. static IRObjectWithUseList *getUseList(Value value); @@ -262,6 +260,12 @@ /// Return which operand this is in the operand list of the User. unsigned getOperandNumber(); + +private: + /// Keep the constructor private and accessible to the OperandStorage class + /// only to avoid hard-to-debug typo/programming mistakes. + friend class OperandStorage; + using IROperand::IROperand; }; //===----------------------------------------------------------------------===//