Skip to content

[silgenpattern] Change catch emission to not be conditional on owners… #19986

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

Conversation

gottesmm
Copy link
Contributor

…hip verification being enabled.

We were missing the code-coverage needed to show this so I added some examples
to test/SILGen/errors.swift.

rdar://29791263

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

//
// CHECK: [[SWITCH_MATCH_FAIL_BB]]([[SUBERROR:%.*]] : @owned $HomeworkError):
// CHECK: destroy_value [[SUBERROR]]
// CHECK: br [[RETHROW_BB:bb[0-9]+]]([[ERROR]] : $Error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does there need to be an end_borrow in SWITCH_MATCH_FAIL_BB1.

// CHECK: br [[RETHROW_BB:bb[0-9]+]]([[ERROR]] : $Error)
//
// CHECK: [[CAST_NO_BB]]:
// CHECK: br [[RETHROW_BB]]([[ERROR]] : $Error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does there need to be an end_borrow in CAST_NO_BB.

// CHECK: switch_enum [[SUBERROR]] : $HomeworkError, case #HomeworkError.TooHard!enumelt: {{bb[0-9]+}}, case #HomeworkError.TooMuch!enumelt: {{bb[0-9]+}}, default [[SWITCH_MATCH_FAIL_BB:bb[0-9]+]],
//
// CHECK: [[SWITCH_MATCH_FAIL_BB]]([[SUBERROR:%.*]] : @owned $HomeworkError):
// CHECK: destroy_value [[SUBERROR]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question about the end_borrow here.

@@ -176,6 +176,79 @@ func all_together_now(_ flag: Bool) -> Cat {
}
}

// Make sure that if we catch an error in a throwing function we borrow the
// error and only consume the error by the rethrow block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only consume the error in the rethrow block.

@gottesmm
Copy link
Contributor Author

I'll fix the comment and add in the end_borrows (they are there I just didn't add the filecheck pattern).

…hip verification being enabled.

We were missing the code-coverage needed to show this so I added some examples
to test/SILGen/errors.swift.

rdar://29791263
@gottesmm gottesmm force-pushed the pr-39aa50102d65c79c698d094c139faab143fa5bbe branch from b34247a to 447a11a Compare October 23, 2018 17:05
@gottesmm
Copy link
Contributor Author

@atrick made the changes. Merging!

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit cbbc03a into swiftlang:master Oct 23, 2018
@gottesmm gottesmm deleted the pr-39aa50102d65c79c698d094c139faab143fa5bbe branch October 23, 2018 18:24
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.

3 participants