coverage: Migrate branch coverage to use CoveragePoint and HIR analysis - #162425
Open
Zalathar wants to merge 1 commit into
Open
coverage: Migrate branch coverage to use CoveragePoint and HIR analysis#162425Zalathar wants to merge 1 commit into
Zalathar wants to merge 1 commit into
Conversation
While we still rely on injecting markers into the true and false blocks of a condition during MIR building, this approach avoids the need for a separate side-table, as the association between true/false markers can be recovered by matching their HirId. There is no longer any need to keep track of enclosing `!` expressions, because with HirId we can instead walk up the HIR parent chain to find the original condition. `CoverageEarlyInfo` and `CoverageKind::BlockMarker` have been removed, as they are no longer needed.
Collaborator
|
Some changes occurred in match lowering cc @Nadrieril Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Collaborator
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
Author
|
|
Contributor
|
☔ The latest upstream changes (presumably #162434) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
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.
Historically, the implementation of branch coverage instrumentation (#122322) required keeping a side-table of branch spans associated with opaque marker-statement IDs, which corresponded to injected marker statements. Using similar techniques to #161517, this PR instead injects marker statements that associate the true/false destination blocks with the HirId of the expression being inspected.
While we still rely on injecting markers into the true and false blocks of a condition during MIR building, this approach avoids the need for a separate side-table, as the association between true/false markers can be recovered by matching their HirId.
There is no longer any need to keep track of enclosing
!expressions, because with HirId we can instead walk up the HIR parent chain to find the original condition.CoverageEarlyInfoandCoverageKind::BlockMarkerhave been removed, as theyare no longer needed.