-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
@swift-ci Please smoke test |
@jckarter what's the difference between CleanupLocation and calling SILLocation::markAutoGenerated()? |
lib/SIL/SILType.cpp
Outdated
@@ -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(); |
There was a problem hiding this comment.
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?
AIUI both have the same ultimate effect of being treated as implicit by the debugger. |
21ea0c2
to
5e4b2c5
Compare
…n in witness thunks
… that return Never indirectly
@swift-ci Please smoke test |
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
Source compat failure is some watchOS availability thing unrelated to my changes. |
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.