Skip to content
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: Allow each coverage statement to have multiple code regions #115301

Merged
merged 7 commits into from
Oct 3, 2023

Commits on Oct 3, 2023

  1. coverage: Mappings for unused functions can all be zero

    There is no need to include a dummy counter reference in the coverage mappings
    for an unused function.
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    59a11af View commit details
    Browse the repository at this point in the history
  2. coverage: Encapsulate coverage spans

    By encapsulating the coverage spans in a struct, we can change the internal
    representation without disturbing existing call sites. This will be useful for
    grouping coverage spans by BCB.
    
    This patch includes some changes that were originally in rust-lang#115912, which avoid
    the need for a particular test to deal with coverage spans at all.
    
    (Comments/logs referring to `CoverageSpan` are updated in a subsequent patch.)
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    e29db47 View commit details
    Browse the repository at this point in the history
  3. coverage: Update comments/logs that referred to CoverageSpan

    The concrete type `CoverageSpan` is no longer used outside of the `spans`
    module.
    
    This is a separate patch to avoid noise in the preceding patch that actually
    encapsulates coverage spans.
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    1355e1f View commit details
    Browse the repository at this point in the history
  4. coverage: Let each coverage statement hold a vector of code regions

    This makes it possible for a `StatementKind::Coverage` to hold more than one
    code region, but that capability is not yet used.
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    ee9d00f View commit details
    Browse the repository at this point in the history
  5. coverage: Store each BCB's code regions in one coverage statement

    If a BCB has more than one code region, those extra regions can now all be
    stored in the same coverage statement, instead of being stored in additional
    statements.
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    86a66c8 View commit details
    Browse the repository at this point in the history
  6. coverage: Remove code for making expression copies of BCB counters

    Now that coverage statements can have multiple code regions attached to them,
    this code is never used.
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    b1cf0c8 View commit details
    Browse the repository at this point in the history
  7. coverage: Remove next_id methods from counter/expression IDs

    When these methods were originally written, I wasn't aware that
    `newtype_index!` already supports addition with ordinary numbers, without
    needing to unwrap and re-wrap.
    Zalathar committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    053c4f9 View commit details
    Browse the repository at this point in the history