dotnet / dotnet/runtime

Consider diagnostic bag for ILLink

Open
#132,323 2 comments 0 reactions 0 assignees View on GitHub
area-Tools-ILLink
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

From @agocke in https://github.com/dotnet/runtime/pull/131911#pullrequestreview-4932999368:

> In general I prefer taking a diagnostics bag vs suppressing warnings. That way the core code stays simple by just adding to the bag, but if the caller doesn't need the bag they can just throw it away after the call instead of passing on the diagnostics

We should consider adopting a pattern like this in ILLink and related tools. This could potentially simplify the suppression logic, but we would need to re-think some of the abstractions around `DiagnosticContext`.

Contributor guide

Open the contributing guide

Research direction

Start with the linked pull request review and trace ILLink's DiagnosticContext and current warning-suppression abstractions. Determine whether the diagnostics-bag pattern fits ILLink and related tools; done means the design question is resolved and the affected abstractions and caller behavior are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.