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) {
367367
368368bool swift::isIdentityPreservingRefCast (SingleValueInstruction *svi) {
369369 // 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);
372372}
373373
374374// On some platforms, casting from a metatype to a reference type dynamically
@@ -385,8 +385,6 @@ bool swift::isIdentityAndOwnershipPreservingRefCast(
385385 switch (svi->getKind ()) {
386386 default :
387387 return false ;
388- // Ignore borrows
389- case SILInstructionKind::BeginBorrowInst:
390388 // Ignore class type casts
391389 case SILInstructionKind::UpcastInst:
392390 case SILInstructionKind::UncheckedRefCastInst:
@@ -479,7 +477,7 @@ SILValue swift::findOwnershipReferenceRoot(SILValue ref) {
479477// MARK: AccessedStorage
480478// ===----------------------------------------------------------------------===//
481479
482- SILGlobalVariable *getReferencedGlobal (SILInstruction *inst) {
480+ static SILGlobalVariable *getReferencedGlobal (SILInstruction *inst) {
483481 if (auto *gai = dyn_cast<GlobalAddrInst>(inst)) {
484482 return gai->getReferencedGlobal ();
485483 }
You can’t perform that action at this time.
0 commit comments