This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
Factor ReflectionMethodBodyScanner to be more similar to analyzer - #2761
Merged
Merged
Conversation
From HandleCallAction and RequireDynamicallyAccessedMembersAction
tlakollo
reviewed
Apr 25, 2022
tlakollo
reviewed
Apr 25, 2022
tlakollo
reviewed
Apr 25, 2022
tlakollo
approved these changes
Apr 25, 2022
- Clean up left-over comments, newlines - Remove unnecessary MessageOrigin argument
vitek-karas
approved these changes
Apr 26, 2022
Member
|
I'm going to merge this - working on more sharing and this would come really handy. |
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
…tnet/linker#2761) Follow-up to dotnet/linker#2747. This is a factoring change only and doesn't introduce functional changes. This does two things to move the method body scanner to be more similar to the trim analysis visitor: - Uses `DiagnosticContext` to record diagnostics. Right now, this still happens inline as we run the scanner, but the idea will be to move this out to a driver that runs the analysis, and then records diagnostics from the recorded patterns (like how it is done in the analyzer) - Moves reflection-marking helpers out of `ReflectionMethodBodyScanner` to a separate class. This prevents us from having to pass around the scanner to other helpers, and makes it more obvious which parts of the code to scanning only vs other things. The new `ReflectionMarker` is conceptually similar to `ReflectionAccessAnalyzer` in the Roslyn analyzer and could be a candidate for future code sharing. Commit migrated from dotnet/linker@f26189b
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.
Follow-up to #2747. This is a factoring change only and doesn't introduce functional changes.
This does two things to move the method body scanner to be more similar to the trim analysis visitor:
DiagnosticContextto record diagnostics. Right now, this still happens inline as we run the scanner, but the idea will be to move this out to a driver that runs the analysis, and then records diagnostics from the recorded patterns (like how it is done in the analyzer)ReflectionMethodBodyScannerto a separate class. This prevents us from having to pass around the scanner to other helpers, and makes it more obvious which parts of the code to scanning only vs other things. The newReflectionMarkeris conceptually similar toReflectionAccessAnalyzerin the Roslyn analyzer and could be a candidate for future code sharing.