[ILLink analyzer] Add analyzer support for feature checks#94944
Merged
sbomer merged 11 commits intodotnet:mainfrom Feb 29, 2024
Merged
[ILLink analyzer] Add analyzer support for feature checks#94944sbomer merged 11 commits intodotnet:mainfrom
sbomer merged 11 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsAdds support for annotating static boolean properties with Adds two new warnings for:
See #94625 for notes on the design.
|
This was referenced Feb 28, 2024
jtschuster
approved these changes
Feb 28, 2024
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureCheckAttributeDataFlow.cs
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/DataFlow/FeatureChecksValue.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/ISymbolExtensions.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/ISymbolExtensions.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TrimAnalysisReturnValuePattern.cs.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TrimAnalysisReturnValuePattern.cs.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TrimAnalysisReturnValuePattern.cs.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureCheckAttributeDataFlow.cs
Show resolved
Hide resolved
jtschuster
reviewed
Feb 28, 2024
…cksValue.cs Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
- Add more detail to feature check validation message - Use existing attribute helper to get AttributeData by attribute name - Replace unnecessary ImmutableArray Builder - Invert some if conditions to return early - Rename TrimAnalysisReturnValuePattern -> FeatureCheckReturnValuePattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for annotating static boolean properties with
[FeatureCheckAttribute(typeof(RequiresDynamicCodeAttribute))], causing the property to be treated as a guard for analyzer warnings about the correspondingRequiresattribute.Adds two new warnings for:
FeatureCheckAttributeapplied to a non-static or non-bool propertySee #94625 for notes on the design.
See #96859 for the API proposal.