Skip to content

Commit 6d337df

Browse files
committed
[NFC] SILVerifier: Doc + cleanup to store_borrow.
1 parent 2060979 commit 6d337df

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,23 +2450,22 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
24502450
}
24512451

24522452
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).
24532455
require(SI->getSrc()->getType().isObject(),
24542456
"Can't store from an address source");
24552457
require(!fnConv.useLoweredAddresses()
24562458
|| SI->getSrc()->getType().isLoadable(*SI->getFunction()),
24572459
"Can't store a non loadable type");
24582460
require(SI->getDest()->getType().isAddress(),
24592461
"Must store to an address dest");
2462+
// Note: This is the current implementation and the design is not final.
24602463
require(isa<AllocStackInst>(SI->getDest()),
2461-
"store_borrow destination should be alloc_stack");
2464+
"store_borrow destination can only be an alloc_stack");
24622465
requireSameType(SI->getDest()->getType().getObjectType(),
24632466
SI->getSrc()->getType(),
24642467
"Store operand type and dest type mismatch");
24652468

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-
24702469
SSAPrunedLiveness scopedAddressLiveness;
24712470
ScopedAddressValue scopedAddress(SI);
24722471
// FIXME: Reenable @test_load_borrow_store_borrow_nested in

0 commit comments

Comments
 (0)