-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Create closure destructors with internal linkage #86013
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
base: main
Are you sure you want to change the base?
Conversation
This makes these symbols visible in backtraces, at the cost of binary size. The long-term goal is to generate these functions with LinkOnceODRLinkage, using the contents of the HeapLayout to produce a mangled name, so they can be deduplicated across modules. rdar://149084103
|
@swift-ci smoke test |
|
We should do the same for partial apply forwarders too. Today they're generated once per |
Does that mean we should change those to have internal linkage in the short term as well? This PR is just meant as a short-term fix for rdar://149084103. I will be away until after Christmas. |
|
@swift-ci test windows |
I think this comment is about the long term plan to deduplicate these functions. |
aidan-hall
left a comment
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.
I think the generated closure destructors could conflict with @c/@cDecl declarations in user code that use the name objectdestroy. Perhaps rename to __objectdestroy?
Can you explain what you mean? With internal linkage they should get properly uniqued. edit: Oh, I see... when people import C declarations. Yeah, maybe we can introduce some proper mangling here already, or just rename is also fine I guess. |
This makes these symbols visible in backtraces, at the cost of binary size (partially reverts 5e9e68c).
The long-term goal is to generate these functions with LinkOnceODRLinkage, using the contents of the HeapLayout to produce a mangled name, so they can be deduplicated across modules.
rdar://149084103