-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support mcdc analysis for pattern matching #124278
base: master
Are you sure you want to change the base?
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
Failed to set assignee to
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
39732bf
to
0255b0b
Compare
Determining decision of pattern matching is more tricky than expected. I should write it down here in case someone feels confused about it. We call patterns like The first rule is that candidate is constructed where all match pairs representing The second rule is the first pair will be removed and compiler will insert its sub pairs into the candidate's match pairs if it is "full matched" Thus in all, the evaluate order of
While the order of
And the order of
A more mischievous example is
Hopefully the decision structure were not taken as mischief by users. |
This comment has been minimized.
This comment has been minimized.
I have pushed an impractical commit to show design for constructing decisions and mcdc branches of pattern matching. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #124255) made this pull request unmergeable. Please resolve the merge conflicts. |
Split mcdc code to a sub module of coverageinfo A further work from rust-lang#124217 . I have made relatively large changes when working on rust-lang#124278 so that it would better split them from `coverageinfo.rs` to avoid potential troubling merge work with improved branch coverage by `@Zalathar` . Besides `BlockMarkerGenerator` is added to avoid ownership problems (mostly needed for following change of rust-lang#124278 ) All code changes are done in [a37d737a](rust-lang@a3d737a) while the second commit just renames the file. cc `@RenjiSann` `@Zalathar` This will impact your current work.
Implementation for if-let has been drafted. Due to llvm does not support nested decisions yet tests for let-chains are not added. I should try to reduce coverage expressions and investigate if it works for matching guards later. |
☔ The latest upstream changes (presumably #124972) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #130200) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #132128) made this pull request unmergeable. Please resolve the merge conflicts. |
@ZhuUx this is no longer blocked so if you can resolve the conflicts, we can push this forward. Thanks |
f2f6704
to
f79e08c
Compare
This comment has been minimized.
This comment has been minimized.
…n and change the way to calculate decision depth
…thout updating global bitmap
f79e08c
to
0421337
Compare
@rustbot review |
Efforts to clean up match-lowering and coverage instrumentation are still ongoing. There seems to have been some kind of confusion here; I'm a bit baffled to see someone from triage come along and unilaterally proclaim that this is unblocked when it isn't. @rustbot blocked |
☔ The latest upstream changes (presumably #136809) made this pull request unmergeable. Please resolve the merge conflicts. |
To finish the second task at #124144.
Changes
That means,
coverage-options=mcdc
may give different branch coverage results of pattern matching withcoverage-options=branch
temporarily.match
.Note. The results might be a bit counter intuitive due to reorder as this comment introduces.