Skip to content

Commit 336afca

Browse files
committed
[SILOpt] Removed unreachable bailouts.
Now that supportsMoveOnlyTypes is always true, these bailouts can't be reached. Delete the bailouts and the predicate.
1 parent af1da40 commit 336afca

9 files changed

+0
-36
lines changed

include/swift/AST/ASTContext.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,9 +742,6 @@ class ASTContext final {
742742
FuncDecl *getMakeInvocationEncoderOnDistributedActorSystem(
743743
AbstractFunctionDecl *thunk) const;
744744

745-
/// Indicates whether move-only / noncopyable types are supported.
746-
bool supportsMoveOnlyTypes() const;
747-
748745
// Retrieve the declaration of
749746
// DistributedInvocationEncoder.recordGenericSubstitution(_:).
750747
//

lib/AST/ASTContext.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6529,8 +6529,3 @@ Type ASTContext::getNamedSwiftType(ModuleDecl *module, StringRef name) {
65296529
return nominalDecl->getDeclaredType();
65306530
return decl->getDeclaredInterfaceType();
65316531
}
6532-
6533-
bool ASTContext::supportsMoveOnlyTypes() const {
6534-
// currently the only thing holding back whether the types can appear is this.
6535-
return true;
6536-
}

lib/SILOptimizer/Mandatory/ConsumeOperatorCopyableAddressesChecker.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,10 +2463,6 @@ class ConsumeOperatorCopyableAddressesCheckerPass
24632463
auto *fn = getFunction();
24642464
auto &astContext = fn->getASTContext();
24652465

2466-
// Only run this pass if the move only language feature is enabled.
2467-
if (!astContext.supportsMoveOnlyTypes())
2468-
return;
2469-
24702466
// Don't rerun diagnostics on deserialized functions.
24712467
if (getFunction()->wasDeserializedCanonical())
24722468
return;

lib/SILOptimizer/Mandatory/ConsumeOperatorCopyableValuesChecker.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,6 @@ class ConsumeOperatorCopyableValuesCheckerPass : public SILFunctionTransform {
553553
void run() override {
554554
auto *fn = getFunction();
555555

556-
// Only run this pass if the move only language feature is enabled.
557-
if (!fn->getASTContext().supportsMoveOnlyTypes())
558-
return;
559-
560556
// Don't rerun diagnostics on deserialized functions.
561557
if (fn->wasDeserializedCanonical())
562558
return;

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerTester.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ class MoveOnlyAddressCheckerTesterPass : public SILFunctionTransform {
7878
void run() override {
7979
auto *fn = getFunction();
8080

81-
// Only run this pass if the move only language feature is enabled.
82-
if (!fn->getASTContext().supportsMoveOnlyTypes())
83-
return;
84-
8581
// Don't rerun diagnostics on deserialized functions.
8682
if (getFunction()->wasDeserializedCanonical())
8783
return;

lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureTester.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ class MoveOnlyBorrowToDestructureTransformPass : public SILFunctionTransform {
7171
void run() override {
7272
auto *fn = getFunction();
7373

74-
// Only run this pass if the move only language feature is enabled.
75-
if (!fn->getASTContext().supportsMoveOnlyTypes())
76-
return;
77-
7874
// Don't rerun diagnostics on deserialized functions.
7975
if (getFunction()->wasDeserializedCanonical())
8076
return;

lib/SILOptimizer/Mandatory/MoveOnlyChecker.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ class MoveOnlyCheckerPass : public SILFunctionTransform {
215215
void run() override {
216216
auto *fn = getFunction();
217217

218-
// Only run this pass if the move only language feature is enabled.
219-
if (!fn->getASTContext().supportsMoveOnlyTypes())
220-
return;
221-
222218
// Don't rerun diagnostics on deserialized functions.
223219
if (getFunction()->wasDeserializedCanonical())
224220
return;

lib/SILOptimizer/Mandatory/MoveOnlyObjectCheckerTester.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ class MoveOnlyObjectCheckerTesterPass : public SILFunctionTransform {
7575
void run() override {
7676
auto *fn = getFunction();
7777

78-
// Only run this pass if the move only language feature is enabled.
79-
if (!fn->getASTContext().supportsMoveOnlyTypes())
80-
return;
81-
8278
// Don't rerun diagnostics on deserialized functions.
8379
if (getFunction()->wasDeserializedCanonical())
8480
return;

lib/SILOptimizer/Mandatory/MoveOnlyTempAllocationFromLetTester.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ struct MoveOnlyTempAllocationFromLetTester : SILFunctionTransform {
3434
void run() override {
3535
auto *fn = getFunction();
3636

37-
// Only run this pass if the move only language feature is enabled.
38-
if (!fn->getASTContext().supportsMoveOnlyTypes())
39-
return;
40-
4137
// Don't rerun diagnostics on deserialized functions.
4238
if (getFunction()->wasDeserializedCanonical())
4339
return;

0 commit comments

Comments
 (0)