Skip to content

Commit c439a46

Browse files
authored
Merge pull request #41095 from gottesmm/pr-df3640638d2f7ea3d3bb5a1f08c432cbf99069ca
[no-implicit-copy] Make sure to error on copies on borrowed structural sub-values.
2 parents 2fe4417 + 29ba817 commit c439a46

File tree

4 files changed

+738
-21
lines changed

4 files changed

+738
-21
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ class ForwardingOperand {
182182
return use->getOwnershipConstraint();
183183
}
184184

185+
bool isDirectlyForwarding() const {
186+
auto &mixin = *OwnershipForwardingMixin::get(use->getUser());
187+
return mixin.isDirectlyForwarding();
188+
}
189+
185190
ValueOwnershipKind getForwardingOwnershipKind() const;
186191
void setForwardingOwnershipKind(ValueOwnershipKind newKind) const;
187192
void replaceOwnershipKind(ValueOwnershipKind oldKind,

include/swift/SIL/PrunedLiveness.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ struct PrunedLivenessBoundary {
348348
SmallVector<SILInstruction *, 8> lastUsers;
349349
SmallVector<SILBasicBlock *, 8> boundaryEdges;
350350

351+
void clear() {
352+
lastUsers.clear();
353+
boundaryEdges.clear();
354+
}
355+
351356
/// Visit the point at which a lifetime-ending instruction must be inserted,
352357
/// excluding dead-end blocks. This is only useful when it is known that none
353358
/// of the lastUsers ends the lifetime, for example when creating a new borrow

0 commit comments

Comments
 (0)