-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coverage: Prepare for improved branch coverage #124217
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
for branch in &mut self.mcdc_branch_spans[rebase_idx..] { | ||
branch.condition_info = None; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the MC/DC code gives up on full MC/DC instrumentation, instead of creating a BranchSpan
, it now creates an MCDCBranchSpan
with condition_info: None
.
That span will eventually get turned back into an ordinary branch region, in the coverage MIR pass. This change will let me improve how ordinary branch coverage is handled during MIR building, without having to also worry about how it interacts with MC/DC.
cc @Lambdaris @ZhuUx @RenjiSann This will affect any work that you're building on top of the current MC/DC code. |
This comment has been minimized.
This comment has been minimized.
3a6c74b
to
c6eb1ac
Compare
The separation might mean it's better for mcdc to develop its own methods to deal with pattern match like |
r? @oli-obk |
MC/DC's reliance on the existing branch coverage types is making it much harder to improve branch coverage.
This clears the way for larger changes to how branches are handled by the coverage instrumentor, in order to support branch coverage for more language constructs.
@bors r+ rollup |
coverage: Prepare for improved branch coverage When trying to rebase my new branch coverage work (including rust-lang#124154) on top of the introduction of MC/DC coverage (rust-lang#123409), I found it a lot harder than anticipated. With the benefit of hindsight, the branch coverage code and MC/DC code have become more interdependent than I'm happy with. This PR therefore disentangles them a bit, so that it will be easier for both areas of code to evolve independently without interference. --- This PR also includes a few extra branch coverage tests that I had sitting around from my current branch coverage work. They mostly just demonstrate that certain language constructs listed in rust-lang#124118 currently don't have branch coverage support. `@rustbot` label +A-code-coverage
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - rust-lang#124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - rust-lang#124217 (coverage: Prepare for improved branch coverage) - rust-lang#124220 (Miri: detect wrong vtables in wide pointers) - rust-lang#124252 (Improve ICE message for forbidden dep-graph reads.) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#115913 (checked_ilog: improve performance) - rust-lang#124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - rust-lang#124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - rust-lang#124217 (coverage: Prepare for improved branch coverage) - rust-lang#124230 (Stabilize generic `NonZero`.) - rust-lang#124252 (Improve ICE message for forbidden dep-graph reads.) - rust-lang#124268 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#115913 (checked_ilog: improve performance) - rust-lang#124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - rust-lang#124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - rust-lang#124217 (coverage: Prepare for improved branch coverage) - rust-lang#124230 (Stabilize generic `NonZero`.) - rust-lang#124252 (Improve ICE message for forbidden dep-graph reads.) - rust-lang#124268 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124217 - Zalathar:pre-branch, r=oli-obk coverage: Prepare for improved branch coverage When trying to rebase my new branch coverage work (including rust-lang#124154) on top of the introduction of MC/DC coverage (rust-lang#123409), I found it a lot harder than anticipated. With the benefit of hindsight, the branch coverage code and MC/DC code have become more interdependent than I'm happy with. This PR therefore disentangles them a bit, so that it will be easier for both areas of code to evolve independently without interference. --- This PR also includes a few extra branch coverage tests that I had sitting around from my current branch coverage work. They mostly just demonstrate that certain language constructs listed in rust-lang#124118 currently don't have branch coverage support. ``@rustbot`` label +A-code-coverage
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.
When trying to rebase my new branch coverage work (including #124154) on top of the introduction of MC/DC coverage (#123409), I found it a lot harder than anticipated. With the benefit of hindsight, the branch coverage code and MC/DC code have become more interdependent than I'm happy with.
This PR therefore disentangles them a bit, so that it will be easier for both areas of code to evolve independently without interference.
This PR also includes a few extra branch coverage tests that I had sitting around from my current branch coverage work. They mostly just demonstrate that certain language constructs listed in #124118 currently don't have branch coverage support.
@rustbot label +A-code-coverage