mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix BorrowingOperand::visitScopeEndingUses() invariants.
This API only makes sense for a scoped borrow-introducer such as: - reborrow - owned mark_dependence Borrowing operands that forward guaranteed values do not have scope-ending uses.
This commit is contained in:
@@ -2022,10 +2022,13 @@ visitRecursivelyLifetimeEndingUses(
|
||||
// the dependent value.
|
||||
bool MarkDependenceInst::visitNonEscapingLifetimeEnds(
|
||||
llvm::function_ref<bool (Operand *)> visitScopeEnd,
|
||||
llvm::function_ref<bool (Operand *)> visitUnknownUse) const {
|
||||
llvm::function_ref<bool (Operand *)> visitUnknownUse) {
|
||||
assert(getFunction()->hasOwnership() && isNonEscaping()
|
||||
&& "only meaningful for nonescaping dependencies");
|
||||
assert(getType().isObject() && "lifetime ends only exist for values");
|
||||
assert(getOwnershipKind() == OwnershipKind::Owned
|
||||
&& getType().isEscapable(*getFunction())
|
||||
&& "only correct for owned escapable values");
|
||||
bool noUsers = true;
|
||||
if (!visitRecursivelyLifetimeEndingUses(this, noUsers, visitScopeEnd,
|
||||
visitUnknownUse)) {
|
||||
|
||||
Reference in New Issue
Block a user