Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions stdlib/public/core/LifetimeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/// - Parameters:
/// - x: An instance to preserve until this function returns.
@_alwaysEmitIntoClient
@_transparent
public func extendLifetime<T: ~Copyable & ~Escapable>(
_ x: borrowing T
) {
Expand All @@ -31,6 +32,7 @@ public func extendLifetime<T: ~Copyable & ~Escapable>(
/// return value for the `withExtendedLifetime(_:_:)` method.
/// - Returns: The return value, if any, of the `body` closure parameter.
@_alwaysEmitIntoClient
@inline(always)
public func withExtendedLifetime<
T: ~Copyable & ~Escapable,
E: Error,
Expand Down Expand Up @@ -64,6 +66,7 @@ internal func __abi_withExtendedLifetime<T, Result>(
/// return value for the `withExtendedLifetime(_:_:)` method.
/// - Returns: The return value, if any, of the `body` closure parameter.
@_alwaysEmitIntoClient
@inline(always)
public func withExtendedLifetime<
T: ~Copyable & ~Escapable,
E: Error,
Expand Down Expand Up @@ -117,6 +120,7 @@ public func _fixLifetime<T: ~Copyable & ~Escapable>(_ x: borrowing T) {
/// execution.
/// - Returns: The return value, if any, of the `body` closure.
@_alwaysEmitIntoClient
@inline(always)
public func withUnsafeMutablePointer<
T: ~Copyable, E: Error, Result: ~Copyable
>(
Expand All @@ -141,6 +145,7 @@ internal func __abi_se0413_withUnsafeMutablePointer<T, Result>(
/// This function is similar to `withUnsafeMutablePointer`, except that it
/// doesn't trigger stack protection for the pointer.
@_alwaysEmitIntoClient
@inline(always)
public func _withUnprotectedUnsafeMutablePointer<
T: ~Copyable, E: Error, Result: ~Copyable
>(
Expand Down Expand Up @@ -176,6 +181,7 @@ public func _withUnprotectedUnsafeMutablePointer<
/// `withUnsafeMutablePointer(to:_:)` instead.
/// - Returns: The return value, if any, of the `body` closure.
@_alwaysEmitIntoClient
@inline(always)
public func withUnsafePointer<T: ~Copyable, E: Error, Result: ~Copyable>(
to value: borrowing T,
_ body: (UnsafePointer<T>) throws(E) -> Result
Expand Down Expand Up @@ -224,6 +230,7 @@ internal func __abi_withUnsafePointer<T, Result>(
/// `withUnsafeMutablePointer(to:_:)` instead.
/// - Returns: The return value, if any, of the `body` closure.
@_alwaysEmitIntoClient
@inline(always)
public func withUnsafePointer<T: ~Copyable, E: Error, Result: ~Copyable>(
to value: inout T,
_ body: (UnsafePointer<T>) throws(E) -> Result
Expand All @@ -250,6 +257,7 @@ internal func __abi_se0413_withUnsafePointer<T, Result>(
/// This function is similar to `withUnsafePointer`, except that it
/// doesn't trigger stack protection for the pointer.
@_alwaysEmitIntoClient
@inline(always)
public func _withUnprotectedUnsafePointer<
T: ~Copyable, E: Error, Result: ~Copyable
>(
Expand All @@ -268,6 +276,7 @@ public func _withUnprotectedUnsafePointer<
/// This function is similar to `withUnsafePointer`, except that it
/// doesn't trigger stack protection for the pointer.
@_alwaysEmitIntoClient
@inline(always)
public func _withUnprotectedUnsafePointer<
T: ~Copyable, E: Error, Result: ~Copyable
>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueOySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import TestModule
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK-NOT: @"$s4main5ValueOySiGMf"

extension Int : P {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import TestModule
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK-NOT: @"$s4main5ValueOySiGMf"

extension Int : P {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueOySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueVySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueVySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueVySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueVySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: CPU=armv7 && OS=ios
// UNSUPPORTED: CPU=armv7s && OS=ios

// CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_existential_type

// CHECK: @"$s4main5ValueVySiGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
// CHECK-SAME: [[INT]],
Expand Down