Skip to content

Commit 16efe40

Browse files
committed
[ownership] Add copy constructor/assignment operator for BorrowScopeOperand.
NFC.
1 parent 551862c commit 16efe40

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ struct BorrowScopeOperand {
251251

252252
BorrowScopeOperand(Operand *op)
253253
: kind(*BorrowScopeOperandKind::get(op->getUser()->getKind())), op(op) {}
254+
BorrowScopeOperand(const BorrowScopeOperand &other)
255+
: kind(other.kind), op(other.op) {}
256+
BorrowScopeOperand &operator=(const BorrowScopeOperand &other) {
257+
kind = other.kind;
258+
op = other.op;
259+
return *this;
260+
}
254261

255262
/// If value is a borrow introducer return it after doing some checks.
256263
static Optional<BorrowScopeOperand> get(Operand *op) {

0 commit comments

Comments
 (0)