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:
Andrew Trick
2025-02-25 01:12:26 -08:00
parent 6fa0b2ec98
commit 1cb4d50877
3 changed files with 26 additions and 9 deletions

View File

@@ -8815,10 +8815,14 @@ public:
uint8_t(MarkDependenceKind::Escaping);
}
/// Visit the instructions that end the lifetime of an OSSA on-stack closure.
/// Visit the instructions that end the lifetime the dependent value.
///
/// Preconditions:
/// - isNonEscaping()
/// - Produces an owned, Escapable, non-address value
bool visitNonEscapingLifetimeEnds(
llvm::function_ref<bool (Operand*)> visitScopeEnd,
llvm::function_ref<bool (Operand*)> visitUnknownUse) const;
llvm::function_ref<bool (Operand*)> visitUnknownUse);
};
/// Promote an Objective-C block that is on the stack to the heap, or simply