[SILOpt] Removed unreachable bailouts.

Now that supportsMoveOnlyTypes is always true, these bailouts can't be
reached.  Delete the bailouts and the predicate.
This commit is contained in:
Nate Chandler
2024-02-05 17:40:17 -08:00
parent af1da401d9
commit 336afca477
9 changed files with 0 additions and 36 deletions

View File

@@ -742,9 +742,6 @@ public:
FuncDecl *getMakeInvocationEncoderOnDistributedActorSystem(
AbstractFunctionDecl *thunk) const;
/// Indicates whether move-only / noncopyable types are supported.
bool supportsMoveOnlyTypes() const;
// Retrieve the declaration of
// DistributedInvocationEncoder.recordGenericSubstitution(_:).
//

View File

@@ -6529,8 +6529,3 @@ Type ASTContext::getNamedSwiftType(ModuleDecl *module, StringRef name) {
return nominalDecl->getDeclaredType();
return decl->getDeclaredInterfaceType();
}
bool ASTContext::supportsMoveOnlyTypes() const {
// currently the only thing holding back whether the types can appear is this.
return true;
}

View File

@@ -2463,10 +2463,6 @@ class ConsumeOperatorCopyableAddressesCheckerPass
auto *fn = getFunction();
auto &astContext = fn->getASTContext();
// Only run this pass if the move only language feature is enabled.
if (!astContext.supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (getFunction()->wasDeserializedCanonical())
return;

View File

@@ -553,10 +553,6 @@ class ConsumeOperatorCopyableValuesCheckerPass : public SILFunctionTransform {
void run() override {
auto *fn = getFunction();
// Only run this pass if the move only language feature is enabled.
if (!fn->getASTContext().supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (fn->wasDeserializedCanonical())
return;

View File

@@ -78,10 +78,6 @@ class MoveOnlyAddressCheckerTesterPass : public SILFunctionTransform {
void run() override {
auto *fn = getFunction();
// Only run this pass if the move only language feature is enabled.
if (!fn->getASTContext().supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (getFunction()->wasDeserializedCanonical())
return;

View File

@@ -71,10 +71,6 @@ class MoveOnlyBorrowToDestructureTransformPass : public SILFunctionTransform {
void run() override {
auto *fn = getFunction();
// Only run this pass if the move only language feature is enabled.
if (!fn->getASTContext().supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (getFunction()->wasDeserializedCanonical())
return;

View File

@@ -215,10 +215,6 @@ class MoveOnlyCheckerPass : public SILFunctionTransform {
void run() override {
auto *fn = getFunction();
// Only run this pass if the move only language feature is enabled.
if (!fn->getASTContext().supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (getFunction()->wasDeserializedCanonical())
return;

View File

@@ -75,10 +75,6 @@ class MoveOnlyObjectCheckerTesterPass : public SILFunctionTransform {
void run() override {
auto *fn = getFunction();
// Only run this pass if the move only language feature is enabled.
if (!fn->getASTContext().supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (getFunction()->wasDeserializedCanonical())
return;

View File

@@ -34,10 +34,6 @@ struct MoveOnlyTempAllocationFromLetTester : SILFunctionTransform {
void run() override {
auto *fn = getFunction();
// Only run this pass if the move only language feature is enabled.
if (!fn->getASTContext().supportsMoveOnlyTypes())
return;
// Don't rerun diagnostics on deserialized functions.
if (getFunction()->wasDeserializedCanonical())
return;