-
Notifications
You must be signed in to change notification settings - Fork 128
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
Improve support for Analyzer AOT warnings #2495
Comments
Less relevant but in the same line, NativeAOT needs a place to document warnings. We already have the RequiresDynamicCode warning produced by both the AOT code and analyzer, but is not in the Microsoft Docs |
The warnings are now documented, for example: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/warnings/il3050 @tlakollo do you remember what kind of support is this issue about? We do have the analyzer for The only thing I'm aware of is that NativeAOT has special handling for a couple of APIs like |
I think this issue refers to two different things, mainly the intrinsic support for NativeAOT, second part is the diagnostic codes that are currently not produced by the analyzer IL3053-IL3055 but likely are even more niche to encounter. This issue was filled when we already had support for IL3050-IL3052 |
Since you have more context, could you please rename the issue and add larger description about what it wants? |
Currently, we have an analyzer that can support IL3050 and IL3051. This allows having warnings into methods and classes annotated with
RequiresDynamicCode
when they are accessed, which is similar behavior to what we have forRequiresUnreferencedCode
.In the case of
RequiresUnreferencedCode
we use aDynamicallyAccessedMembersAnalyzer
to conduct a broader analysis, we run a Dataflow section in which special methods considered "intrinsics" are treated as special method calls. They are considered special because although the methods are annotated withRequiresUnreferencedCode
and they will warn in certain scenarios, we use the dataflow analysis to understand the inputs to the method and try not to warn for scenarios that are safe for trimming.For AOT, we have a similar number of intrinsics that the compiler does a broader analysis in order to warn only in certain scenarios but at this moment they all will warn unconditionally e.g. with
MakeGenericType
Additional to the intrinsic support which are methods annotated with
RequiresDynamicCode
they are certain patterns that the AOT compiler verifies during the analysis phase and creates warnings for IL3052, IL3054, IL3055, IL3056 that need to be produced by the analyzerThe text was updated successfully, but these errors were encountered: