Skip to content

[Profiler] Improve if statement coverage #70172

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

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Dec 1, 2023

Fix counters for regions following else ifs, fix the counters for else if conditions, and fix handling of break statements. Also while here, clean up the handling of branch exit regions such that we don't generate multiple overlapping regions for each branch, but a single region at the end of the entire if statement that accounts for all exiting control flow.

rdar://104078910
rdar://104079242
Resolves #62943
Resolves #62944

The 'then' statement must be a BraceStmt, and
the 'else' must either be a BraceStmt or an IfStmt.
Fix counters for regions following `else if`s, fix
the counters for `else if` conditions, and fix
handling of `break` statements. Also while here,
clean up the handling of branch exit regions such
that we don't generate multiple overlapping
regions for each branch, but a single region at
the end of the entire `if` statement that accounts
for all exiting control flow.

rdar://104078910
rdar://104079242
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight hamishknight merged commit e6ec9b0 into swiftlang:main Dec 4, 2023
@hamishknight hamishknight deleted the or-else branch December 4, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect coverage for blocks following else ifs Incorrect else if condition coverage
2 participants