File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -2192,10 +2192,11 @@ void IRGenModule::emitVTableStubs() {
21922192 if (!stub) {
21932193 // Create a single stub function which calls swift_deletedMethodError().
21942194 stub = llvm::Function::Create (llvm::FunctionType::get (VoidTy, false ),
2195- llvm::GlobalValue::InternalLinkage,
2196- " _swift_dead_method_stub" );
2195+ llvm::GlobalValue::LinkOnceODRLinkage,
2196+ " _swift_dead_method_stub" ,
2197+ &Module);
2198+ ApplyIRLinkage (IRLinkage::InternalLinkOnceODR).to (stub);
21972199 stub->setAttributes (constructInitialAttributes ());
2198- Module.getFunctionList ().push_back (stub);
21992200 stub->setCallingConv (DefaultCC);
22002201 auto *entry = llvm::BasicBlock::Create (getLLVMContext (), " entry" , stub);
22012202 auto *errorFunc = getDeletedMethodErrorFn ();
Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ open class C {
1515 private func foo( ) async { }
1616}
1717
18- // CHECK: @"$s1M1CC3foo33_{{.*}}Tu" = hidden global %swift.async_func_pointer <{ {{.*}} @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvg"
18+ // CHECK: @"$s1M1CC3foo33_{{.*}}Tu" = hidden global %swift.async_func_pointer <{ {{.*}} @_swift_dead_method_stub
1919
20- // CHECK: @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvs" = hidden alias void (), ptr @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvg"
21- // CHECK: @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvM" = hidden alias void (), ptr @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvg"
20+ // CHECK: @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvs" = hidden alias void (), ptr @_swift_dead_method_stub
21+ // CHECK: @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvM" = hidden alias void (), ptr @_swift_dead_method_stub
2222
23- // CHECK: define hidden void @"$s1M1CC1i33_807E3D81CC6CDD898084F3279464DDF9LLSDySOypGvg" ()
23+ // CHECK: define linkonce_odr hidden void @_swift_dead_method_stub ()
2424// CHECK: entry:
2525// CHECK: tail call void @swift_deletedMethodError()
2626
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ class C {
88 init ( i: Int ) { self . i = i }
99}
1010
11- // CHECK: @"$s7zombies1CC1i33_{{.*}}vs" = hidden {{(dllexport )?}}alias void (), ptr @"$s7zombies1CC1i33_45489CBEFBF369AB7AEE3A799A95D78DLLSivg"
11+ // CHECK: @"$s7zombies1CC1i33_{{.*}}vs" = hidden {{(dllexport )?}}alias void (), ptr @_swift_dead_method_stub
1212
13- // CHECK: define hidden void @"$s7zombies1CC1i33_45489CBEFBF369AB7AEE3A799A95D78DLLSivg"()
13+ // CHECK: define linkonce_odr hidden void @_swift_dead_method_stub
1414// CHECK: entry:
1515// CHECK: tail call void @swift_deletedMethodError()
Original file line number Diff line number Diff line change @@ -56,13 +56,15 @@ public func unnecessary() -> Int64 { 5 }
5656@_neverEmitIntoClient
5757public func unusedYetThere( ) -> Int64 { 5 }
5858
59- public class PointClass {
59+ open class PointClass {
6060 public var x , y : Int
6161
6262 public init ( x: Int , y: Int ) {
6363 self . x = x
6464 self . y = y
6565 }
66+
67+ private func notUsed( ) { }
6668}
6769
6870public protocol Reflectable : AnyObject {
@@ -89,6 +91,9 @@ public func createsExistential() -> any Reflectable {
8991
9092// LIBRARY-IR-NOT: define {{.*}} @"$es27_allocateUninitializedArrayySayxG_BptBwlFSi_Tg5"
9193
94+
95+ // LIBRARY-IR: define linkonce_odr hidden void @_swift_dead_method_stub
96+
9297// LIBRARY-SIL: sil @$e7Library5helloSaySiGyF
9398// LIBRARY-SIL: sil @$e7Library8getArraySaySiGyF : $@convention(thin) () -> @owned Array<Int> {
9499
You can’t perform that action at this time.
0 commit comments