@@ -18,7 +18,6 @@ import Swift
1818
1919#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
2020
21- @_implementationOnly import Darwin. Mach
2221@_implementationOnly import _SwiftBacktracingShims
2322
2423#endif
@@ -327,20 +326,20 @@ public struct Backtrace: CustomStringConvertible, Sendable {
327326 /// @returns A list of `Image`s.
328327 public static func captureImages( ) -> [ Image ] {
329328 #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
330- return captureImages ( for: mach_task_self_ )
329+ return captureImages ( for: _swift_backtrace_task_self ( ) )
331330 #else
332331 return [ ]
333332 #endif
334333 }
335334
336335 #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
337- private static func withDyldProcessInfo< T> ( for task: task_t ,
336+ private static func withDyldProcessInfo< T> ( for task: __swift_task_t ,
338337 fn: ( OpaquePointer ? ) throws -> T )
339338 rethrows -> T {
340- var kret : kern_return_t = KERN_SUCCESS
339+ var kret = __swift_kern_return_t ( _SWIFT_KERN_SUCCESS )
341340 let dyldInfo = _dyld_process_info_create ( task, 0 , & kret)
342341
343- if kret != KERN_SUCCESS {
342+ if kret != _SWIFT_KERN_SUCCESS {
344343 fatalError ( " error: cannot create dyld process info " )
345344 }
346345
@@ -357,7 +356,7 @@ public struct Backtrace: CustomStringConvertible, Sendable {
357356 var images : [ Image ] = [ ]
358357
359358 #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
360- let task = process as! task_t
359+ let task = process as! __swift_task_t
361360
362361 withDyldProcessInfo ( for: task) { dyldInfo in
363362 _dyld_process_info_for_each_image ( dyldInfo) {
@@ -366,7 +365,7 @@ public struct Backtrace: CustomStringConvertible, Sendable {
366365 if let path = path, let uuid = uuid {
367366 let pathString = String ( cString: path)
368367 let theUUID = Array ( UnsafeBufferPointer ( start: uuid,
369- count: MemoryLayout< uuid_t > . size) )
368+ count: MemoryLayout< __swift_uuid_t > . size) )
370369 let name : String
371370 if let slashIndex = pathString. lastIndex ( of: " / " ) {
372371 name = String ( pathString. suffix ( from:
@@ -404,7 +403,7 @@ public struct Backtrace: CustomStringConvertible, Sendable {
404403 /// @returns A `SharedCacheInfo`.
405404 public static func captureSharedCacheInfo( ) -> SharedCacheInfo ? {
406405 #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
407- return captureSharedCacheInfo ( for: mach_task_self_ )
406+ return captureSharedCacheInfo ( for: _swift_backtrace_task_self ( ) )
408407 #else
409408 return nil
410409 #endif
@@ -413,13 +412,13 @@ public struct Backtrace: CustomStringConvertible, Sendable {
413412 @_spi ( Internal)
414413 public static func captureSharedCacheInfo( for t: Any ) -> SharedCacheInfo ? {
415414 #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
416- let task = t as! task_t
415+ let task = t as! __swift_task_t
417416 return withDyldProcessInfo ( for: task) { dyldInfo in
418417 var cacheInfo = dyld_process_cache_info ( )
419418 _dyld_process_info_get_cache ( dyldInfo, & cacheInfo)
420419 let theUUID = withUnsafePointer ( to: cacheInfo. cacheUUID) {
421420 Array ( UnsafeRawBufferPointer ( start: $0,
422- count: MemoryLayout< uuid_t > . size) )
421+ count: MemoryLayout< __swift_uuid_t > . size) )
423422 }
424423 return SharedCacheInfo ( uuid: theUUID,
425424 baseAddress: Address ( cacheInfo. cacheBaseAddress) ,
0 commit comments