Deduplicate warnings for attribute on property dataflow#127254
Merged
eduardo-vp merged 5 commits intodotnet:mainfrom Apr 28, 2026
Merged
Deduplicate warnings for attribute on property dataflow#127254eduardo-vp merged 5 commits intodotnet:mainfrom
eduardo-vp merged 5 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes NativeAOT duplicate trim-analysis warnings emitted when analyzing custom attributes on properties/events (dataflow/capability warnings), aligning NativeAOT behavior with the analyzer/ILLink and addressing #120004.
Changes:
- Add a deduplication mechanism in the NativeAOT metadata manager to ensure property/event custom attributes are analyzed only once per metadata handle.
- Update NativeAOT linker/analyzer test cases by removing
UnexpectedWarningannotations that were tracking the duplicate-warning bug.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnAttribute.cs | Removes NativeAOT-only UnexpectedWarning entries now that warnings should not be duplicated. |
| src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AttributePropertyDataflow.cs | Removes NativeAOT-only UnexpectedWarning entries for attribute-on-property/event dataflow scenarios. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs | Tracks processed property/event custom attribute handles to support deduplication. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CustomAttributeBasedDependencyAlgorithm.cs | Uses the new tracking to skip re-analyzing the same property/event custom attributes (and re-emitting the same diagnostics). |
Member
Author
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Apr 22, 2026
Open
added 2 commits
April 27, 2026 12:21
Member
Author
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
MichalStrehovsky
approved these changes
Apr 28, 2026
…nalysis/MethodMetadataNode.cs Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
Member
Author
|
/ba-g DeadLetter |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding
PropertyMetadataNodeandEventMetadataNodeto the dependency graph to remove duplicate warnings caused by analyzing accessors (getter, setter) and events (adder, remover, raiser) more than once.Fixes #120004.