Skip to content

[IRGen] swift_getFunctionTypeMetadataGlobalActor has concurrency availability #38140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion include/swift/Runtime/RuntimeFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ FUNCTION(GetFunctionMetadataDifferentiable,
// const Metadata *globalActor);
FUNCTION(GetFunctionMetadataGlobalActor,
swift_getFunctionTypeMetadataGlobalActor,
C_CC, AlwaysAvailable,
C_CC, ConcurrencyAvailability,
RETURNS(TypeMetadataPtrTy),
ARGS(SizeTy,
SizeTy,
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/Linking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
case Kind::PartialApplyForwarderAsyncFunctionPointer:
return getUnderlyingEntityForAsyncFunctionPointer()
.getLinkage(ForDefinition);
.getLinkage(forDefinition);
case Kind::KnownAsyncFunctionPointer:
return SILLinkage::PublicExternal;
case Kind::PartialApplyForwarder:
Expand Down
13 changes: 13 additions & 0 deletions test/IRGen/async/weak_availability.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// RUN: %target-swift-frontend -enable-implicit-dynamic -target %target-cpu-apple-macosx11 -Onone -emit-ir %s | %FileCheck --check-prefix=MAYBE-AVAILABLE %s
// REQUIRES: OS=macosx && CPU=x86_64

@available(macOS 12.0, *)
public func f<S: AsyncSequence>(_ s: S) async throws -> Any.Type {
for try await _ in s { }

typealias Fn = @MainActor () -> S.Element
return Fn.self
}

// MAYBE-AVAILABLE: @"$sScI4next7ElementQzSgyYaKFTjTu" = extern_weak global
// MAYBE-AVAILABLE: declare{{.*}} extern_weak{{.*}} @swift_getFunctionTypeMetadataGlobalActor