Commit 78a3f96
Resolve generic descriptor method signatures in ILC (dotnet#128123)
NativeAOT could not resolve XML descriptor method signatures that
reference generic parameters, e.g. `System.Void Method(T)`, while ILLink
accepted the same descriptor.
- **Descriptor matching**
- Formats method signatures with method/type generic context.
- Resolves signature variables back to their generic parameter names for
XML comparison.
- **ILTrim coverage and parity**
- Re-enables existing ILTrim coverage for descriptor-rooted methods by
removing expected-failure entries that now pass.
- Removes the test-specific `--disable-opt unreachablebodies test`
workaround.
- Adds an ILTrim `IsWorthConvertingToThrow` approximation so empty
method bodies composed of an optional `nop` followed by `ret` are
preserved as-is, matching ILLink behavior closely enough for these
tests.
- Uses that heuristic when deciding whether to rewrite unreachable
method bodies.
- **ILCompiler test coverage**
- Updates the shared LinkXml test expectation so NativeAOT/ILCompiler
now expects the generic descriptor-rooted method to be kept.
Example descriptor now handled consistently:
```xml
<type fullname="MyGenericClass`1">
<method signature="System.Void GenericMethod(T)" />
</type>
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>1 parent 7210d22 commit 78a3f96
4 files changed
Lines changed: 54 additions & 19 deletions
File tree
- src
- coreclr/tools
- Common/Compiler
- ILTrim.Core/DependencyAnalysis/TokenBased
- ILTrim.Tests
- tools/illink/test/Mono.Linker.Tests.Cases/LinkXml
Lines changed: 23 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
| 534 | + | |
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
| |||
545 | 546 | | |
546 | 547 | | |
547 | 548 | | |
548 | | - | |
| 549 | + | |
549 | 550 | | |
550 | 551 | | |
551 | 552 | | |
| |||
572 | 573 | | |
573 | 574 | | |
574 | 575 | | |
575 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
576 | 584 | | |
577 | 585 | | |
578 | 586 | | |
| |||
620 | 628 | | |
621 | 629 | | |
622 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
623 | 637 | | |
624 | 638 | | |
625 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
626 | 646 | | |
627 | 647 | | |
628 | 648 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
204 | 234 | | |
205 | 235 | | |
206 | 236 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | | - | |
178 | 176 | | |
179 | | - | |
180 | 177 | | |
181 | 178 | | |
182 | 179 | | |
| |||
229 | 226 | | |
230 | 227 | | |
231 | 228 | | |
232 | | - | |
233 | 229 | | |
234 | 230 | | |
235 | 231 | | |
| |||
324 | 320 | | |
325 | 321 | | |
326 | 322 | | |
327 | | - | |
328 | 323 | | |
329 | | - | |
330 | | - | |
331 | 324 | | |
332 | 325 | | |
333 | 326 | | |
| |||
370 | 363 | | |
371 | 364 | | |
372 | 365 | | |
373 | | - | |
374 | 366 | | |
375 | 367 | | |
376 | 368 | | |
377 | 369 | | |
378 | 370 | | |
379 | 371 | | |
380 | | - | |
381 | | - | |
382 | 372 | | |
383 | | - | |
384 | 373 | | |
385 | 374 | | |
386 | 375 | | |
| |||
392 | 381 | | |
393 | 382 | | |
394 | 383 | | |
395 | | - | |
396 | 384 | | |
397 | 385 | | |
398 | 386 | | |
| |||
506 | 494 | | |
507 | 495 | | |
508 | 496 | | |
509 | | - | |
510 | 497 | | |
511 | 498 | | |
512 | 499 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| |||
0 commit comments