mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Intrinsic support for pinning.
Using the intrinsics is obnoxious because I needed them to return Builtin.NativeObject?, but there's no reasonable way to safely generate optional types from Builtins.cpp. Ugh. Dave and I also decided that there's no need for swift_tryPin to allow a null object. Swift SVN r23824
This commit is contained in:
@@ -75,9 +75,11 @@ static bool isTransitiveEscapeInst(SILInstruction *Inst) {
|
||||
case ValueKind::StringLiteralInst:
|
||||
case ValueKind::CopyBlockInst:
|
||||
case ValueKind::StrongReleaseInst:
|
||||
case ValueKind::StrongPinInst: // Pin handle is independently managed
|
||||
case ValueKind::StrongRetainAutoreleasedInst:
|
||||
case ValueKind::StrongRetainInst:
|
||||
case ValueKind::StrongRetainUnownedInst:
|
||||
case ValueKind::StrongUnpinInst:
|
||||
case ValueKind::UnownedReleaseInst:
|
||||
case ValueKind::UnownedRetainInst:
|
||||
case ValueKind::InjectEnumAddrInst:
|
||||
@@ -264,7 +266,7 @@ static bool valueMayBeCaptured(SILValue V, CaptureException Exception) {
|
||||
// RefCountOperations don't capture.
|
||||
//
|
||||
// The release case is true since Swift does not allow destructors to
|
||||
// resurrent objects. This is enforced via a runtime failure.
|
||||
// resurrect objects. This is enforced via a runtime failure.
|
||||
if (isa<RefCountingInst>(Inst))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user