Skip to content

Commit 7c5a5e5

Browse files
Merge pull request swiftlang#32174 from nate-chandler/generic-metadata-prespecialization-components/classes-nongeneric-superclasses
[metadata prespecialization] Support classes with non-generic ancestors.
2 parents 7b3a340 + 8ec75d4 commit 7c5a5e5

File tree

21 files changed

+1018
-56
lines changed

21 files changed

+1018
-56
lines changed

lib/IRGen/GenClass.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ namespace {
207207
/// to compute FieldAccesses for them.
208208
void addFieldsForClass(ClassDecl *theClass, SILType classType,
209209
bool superclass) {
210+
addFieldsForClassImpl(theClass, classType, theClass, classType,
211+
superclass);
212+
}
213+
214+
void addFieldsForClassImpl(ClassDecl *rootClass, SILType rootClassType,
215+
ClassDecl *theClass, SILType classType,
216+
bool superclass) {
210217
if (theClass->hasClangNode()) {
211218
Options |= ClassMetadataFlags::ClassHasObjCAncestry;
212219
return;
@@ -240,7 +247,8 @@ namespace {
240247
} else {
241248
// Otherwise, we are allowed to have total knowledge of the superclass
242249
// fields, so walk them to compute the layout.
243-
addFieldsForClass(superclassDecl, superclassType, /*superclass=*/true);
250+
addFieldsForClassImpl(rootClass, rootClassType, superclassDecl,
251+
superclassType, /*superclass=*/true);
244252
}
245253
}
246254

@@ -259,11 +267,12 @@ namespace {
259267
}
260268

261269
// Collect fields from this class and add them to the layout as a chunk.
262-
addDirectFieldsFromClass(theClass, classType, superclass);
270+
addDirectFieldsFromClass(rootClass, rootClassType, theClass, classType,
271+
superclass);
263272
}
264273

265-
void addDirectFieldsFromClass(ClassDecl *theClass,
266-
SILType classType,
274+
void addDirectFieldsFromClass(ClassDecl *rootClass, SILType rootClassType,
275+
ClassDecl *theClass, SILType classType,
267276
bool superclass) {
268277
for (VarDecl *var : theClass->getStoredProperties()) {
269278
SILType type = classType.getFieldType(var, IGM.getSILModule(),
@@ -287,9 +296,9 @@ namespace {
287296
bool isKnownEmpty = !addField(element, LayoutStrategy::Universal);
288297

289298
bool isSpecializedGeneric =
290-
(theClass->isGenericContext() && !classType.getASTType()
291-
->getRecursiveProperties()
292-
.hasUnboundGeneric());
299+
(rootClass->isGenericContext() && !rootClassType.getASTType()
300+
->getRecursiveProperties()
301+
.hasUnboundGeneric());
293302

294303
// The 'Elements' list only contains superclass fields when we're
295304
// building a layout for tail allocation.

lib/IRGen/MetadataRequest.cpp

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,10 @@ bool irgen::isCanonicalSpecializedNominalTypeMetadataStaticallyAddressable(
750750
auto superclassType =
751751
type->getSuperclass(/*useArchetypes=*/false)->getCanonicalType();
752752
if (!isInitializableTypeMetadataStaticallyAddressable(IGM,
753-
superclassType)) {
753+
superclassType) &&
754+
!tryEmitConstantHeapMetadataRef(
755+
IGM, superclassType,
756+
/*allowDynamicUninitialized=*/false)) {
754757
return false;
755758
}
756759
}
@@ -2172,12 +2175,21 @@ emitIdempotentCanonicalSpecializedClassMetadataInitializationComponent(
21722175
return;
21732176
}
21742177
initializedTypes.insert(theType);
2175-
llvm::Function *accessor =
2176-
IGF.IGM.getAddrOfCanonicalSpecializedGenericTypeMetadataAccessFunction(
2177-
theType, NotForDefinition);
2178+
auto *classDecl = theType->getClassOrBoundGenericClass();
2179+
assert(classDecl);
2180+
if (classDecl->isGenericContext()) {
2181+
llvm::Function *accessor =
2182+
IGF.IGM.getAddrOfCanonicalSpecializedGenericTypeMetadataAccessFunction(
2183+
theType, NotForDefinition);
21782184

2179-
auto request = DynamicMetadataRequest(MetadataState::Complete);
2180-
IGF.emitGenericTypeMetadataAccessFunctionCall(accessor, {}, request);
2185+
auto request = DynamicMetadataRequest(MetadataState::Complete);
2186+
IGF.emitGenericTypeMetadataAccessFunctionCall(accessor, {}, request);
2187+
} else {
2188+
llvm::Function *accessor =
2189+
IGF.IGM.getAddrOfTypeMetadataAccessFunction(theType, NotForDefinition);
2190+
auto request = DynamicMetadataRequest(MetadataState::Complete);
2191+
IGF.emitGenericTypeMetadataAccessFunctionCall(accessor, {}, request);
2192+
}
21812193
}
21822194

21832195
MetadataResponse
@@ -2197,10 +2209,6 @@ irgen::emitCanonicalSpecializedGenericTypeMetadataAccessFunction(
21972209
assert(nominal->isGenericContext());
21982210
assert(!theType->hasUnboundGenericType());
21992211

2200-
auto *uninitializedMetadata = IGF.IGM.getAddrOfTypeMetadata(theType);
2201-
initializedTypes.insert(theType);
2202-
auto *initializedMetadata =
2203-
emitIdempotentClassMetadataInitialization(IGF, uninitializedMetadata);
22042212
auto requirements = GenericTypeRequirements(IGF.IGM, nominal);
22052213
auto substitutions =
22062214
theType->getContextSubstitutionMap(IGF.IGM.getSwiftModule(), nominal);
@@ -2220,12 +2228,14 @@ irgen::emitCanonicalSpecializedGenericTypeMetadataAccessFunction(
22202228
if (superclassType) {
22212229
auto superclass = superclassType->getCanonicalType();
22222230
auto *superclassNominal = superclass->getAnyNominal();
2223-
if (superclassNominal->isGenericContext()) {
2224-
emitIdempotentCanonicalSpecializedClassMetadataInitializationComponent(
2225-
IGF, superclassType->getCanonicalType(), initializedTypes);
2226-
}
2231+
emitIdempotentCanonicalSpecializedClassMetadataInitializationComponent(
2232+
IGF, superclassType->getCanonicalType(), initializedTypes);
22272233
}
22282234

2235+
auto *uninitializedMetadata = IGF.IGM.getAddrOfTypeMetadata(theType);
2236+
initializedTypes.insert(theType);
2237+
auto *initializedMetadata =
2238+
emitIdempotentClassMetadataInitialization(IGF, uninitializedMetadata);
22292239
return MetadataResponse::forComplete(initializedMetadata);
22302240
}
22312241

stdlib/private/StdlibUnittest/StdlibUnittest.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,7 @@ public enum TestRunPredicate : CustomStringConvertible {
18791879

18801880
case iOSAny(/*reason:*/ String)
18811881
case iOSMajor(Int, reason: String)
1882+
case iOSMajorRange(ClosedRange<Int>, reason: String)
18821883
case iOSMinor(Int, Int, reason: String)
18831884
case iOSMinorRange(Int, ClosedRange<Int>, reason: String)
18841885
case iOSBugFix(Int, Int, Int, reason: String)
@@ -1888,6 +1889,7 @@ public enum TestRunPredicate : CustomStringConvertible {
18881889

18891890
case tvOSAny(/*reason:*/ String)
18901891
case tvOSMajor(Int, reason: String)
1892+
case tvOSMajorRange(ClosedRange<Int>, reason: String)
18911893
case tvOSMinor(Int, Int, reason: String)
18921894
case tvOSMinorRange(Int, ClosedRange<Int>, reason: String)
18931895
case tvOSBugFix(Int, Int, Int, reason: String)
@@ -1897,6 +1899,7 @@ public enum TestRunPredicate : CustomStringConvertible {
18971899

18981900
case watchOSAny(/*reason:*/ String)
18991901
case watchOSMajor(Int, reason: String)
1902+
case watchOSMajorRange(ClosedRange<Int>, reason: String)
19001903
case watchOSMinor(Int, Int, reason: String)
19011904
case watchOSMinorRange(Int, ClosedRange<Int>, reason: String)
19021905
case watchOSBugFix(Int, Int, Int, reason: String)
@@ -1948,6 +1951,8 @@ public enum TestRunPredicate : CustomStringConvertible {
19481951
return "iOS(*, reason: \(reason))"
19491952
case .iOSMajor(let major, let reason):
19501953
return "iOS(\(major).*, reason: \(reason))"
1954+
case .iOSMajorRange(let range, let reason):
1955+
return "iOS([\(range)], reason: \(reason))"
19511956
case .iOSMinor(let major, let minor, let reason):
19521957
return "iOS(\(major).\(minor), reason: \(reason))"
19531958
case .iOSMinorRange(let major, let minorRange, let reason):
@@ -1964,6 +1969,8 @@ public enum TestRunPredicate : CustomStringConvertible {
19641969
return "tvOS(*, reason: \(reason))"
19651970
case .tvOSMajor(let major, let reason):
19661971
return "tvOS(\(major).*, reason: \(reason))"
1972+
case .tvOSMajorRange(let range, let reason):
1973+
return "tvOS([\(range)], reason: \(reason))"
19671974
case .tvOSMinor(let major, let minor, let reason):
19681975
return "tvOS(\(major).\(minor), reason: \(reason))"
19691976
case .tvOSMinorRange(let major, let minorRange, let reason):
@@ -1980,6 +1987,8 @@ public enum TestRunPredicate : CustomStringConvertible {
19801987
return "watchOS(*, reason: \(reason))"
19811988
case .watchOSMajor(let major, let reason):
19821989
return "watchOS(\(major).*, reason: \(reason))"
1990+
case .watchOSMajorRange(let range, let reason):
1991+
return "watchOS([\(range)], reason: \(reason))"
19831992
case .watchOSMinor(let major, let minor, let reason):
19841993
return "watchOS(\(major).\(minor), reason: \(reason))"
19851994
case .watchOSMinorRange(let major, let minorRange, let reason):
@@ -2094,6 +2103,14 @@ public enum TestRunPredicate : CustomStringConvertible {
20942103
return false
20952104
}
20962105

2106+
case .iOSMajorRange(let range, _):
2107+
switch _getRunningOSVersion() {
2108+
case .iOS(let major, _, _):
2109+
return range.contains(major)
2110+
default:
2111+
return false
2112+
}
2113+
20972114
case .iOSMinor(let major, let minor, _):
20982115
switch _getRunningOSVersion() {
20992116
case .iOS(major, minor, _):
@@ -2150,6 +2167,14 @@ public enum TestRunPredicate : CustomStringConvertible {
21502167
return false
21512168
}
21522169

2170+
case .tvOSMajorRange(let range, _):
2171+
switch _getRunningOSVersion() {
2172+
case .tvOS(let major, _, _):
2173+
return range.contains(major)
2174+
default:
2175+
return false
2176+
}
2177+
21532178
case .tvOSMinor(let major, let minor, _):
21542179
switch _getRunningOSVersion() {
21552180
case .tvOS(major, minor, _):
@@ -2206,6 +2231,14 @@ public enum TestRunPredicate : CustomStringConvertible {
22062231
return false
22072232
}
22082233

2234+
case .watchOSMajorRange(let range, _):
2235+
switch _getRunningOSVersion() {
2236+
case .watchOS(let major, _, _):
2237+
return range.contains(major)
2238+
default:
2239+
return false
2240+
}
2241+
22092242
case .watchOSMinor(let major, let minor, _):
22102243
switch _getRunningOSVersion() {
22112244
case .watchOS(major, minor, _):

stdlib/public/core/Prespecialize.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ internal func _prespecialize() {
1414
consume(Array<Int>.self)
1515
consume(Array<Optional<Any>>.self)
1616
consume(Array<Optional<String>>.self)
17+
#if _runtime(_ObjC)
18+
consume(_ArrayBuffer<()>.self)
19+
consume(_ArrayBuffer<(Optional<String>, Any)>.self)
20+
consume(_ArrayBuffer<Any>.self)
21+
consume(_ArrayBuffer<AnyHashable>.self)
22+
consume(_ArrayBuffer<Dictionary<String, Any>>.self)
23+
consume(_ArrayBuffer<Dictionary<String, AnyObject>>.self)
24+
consume(_ArrayBuffer<Int64>.self)
25+
consume(_ArrayBuffer<Int>.self)
26+
consume(_ArrayBuffer<Optional<Any>>.self)
27+
consume(_ArrayBuffer<Optional<String>>.self)
28+
#endif
1729
consume(ClosedRange<Int>.self)
1830
consume(ContiguousArray<(AnyHashable, Any)>.self)
1931
consume(ContiguousArray<(Optional<String>, Any)>.self)
@@ -22,6 +34,13 @@ internal func _prespecialize() {
2234
consume(ContiguousArray<Dictionary<String, AnyObject>>.self)
2335
consume(ContiguousArray<Int64>.self)
2436
consume(ContiguousArray<String>.self)
37+
consume(_ContiguousArrayStorage<(AnyHashable, Any)>.self)
38+
consume(_ContiguousArrayStorage<(Optional<String>, Any)>.self)
39+
consume(_ContiguousArrayStorage<Any>.self)
40+
consume(_ContiguousArrayStorage<AnyHashable>.self)
41+
consume(_ContiguousArrayStorage<Dictionary<String, AnyObject>>.self)
42+
consume(_ContiguousArrayStorage<Int64>.self)
43+
consume(_ContiguousArrayStorage<String>.self)
2544
consume(Dictionary<String, String>.Index.self)
2645
consume(Dictionary<String, String>.Iterator.self)
2746
consume(Dictionary<AnyHashable, Any>.self)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
open class Ancestor1 {
2+
public let value: Int
3+
4+
public init(_ value: Int) {
5+
self.value = value
6+
}
7+
}
8+

test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_distinct_generic_class.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ doit()
339339

340340
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAA9Argument2ACLLCySSGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {
341341
// CHECK: entry:
342-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
343-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Argument2[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
342+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
343+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument2[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
344344
// CHECK-unknown: ret
345345
// CHECK-apple: [[INITIALIZED_CLASS:%[0-9]+]] = call %objc_class* @objc_opt_self(
346346
// : %objc_class* bitcast (
@@ -385,8 +385,6 @@ doit()
385385
// : )
386386
// : )
387387
// CHECK-apple: [[INITIALIZED_METADATA:%[0-9]+]] = bitcast %objc_class* [[INITIALIZED_CLASS]] to %swift.type*
388-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
389-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Argument2[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
390388
// CHECK-apple: [[PARTIAL_METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response undef, %swift.type* [[INITIALIZED_METADATA]], 0
391389
// CHECK-apple: [[METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response [[PARTIAL_METADATA_RESPONSE]], [[INT]] 0, 1
392390
// CHECK-apple: ret %swift.metadata_response [[METADATA_RESPONSE]]

test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_different_value.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ doit()
329329

330330
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAFySSGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {
331331
// CHECK: entry:
332-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
333-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
332+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
333+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
334334
// CHECK-unknown: ret
335335
// CHECK-apple: [[INITIALIZED_CLASS:%[0-9]+]] = call %objc_class* @objc_opt_self(
336336
// : %objc_class* bitcast (
@@ -375,8 +375,6 @@ doit()
375375
// : )
376376
// : )
377377
// CHECK-apple: [[INITIALIZED_METADATA:%[0-9]+]] = bitcast %objc_class* [[INITIALIZED_CLASS]] to %swift.type*
378-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
379-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
380378
// CHECK-apple: [[PARTIAL_METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response undef, %swift.type* [[INITIALIZED_METADATA]], 0
381379
// CHECK-apple: [[METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response [[PARTIAL_METADATA_RESPONSE]], [[INT]] 0, 1
382380
// CHECK-apple: ret %swift.metadata_response [[METADATA_RESPONSE]]

test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_same_value.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ doit()
329329

330330
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {
331331
// CHECK: entry:
332-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
333-
// CHECK-unknown-NOT: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
332+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
333+
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
334334
// CHECK-unknown: ret
335335
// CHECK-apple: [[INITIALIZED_CLASS:%[0-9]+]] = call %objc_class* @objc_opt_self(
336336
// : %objc_class* bitcast (
@@ -375,8 +375,6 @@ doit()
375375
// : )
376376
// : )
377377
// CHECK-apple: [[INITIALIZED_METADATA:%[0-9]+]] = bitcast %objc_class* [[INITIALIZED_CLASS]] to %swift.type*
378-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
379-
// CHECK-apple-NOT: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
380378
// CHECK-apple: [[PARTIAL_METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response undef, %swift.type* [[INITIALIZED_METADATA]], 0
381379
// CHECK-apple: [[METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response [[PARTIAL_METADATA_RESPONSE]], [[INT]] 0, 1
382380
// CHECK-apple: ret %swift.metadata_response [[METADATA_RESPONSE]]

test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_con_double.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,12 @@ doit()
332332
// CHECK: ; Function Attrs: noinline nounwind readnone
333333
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {
334334
// CHECK: entry:
335-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
335+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
336+
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
336337
// CHECK-unknown: ret
337338
// CHECK-apple: [[INITIALIZED_CLASS:%[0-9]+]] = call %objc_class* @objc_opt_self(
338339
// CHECK-SAME: @"$s4main5Value[[UNIQUE_ID_1]]CySSGMf"
339340
// CHECK-apple: [[INITIALIZED_METADATA:%[0-9]+]] = bitcast %objc_class* [[INITIALIZED_CLASS]] to %swift.type*
340-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
341-
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
342341
// CHECK-apple: [[PARTIAL_METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response undef, %swift.type* [[INITIALIZED_METADATA]], 0
343342
// CHECK-apple: [[METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response [[PARTIAL_METADATA_RESPONSE]], [[INT]] 0, 1
344343
// CHECK-apple: ret %swift.metadata_response [[METADATA_RESPONSE]]

test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_subclass_arg.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,12 @@ doit()
317317
// CHECK: ; Function Attrs: noinline nounwind readnone
318318
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {
319319
// CHECK: entry:
320-
// CHECK-unknown: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
320+
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
321+
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
321322
// CHECK-unknown: ret
322323
// CHECK-apple: [[INITIALIZED_CLASS:%[0-9]+]] = call %objc_class* @objc_opt_self(
323324
// CHECK-SAME: @"$s4main5Value[[UNIQUE_ID_1]]CySSGMf"
324325
// CHECK-apple: [[INITIALIZED_METADATA:%[0-9]+]] = bitcast %objc_class* [[INITIALIZED_CLASS]] to %swift.type*
325-
// CHECK-apple: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
326-
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
327326
// CHECK-apple: [[PARTIAL_METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response undef, %swift.type* [[INITIALIZED_METADATA]], 0
328327
// CHECK-apple: [[METADATA_RESPONSE:%[0-9]+]] = insertvalue %swift.metadata_response [[PARTIAL_METADATA_RESPONSE]], [[INT]] 0, 1
329328
// CHECK-apple: ret %swift.metadata_response [[METADATA_RESPONSE]]

0 commit comments

Comments
 (0)