Skip to content

Commit 91d0a10

Browse files
committed
IRGen: Don't add class stubs to objc_classes list
1 parent ce70083 commit 91d0a10

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,12 +3231,6 @@ void irgen::emitClassMetadata(IRGenModule &IGM, ClassDecl *classDecl,
32313231
classDecl, NotForDefinition,
32323232
TypeMetadataAddress::AddressPoint);
32333233
emitObjCClassSymbol(IGM, classDecl, stub);
3234-
3235-
// @_objc_non_lazy_realization is only for use by the standard
3236-
// library, and we cannot support it with Objective-C class
3237-
// stubs (which there are none of in the standard library).
3238-
assert(!classDecl->getAttrs().hasAttribute<ObjCNonLazyRealizationAttr>());
3239-
IGM.addObjCClass(stub, /*eagerInitialization=*/false);
32403234
}
32413235
}
32423236
break;

test/IRGen/class_update_callback_with_stub.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// RUN: %target-swift-frontend -emit-module -enable-library-evolution -emit-module-path=%t/resilient_struct.swiftmodule -I %t %S/../Inputs/resilient_struct.swift
44
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module-path %t/resilient_class.swiftmodule -enable-library-evolution %S/../Inputs/resilient_class.swift
55
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module-path %t/resilient_objc_class.swiftmodule -enable-library-evolution %S/../Inputs/resilient_objc_class.swift
6-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -I %t -emit-ir -enable-library-evolution -enable-resilient-objc-class-stubs %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-runtime -DINT=i%target-ptrsize
6+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -I %t -emit-ir -enable-library-evolution -enable-resilient-objc-class-stubs %s > %t/out
7+
// RUN: %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-runtime -DINT=i%target-ptrsize < %t/out
8+
// RUN: %FileCheck %s --check-prefix=NEGATIVE < %t/out
79

810
import Foundation
911
import resilient_class
@@ -88,13 +90,9 @@ import resilient_objc_class
8890
// CHECK-SAME: @"$s31class_update_callback_with_stub27FixedLayoutNSObjectSubclassCMs"
8991

9092

91-
// -- The NSObject-derived class appears on the class list
92-
93-
// CHECK-LABEL: @objc_classes = internal global
94-
// CHECK-SAME: @"$s31class_update_callback_with_stub25ResilientNSObjectSubclassCMs"
95-
// CHECK-SAME: @"$s31class_update_callback_with_stub27FixedLayoutNSObjectSubclassCMs"
96-
// CHECK-SAME: , section "__DATA,__objc_classlist,regular,no_dead_strip"
93+
// -- Class stubs do not appear in the class list
9794

95+
// NEGATIVE-NOT: @objc_classes =
9896

9997
// -- The category list
10098

@@ -152,4 +150,4 @@ extension ResilientNSObjectSubclass {
152150

153151
extension FixedLayoutNSObjectSubclass {
154152
@objc public func objcMethod() {}
155-
}
153+
}

0 commit comments

Comments
 (0)