diff --git a/lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp b/lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp index 22db6bac7bfb2..75701f8295764 100644 --- a/lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp +++ b/lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp @@ -199,6 +199,7 @@ struct SILMoveOnlyWrappedTypeEliminatorVisitor NO_UPDATE_NEEDED(Object) NO_UPDATE_NEEDED(OpenExistentialRef) NO_UPDATE_NEEDED(OpenExistentialAddr) + NO_UPDATE_NEEDED(OpenExistentialBox) NO_UPDATE_NEEDED(ConvertFunction) NO_UPDATE_NEEDED(RefToBridgeObject) NO_UPDATE_NEEDED(BridgeObjectToRef) diff --git a/test/SILOptimizer/moveonly_type_eliminator.sil b/test/SILOptimizer/moveonly_type_eliminator.sil index 1074cb19d87de..8bc0bbe04643e 100644 --- a/test/SILOptimizer/moveonly_type_eliminator.sil +++ b/test/SILOptimizer/moveonly_type_eliminator.sil @@ -4,6 +4,7 @@ sil_stage raw import Builtin +import Swift ////////////////// // Declarations // @@ -38,8 +39,6 @@ struct KlassPair { sil @use_klass : $@convention(thin) (@guaranteed Klass) -> () -protocol Error {} - /////////// // Tests // /////////// @@ -616,6 +615,17 @@ bb0(%x : @guaranteed $any Error): return %em : $@thick any Error.Type } +// CHECK-LABEL: sil [ossa] @existential_box : +// CHECK: %1 = open_existential_box %0 : $any Error +// CHECK-LABEL: } // end sil function 'existential_box' +sil [ossa] @existential_box : $@convention(thin) (@guaranteed any Error) -> () { +bb0(%x : @guaranteed $any Error): + %y = copyable_to_moveonlywrapper [guaranteed] %x : $any Error + %o = open_existential_box %y : $@moveOnly (any Error) to $*@opened("01234567-89AB-CDEF-0123-000000000000", Error) Self + %r = tuple () + return %r : $() +} + // CHECK-LABEL: sil [ossa] @builtin_tsanInoutAccess : {{.*}} { // CHECK: builtin "tsanInoutAccess" // CHECK-LABEL: } // end sil function 'builtin_tsanInoutAccess'