mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AllocBoxToStack] See through borrows.
Now that alloc_boxes whose lifetimes are lexical are emitted with begin_borrow [lexical]/end_borrow, AllocBoxToStack needs to be able to see through those new borrow scopes in order to continue stack promoting the same boxes that it was able to before those lexical scopes were emitted.
This commit is contained in:
@@ -285,6 +285,10 @@ SILBuilder::emitDestroyAddr(SILLocation Loc, SILValue Operand) {
|
||||
if (isa<DeallocStackInst>(Inst))
|
||||
continue;
|
||||
|
||||
// end_borrow insts also don't affect take-ability
|
||||
if (isa<EndBorrowInst>(Inst))
|
||||
continue;
|
||||
|
||||
// An end_access of the same address may be able to be rewritten as a
|
||||
// [deinit] access.
|
||||
if (auto endAccess = dyn_cast<EndAccessInst>(Inst)) {
|
||||
|
||||
Reference in New Issue
Block a user