Skip to content

Commit 42e8a96

Browse files
authored
Merge pull request #29873 from gottesmm/pr-9e43d3301740b75fd0546f1d2f2f9f353f5a6ccd
[ownership] Add copy constructor/assignment operator for BorrowScopeOperand.
2 parents 3777ec0 + 16efe40 commit 42e8a96

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)