AST: Give destructors a second parameter list

Constructors and methods had two parameter lists, one for self and one
for the formal parameters. Destructors only had one parameter list,
which introduced an annoying corner case.
This commit is contained in:
Slava Pestov
2018-07-18 16:13:52 -07:00
parent fe8263e2ec
commit 301d9f0cf3
42 changed files with 96 additions and 107 deletions

View File

@@ -6096,7 +6096,8 @@ public:
/// }
/// \endcode
class DestructorDecl : public AbstractFunctionDecl {
ParameterList *SelfParameter;
ParameterList *ParameterLists[2];
public:
DestructorDecl(SourceLoc DestructorLoc, ParamDecl *selfDecl,
DeclContext *Parent);
@@ -6104,14 +6105,12 @@ public:
void setSelfDecl(ParamDecl *selfDecl);
MutableArrayRef<ParameterList *> getParameterLists() {
return { &SelfParameter, 1 };
return { ParameterLists, 2 };
}
ArrayRef<const ParameterList *> getParameterLists() const {
return { &SelfParameter, 1 };
return { ParameterLists, 2 };
}
SourceLoc getDestructorLoc() const { return getNameLoc(); }
SourceLoc getStartLoc() const { return getDestructorLoc(); }
SourceRange getSourceRange() const;

View File

@@ -5379,16 +5379,17 @@ DestructorDecl::DestructorDecl(SourceLoc DestructorLoc, ParamDecl *selfDecl,
: AbstractFunctionDecl(DeclKind::Destructor, Parent,
DeclBaseName::createDestructor(), DestructorLoc,
/*Throws=*/false, /*ThrowsLoc=*/SourceLoc(),
/*NumParameterLists=*/1, nullptr) {
/*NumParameterLists=*/2, nullptr) {
setSelfDecl(selfDecl);
ParameterLists[1] = ParameterList::createEmpty(Parent->getASTContext());
}
void DestructorDecl::setSelfDecl(ParamDecl *selfDecl) {
if (selfDecl) {
SelfParameter = ParameterList::createWithoutLoc(selfDecl);
SelfParameter->setDeclContextOfParamDecls(this);
ParameterLists[0] = ParameterList::createWithoutLoc(selfDecl);
ParameterLists[0]->setDeclContextOfParamDecls(this);
} else {
SelfParameter = nullptr;
ParameterLists[0] = nullptr;
}
}

View File

@@ -813,8 +813,6 @@ unsigned SILDeclRef::getParameterListCount() const {
return func->getParameterLists().size();
} else if (auto *ed = dyn_cast<EnumElementDecl>(vd)) {
return ed->hasAssociatedValues() ? 2 : 1;
} else if (isa<DestructorDecl>(vd)) {
return 1;
} else if (isa<ClassDecl>(vd)) {
return 2;
} else if (isa<VarDecl>(vd)) {

View File

@@ -1673,9 +1673,10 @@ static CanAnyFunctionType getDestructorInterfaceType(TypeConverter &TC,
CanType resultTy = (isDeallocating
? TupleType::getEmpty(C)
: C.TheNativeObjectType);
CanType methodTy = CanFunctionType::get(TupleType::getEmpty(C), resultTy);
auto sig = TC.getEffectiveGenericSignature(dd);
return CanAnyFunctionType::get(sig, classType, resultTy, extInfo);
return CanAnyFunctionType::get(sig, classType, methodTy, extInfo);
}
/// Retrieve the type of the ivar initializer or destroyer method for

View File

@@ -923,16 +923,6 @@ void TypeChecker::configureInterfaceType(AbstractFunctionDecl *func,
}
auto paramLists = func->getParameterLists();
SmallVector<ParameterList*, 4> storedParamLists;
// FIXME: Destructors don't have the '()' pattern in their signature, so
// paste it here.
if (isa<DestructorDecl>(func)) {
assert(paramLists.size() == 1 && "Only the self paramlist");
storedParamLists.push_back(paramLists[0]);
storedParamLists.push_back(ParameterList::createEmpty(Context));
paramLists = storedParamLists;
}
bool hasSelf = func->getDeclContext()->isTypeContext();
for (unsigned i = 0, e = paramLists.size(); i != e; ++i) {

View File

@@ -109,15 +109,15 @@ sil @$S5test110DerivedIntCfD : $@convention(method) (@owned DerivedInt) -> ()
sil_vtable BaseBase {
#BaseBase.foo!1: (BaseBase) -> () -> () : @$S5test104BaseB0C3fooyyF
#BaseBase.deinit!deallocator: @$S5test104BaseB0CfD
#BaseBase.deinit!deallocator.1: @$S5test104BaseB0CfD
}
sil_vtable Base {
#BaseBase.foo!1: (BaseBase) -> () -> () : @$S5test104BaseB0C3fooyyF [inherited]
#Base.deinit!deallocator: @$S5test14BaseCfD
#Base.deinit!deallocator.1: @$S5test14BaseCfD
}
sil_vtable DerivedInt {
#BaseBase.foo!1: (BaseBase) -> () -> () : @$S5test110DerivedIntC3fooyyF [override]
#DerivedInt.deinit!deallocator: @$S5test110DerivedIntCfD
#DerivedInt.deinit!deallocator.1: @$S5test110DerivedIntCfD
}

View File

@@ -220,6 +220,6 @@ bb0(%0 : $C):
}
sil_vtable C {
#C.deinit!deallocator: @_TFC28nonatomic_reference_counting1CD // C.__deallocating_deinit
#C.deinit!deallocator.1: @_TFC28nonatomic_reference_counting1CD // C.__deallocating_deinit
}

View File

@@ -109,7 +109,7 @@ bb0(%0 : @unowned $SwiftGizmo):
// CHECK-NEXT: store %objc_class* [[T1]], %objc_class** [[OBJC_SUPER_CLASS]], align 8
// CHECK-NEXT: [[DEALLOC_SEL:%[a-zA-Z0-9]+]] = load i8*, i8** @"\01L_selector(dealloc)", align 8
// CHECK-NEXT: call void bitcast (void ()* @objc_msgSendSuper2 to void (%objc_super*, i8*)*)(%objc_super* [[OBJC_SUPER]], i8* [[DEALLOC_SEL]])
%5 = objc_super_method %0 : $SwiftGizmo, #Gizmo.deinit!deallocator.foreign : (Gizmo) -> () -> (), $@convention(objc_method) (Gizmo) -> () // user: %7
%5 = objc_super_method %0 : $SwiftGizmo, #Gizmo.deinit!deallocator.1.foreign : (Gizmo) -> () -> (), $@convention(objc_method) (Gizmo) -> () // user: %7
%6 = upcast %0 : $SwiftGizmo to $Gizmo // user: %7
%7 = apply %5(%6) : $@convention(objc_method) (Gizmo) -> ()

View File

@@ -62,6 +62,6 @@ bb0(%0 : $*Any):
}
sil_vtable XXX {
#XXX.deinit!deallocator: @XXX_dtor
#XXX.deinit!deallocator.1: @XXX_dtor
#XXX.init!initializer.1: @XXX_ctor
}

View File

@@ -6,7 +6,7 @@ import Foundation
public class Derived: NSString {
// CHECK-LABEL: sil @$S15coverage_deinit7DerivedCfD
// CHECK: builtin "int_instrprof_increment"
// CHECK-NEXT: super_method {{.*}} : $Derived, #NSString.deinit!deallocator.foreign
// CHECK-NEXT: super_method {{.*}} : $Derived, #NSString.deinit!deallocator.1.foreign
deinit {
}
}

View File

@@ -122,7 +122,7 @@ sil_vtable Derived1 {
#Base.foo!1: (Base) -> (Int32) -> () : @_TFC10SILDeclRef8Derived13foofT1nVs5Int32_T_ // Derived1.foo(n : Int32) -> ()
#Base.foo!1: (Base) -> (Float) -> Int32 : @_TFC10SILDeclRef8Derived13foofT1fSf_Vs5Int32 // Derived1.foo(f : Float) -> Int32
#Base.init!initializer.1: (Base.Type) -> () -> Base : @_TFC10SILDeclRef8Derived1cfT_S0_ // Derived1.init() -> Derived1
#Derived1.deinit!deallocator: (Derived1) -> () -> () : @_TFC10SILDeclRef8Derived1D // Derived1.__deallocating_deinit
#Derived1.deinit!deallocator.1: (Derived1) -> () -> () : @_TFC10SILDeclRef8Derived1D // Derived1.__deallocating_deinit
}
sil_vtable Derived2 {
@@ -130,7 +130,7 @@ sil_vtable Derived2 {
#Base.foo!1: (Base) -> (Int32) -> () : @_TFC10SILDeclRef8Derived23foofT1nVs5Int32_T_ // Derived2.foo(n : Int32) -> ()
#Base.foo!1: (Base) -> (Float) -> Int32 : @_TFC10SILDeclRef8Derived23foofT1fSf_Vs5Int32 // Derived2.foo(f : Float) -> Int32
#Base.init!initializer.1: (Base.Type) -> () -> Base : @_TFC10SILDeclRef8Derived2cfT_S0_ // Derived2.init() -> Derived2
#Derived2.deinit!deallocator: (Derived2) -> () -> () : @_TFC10SILDeclRef8Derived2D // Derived2.__deallocating_deinit
#Derived2.deinit!deallocator.1: (Derived2) -> () -> () : @_TFC10SILDeclRef8Derived2D // Derived2.__deallocating_deinit
}
sil_witness_table [serialized] Base: P module SILDeclRef {

View File

@@ -91,6 +91,6 @@ bb0(%0 : $C):
}
sil_vtable C {
#C.deinit!deallocator: @_TFC28nonatomic_reference_counting1CD // C.__deallocating_deinit
#C.deinit!deallocator.1: @_TFC28nonatomic_reference_counting1CD // C.__deallocating_deinit
}

View File

@@ -44,14 +44,14 @@ sil_vtable Base {
#Base.m1!1: (Base) -> () -> () : @$S1x4BaseC2m1yyF
#Base.m2!1: (Base) -> () -> () : @$S1x4BaseC2m2yyF
#Base.init!initializer.1: (Base.Type) -> () -> Base : @$S1x4BaseCACycfc
#Base.deinit!deallocator: @$S1x4BaseCfD
#Base.deinit!deallocator.1: @$S1x4BaseCfD
}
// CHECK-LABEL: sil_vtable Base {
// CHECK-NEXT: #Base.m1!1: (Base) -> () -> () : @$S1x4BaseC2m1yyF
// CHECK-NEXT: #Base.m2!1: (Base) -> () -> () : @$S1x4BaseC2m2yyF
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : @$S1x4BaseCACycfc
// CHECK-NEXT: #Base.deinit!deallocator: @$S1x4BaseCfD
// CHECK-NEXT: #Base.deinit!deallocator.1: @$S1x4BaseCfD
// CHECK-NEXT: }
sil_vtable Derived {
@@ -59,7 +59,7 @@ sil_vtable Derived {
#Base.m2!1: (Base) -> () -> () : @$S1x7DerivedC2m2yyF [override]
#Base.init!initializer.1: (Base.Type) -> () -> Base : @$S1x7DerivedCACycfc [override]
#Derived.m3!1: (Derived) -> () -> () : @$S1x7DerivedC2m3yyF
#Derived.deinit!deallocator: @$S1x7DerivedCfD
#Derived.deinit!deallocator.1: @$S1x7DerivedCfD
}
// CHECK-LABEL: sil_vtable Derived {
@@ -67,5 +67,5 @@ sil_vtable Derived {
// CHECK-NEXT: #Base.m2!1: (Base) -> () -> () : @$S1x7DerivedC2m2yyF [override]
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : @$S1x7DerivedCACycfc [override]
// CHECK-NEXT: #Derived.m3!1: (Derived) -> () -> () : @$S1x7DerivedC2m3yyF
// CHECK-NEXT: #Derived.deinit!deallocator: @$S1x7DerivedCfD
// CHECK-NEXT: #Derived.deinit!deallocator.1: @$S1x7DerivedCfD
// CHECK-NEXT: }

View File

@@ -28,12 +28,12 @@ Class.firstMethod()
// CHECK-NEXT: #Class.firstMethod!1: (Class.Type) -> () -> () : @$S28vtable_deserialization_input5ClassC11firstMethodyyFZ
// CHECK-NEXT: #Class.secondMethod!1: (Class.Type) -> () -> () : @$S28vtable_deserialization_input5ClassC12secondMethodyyFZ
// CHECK-NEXT: #Class.thirdMethod!1: (Class.Type) -> () -> () : @$S28vtable_deserialization_input5ClassC11thirdMethodyyFZ
// CHECK-NEXT: #Class.deinit!deallocator: @$S28vtable_deserialization_input5ClassCfD
// CHECK-NEXT: #Class.deinit!deallocator.1: @$S28vtable_deserialization_input5ClassCfD
// CHECK-NEXT: }
// OPT: sil_vtable Class {
// OPT-NEXT: #Class.firstMethod!1: (Class.Type) -> () -> () : @$S28vtable_deserialization_input5ClassC11firstMethodyyFZ
// OPT-NEXT: #Class.secondMethod!1: (Class.Type) -> () -> () : @$S28vtable_deserialization_input5ClassC12secondMethodyyFZ
// OPT-NEXT: #Class.thirdMethod!1: (Class.Type) -> () -> () : @$S28vtable_deserialization_input5ClassC11thirdMethodyyFZ
// OPT-NEXT: #Class.deinit!deallocator: @$S28vtable_deserialization_input5ClassCfD
// OPT-NEXT: #Class.deinit!deallocator.1: @$S28vtable_deserialization_input5ClassCfD
// OPT-NEXT: }

View File

@@ -59,7 +59,7 @@ public func testBase(b: Base) -> Int32 {
// CHECK-NEXT: #Base.foo!1: (Base) -> (Int32) -> () : @$S10SILDeclRef4BaseC3foo1nys5Int32V_tF // Base.foo(n:)
// CHECK-NEXT: #Base.foo!1: (Base) -> (Float) -> Int32 : @$S10SILDeclRef4BaseC3foo1fs5Int32VSf_tF // Base.foo(f:)
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : @$S10SILDeclRef4BaseCACycfc // Base.init()
// CHECK-NEXT: #Base.deinit!deallocator: @$S10SILDeclRef4BaseCfD // Base.__deallocating_deinit
// CHECK-NEXT: #Base.deinit!deallocator.1: @$S10SILDeclRef4BaseCfD // Base.__deallocating_deinit
// CHECK-NEXT: }
// CHECK:sil_witness_table [serialized] Base: P module SILDeclRef {

View File

@@ -587,7 +587,7 @@ class Sub : Base {
// CHECK-NEXT: #Base.value!setter.1: (Base) -> (Int32) -> () : @$S10addressors4BaseC5values5Int32Vvs
// CHECK-NEXT: #Base.value!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : @$S10addressors4BaseC5values5Int32Vvm
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : @$S10addressors4BaseCACycfc
// CHECK-NEXT: #Base.deinit!deallocator: @$S10addressors4BaseCfD
// CHECK-NEXT: #Base.deinit!deallocator.1: @$S10addressors4BaseCfD
// CHECK-NEXT: }
// CHECK-LABEL: sil_vtable Sub {
@@ -598,5 +598,5 @@ class Sub : Base {
// CHECK-NEXT: #Base.value!setter.1: (Base) -> (Int32) -> () : @$S10addressors3SubC5values5Int32Vvs
// CHECK-NEXT: #Base.value!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : @$S10addressors3SubC5values5Int32Vvm
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : @$S10addressors3SubCACycfc
// CHECK-NEXT: #Sub.deinit!deallocator: @$S10addressors3SubCfD
// CHECK-NEXT: #Sub.deinit!deallocator.1: @$S10addressors3SubCfD
// CHECK-NEXT: }

View File

@@ -44,5 +44,5 @@ class SubclassOfOutsideChild : ResilientOutsideChild {
// CHECK-NEXT: #ResilientOutsideParent.init!initializer.1: (ResilientOutsideParent.Type) -> () -> ResilientOutsideParent : @$S16class_resilience22SubclassOfOutsideChildCACycfc [override]
// CHECK-NEXT: #ResilientOutsideParent.method!1: (ResilientOutsideParent) -> () -> () : @$S16class_resilience22SubclassOfOutsideChildC6methodyyF [override]
// CHECK-NEXT: #SubclassOfOutsideChild.newMethod!1: (SubclassOfOutsideChild) -> () -> () : @$S16class_resilience22SubclassOfOutsideChildC9newMethodyyF
// CHECK-NEXT: #SubclassOfOutsideChild.deinit!deallocator: @$S16class_resilience22SubclassOfOutsideChildCfD
// CHECK-NEXT: #SubclassOfOutsideChild.deinit!deallocator.1: @$S16class_resilience22SubclassOfOutsideChildCfD
// CHECK-NEXT: }

View File

@@ -31,9 +31,9 @@ public func testmain() {
// function elimination
// CHECK-LABEL: sil_vtable A
// CHECK: A.deinit!deallocator: @[[A]]
// CHECK: A.deinit!deallocator.1: @[[A]]
// CHECK-LABEL: sil_vtable B
// CHECK-NOT: A.deinit
// CHECK: B.deinit!deallocator: @[[B]]
// CHECK: B.deinit!deallocator.1: @[[B]]

View File

@@ -516,7 +516,7 @@ public class ConcreteDerived : GenericBase<Int> {
// CHECK-NEXT: #Foo.subscript!setter.1: {{.*}} : @$S7dynamic3FooC4objcSiyXl_tcis // dynamic.Foo.subscript.setter : (objc: Swift.AnyObject) -> Swift.Int
// CHECK-NEXT: #Foo.subscript!materializeForSet
// CHECK-NEXT: #Foo.overriddenByDynamic!1: {{.*}} : @$S7dynamic3FooC19overriddenByDynamic{{[_0-9a-zA-Z]*}}
// CHECK-NEXT: #Foo.deinit!deallocator: {{.*}}
// CHECK-NEXT: #Foo.deinit!deallocator.1: {{.*}}
// CHECK-NEXT: }
// Vtable uses a dynamic thunk for dynamic overrides
@@ -545,12 +545,12 @@ public class ConcreteDerived : GenericBase<Int> {
// No vtable entry for override of @objc extension property
// CHECK-LABEL: sil_vtable [serialized] SubExt {
// CHECK-NEXT: #SubExt.deinit!deallocator: @$S7dynamic6SubExtCfD // dynamic.SubExt.__deallocating_deinit
// CHECK-NEXT: #SubExt.deinit!deallocator.1: @$S7dynamic6SubExtCfD // dynamic.SubExt.__deallocating_deinit
// CHECK-NEXT: }
// Dynamic thunk + vtable re-abstraction
// CHECK-LABEL: sil_vtable [serialized] ConcreteDerived {
// CHECK-NEXT: #GenericBase.method!1: <T> (GenericBase<T>) -> (T) -> () : public @$S7dynamic15ConcreteDerivedC6methodyySiFAA11GenericBaseCADyyxFTV [override] // vtable thunk for dynamic.GenericBase.method(A) -> () dispatching to dynamic.ConcreteDerived.method(Swift.Int) -> ()
// CHECK-NEXT: #GenericBase.init!initializer.1: <T> (GenericBase<T>.Type) -> () -> GenericBase<T> : @$S7dynamic15ConcreteDerivedCACycfc [override] // dynamic.ConcreteDerived.init() -> dynamic.ConcreteDerived
// CHECK-NEXT: #ConcreteDerived.deinit!deallocator: @$S7dynamic15ConcreteDerivedCfD // dynamic.ConcreteDerived.__deallocating_deinit
// CHECK-NEXT: #ConcreteDerived.deinit!deallocator.1: @$S7dynamic15ConcreteDerivedCfD // dynamic.ConcreteDerived.__deallocating_deinit
// CHECK-NEXT: }

View File

@@ -965,12 +965,12 @@ class SomeErrorClass : Error { }
// CHECK-LABEL: sil_vtable SomeErrorClass
// CHECK-NEXT: #SomeErrorClass.init!initializer.1: {{.*}} : @$S6errors14SomeErrorClassCACycfc
// CHECK-NEXT: #SomeErrorClass.deinit!deallocator: @$S6errors14SomeErrorClassCfD
// CHECK-NEXT: #SomeErrorClass.deinit!deallocator.1: @$S6errors14SomeErrorClassCfD
// CHECK-NEXT: }
class OtherErrorSub : OtherError { }
// CHECK-LABEL: sil_vtable OtherErrorSub {
// CHECK-NEXT: #OtherError.init!initializer.1: {{.*}} : @$S6errors13OtherErrorSubCACycfc [override] // OtherErrorSub.init()
// CHECK-NEXT: #OtherErrorSub.deinit!deallocator: @$S6errors13OtherErrorSubCfD // OtherErrorSub.__deallocating_deinit
// CHECK-NEXT: #OtherErrorSub.deinit!deallocator.1: @$S6errors13OtherErrorSubCfD // OtherErrorSub.__deallocating_deinit
// CHECK-NEXT:}

View File

@@ -119,13 +119,13 @@ class FinalEntity: NSObject, EntityIDProto {
// CHECK-LABEL: sil_vtable SwiftGizmo {
// CHECK-NEXT: #SwiftGizmo.modifyX!1: {{.*}} : @$S19objc_attr_NSManaged10SwiftGizmoC7modifyXyyF
// CHECK-NEXT: #SwiftGizmo.testFunc!1: {{.*}} : @$S19objc_attr_NSManaged10SwiftGizmoC8testFuncyyF
// CHECK-NEXT: #SwiftGizmo.deinit!deallocator: @$S19objc_attr_NSManaged10SwiftGizmoCfD
// CHECK-NEXT: #SwiftGizmo.deinit!deallocator.1: @$S19objc_attr_NSManaged10SwiftGizmoCfD
// CHECK-NEXT: }
// CHECK-LABEL: sil_vtable FinalGizmo {
// CHECK-NEXT: #SwiftGizmo.modifyX!1: {{.*}} : @$S19objc_attr_NSManaged10SwiftGizmoC7modifyX{{[_0-9a-zA-Z]*}}F
// CHECK-NEXT: #SwiftGizmo.testFunc!1: {{.*}} : @$S19objc_attr_NSManaged10SwiftGizmoC8testFunc{{[_0-9a-zA-Z]*}}F
// CHECK-NEXT: #FinalGizmo.deinit!deallocator: @$S19objc_attr_NSManaged10FinalGizmoCfD
// CHECK-NEXT: #FinalGizmo.deinit!deallocator.1: @$S19objc_attr_NSManaged10FinalGizmoCfD
// CHECK-NEXT: }
// CHECK-LABEL: sil_vtable ProtoAdopter {

View File

@@ -44,7 +44,7 @@ class SwiftGizmo : Gizmo {
// CHECK-NOT: ref_element_addr
// Call super -dealloc.
// CHECK: [[SUPER_DEALLOC:%[0-9]+]] = objc_super_method [[SELF]] : $SwiftGizmo, #Gizmo.deinit!deallocator.foreign : (Gizmo) -> () -> (), $@convention(objc_method) (Gizmo) -> ()
// CHECK: [[SUPER_DEALLOC:%[0-9]+]] = objc_super_method [[SELF]] : $SwiftGizmo, #Gizmo.deinit!deallocator.1.foreign : (Gizmo) -> () -> (), $@convention(objc_method) (Gizmo) -> ()
// CHECK: [[SUPER:%[0-9]+]] = upcast [[SELF]] : $SwiftGizmo to $Gizmo
// CHECK: [[SUPER_DEALLOC_RESULT:%[0-9]+]] = apply [[SUPER_DEALLOC]]([[SUPER]]) : $@convention(objc_method) (Gizmo) -> ()
// CHECK: end_lifetime [[SUPER]]

View File

@@ -35,7 +35,7 @@ class Generic<T>: NSObject {
// CHECK-LABEL: sil hidden @$S18objc_generic_class11SubGeneric1CfD : $@convention(method) <U, V> (@owned SubGeneric1<U, V>) -> () {
// CHECK: bb0([[SELF:%.*]] : @owned $SubGeneric1<U, V>):
// CHECK: [[SUPER_DEALLOC:%.*]] = objc_super_method [[SELF]] : $SubGeneric1<U, V>, #Generic.deinit!deallocator.foreign : <T> (Generic<T>) -> () -> (), $@convention(objc_method) <τ_0_0> (Generic<τ_0_0>) -> ()
// CHECK: [[SUPER_DEALLOC:%.*]] = objc_super_method [[SELF]] : $SubGeneric1<U, V>, #Generic.deinit!deallocator.1.foreign : <T> (Generic<T>) -> () -> (), $@convention(objc_method) <τ_0_0> (Generic<τ_0_0>) -> ()
// CHECK: [[SUPER:%.*]] = upcast [[SELF:%.*]] : $SubGeneric1<U, V> to $Generic<Int>
// CHECK: apply [[SUPER_DEALLOC]]<Int>([[SUPER]])
class SubGeneric1<U, V>: Generic<Int> {

View File

@@ -25,15 +25,15 @@ class Root {
// CHECK-LABEL: sil_vtable Baboom {
// CHECK: #Boom.init!allocator.1: (Boom.Type) -> () -> Boom : @$S29objc_required_designated_init6BaboomCACycfC [override]
// CHECK: #Baboom.deinit!deallocator: @$S29objc_required_designated_init6BaboomCfD
// CHECK: #Baboom.deinit!deallocator.1: @$S29objc_required_designated_init6BaboomCfD
// CHECK: }
// CHECK-LABEL: sil_vtable BigBadaBoom {
// CHECK: #Badaboom.init!allocator.1: <U> (Badaboom<U>.Type) -> () -> Badaboom<U> : @$S29objc_required_designated_init11BigBadaBoomCACyxGycfC [override]
// CHECK: #BigBadaBoom.deinit!deallocator: @$S29objc_required_designated_init11BigBadaBoomCfD
// CHECK: #BigBadaBoom.deinit!deallocator.1: @$S29objc_required_designated_init11BigBadaBoomCfD
// CHECK: }
// CHECK-LABEL: sil_vtable Root {
// CHECK: #Root.init!allocator.1: (Root.Type) -> () -> Root : @$S29objc_required_designated_init4RootCACycfC
// CHECK: #Root.deinit!deallocator: @$S29objc_required_designated_init4RootCfD
// CHECK: #Root.deinit!deallocator.1: @$S29objc_required_designated_init4RootCfD
// CHECK: }

View File

@@ -41,19 +41,19 @@ public class PublicSub: Base {
// CHECK-LABEL: sil_vtable PrivateSub {
// CHECK-NEXT: #Base.foo!1: {{.*}} : @$S4main10PrivateSub33_F1525133BD493492AD72BF10FBCB1C52LLC3fooyyF
// CHECK-NEXT: #Base.init!initializer.1: {{.*}} : @$S4main10PrivateSub33_F1525133BD493492AD72BF10FBCB1C52LLCADycfc
// CHECK-NEXT: #PrivateSub.deinit!deallocator: @$S4main10PrivateSub33_F1525133BD493492AD72BF10FBCB1C52LLCfD
// CHECK-NEXT: #PrivateSub.deinit!deallocator.1: @$S4main10PrivateSub33_F1525133BD493492AD72BF10FBCB1C52LLCfD
// CHECK-NEXT: }
// CHECK-LABEL: sil_vtable Sub {
// CHECK-NEXT: #Base.foo!1: {{.*}} : @$S4main3SubC3fooyyF
// CHECK-NEXT: #Base.init!initializer.1: {{.*}} : @$S4main3SubCACycfc
// CHECK-NEXT: #Sub.deinit!deallocator: @$S4main3SubCfD
// CHECK-NEXT: #Sub.deinit!deallocator.1: @$S4main3SubCfD
// CHECK-NEXT: }
// CHECK-LABEL: sil_vtable [serialized] PublicSub {
// CHECK-NEXT: #Base.foo!1: {{.*}} : @$S4main9PublicSubC3fooyyF
// CHECK-NEXT: #Base.init!initializer.1: {{.*}} : @$S4main9PublicSubCACycfc
// CHECK-NEXT: #PublicSub.deinit!deallocator: @$S4main9PublicSubCfD
// CHECK-NEXT: #PublicSub.deinit!deallocator.1: @$S4main9PublicSubCfD
// CHECK-NEXT: }

View File

@@ -173,7 +173,7 @@ class Opaque<T> {
// CHECK-NEXT: #Opaque.variantOptionalityFunctions!1: <T> (Opaque<T>) -> (@escaping (T) -> T) -> ((T) -> T)? : @$S27vtable_thunks_reabstraction6OpaqueC27variantOptionalityFunctions1xxxcSgxxc_tF // Opaque.variantOptionalityFunctions(x:)
// CHECK-NEXT: #Opaque.variantOptionalityTuples!1: <T> (Opaque<T>) -> ((T, (T.Type, (T) -> T))) -> (T, (T.Type, (T) -> T))? : @$S27vtable_thunks_reabstraction6OpaqueC24variantOptionalityTuples1xx_xm_xxcttSgx_xm_xxctt_tF // Opaque.variantOptionalityTuples(x:)
// CHECK-NEXT: #Opaque.init!initializer.1: <T> (Opaque<T>.Type) -> () -> Opaque<T> : @$S27vtable_thunks_reabstraction6OpaqueCACyxGycfc // Opaque.init()
// CHECK-NEXT: #Opaque.deinit!deallocator: @$S27vtable_thunks_reabstraction6OpaqueCfD // Opaque.__deallocating_deinit
// CHECK-NEXT: #Opaque.deinit!deallocator.1: @$S27vtable_thunks_reabstraction6OpaqueCfD // Opaque.__deallocating_deinit
// CHECK-NEXT: }
class StillOpaque<T>: Opaque<T> {
@@ -196,7 +196,7 @@ class StillOpaque<T>: Opaque<T> {
// CHECK-NEXT: #StillOpaque.variantOptionalityTuples!1: <T> (StillOpaque<T>) -> ((T, (T.Type, (T) -> T))?) -> (T, (T.Type, (T) -> T)) : @$S27vtable_thunks_reabstraction11StillOpaqueC24variantOptionalityTuples1xx_xm_xxcttx_xm_xxcttSg_tF // StillOpaque.variantOptionalityTuples(x:)
// CHECK-NEXT: #StillOpaque.deinit!deallocator: @$S27vtable_thunks_reabstraction11StillOpaqueCfD // StillOpaque.__deallocating_deinit
// CHECK-NEXT: #StillOpaque.deinit!deallocator.1: @$S27vtable_thunks_reabstraction11StillOpaqueCfD // StillOpaque.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteValue: Opaque<S> {
@@ -230,7 +230,7 @@ class ConcreteValue: Opaque<S> {
// CHECK-NEXT: #ConcreteValue.variantOptionalityFunctions!1: (ConcreteValue) -> (((S) -> S)?) -> (S) -> S : @$S27vtable_thunks_reabstraction13ConcreteValueC27variantOptionalityFunctions1xAA1SVAGcA2GcSg_tF // ConcreteValue.variantOptionalityFunctions(x:)
// CHECK-NEXT: #ConcreteValue.variantOptionalityTuples!1: (ConcreteValue) -> ((S, (S.Type, (S) -> S))?) -> (S, (S.Type, (S) -> S)) : @$S27vtable_thunks_reabstraction13ConcreteValueC24variantOptionalityTuples1xAA1SV_AGm_A2GcttAG_AGm_A2GcttSg_tF // ConcreteValue.variantOptionalityTuples(x:)
// CHECK-NEXT: #ConcreteValue.deinit!deallocator: @$S27vtable_thunks_reabstraction13ConcreteValueCfD // ConcreteValue.__deallocating_deinit
// CHECK-NEXT: #ConcreteValue.deinit!deallocator.1: @$S27vtable_thunks_reabstraction13ConcreteValueCfD // ConcreteValue.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteClass: Opaque<C> {
@@ -265,7 +265,7 @@ class ConcreteClass: Opaque<C> {
// CHECK-NEXT: #ConcreteClass.variantOptionalityFunctions!1: (ConcreteClass) -> (((C) -> C)?) -> (C) -> C : @$S27vtable_thunks_reabstraction13ConcreteClassC27variantOptionalityFunctions1xAA1CCAGcA2GcSg_tF // ConcreteClass.variantOptionalityFunctions(x:)
// CHECK-NEXT: #ConcreteClass.variantOptionalityTuples!1: (ConcreteClass) -> ((C, (C.Type, (C) -> C))?) -> (C, (C.Type, (C) -> C)) : @$S27vtable_thunks_reabstraction13ConcreteClassC24variantOptionalityTuples1xAA1CC_AGm_A2GcttAG_AGm_A2GcttSg_tF // ConcreteClass.variantOptionalityTuples(x:)
// CHECK-NEXT: #ConcreteClass.deinit!deallocator: @$S27vtable_thunks_reabstraction13ConcreteClassCfD // ConcreteClass.__deallocating_deinit
// CHECK-NEXT: #ConcreteClass.deinit!deallocator.1: @$S27vtable_thunks_reabstraction13ConcreteClassCfD // ConcreteClass.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteClassVariance: Opaque<C> {
@@ -288,7 +288,7 @@ class ConcreteClassVariance: Opaque<C> {
// No new vtable entries -- class references are ABI compatible with
// optional class references.
// CHECK-NEXT: #ConcreteClassVariance.deinit!deallocator: @$S27vtable_thunks_reabstraction21ConcreteClassVarianceCfD // ConcreteClassVariance.__deallocating_deinit
// CHECK-NEXT: #ConcreteClassVariance.deinit!deallocator.1: @$S27vtable_thunks_reabstraction21ConcreteClassVarianceCfD // ConcreteClassVariance.__deallocating_deinit
// CHECK-NEXT: }
class OpaqueTuple<U>: Opaque<(U, U)> {
@@ -312,7 +312,7 @@ class OpaqueTuple<U>: Opaque<(U, U)> {
// CHECK-NEXT: #OpaqueTuple.variantOptionality!1: <U> (OpaqueTuple<U>) -> ((U, U)?) -> (U, U) : @$S27vtable_thunks_reabstraction11OpaqueTupleC18variantOptionality1xx_xtx_xtSg_tF // OpaqueTuple.variantOptionality(x:)
// CHECK-NEXT: #OpaqueTuple.deinit!deallocator: @$S27vtable_thunks_reabstraction11OpaqueTupleCfD // OpaqueTuple.__deallocating_deinit
// CHECK-NEXT: #OpaqueTuple.deinit!deallocator.1: @$S27vtable_thunks_reabstraction11OpaqueTupleCfD // OpaqueTuple.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteTuple: Opaque<(S, S)> {
@@ -336,7 +336,7 @@ class ConcreteTuple: Opaque<(S, S)> {
// CHECK-NEXT: #ConcreteTuple.variantOptionality!1: (ConcreteTuple) -> ((S, S)?) -> (S, S) : @$S27vtable_thunks_reabstraction13ConcreteTupleC18variantOptionality1xAA1SV_AGtAG_AGtSg_tF // ConcreteTuple.variantOptionality(x:)
// CHECK-NEXT: #ConcreteTuple.deinit!deallocator: @$S27vtable_thunks_reabstraction13ConcreteTupleCfD // ConcreteTuple.__deallocating_deinit
// CHECK-NEXT: #ConcreteTuple.deinit!deallocator.1: @$S27vtable_thunks_reabstraction13ConcreteTupleCfD // ConcreteTuple.__deallocating_deinit
// CHECK-NEXT: }
class OpaqueFunction<U, V>: Opaque<(U) -> V> {
@@ -360,7 +360,7 @@ class OpaqueFunction<U, V>: Opaque<(U) -> V> {
// CHECK-NEXT: #OpaqueFunction.variantOptionality!1: <U, V> (OpaqueFunction<U, V>) -> (((U) -> V)?) -> (U) -> V : @$S27vtable_thunks_reabstraction14OpaqueFunctionC18variantOptionality1xq_xcq_xcSg_tF // OpaqueFunction.variantOptionality(x:)
// CHECK-NEXT: #OpaqueFunction.deinit!deallocator: @$S27vtable_thunks_reabstraction14OpaqueFunctionCfD // OpaqueFunction.__deallocating_deinit
// CHECK-NEXT: #OpaqueFunction.deinit!deallocator.1: @$S27vtable_thunks_reabstraction14OpaqueFunctionCfD // OpaqueFunction.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteFunction: Opaque<(S) -> S> {
@@ -384,7 +384,7 @@ class ConcreteFunction: Opaque<(S) -> S> {
// CHECK-NEXT: #ConcreteFunction.variantOptionality!1: (ConcreteFunction) -> (((S) -> S)?) -> (S) -> S : @$S27vtable_thunks_reabstraction16ConcreteFunctionC18variantOptionality1xAA1SVAGcA2GcSg_tF // ConcreteFunction.variantOptionality(x:)
// CHECK-NEXT: #ConcreteFunction.deinit!deallocator: @$S27vtable_thunks_reabstraction16ConcreteFunctionCfD // ConcreteFunction.__deallocating_deinit
// CHECK-NEXT: #ConcreteFunction.deinit!deallocator.1: @$S27vtable_thunks_reabstraction16ConcreteFunctionCfD // ConcreteFunction.__deallocating_deinit
// CHECK-NEXT: }
class OpaqueMetatype<U>: Opaque<U.Type> {
@@ -408,7 +408,7 @@ class OpaqueMetatype<U>: Opaque<U.Type> {
// CHECK-NEXT: #OpaqueMetatype.variantOptionality!1: <U> (OpaqueMetatype<U>) -> (U.Type?) -> U.Type : @$S27vtable_thunks_reabstraction14OpaqueMetatypeC18variantOptionality1xxmxmSg_tF // OpaqueMetatype.variantOptionality(x:)
// CHECK-NEXT: #OpaqueMetatype.deinit!deallocator: @$S27vtable_thunks_reabstraction14OpaqueMetatypeCfD // OpaqueMetatype.__deallocating_deinit
// CHECK-NEXT: #OpaqueMetatype.deinit!deallocator.1: @$S27vtable_thunks_reabstraction14OpaqueMetatypeCfD // OpaqueMetatype.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteValueMetatype: Opaque<S.Type> {
@@ -432,7 +432,7 @@ class ConcreteValueMetatype: Opaque<S.Type> {
// CHECK-NEXT: #ConcreteValueMetatype.variantOptionality!1: (ConcreteValueMetatype) -> (S.Type?) -> S.Type : @$S27vtable_thunks_reabstraction21ConcreteValueMetatypeC18variantOptionality1xAA1SVmAGmSg_tF // ConcreteValueMetatype.variantOptionality(x:)
// CHECK-NEXT: #ConcreteValueMetatype.deinit!deallocator: @$S27vtable_thunks_reabstraction21ConcreteValueMetatypeCfD // ConcreteValueMetatype.__deallocating_deinit
// CHECK-NEXT: #ConcreteValueMetatype.deinit!deallocator.1: @$S27vtable_thunks_reabstraction21ConcreteValueMetatypeCfD // ConcreteValueMetatype.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteClassMetatype: Opaque<C.Type> {
@@ -454,7 +454,7 @@ class ConcreteClassMetatype: Opaque<C.Type> {
// Class metatypes are ABI compatible with optional class metatypes.
// CHECK-NEXT: #ConcreteClassMetatype.deinit!deallocator: @$S27vtable_thunks_reabstraction21ConcreteClassMetatypeCfD // ConcreteClassMetatype.__deallocating_deinit
// CHECK-NEXT: #ConcreteClassMetatype.deinit!deallocator.1: @$S27vtable_thunks_reabstraction21ConcreteClassMetatypeCfD // ConcreteClassMetatype.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteOptional: Opaque<S?> {
@@ -475,7 +475,7 @@ class ConcreteOptional: Opaque<S?> {
// CHECK-NEXT: #Opaque.variantOptionalityFunctions!1: <T> (Opaque<T>) -> (@escaping (T) -> T) -> ((T) -> T)? : @$S27vtable_thunks_reabstraction6OpaqueC27variantOptionalityFunctions1xxxcSgxxc_tF [inherited] // Opaque.variantOptionalityFunctions(x:)
// CHECK-NEXT: #Opaque.variantOptionalityTuples!1: <T> (Opaque<T>) -> ((T, (T.Type, (T) -> T))) -> (T, (T.Type, (T) -> T))? : @$S27vtable_thunks_reabstraction6OpaqueC24variantOptionalityTuples1xx_xm_xxcttSgx_xm_xxctt_tF [inherited] // Opaque.variantOptionalityTuples(x:)
// CHECK-NEXT: #Opaque.init!initializer.1: <T> (Opaque<T>.Type) -> () -> Opaque<T> : @$S27vtable_thunks_reabstraction16ConcreteOptionalCACycfc [override] // ConcreteOptional.init()
// CHECK-NEXT: #ConcreteOptional.deinit!deallocator: @$S27vtable_thunks_reabstraction16ConcreteOptionalCfD // ConcreteOptional.__deallocating_deinit
// CHECK-NEXT: #ConcreteOptional.deinit!deallocator.1: @$S27vtable_thunks_reabstraction16ConcreteOptionalCfD // ConcreteOptional.__deallocating_deinit
// CHECK-NEXT: }
// Make sure we remap the method's innermost generic parameters
@@ -488,7 +488,7 @@ class GenericBase<T> {
// CHECK-LABEL: sil_vtable GenericBase {
// CHECK-NEXT: #GenericBase.doStuff!1: <T><U> (GenericBase<T>) -> (T, U) -> () : @$S27vtable_thunks_reabstraction11GenericBaseC7doStuff1t1uyx_qd__tlF // GenericBase.doStuff<A>(t:u:)
// CHECK-NEXT: #GenericBase.init!initializer.1: <T><U> (GenericBase<T>.Type) -> (T, U) -> GenericBase<T> : @$S27vtable_thunks_reabstraction11GenericBaseC1t1uACyxGx_qd__tclufc // GenericBase.init<A>(t:u:)
// CHECK-NEXT: #GenericBase.deinit!deallocator: @$S27vtable_thunks_reabstraction11GenericBaseCfD // GenericBase.__deallocating_deinit
// CHECK-NEXT: #GenericBase.deinit!deallocator.1: @$S27vtable_thunks_reabstraction11GenericBaseCfD // GenericBase.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteSub : GenericBase<Int> {
@@ -503,7 +503,7 @@ class ConcreteSub : GenericBase<Int> {
// CHECK-LABEL: sil_vtable ConcreteSub {
// CHECK-NEXT: #GenericBase.doStuff!1: <T><U> (GenericBase<T>) -> (T, U) -> () : hidden @$S27vtable_thunks_reabstraction11ConcreteSubC7doStuff1t1uySi_xtlFAA11GenericBaseCAdeFyx_qd__tlFTV [override] // vtable thunk for GenericBase.doStuff<A>(t:u:) dispatching to ConcreteSub.doStuff<A>(t:u:)
// CHECK-NEXT: #GenericBase.init!initializer.1: <T><U> (GenericBase<T>.Type) -> (T, U) -> GenericBase<T> : hidden @$S27vtable_thunks_reabstraction11ConcreteSubC1t1uACSi_xtclufcAA11GenericBaseCAdeGyxGx_qd__tclufcTV [override] // vtable thunk for GenericBase.init<A>(t:u:) dispatching to ConcreteSub.init<A>(t:u:)
// CHECK-NEXT: #ConcreteSub.deinit!deallocator: @$S27vtable_thunks_reabstraction11ConcreteSubCfD // ConcreteSub.__deallocating_deinit
// CHECK-NEXT: #ConcreteSub.deinit!deallocator.1: @$S27vtable_thunks_reabstraction11ConcreteSubCfD // ConcreteSub.__deallocating_deinit
// CHECK-NEXT: }
class ConcreteBase {
@@ -514,7 +514,7 @@ class ConcreteBase {
// CHECK-LABEL: sil_vtable ConcreteBase {
// CHECK-NEXT: #ConcreteBase.init!initializer.1: <U> (ConcreteBase.Type) -> (Int, U) -> ConcreteBase : @$S27vtable_thunks_reabstraction12ConcreteBaseC1t1uACSi_xtclufc // ConcreteBase.init<A>(t:u:)
// CHECK-NEXT: #ConcreteBase.doStuff!1: <U> (ConcreteBase) -> (Int, U) -> () : @$S27vtable_thunks_reabstraction12ConcreteBaseC7doStuff1t1uySi_xtlF // ConcreteBase.doStuff<A>(t:u:)
// CHECK-NEXT: #ConcreteBase.deinit!deallocator: @$S27vtable_thunks_reabstraction12ConcreteBaseCfD // ConcreteBase.__deallocating_deinit
// CHECK-NEXT: #ConcreteBase.deinit!deallocator.1: @$S27vtable_thunks_reabstraction12ConcreteBaseCfD // ConcreteBase.__deallocating_deinit
// CHECK-NEXT: }
class GenericSub<T> : ConcreteBase {
@@ -529,7 +529,7 @@ class GenericSub<T> : ConcreteBase {
// CHECK-LABEL: sil_vtable GenericSub {
// CHECK-NEXT: #ConcreteBase.init!initializer.1: <U> (ConcreteBase.Type) -> (Int, U) -> ConcreteBase : @$S27vtable_thunks_reabstraction10GenericSubC1t1uACyxGSi_qd__tclufc [override] // GenericSub.init<A>(t:u:)
// CHECK-NEXT: #ConcreteBase.doStuff!1: <U> (ConcreteBase) -> (Int, U) -> () : @$S27vtable_thunks_reabstraction10GenericSubC7doStuff1t1uySi_qd__tlF [override] // GenericSub.doStuff<A>(t:u:)
// CHECK-NEXT: #GenericSub.deinit!deallocator: @$S27vtable_thunks_reabstraction10GenericSubCfD // GenericSub.__deallocating_deinit
// CHECK-NEXT: #GenericSub.deinit!deallocator.1: @$S27vtable_thunks_reabstraction10GenericSubCfD // GenericSub.__deallocating_deinit
// CHECK-NEXT: }
// Issue with generic parameter index
@@ -542,7 +542,7 @@ class MoreGenericSub1<T, TT> : GenericBase<T> {
// CHECK-LABEL: sil_vtable MoreGenericSub1 {
// CHECK-NEXT: #GenericBase.doStuff!1: <T><U> (GenericBase<T>) -> (T, U) -> () : @$S27vtable_thunks_reabstraction15MoreGenericSub1C7doStuff1t1uyx_qd__tlF [override] // MoreGenericSub1.doStuff<A>(t:u:)
// CHECK-NEXT: #GenericBase.init!initializer.1: <T><U> (GenericBase<T>.Type) -> (T, U) -> GenericBase<T> : @$S27vtable_thunks_reabstraction15MoreGenericSub1C1t1uACyxq_Gx_qd__tclufc [override] // MoreGenericSub1.init<A>(t:u:)
// CHECK-NEXT: #MoreGenericSub1.deinit!deallocator: @$S27vtable_thunks_reabstraction15MoreGenericSub1CfD // MoreGenericSub1.__deallocating_deinit
// CHECK-NEXT: #MoreGenericSub1.deinit!deallocator.1: @$S27vtable_thunks_reabstraction15MoreGenericSub1CfD // MoreGenericSub1.__deallocating_deinit
// CHECK-NEXT: }
class MoreGenericSub2<TT, T> : GenericBase<T> {
@@ -554,5 +554,5 @@ class MoreGenericSub2<TT, T> : GenericBase<T> {
// CHECK-LABEL: sil_vtable MoreGenericSub2 {
// CHECK-NEXT: #GenericBase.doStuff!1: <T><U> (GenericBase<T>) -> (T, U) -> () : @$S27vtable_thunks_reabstraction15MoreGenericSub2C7doStuff1t1uyq__qd__tlF [override] // MoreGenericSub2.doStuff<A>(t:u:)
// CHECK-NEXT: #GenericBase.init!initializer.1: <T><U> (GenericBase<T>.Type) -> (T, U) -> GenericBase<T> : @$S27vtable_thunks_reabstraction15MoreGenericSub2C1t1uACyxq_Gq__qd__tclufc [override] // MoreGenericSub2.init<A>(t:u:)
// CHECK-NEXT: #MoreGenericSub2.deinit!deallocator: @$S27vtable_thunks_reabstraction15MoreGenericSub2CfD // MoreGenericSub2.__deallocating_deinit
// CHECK-NEXT: #MoreGenericSub2.deinit!deallocator.1: @$S27vtable_thunks_reabstraction15MoreGenericSub2CfD // MoreGenericSub2.__deallocating_deinit
// CHECK-NEXT: }

View File

@@ -69,7 +69,7 @@ class B : A {
// CHECK: sil_vtable RequiredInitDerived {
// CHECK-NEXT: #SimpleInitBase.init!initializer.1: {{.*}} : @$S7vtables19RequiredInitDerivedC{{[_0-9a-zA-Z]*}}fc
// CHECK-NEXT: #RequiredInitDerived.init!allocator.1: {{.*}} : @$S7vtables19RequiredInitDerivedC
// CHECK-NEXT: #RequiredInitDerived.deinit!deallocator: @$S7vtables19RequiredInitDerivedCfD
// CHECK-NEXT: #RequiredInitDerived.deinit!deallocator.1: @$S7vtables19RequiredInitDerivedCfD
// CHECK-NEXT: }
class SimpleInitBase { }

View File

@@ -59,13 +59,13 @@ func callWotsit(_ w: Wotsit) {
// CHECK: sil_vtable Hoozit {
// CHECK-NEXT: #Hoozit.anse!1: {{.*}} : @$S12vtables_objc6HoozitC4anse{{[_0-9a-zA-Z]*}}F
// CHECK-NEXT: #Hoozit.incorrige!1: {{.*}} : @$S12vtables_objc6HoozitC9incorrige{{[_0-9a-zA-Z]*}}F
// CHECK-NEXT: #Hoozit.deinit!deallocator: @$S12vtables_objc6HoozitCfD
// CHECK-NEXT: #Hoozit.deinit!deallocator.1: @$S12vtables_objc6HoozitCfD
// CHECK-NEXT: }
// CHECK: sil_vtable Wotsit {
// CHECK-NEXT: #Hoozit.anse!1: {{.*}} : @$S12vtables_objc6HoozitC4anse{{[_0-9a-zA-Z]*}}F
// CHECK-NEXT: #Hoozit.incorrige!1: {{.*}} : @$S12vtables_objc6WotsitC9incorrige{{[_0-9a-zA-Z]*}}F
// CHECK-NEXT: #Wotsit.deinit!deallocator: @$S12vtables_objc6WotsitCfD
// CHECK-NEXT: #Wotsit.deinit!deallocator.1: @$S12vtables_objc6WotsitCfD
// CHECK-NEXT: }
// <rdar://problem/15282548>

View File

@@ -59,6 +59,6 @@ bb0(%0 : $*X, %1 : $*X):
sil_vtable MyClass {
#MyClass.init!initializer.1: @_TFC7TestMod7MyClasscfMS0_FT_S0_ // TestMod.MyClass.init (TestMod.MyClass.Type)() -> TestMod.MyClass
#MyClass.mymethod!1: @_TFC7TestMod7MyClass8mymethodurfS0_Fq_q_ // TestMod.MyClass.mymethod <A> (TestMod.MyClass)(A) -> A
#MyClass.deinit!deallocator: @_TFC7TestMod7MyClassD // TestMod.MyClass.__deallocating_deinit
#MyClass.deinit!deallocator.1: @_TFC7TestMod7MyClassD // TestMod.MyClass.__deallocating_deinit
}

View File

@@ -46,6 +46,6 @@ bb0(%0 : $C):
}
sil_vtable C {
#C.deinit!deallocator: @_TFC28nonatomic_reference_counting1CD // C.__deallocating_deinit
#C.deinit!deallocator.1: @_TFC28nonatomic_reference_counting1CD // C.__deallocating_deinit
}

View File

@@ -666,13 +666,13 @@ sil @SomeChildItem_destructor : $@convention(method) (@owned SomeChildItem) -> (
sil_vtable SomeItem {
#SomeItem.init!allocator.1: @SomeItem_allocator
#SomeItem.init!initializer.1: @SomeItem_initializer
#SomeItem.deinit!deallocator: @SomeItem_destructor
#SomeItem.deinit!deallocator.1: @SomeItem_destructor
}
sil_vtable SomeChildItem {
#SomeItem.init!allocator.1: @SomeChildItem_allocator
#SomeItem.init!initializer.1: @SomeChildItem_initializer
#SomeChildItem.deinit!deallocator: @SomeChildItem_destructor
#SomeChildItem.deinit!deallocator.1: @SomeChildItem_destructor
}
public protocol PublicProtocol {

View File

@@ -89,7 +89,7 @@ func getDispatchQueue() -> DispatchQueue
// CHECK: [[F:%.*]] = function_ref @$S27closure_lifetime_fixup_objc1CCfdyyXEfU_
// CHECK: [[PA:%.*]] = partial_apply [callee_guaranteed] [[F]](%0)
// CHECK: [[OPT:%.*]] = enum $Optional<@callee_guaranteed () -> ()>, #Optional.some!enumelt.1, [[PA]]
// CHECK: [[DEINIT:%.*]] = objc_super_method [[SELF]] : $C, #NSObject.deinit!deallocator.foreign
// CHECK: [[DEINIT:%.*]] = objc_super_method [[SELF]] : $C, #NSObject.deinit!deallocator.1.foreign
// CHECK: release_value [[OPT]] : $Optional<@callee_guaranteed () -> ()>
// CHECK: [[SUPER:%.*]] = upcast [[SELF]] : $C to $NSObject // user: %34
// CHECK-NEXT: apply [[DEINIT]]([[SUPER]]) : $@convention(objc_method) (NSObject) -> ()

View File

@@ -226,12 +226,12 @@ bb0:
sil_vtable Foo {
#Foo.speak!1: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276713Foo5speakfS0_FT_T_ // main.(Foo in _9ACC0692747077F216D14C36CD927671).speak (main.(Foo in _9ACC0692747077F216D14C36CD927671))() -> ()
#Foo.deinit!deallocator: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276713FooD // main.(Foo in _9ACC0692747077F216D14C36CD927671).__deallocating_deinit
#Foo.deinit!deallocator.1: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276713FooD // main.(Foo in _9ACC0692747077F216D14C36CD927671).__deallocating_deinit
#Foo.init!initializer.1: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276713FoocfMS0_FT_S0_ // main.(Foo in _9ACC0692747077F216D14C36CD927671).init (main.(Foo in _9ACC0692747077F216D14C36CD927671).Type)() -> main.(Foo in _9ACC0692747077F216D14C36CD927671)
}
sil_vtable Foo2 {
#Foo.speak!1: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276714Foo25speakfS0_FT_T_ // main.(Foo2 in _9ACC0692747077F216D14C36CD927671).speak (main.(Foo2 in _9ACC0692747077F216D14C36CD927671))() -> ()
#Foo.init!initializer.1: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276714Foo2cfMS0_FT_S0_ // main.(Foo2 in _9ACC0692747077F216D14C36CD927671).init (main.(Foo2 in _9ACC0692747077F216D14C36CD927671).Type)() -> main.(Foo2 in _9ACC0692747077F216D14C36CD927671)
#Foo2.deinit!deallocator: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276714Foo2D // main.(Foo2 in _9ACC0692747077F216D14C36CD927671).__deallocating_deinit
#Foo2.deinit!deallocator.1: @_TFC4mainP33_9ACC0692747077F216D14C36CD9276714Foo2D // main.(Foo2 in _9ACC0692747077F216D14C36CD927671).__deallocating_deinit
}

View File

@@ -948,7 +948,7 @@ bb0(%0 : $Ping):
sil_vtable Ping {
#Ping.ping!1: @_TFC4main4Ping4pingfS0_FT_S0_ // main.Ping.ping (main.Ping)() -> main.Ping
#Ping.deinit!deallocator: @_TFC4main4PingD // main.Ping.__deallocating_deinit
#Ping.deinit!deallocator.1: @_TFC4main4PingD // main.Ping.__deallocating_deinit
#Ping.init!initializer.1: @_TFC4main4PingcfMS0_FT_S0_ // main.Ping.init (main.Ping.Type)() -> main.Ping
}
@@ -1040,7 +1040,7 @@ bb0(%0 : $*T, %1 : $Int):
sil_vtable T {
#T.reach!1: @_TFC1p1T5reachfS0_FT_T_ // p.T.reach (p.T)() -> ()
#T.deinit!deallocator: @_TFC1p1TD // p.T.__deallocating_deinit
#T.deinit!deallocator.1: @_TFC1p1TD // p.T.__deallocating_deinit
#T.init!initializer.1: @_TFC1p1TcfMS0_FT_S0_ // p.T.init (p.T.Type)() -> p.T
}

View File

@@ -89,7 +89,7 @@ bb0(%0 : $Bar):
sil hidden @_TFC4test3BarD : $@convention(method) (@owned Bar) -> () {
bb0(%0 : $Bar):
debug_value %0 : $Bar, let, name "self" // id: %1
%2 = objc_super_method %0 : $Bar, #NSObject.deinit!deallocator.foreign : (NSObject) -> () -> (), $@convention(objc_method) (NSObject) -> () // user: %4
%2 = objc_super_method %0 : $Bar, #NSObject.deinit!deallocator.1.foreign : (NSObject) -> () -> (), $@convention(objc_method) (NSObject) -> () // user: %4
%3 = upcast %0 : $Bar to $NSObject // user: %4
%4 = apply %2(%3) : $@convention(objc_method) (NSObject) -> ()
%5 = tuple () // user: %6
@@ -269,5 +269,5 @@ bb0(%0 : $@objc_metatype XXX.Type):
sil_vtable Bar {
#Bar.init!initializer.1: @_TFC4test3BarcfMS0_FT_S0_ // test.Bar.init (test.Bar.Type)() -> test.Bar
#Bar.walk!1: @_TFC4test3Bar4walkfS0_FT_T_ // test.Bar.walk (test.Bar)() -> ()
#Bar.deinit!deallocator: @_TFC4test3BarD // test.Bar.__deallocating_deinit
#Bar.deinit!deallocator.1: @_TFC4test3BarD // test.Bar.__deallocating_deinit
}

View File

@@ -128,7 +128,7 @@ bb0(%0 : $B):
}
sil_vtable B {
#B.deinit!deallocator: @$S4test1BCfD // test.B.__deallocating_deinit
#B.deinit!deallocator.1: @$S4test1BCfD // test.B.__deallocating_deinit
#B.init!initializer.1: @$S4test1BCACycfc // test.B.init () -> test.B
}

View File

@@ -856,7 +856,7 @@ sil_vtable Base {
#Base.foo!1: @_TFC16devirt_try_apply4Base3foofS0_FzT_GSqVs5Int32_
#Base.boo1!1: @_TFC16devirt_try_apply4Base4boo1fS0_FzT_S0_
#Base.boo2!1: @_TFC16devirt_try_apply4Base4boo2fS0_FzT_GSqS0__
#Base.deinit!deallocator: @_TFC16devirt_try_apply4BaseD
#Base.deinit!deallocator.1: @_TFC16devirt_try_apply4BaseD
#Base.init!initializer.1: @_TFC16devirt_try_apply4BasecfMS0_FT_S0_
}
@@ -865,7 +865,7 @@ sil_vtable Derived1 {
#Base.boo1!1: @_TFC16devirt_try_apply8Derived14boo1fS0_FzT_S0_
#Base.boo2!1: @_TFC16devirt_try_apply8Derived14boo2fS0_FzT_GSqS0__
#Base.init!initializer.1: @_TFC16devirt_try_apply8Derived1cfMS0_FT_S0_
#Derived1.deinit!deallocator: @_TFC16devirt_try_apply8Derived1D
#Derived1.deinit!deallocator.1: @_TFC16devirt_try_apply8Derived1D
}
sil_vtable Derived2 {
@@ -873,19 +873,19 @@ sil_vtable Derived2 {
#Base.boo1!1: @_TFC16devirt_try_apply8Derived24boo1fS0_FzT_S0_
#Base.boo2!1: @_TFC16devirt_try_apply8Derived24boo2fS0_FzT_S0_
#Base.init!initializer.1: @_TFC16devirt_try_apply8Derived2cfMS0_FT_S0_
#Derived2.deinit!deallocator: @_TFC16devirt_try_apply8Derived2D
#Derived2.deinit!deallocator.1: @_TFC16devirt_try_apply8Derived2D
}
sil_vtable CP1 {
#CP1.foo!1: @_TFC16devirt_try_apply3CP13foofS0_FzT_Vs5Int32
#CP1.deinit!deallocator: @_TFC16devirt_try_apply3CP1D
#CP1.deinit!deallocator.1: @_TFC16devirt_try_apply3CP1D
#CP1.init!initializer.1: @_TFC16devirt_try_apply3CP1cfMS0_FT_S0_
}
sil_vtable CP2 {
#CP1.foo!1: @_TFC16devirt_try_apply3CP23foofS0_FzT_Vs5Int32
#CP1.init!initializer.1: @_TFC16devirt_try_apply3CP2cfMS0_FT_S0_
#CP2.deinit!deallocator: @_TFC16devirt_try_apply3CP2D
#CP2.deinit!deallocator.1: @_TFC16devirt_try_apply3CP2D
}
sil_witness_table CP1: P module devirt_try_apply {

View File

@@ -853,7 +853,7 @@ bb0(%0 : $*T):
sil_vtable ClassUsingThrowingP {
#ClassUsingThrowingP.init!allocator.1: (ClassUsingThrowingP.Type) -> () -> ClassUsingThrowingP : @$S34eager_specialize_throwing_function19ClassUsingThrowingPCACycfC // ClassUsingThrowingP.__allocating_init()
#ClassUsingThrowingP.init!initializer.1: (ClassUsingThrowingP.Type) -> () -> ClassUsingThrowingP : @$S34eager_specialize_throwing_function19ClassUsingThrowingPCACycfc // ClassUsingThrowingP.init()
#ClassUsingThrowingP.deinit!deallocator: @$S34eager_specialize_throwing_function19ClassUsingThrowingPCfD // ClassUsingThrowingP.__deallocating_deinit
#ClassUsingThrowingP.deinit!deallocator.1: @$S34eager_specialize_throwing_function19ClassUsingThrowingPCfD // ClassUsingThrowingP.__deallocating_deinit
}
sil_witness_table hidden Int64: ThrowingP module eager_specialize_throwing_function {

View File

@@ -1471,11 +1471,11 @@ bb0(%0 : $Z):
}
sil_vtable X {
#X.deinit!deallocator: @$S4main1XCfD
#X.deinit!deallocator.1: @$S4main1XCfD
}
sil_vtable Z {
#Z.deinit!deallocator: @$S4main1ZCfD
#Z.deinit!deallocator.1: @$S4main1ZCfD
}

View File

@@ -104,5 +104,5 @@ bb0(%0 : $Foo):
sil_vtable Foo2 {
#Foo.doSomething!1: @_TFC4test4Foo211doSomethingfS0_FT_CS_3Foo // test.Foo2.doSomething (test.Foo2)() -> test.Foo
#Foo.init!initializer.1: @_TFC4test4Foo2cfMS0_FT_S0_ // test.Foo2.init (test.Foo2.Type)() -> test.Foo2
#Foo2.deinit!deallocator: @_TFC4test4Foo2D // test.Foo2.__deallocating_deinit
#Foo2.deinit!deallocator.1: @_TFC4test4Foo2D // test.Foo2.__deallocating_deinit
}

View File

@@ -469,14 +469,14 @@ bb0(%0 : $Base):
sil_vtable C {
#C.foo!1: @$S14optimize_never1CC3foos5Int32VyF
#C.deinit!deallocator: @$S14optimize_never1CCfD
#C.deinit!deallocator.1: @$S14optimize_never1CCfD
#C.init!initializer.1: @$S14optimize_never1CCACycfc
}
sil_vtable D {
#C.foo!1: @$S14optimize_never1DC3foos5Int32VyF
#C.init!initializer.1: @$S14optimize_never1DCACycfc
#D.deinit!deallocator: @$S14optimize_never1DCfD
#D.deinit!deallocator.1: @$S14optimize_never1DCfD
}
sil_vtable Base {

View File

@@ -60,7 +60,7 @@ sil_witness_table [serialized] <T> ConformingGenericStruct<T> : ResilientProtoco
// vtables cannot be serialized from SIL.
// SIL-NM: V C
sil_vtable [serialized] C {
#C.deinit!deallocator: @c_deinit
#C.deinit!deallocator.1: @c_deinit
}