Skip to content

Fix various bogus unreachable code warnings #15567

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 5 commits into from
Jun 6, 2018

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 28, 2018

Fixes the re-opened https://bugs.swift.org/browse/SR-2729. Also might fix https://bugs.swift.org/browse/SR-3696 but I don't have a Linux machine available right now.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@jckarter what's the difference between CleanupLocation and calling SILLocation::markAutoGenerated()?

@slavapestov slavapestov requested a review from jckarter March 28, 2018 07:14
@@ -638,17 +638,17 @@ bool SILModuleConventions::isPassedIndirectlyInSIL(SILType type, SILModule &M) {
}

bool SILFunctionType::isNoReturnFunction() {
return getDirectFormalResultsType().getSwiftRValueType()->isUninhabited();
if (getNumResults() == 1)
return getSingleResult().getType()->isUninhabited();
Copy link
Contributor

Choose a reason for hiding this comment

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

A function would be noreturn if any of its results are uninhabited, wouldn't it?

@jckarter
Copy link
Contributor

AIUI both have the same ultimate effect of being treated as implicit by the debugger.

@slavapestov slavapestov force-pushed the never-fixes branch 4 times, most recently from 21ea0c2 to 5e4b2c5 Compare June 5, 2018 05:32
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

2 similar comments
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

Source compat failure is some watchOS availability thing unrelated to my changes.

@slavapestov slavapestov merged commit d035caf into swiftlang:master Jun 6, 2018
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