coverage: Rename the three main coverage-info structs - #161902
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras |
|
r? @mejrs rustbot has assigned @mejrs. Use Why was this reviewer chosen?The reviewer was selected based on:
|
cc5f515 to
e4f8600
Compare
This comment has been minimized.
This comment has been minimized.
|
I'm not a fan of putting "early" in names of things. In my experience it tends to be somewhat vague and it ages poorly. How about |
e4f8600 to
6308364
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
- CoverageInfoHi => CoverageEarlyInfo - FunctionCoverageInfo => CoverageMirInfo - CoverageIdsInfo => CoverageCodegenInfo
6308364 to
0bce041
Compare
Hmm, I see the general concern, but in this instance I think it's doing good work, and there's less risk of it going stale than if we tried to use a less-vague name. The main distinction I'm trying to make is that of the two side-data structs attached to a MIR body, this is the one that has to be prepared at a time before the main InstrumentCoverage pass, because it preserves information that is only available during MIR building. The struct itself contains whatever currently needs to be collected early and stored as side-data. It's less “important” than the side-data recorded during instrumentation, and ceases to have value after instrumentation. Any my hope is that follow-up work to #161517 will allow it to be removed entirely. The specific suggestion of I could imagine it being named something verbose like |
coverage: Rename the three main coverage-info structs This PR renames the three main structures used to carry per-function coverage info through different stages of compilation: ```text - CoverageInfoHi => CoverageEarlyInfo // collected early, at the THIR/MIR boundary during MIR building - FunctionCoverageInfo => CoverageMirInfo // collected during the main MIR instrumentation pass - CoverageIdsInfo => CoverageCodegenInfo // collected during codegen, after MIR opts ``` The new names should hopefully help to keep the three structs distinct, while also avoiding the historical inconsistency of the previous names. The renaming also resolves an old TODO of mine about `coverage_ids_info` no longer making sense as a name. There should be no change to compiler behaviour.
Rollup merge of #161902 - Zalathar:coverage-info, r=mejrs coverage: Rename the three main coverage-info structs This PR renames the three main structures used to carry per-function coverage info through different stages of compilation: ```text - CoverageInfoHi => CoverageEarlyInfo // collected early, at the THIR/MIR boundary during MIR building - FunctionCoverageInfo => CoverageMirInfo // collected during the main MIR instrumentation pass - CoverageIdsInfo => CoverageCodegenInfo // collected during codegen, after MIR opts ``` The new names should hopefully help to keep the three structs distinct, while also avoiding the historical inconsistency of the previous names. The renaming also resolves an old TODO of mine about `coverage_ids_info` no longer making sense as a name. There should be no change to compiler behaviour.
This PR renames the three main structures used to carry per-function coverage info through different stages of compilation:
The new names should hopefully help to keep the three structs distinct, while also avoiding the historical inconsistency of the previous names.
The renaming also resolves an old TODO of mine about
coverage_ids_infono longer making sense as a name.There should be no change to compiler behaviour.