-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Serialization] Drop overriding relationship in constructors when safe #63266
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
Conversation
@swift-ci Please smoke test |
if (overriddenOrError) { | ||
overridden = overriddenOrError.get(); | ||
} else { | ||
if (overriddenAffectsABI || !ctx.LangOpts.EnableDeserializationRecovery) { |
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.
Could we set overridden = nullptr
if we're allowing compiler errors in this case (ie. MF.allowCompilerErrors
)?
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.
Sure 👍
if (firstTimeRequired && overridden->isRequired()) | ||
firstTimeRequired = false; | ||
} | ||
bool overriddenAffectsABI = overriddenDeclAffectsABI(ctor, overridden); |
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.
Is the relationship actually useful if it doesn't?
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.
That's a good question. For non-resilient modules it could be used by optimizations. For resilient modules in most cases it should now be dropped by deserialization safety for the public-override-internal case, and the clang case is there more as tolerance for poor modularization and such I believe. I think we could try always dropping it when reading from a resilient module.
f7e2d14
to
963748b
Compare
Deserialization recovery lead the compiler to drop public constructors overridding internal constructors. This limits the logic to dropping the overriding relationship instead of the whole constructor. This applies when the overriden constructor fails to deserialize and only when the overriding relationship was marked as not affecting ABI. rdar://104704832
At deserialization, we can drop the overriding relationship if the overriden decl is internal and only when the overrider is in a resilient module.
963748b
to
e3206ba
Compare
@swift-ci Please smoke test |
e3206ba
to
2d8f075
Compare
@swift-ci Please smoke test |
@swift-ci please smoke test macOS |
Deserialization recovery lead the compiler to drop public constructors overriding internal constructors. This PR limits the logic to dropping only the overriding relationship instead of the whole constructor. This applies when the overriden constructor fails to deserialize and only when the overriding relationship was marked as not affecting ABI. This should realign the behavior between swiftmodules and swiftinterfaces.
rdar://104704832
Fixes: #63242
This is the equivalent of #63068 for constructors.