mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, the "bare" linkage of a link entity was used to determine whether to put an async function pointer into the tbd. That did not match the mechanism by which the linkage was determined in IRGen. There, the linkage is the "_effective_" linkage (i.e. the value returned from SILFunction::getEffectiveSymbolLinkage). Here, whether to put the async function pointer corresponding to a class method is determined on the basis of that effective linkage. rdar://problem/73203508
26 lines
938 B
Swift
26 lines
938 B
Swift
import _Concurrency
|
|
|
|
func printGeneric<T>(_ t: T) {
|
|
print(t)
|
|
}
|
|
// CHECK-LL: @"$s4main6call_fyyAA1CCYFTu" = {{(dllexport )?}}{{(protected )?}}global %swift.async_func_pointer
|
|
// CHECK-LL: @"$s4main1CC1fyyYFTu" = {{(dllexport )?}}{{(protected )?}}global %swift.async_func_pointer
|
|
|
|
// CHECK-LL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s4main6call_fyyAA1CCYF"(%swift.task* {{%[0-9]+}}, %swift.executor* {{%[0-9]+}}, %swift.context* {{%[0-9]+}}) {{#[0-9]*}} {
|
|
// CHECK-LL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s4main1CC1fyyYF"(%swift.task* {{%[0-9]+}}, %swift.executor* {{%[0-9]+}}, %swift.context* {{%[0-9]+}}) {{#[0-9]*}} {
|
|
public func call_f(_ c: C) async {
|
|
print("entering call_f")
|
|
await c.f()
|
|
print("exiting call_f")
|
|
}
|
|
open class C {
|
|
public init() {}
|
|
func f() async {
|
|
printGeneric("entering f")
|
|
printGeneric(Self.self)
|
|
printGeneric(self)
|
|
printGeneric("exiting f")
|
|
}
|
|
}
|
|
|