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

[SwiftBindings] Retrieve metadata information #2892

Open
jkurdek opened this issue Dec 17, 2024 · 0 comments
Open

[SwiftBindings] Retrieve metadata information #2892

jkurdek opened this issue Dec 17, 2024 · 0 comments
Labels
area-SwiftBindings Swift bindings for .NET

Comments

@jkurdek
Copy link
Member

jkurdek commented Dec 17, 2024

Currently we retrieve metadata information during parsing. This might not be a correct place to do this (#2870 (comment)). We should find a correct place and method of doing the retrieval.


I was looking into how to do this and it's a little more complicated than you think. The problem is that the value witness table for any particular type might not live in the dylib that you're reading. For example, if I define a swift type like this:

public struct NoInThisDylib {
    public let contents: Int
    public init(with: Int) {
        contents = with
    }
}

Then the value witness table for this type is an external reference to the value witness table for Int64 from libswiftCore.dylib. IIRC all heap allocated types (classes) share the same value witness table.

Originally posted by @stephen-hawley in #2870 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-SwiftBindings Swift bindings for .NET
Projects
None yet
Development

No branches or pull requests

1 participant