Optimize the Regex source generator's handling of Compilation objects.#65431
Optimize the Regex source generator's handling of Compilation objects.#65431stephentoub merged 4 commits intodotnet:mainfrom
Compilation objects.#65431Conversation
…rator. And remove a now-unused file.
|
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsThis PR optimizes the Regex source generator's pipeline in a similar way to what was done in #64579. The The
|
Compilation objects.
src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs
Outdated
Show resolved
Hide resolved
chsienki
left a comment
There was a problem hiding this comment.
Thanks @teo-tsirpanis, this looks like a nice improvement! I've written my thoughts on the attribute lookup change.
Will leave it to @stephentoub to decide, but maybe for this PR we should leave the old behavior using GetBestTypeByMetadataName and consider being more permissive in a separate change.
d27320e to
00ad4be
Compare
|
PR feedback was addressed; we still use |
This PR optimizes the Regex source generator's pipeline in a similar way to what was done in #64579.
The
Compilationobject was mostly removed from the pipeline, with its presence being restricted to anIncrementalValueProvider<bool>that contains whether unsafe code is allowed, which is seamlessly combined to the main pipeline without needing a custom comparer.The
GetRegexTypeToEmitmethod was merged with theGetSemanticTargetForGenerationmethod and moved earlier in the pipeline, according to feedback from the linked PR.