File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -999,15 +999,16 @@ void TBDGenVisitor::visitConstructorDecl(ConstructorDecl *CD) {
999
999
}
1000
1000
1001
1001
void TBDGenVisitor::visitDestructorDecl (DestructorDecl *DD) {
1002
- // Class destructors come in two forms (deallocating and non-deallocating),
1003
- // like constructors above. This is the deallocating one:
1002
+ // Destructors come in two forms (deallocating and non-deallocating), like
1003
+ // constructors above. Classes use both but move only non-class nominal types
1004
+ // only use the deallocating one. This is the deallocating one:
1004
1005
visitAbstractFunctionDecl (DD);
1005
1006
1006
- auto parentClass = DD->getParent ()->getSelfClassDecl ();
1007
-
1008
- // But the non-deallocating one doesn't apply to some @objc classes.
1009
- if (! Lowering::usesObjCAllocator (parentClass)) {
1010
- addSymbol ( SILDeclRef (DD, SILDeclRef::Kind::Destroyer));
1007
+ if ( auto parentClass = DD->getParent ()->getSelfClassDecl ()) {
1008
+ // But the non-deallocating one doesn't apply to some @objc classes.
1009
+ if (! Lowering::usesObjCAllocator (parentClass)) {
1010
+ addSymbol ( SILDeclRef (DD, SILDeclRef::Kind::Destroyer));
1011
+ }
1011
1012
}
1012
1013
}
1013
1014
You can’t perform that action at this time.
0 commit comments