@@ -2450,23 +2450,22 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
2450
2450
}
2451
2451
2452
2452
void checkStoreBorrowInst (StoreBorrowInst *SI) {
2453
+ // A store_borrow must be to an alloc_stack. That alloc_stack can only be
2454
+ // used by store_borrows (and dealloc_stacks).
2453
2455
require (SI->getSrc ()->getType ().isObject (),
2454
2456
" Can't store from an address source" );
2455
2457
require (!fnConv.useLoweredAddresses ()
2456
2458
|| SI->getSrc ()->getType ().isLoadable (*SI->getFunction ()),
2457
2459
" Can't store a non loadable type" );
2458
2460
require (SI->getDest ()->getType ().isAddress (),
2459
2461
" Must store to an address dest" );
2462
+ // Note: This is the current implementation and the design is not final.
2460
2463
require (isa<AllocStackInst>(SI->getDest ()),
2461
- " store_borrow destination should be alloc_stack" );
2464
+ " store_borrow destination can only be an alloc_stack" );
2462
2465
requireSameType (SI->getDest ()->getType ().getObjectType (),
2463
2466
SI->getSrc ()->getType (),
2464
2467
" Store operand type and dest type mismatch" );
2465
2468
2466
- // Note: This is the current implementation and the design is not final.
2467
- require (isa<AllocStackInst>(SI->getDest ()),
2468
- " store_borrow destination can only be an alloc_stack" );
2469
-
2470
2469
SSAPrunedLiveness scopedAddressLiveness;
2471
2470
ScopedAddressValue scopedAddress (SI);
2472
2471
// FIXME: Reenable @test_load_borrow_store_borrow_nested in
0 commit comments