-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Introduce a source generator for invoking methods on unmanaged vtables #68276
Conversation
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsThis PR introduces a source generator that supports invoking native function pointers that are defined sequentially in memory (like in a static table or a vtable). This generator is a first step towards our COM source generator and provides a more focused testing ground for the managed->native and native->managed marshalling stubs while also enabling us to move some non-COM dotnet/runtime code to use auto-generated interop stubs (in particular, this generator would allow us to remove the manually-generated code from System.Net.Quic's MSQuic implementation). Depends on #67997
|
…with the vtable index generator to pass.
…up the marshalling generator correctly (E2E-style validation)
208c5c8
to
7caa3c7
Compare
I've marked this PR as ready for review as it has enough infrastructure to be useful and it has some basic testing. I still need to add the runtime tests. |
...em.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ContainingSyntaxContext.cs
Outdated
Show resolved
Hide resolved
...raries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Tests/ImplicitThisTests.cs
Outdated
Show resolved
Hide resolved
...braries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGenerator.cs
Outdated
Show resolved
Hide resolved
attn @lateralusX this is potentially interesting for some of your favorite platforms |
1dda5c2
to
9ca69dd
Compare
…hat the tests all use
…articularly efficiently.
…Environment to avoid rooting the compilation. Update all generators to follow suit and add a test in LibraryImportGenerator to validate that we don't keep the compilation alive. Also fix the build failure in ComInterfaceGenerator
Wasm build tests failure is #76429 |
…s that have occured in our policy since this branch was started
All failures are dotnet/arcade#10885 |
This PR introduces a source generator that supports invoking native function pointers that are defined sequentially in memory (like in a static table or a vtable). This generator is a first step towards our COM source generator and provides a more focused testing ground for the managed->native and native->managed marshalling stubs while also enabling us to move some non-COM dotnet/runtime code to use auto-generated interop stubs.