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: Unbox and simplify bcb_filtered_successors #116589

Merged
merged 2 commits into from
Oct 10, 2023

Commits on Oct 10, 2023

  1. coverage: Replace ShortCircuitPreorder with a single function

    Instead of defining a named struct, we can use `std::iter::from_fn` and store
    intermediate state in a closure.
    Zalathar committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    f214497 View commit details
    Browse the repository at this point in the history
  2. coverage: Unbox and simplify bcb_filtered_successors

    This function already has access to the MIR body, so instead of taking a
    reference to a terminator, it's simpler and easier to pass in a basic block
    index.
    
    There is no need to box the returned iterator if we instead add appropriate
    lifetime captures, since `short_circuit_preorder` is now generic over the type
    of iterator it expects.
    
    We can also greatly simplify the function's implementation by observing that
    the only difference between its two cases is whether we take all of a BB's
    successors, or just the first one.
    Zalathar committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    5d62945 View commit details
    Browse the repository at this point in the history