Skip to content

Commit d6cef2c

Browse files
authored
Merge pull request #64170 from al45tair/eng/PR-106276227
[Backtracing] Mark withCurrentContext() as @_transparent.
2 parents 5e1f304 + 7ed869e commit d6cef2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/public/Backtracing/Context.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ extension arm_gprs {
272272
throw NotImplemented()
273273
}
274274
#elseif arch(x86_64)
275+
@usableFromInline
275276
@_silgen_name("_swift_get_cpu_context")
276277
static func _swift_get_cpu_context() -> X86_64Context
277278

279+
@_transparent
278280
public static func withCurrentContext<T>(fn: (X86_64Context) throws -> T) rethrows -> T {
279281
return try fn(_swift_get_cpu_context())
280282
}
@@ -427,9 +429,11 @@ extension arm_gprs {
427429
throw NotImplemented()
428430
}
429431
#elseif arch(i386)
432+
@usableFromInline
430433
@_silgen_name("_swift_get_cpu_context")
431434
static func _swift_get_cpu_context() -> I386Context
432435

436+
@_transparent
433437
public static func withCurrentContext<T>(fn: (I386Context) throws -> T) rethrows -> T {
434438
return try fn(_swift_get_cpu_context())
435439
}
@@ -630,9 +634,11 @@ extension arm_gprs {
630634
throw NotImplemented()
631635
}
632636
#elseif arch(arm64) || arch(arm64_32)
637+
@usableFromInline
633638
@_silgen_name("_swift_get_cpu_context")
634639
static func _swift_get_cpu_context() -> ARM64Context
635640

641+
@_transparent
636642
public static func withCurrentContext<T>(fn: (ARM64Context) throws -> T) rethrows -> T {
637643
return try fn(_swift_get_cpu_context())
638644
}
@@ -769,9 +775,11 @@ extension arm_gprs {
769775
throw NotImplemented()
770776
}
771777
#elseif arch(arm)
778+
@usableFromInline
772779
@_silgen_name("_swift_get_cpu_context")
773780
static func _swift_get_cpu_context() -> ARMContext
774781

782+
@_transparent
775783
public static func withCurrentContext<T>(fn: (ARMContext) throws -> T) rethrows -> T {
776784
return try fn(_swift_get_cpu_context())
777785
}

0 commit comments

Comments
 (0)