Skip to content

Fix opaque type substitution in the package cmo resilience domain #73794

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

Conversation

aschwaighofer
Copy link
Contributor

We need to serialize the underlying type if we want to see the underlying type accross the package resilience domain.

rdar://128482863

@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@@ -188,6 +189,20 @@ public func mainPubArgRetInlinable(_ arg: PubKlass) -> PubStruct {
return PubStruct(arg.data)
}

// CHECK-OPAQUE: sil @$s4Main023testPackageInSerializedC4FuncyyF : $@convention(thin) () -> ()
Copy link
Contributor

@elsh elsh May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Could you create a new test file for this, like package-cmo-opaque-type? This file already contains too much and is getting harder to track all cases.

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@aschwaighofer aschwaighofer force-pushed the package_cmo_opaque_type_subst branch from bcd6f26 to 748b69d Compare May 21, 2024 20:22
@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@aschwaighofer
Copy link
Contributor Author

@swift-ci test

// RUN: -module-name=Lib -package-name Pkg \
// RUN: -parse-as-library -emit-module -emit-module-path %t/Lib.swiftmodule -I%t \
// RUN: -Xfrontend -experimental-package-cmo -Xfrontend -experimental-allow-non-resilient-access \
// RUN: -O -wmo -enable-library-evolution -Xfrontend -disable-availability-checking
Copy link
Contributor

@elsh elsh May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw a proper diagnostics somewhere else so we don't need this -disable-availability-checking flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this flag is used out of convenience, without it availability annotations would have to be used (because of opaque result types).

@aschwaighofer aschwaighofer merged commit 58cc2a4 into swiftlang:main May 24, 2024
5 checks passed
aschwaighofer added a commit to aschwaighofer/swift that referenced this pull request May 24, 2024
…mo_opaque_type_subst

Fix opaque type substitution in the package cmo resilience domain

We need to serialize the underlying type if we want to see the underlying type accross the package resilience domain.

rdar://128482863

(cherry picked from commit 58cc2a4)

Risk: Low, should only affect package CMO mode

rdar://128647016
@elsh elsh mentioned this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants