mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
DeadFunctionElimination: don’t eliminate public methods which are called via a thunk.
For this we need to store the linkage of the “original” method implementation in the vtable. Otherwise DeadFunctionElimination thinks that the method implementation is not public but private (which is the linkage of the thunk). The big part of this change is to extend SILVTable to store the linkage (+ serialization, printing, etc.). fixes rdar://problem/29841635
This commit is contained in:
@@ -1569,10 +1569,12 @@ bb0(%0 : $Builtin.RawPointer, %1 : $Builtin.Word):
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil_vtable Foo {
|
||||
// CHECK: #Foo.subscript!getter.1: _TFC3tmp3Foog9subscriptFTVs5Int32S1__S1_
|
||||
// CHECK: #Foo.subscript!getter.1: hidden _TFC3tmp3Foog9subscriptFTVs5Int32S1__S1_
|
||||
// CHECK: #Foo.subscript!setter.1: _TFC3tmp3Foos9subscriptFTVs5Int32S1__S1_
|
||||
// CHECK: }
|
||||
sil_vtable Foo {
|
||||
#Foo.subscript!getter.1: _TFC3tmp3Foog9subscriptFTVs5Int32S1__S1_
|
||||
#Foo.subscript!setter.1: _TFC3tmp3Foos9subscriptFTVs5Int32S1__S1_
|
||||
// Override the linke to check if it is parsed correctly.
|
||||
#Foo.subscript!getter.1: hidden _TFC3tmp3Foog9subscriptFTVs5Int32S1__S1_
|
||||
// The public linkage is the same as the function's linkage and should not be printed.
|
||||
#Foo.subscript!setter.1: public _TFC3tmp3Foos9subscriptFTVs5Int32S1__S1_
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user