-
Notifications
You must be signed in to change notification settings - Fork 541
[RGen] Generate the static class for the trampolines. #22890
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
Upate the code generation of rgen to use the 'global::' allias based in the generator configuration. The tests classes have been updated to ensure that if we switch off the use of the alias, the tests do not need to be udpdated.
…ppends with nfloat.
…ory.Dlfcn.cs Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
This change just makes sure that the static class needed by the trampoline is correctly generated. The comment ignores the fact that the getters of the trampolines is incorrect, this is because we want to be able first to generate the helper classes. The code generates the trampoline.g.cs file with the SD* classes but is missing the NID* ones which will be generated in comming PRs.
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.
Pull Request Overview
This PR introduces the static class generation for trampolines while updating test classes and binding syntax to support the trampoline helper generation. Key changes include the addition of new trampoline properties in the test files, extended expected trampoline outputs and selectors, and updates to the TrampolineEmitter along with relevant documentation and known types.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs | Adds new trampoline properties and duplicate handler declarations for different delegate types |
tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTestsTrampolines.cs | Extends generated trampoline delegates and exposes potential missing return in a delegate |
tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTests.cs | Adds new selector handles and duplicate property definitions for trampoline callbacks |
src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs | Implements static trampoline class and delegate emission logic |
src/rgen/Microsoft.Macios.Generator/Emitters/Documentation.cs | Updates documentation methods for the trampoline static class |
src/rgen/Microsoft.Macios.Generator/Emitters/BindingSyntaxFactory.KnownTypes.cs | Adds a new TypeSyntax for BlockLiteral |
Comments suppressed due to low confidence (2)
tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTests.cs:285
- There is a duplicate definition for the 'KernelRoiCallback' property which may lead to ambiguity. Consider consolidating these definitions or renaming one if they represent separate behaviors.
public partial global::CoreImage.CIKernelRoiCallback KernelRoiCallback
tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs:46
- There are duplicate export declarations for 'imageGeneratorCompletionHandler' with different delegate types. Ensure that each property export has a unique name or intended delegate type to avoid conflicts.
[Export<Property>("imageGeneratorCompletionHandler", ArgumentSemantic.Copy)]
} | ||
} |
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.
The delegate SDCIKernelRoiCallback.Invoke is missing a return statement for the computed CGRect value. Add a 'return ret;' after calling the delegate to ensure the method returns a value.
} | |
} | |
return ret; | |
} | |
return global::CoreGraphics.CGRect.Empty; |
Copilot uses AI. Check for mistakes.
This comment has been minimized.
This comment has been minimized.
f1fca5b
to
dad1b42
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bef44ac
to
27f16f0
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
75762c4
to
969439b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #969439b] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #c5d209d] Build passed (Build packages) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #c5d209d] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #c5d209d] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #c5d209d] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #c5d209d] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #969439b] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #c5d209d] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 1 tests failed, 114 tests passed. Failures❌ generator tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This change just makes sure that the static class needed by the trampoline is correctly generated. The comment ignores the fact that the getters of the trampolines is incorrect, this is because we want to be able first to generate the helper classes.
The code generates the trampoline.g.cs file with the SD* classes but is missing the NID* ones which will be generated in comming PRs.