Skip to content

IRGen: Add code to support building fragile resilient protocol witnesses #72218

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 don't currently support building resilient relative protocol witness tables. One might want to build with relative witness tables but not need resilient protocols. Allow for that scenario.

Add a test configuration to test library-evolution + fragile resilient protocols + relative protocol witness tables.

We don't currently support building resilient relative protocol witness tables.
One might want to build with relative witness tables but not need
resilient protocols. Allow for that scenario.

Add a test configuration to test library-evolution + fragile resilient
protocols + relative protocol witness tables.
@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@@ -2528,6 +2532,16 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
bool isResilient = isResilientConformance(conf);
bool useRelativeProtocolWitnessTable =
IRGen.Opts.UseRelativeProtocolWitnessTables;
if (useRelativeProtocolWitnessTable &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slavapestov I am trying to test for variadic generics with conditional conformances here. Probably, doing it all wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, for one a dump() isn't going to fly in an no-asserts build ...

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks fine :)

@aschwaighofer
Copy link
Contributor Author

@swift-ci test

if (useRelativeProtocolWitnessTable &&
!conf->getConditionalRequirements().empty()) {
auto nominal = conf->getType()->getAnyNominal();
auto sig = nominal->getGenericSignatureOfContext();
Copy link
Contributor

Choose a reason for hiding this comment

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

This should work too: sig = conf->getGenericSignature();

@@ -2528,6 +2532,16 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
bool isResilient = isResilientConformance(conf);
bool useRelativeProtocolWitnessTable =
IRGen.Opts.UseRelativeProtocolWitnessTables;
if (useRelativeProtocolWitnessTable &&
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks fine :)

@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@aschwaighofer aschwaighofer merged commit 315a763 into swiftlang:main Mar 13, 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