Skip to content

Commit

Permalink
Merge pull request swiftlang#14823 from rjmccall/no-instantiate-field…
Browse files Browse the repository at this point in the history
…-type-vector-slot
  • Loading branch information
swift-ci authored Feb 25, 2018
2 parents 4df75e8 + 46e5c07 commit 251093e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 88 deletions.
7 changes: 0 additions & 7 deletions lib/IRGen/GenMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3222,9 +3222,6 @@ namespace {

asImpl().addDependentData();

// Save a slot for the field type vector address to be instantiated into.
asImpl().addFieldTypeVectorReferenceSlot();

// Lay out the template data.
super::layout();

Expand Down Expand Up @@ -3281,10 +3278,6 @@ namespace {
super::addGenericWitnessTable(type, conf, std::forward<T>(args)...);
}

void addFieldTypeVectorReferenceSlot() {
B.addNullPointer(IGM.TypeMetadataPtrTy->getPointerTo());
}

// Can be overridden by subclassers to emit other dependent metadata.
void addDependentData() {}

Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/enum_value_semantics.sil
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ enum GenericFixedLayout<T> {

// CHECK-LABEL: @"$S20enum_value_semantics18GenericFixedLayoutOMP" = internal global <{{[{].*\* [}]}}> <{
// CHECK: %swift.type* (%swift.type_pattern*, i8**)* @create_generic_metadata_GenericFixedLayout
// CHECK: i32 40, i16 1, i16 16,
// CHECK: i32 32, i16 1, i16 8,
// CHECK: [16 x i8*] zeroinitializer,
// CHECK: i8** getelementptr inbounds ([18 x i8*], [18 x i8*]* @"$S20enum_value_semantics18GenericFixedLayoutOWV", i32 0, i32 0),
// CHECK: i64 2,
Expand Down
67 changes: 0 additions & 67 deletions test/IRGen/field_type_vectors.sil

This file was deleted.

8 changes: 4 additions & 4 deletions test/IRGen/generic_classes.sil
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,20 @@ entry(%c : $RootGeneric<Int32>):
// CHECK-objc: [[METADATA_ARRAY:%.*]] = bitcast %swift.type* [[METADATA]] to i8**
// CHECK-objc: [[T0:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 0
// CHECK-objc: [[T1:%.*]] = bitcast i8** [[T0]] to %objc_class**
// CHECK-objc: [[T0:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -26
// CHECK-objc: [[T0:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -25
// CHECK-objc: [[METACLASS:%.*]] = bitcast i8** [[T0]] to %objc_class*
// CHECK-objc: store %objc_class* [[METACLASS]], %objc_class** [[T1]], align 8
// Set up the instance rodata pointer.
// CHECK-objc: [[T0:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 4
// CHECK-objc: [[T1:%.*]] = bitcast i8** [[T0]] to i64*
// CHECK-objc: [[RODATA:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -21
// CHECK-objc: [[RODATA:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -20
// CHECK-objc: [[T2:%.*]] = ptrtoint i8** [[RODATA]] to i64
// CHECK-objc: [[T3:%.*]] = or i64 [[T2]], 1
// CHECK-objc: store i64 [[T3]], i64* [[T1]], align 8
// Set up the class rodata pointer.
// CHECK-objc: [[T0:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -22
// CHECK-objc: [[T0:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -21
// CHECK-objc: [[T1:%.*]] = bitcast i8** [[T0]] to i64*
// CHECK-objc: [[META_RODATA:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -12
// CHECK-objc: [[META_RODATA:%.*]] = getelementptr inbounds i8*, i8** [[METADATA_ARRAY]], i32 -11
// CHECK-objc: [[T2:%.*]] = ptrtoint i8** [[META_RODATA]] to i64
// CHECK-objc: store i64 [[T2]], i64* [[T1]], align 8
// Initialize our own dependent field offsets.
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/generic_structs.sil
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Builtin
// CHECK: @"$S15generic_structs13SingleDynamicVMP" = internal global <{ {{.*}} }> <{
// -- template header
// CHECK-SAME: %swift.type* (%swift.type_pattern*, i8**)* @create_generic_metadata_SingleDynamic,
// CHECK-SAME: i32 48, i16 1, i16 16, [{{[0-9]+}} x i8*] zeroinitializer,
// CHECK-SAME: i32 40, i16 1, i16 8, [{{[0-9]+}} x i8*] zeroinitializer,
// -- vwtable pointer
// CHECK-SAME: @"$S15generic_structs13SingleDynamicVWV"
// -- address point
Expand Down
16 changes: 8 additions & 8 deletions test/IRGen/generic_types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

// CHECK-LABEL: @"$S13generic_types1ACMP" = internal global
// CHECK: %swift.type* (%swift.type_pattern*, i8**)* @create_generic_metadata_A,
// CHECK-native-SAME: i32 104,
// CHECK-objc-SAME: i32 288,
// CHECK-native-SAME: i32 96,
// CHECK-objc-SAME: i32 280,
// CHECK-SAME: i16 1,
// CHECK-native-SAME: i16 24,
// CHECK-objc-SAME: i16 208,
// CHECK-native-SAME: i16 16,
// CHECK-objc-SAME: i16 200,
// CHECK-SAME: [{{[0-9]+}} x i8*] zeroinitializer,
// CHECK-SAME: void ([[A]]*)* @"$S13generic_types1ACfD",
// CHECK-SAME: i8** @"$SBoWV",
Expand All @@ -39,11 +39,11 @@

// CHECK-LABEL: @"$S13generic_types1BCMP" = internal global
// CHECK-SAME: %swift.type* (%swift.type_pattern*, i8**)* @create_generic_metadata_B,
// CHECK-native-SAME: i32 104,
// CHECK-objc-SAME: i32 288,
// CHECK-native-SAME: i32 96,
// CHECK-objc-SAME: i32 280,
// CHECK-SAME: i16 1,
// CHECK-native-SAME: i16 24,
// CHECK-objc-SAME: i16 208,
// CHECK-native-SAME: i16 16,
// CHECK-objc-SAME: i16 200,
// CHECK-SAME: [{{[0-9]+}} x i8*] zeroinitializer,
// CHECK-SAME: void ([[B]]*)* @"$S13generic_types1BCfD",
// CHECK-SAME: i8** @"$SBoWV",
Expand Down

0 comments on commit 251093e

Please sign in to comment.