Skip to content
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

[SR-6718] Linux Interoperability: Eliminate items in class metadata layout that aren't relevant to non-objc builds #49267

Closed
AnnaZaks mannequin opened this issue Jan 8, 2018 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux runtime The Swift Runtime

Comments

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jan 8, 2018

Previous ID SR-6718
Radar rdar://problem/18801263
Original Reporter @AnnaZaks
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Linux, Runtime
Assignee None
Priority Medium

md5: 1801085f2cc5dfb398494cbf214ff76d

Issue Description:

There are various places in the metadata generation where NULL values are being injected simply because there’s some objective-c related field that isn’t important on a non-objc platform. We should remove these and make sure that things still work. (Note that the debugger wants to preserve some sort of magic number that can be used to identify classes. On ObjC platforms the debugger uses the Swift class's ObjC data to do that.)

@belkadan
Copy link
Contributor

Reminded of this again today. I don't think it would be too difficult, so maybe a good task to assign to someone who's already familiar with the compiler a bit and wants to dive into IRGen and the runtime?

As for a "magic number to identify classes", the value witness table for every class is the same (since it's "just" for native-object references), so we can probably use that: $sBoWV

@belkadan
Copy link
Contributor

belkadan commented Oct 1, 2020

Apparently @davezarzycki got around to this in #31811 so it'll make it into 5.4 (or 6, whatever's next).

@belkadan
Copy link
Contributor

belkadan commented Oct 1, 2020

Tagging @mikeash to make sure the Radar gets closed too.

@mikeash
Copy link
Contributor

mikeash commented Oct 1, 2020

Thanks Jordan, you have pleased the Lords of Radar.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

2 participants