-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
IRGen: Add code to support building fragile resilient protocol witnesses #72218
Conversation
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.
@swift-ci test |
@@ -2528,6 +2532,16 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) { | |||
bool isResilient = isResilientConformance(conf); | |||
bool useRelativeProtocolWitnessTable = | |||
IRGen.Opts.UseRelativeProtocolWitnessTables; | |||
if (useRelativeProtocolWitnessTable && |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks fine :)
@swift-ci test |
lib/IRGen/GenProto.cpp
Outdated
if (useRelativeProtocolWitnessTable && | ||
!conf->getConditionalRequirements().empty()) { | ||
auto nominal = conf->getType()->getAnyNominal(); | ||
auto sig = nominal->getGenericSignatureOfContext(); |
There was a problem hiding this comment.
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 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks fine :)
@swift-ci test |
@swift-ci test |
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.