[ILLink analyzer] Move generic parameter analysis to dataflow#95482
[ILLink analyzer] Move generic parameter analysis to dataflow#95482sbomer merged 5 commits intodotnet:mainfrom
Conversation
And align behavior more closely with NativeAot
|
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsAnd align behavior more closely with NativeAot. Fixes #95121. Some things to note:
|
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs
Show resolved
Hide resolved
|
This is great. I just had one question can't we share the trimming logic between the trimmer, NativeAOT, and the rest of the app models where we do trimming? This is hard to do or is it technically impossible to do so? |
|
We've been making progress on sharing some of the code - see https://github.com/dotnet/runtime/tree/main/src/tools/illink/src/ILLink.Shared. The three tools use three different type systems, so a big part of the sharing effort is using wrapper types that hide some of the type system differences. |
|
The additional complication is that trimmer (illink) and NativeAOT see IL, while the analyzer sees the Roslyn's operations/CFG. We could probably share more if(when) we implement CFG reconstruction from IL in trimmer and NativeAOT. But currently the two approaches have to do some things differently. That said, we already share quite a lot of the core data flow logic, and almost all of the tests. |
And align behavior more closely with NativeAot. I tried to roughly follow the implementation approach used by NativeAot in GenericArgumentDataFlow.cs to make it easier to share the logic (without actually sharing the code for now).
Fixes #95121.
Some things to note:
typeof