Skip to content

SIL: add a utility function to check if a terminator exits a function… #1984

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 1 commit into from
Mar 31, 2016

Conversation

eeckstein
Copy link
Contributor

What's in this pull request?

Resolved bug number: (SR-)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

…. NFC

@eeckstein
Copy link
Contributor Author

@swift-ci Please smoke test

@eeckstein eeckstein merged commit 41a5800 into swiftlang:master Mar 31, 2016
@eeckstein eeckstein deleted the is_function_exiting branch March 31, 2016 18:47
/// Returns true if this terminator exits the function.
bool isFunctionExiting() const {
return getKind() == ValueKind::ThrowInst ||
getKind() == ValueKind::ReturnInst;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be an exhaustive switch, so we cover any new instructions we add? Should Unreachable also be considered to exit the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can this be an exhaustive switch
Makes sense. I'll change it.

Should Unreachable also be considered to exit the function?
Not for the purposes where this function is used.

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.

2 participants