Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Fix warning about duplicate attributes - #2780

Merged
sbomer merged 4 commits into
dotnet:mainfrom
sbomer:duplicateAttributeFix
May 3, 2022
Merged

sbomer merged 4 commits into
dotnet:mainfrom
sbomer:duplicateAttributeFix

Conversation

@sbomer

@sbomer sbomer commented May 2, 2022

Copy link
Copy Markdown
Member

Duplicate attributes were producing warnings on every callsite in the linker to GetLinkerAttributes, which makes the number of warnings depend on the number of callsites in user code.

Deduplicate these by producing the warning only once, when building the linker attributes cache.

Fixes one of the remaining issues encountered while adding trim analysis patterns in the linker.

@sbomer
sbomer requested a review from marek-safar as a code owner May 2, 2022 23:26
@sbomer
sbomer requested review from tlakollo and vitek-karas May 2, 2022 23:26
@sbomer sbomer changed the title Duplicate attribute fix Fix warning about duplicate attributes May 2, 2022

@tlakollo tlakollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/linker/Linker/Annotations.cs Resolved
Make `TryGetLinkerAttribute` fail if there are multiple attributes.
@sbomer
sbomer merged commit 2e91f89 into dotnet:main May 3, 2022
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
Duplicate attributes were producing warnings on every callsite in
the linker to GetLinkerAttributes, which makes the number of
warnings depend on the number of callsites in user code.

Deduplicate these by producing the warning only once, when
building the linker attributes cache.

Fixes one of the remaining issues encountered while adding trim
analysis patterns in the linker.

Make `TryGetLinkerAttribute` fail if there are multiple attributes.

Commit migrated from dotnet/linker@2e91f89
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants