File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -367,8 +367,8 @@ bool swift::isLetAddress(SILValue address) {
367
367
368
368
bool swift::isIdentityPreservingRefCast (SingleValueInstruction *svi) {
369
369
// Ignore both copies and other identity and ownership preserving casts
370
- return isa<CopyValueInst>(svi) ||
371
- isIdentityAndOwnershipPreservingRefCast (svi);
370
+ return isa<CopyValueInst>(svi) || isa<BeginBorrowInst>(svi)
371
+ || isIdentityAndOwnershipPreservingRefCast (svi);
372
372
}
373
373
374
374
// On some platforms, casting from a metatype to a reference type dynamically
@@ -385,8 +385,6 @@ bool swift::isIdentityAndOwnershipPreservingRefCast(
385
385
switch (svi->getKind ()) {
386
386
default :
387
387
return false ;
388
- // Ignore borrows
389
- case SILInstructionKind::BeginBorrowInst:
390
388
// Ignore class type casts
391
389
case SILInstructionKind::UpcastInst:
392
390
case SILInstructionKind::UncheckedRefCastInst:
@@ -479,7 +477,7 @@ SILValue swift::findOwnershipReferenceRoot(SILValue ref) {
479
477
// MARK: AccessedStorage
480
478
// ===----------------------------------------------------------------------===//
481
479
482
- SILGlobalVariable *getReferencedGlobal (SILInstruction *inst) {
480
+ static SILGlobalVariable *getReferencedGlobal (SILInstruction *inst) {
483
481
if (auto *gai = dyn_cast<GlobalAddrInst>(inst)) {
484
482
return gai->getReferencedGlobal ();
485
483
}
You can’t perform that action at this time.
0 commit comments