[dotnet-linker] Don't emit parameter names for generated proxy methods. - #26363
[dotnet-linker] Don't emit parameter names for generated proxy methods.#26363rolfbjarne wants to merge 4 commits into
Conversation
Don't emit parameter names in the generated registrar code. Cecil only emits a Param row for parameters that have a name (or attributes, marshalling info or a default value), and the parameter names of these generated methods have no value to anyone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6aeeddfd-3bd8-4129-ad90-7292860c4b66
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce metadata size in linker-generated registrar/proxy code by avoiding emitting parameter names for generated methods, since Mono.Cecil can omit Param table rows when parameters are unnamed.
Changes:
- Added a
MethodDefinition.AddParameter (TypeReference)helper intended to create unnamed parameters for generated methods. - Updated multiple linker steps (registrar generation and lookup table generation) to use unnamed parameters, keeping intent via inline comments.
- Updated AppBundleRewriter factory-method emission to omit parameter names for generated
_Xamarin_Construct*methods.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dotnet-linker/Steps/TrimmableRegistrarStep.cs | Uses unnamed parameters for generated proxy methods in trimmable registrar generation. |
| tools/dotnet-linker/Steps/ManagedRegistrarStep.cs | Uses unnamed parameters for generated unmanaged-callback signatures and cloned ctor signatures. |
| tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs | Uses unnamed parameters in generated registrar lookup/construct methods. |
| tools/dotnet-linker/CecilExtensions.cs | Introduces the new unnamed-parameter helper overload. |
| tools/dotnet-linker/AppBundleRewriter.cs | Uses unnamed parameters for generated _Xamarin_ConstructNSObject/_Xamarin_ConstructINativeObject methods. |
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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ 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.
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #51389b6] Test results 🔥Test results❌ Tests failed on VSTS: test results 1 tests crashed, 45 tests failed, 153 tests passed. Failures❌ dotnettests tests (iOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (MacCatalyst)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (tvOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)19 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (tvOS)19 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ msbuild tests1 tests failed, 1 tests passed.Failed tests
Html Report (VSDrops) Download ❌ windows tests1 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ Tests on macOS Ventura (13) tests1 tests failed, 4 tests passed.Failed tests
Html Report (VSDrops) Download ❌ Tests on macOS Sonoma (14) tests🔥 Failed catastrophically on VSTS: test results - mac_sonoma (no summary found). Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
|
Don't emit parameter names in the generated registrar code. Cecil only emits a Param row for parameters that have a name (or attributes, marshalling info or a default value), and the parameter names of these generated methods have no value to anyone.
Copilot-Session: 6aeeddfd-3bd8-4129-ad90-7292860c4b66