Skip to content

Commit f04de9f

Browse files
committed
[cxx-interop] Skip metatypes when lowering C++ constructor SIL function type.
When lowering a C++ constructor's function type to a SIL function type, skip over the "self" metatype parameter.
1 parent 7635443 commit f04de9f

9 files changed

+44
-71
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,27 +1315,10 @@ void SignatureExpansion::expandExternalSignatureTypes() {
13151315
// Swift parameters list?
13161316
size_t clangToSwiftParamOffset = paramTys.size();
13171317

1318-
// This is exactly the same as "params" but without thin metatypes. This must
1319-
// exist so that when the path for "Indirect" arguments looks for the
1320-
// SILParameterInfo for a given index, we get the parameter info for the
1321-
// coorisponding clang type's index and not a "random" parameter's info.
1322-
//
1323-
// This is only an issue in very rare cases when we have a constructor that
1324-
// looks like this: (T, @thin U.Type) -> @out U. In this case "params" will
1325-
// contain two elements and "paramTys" will contain two elements so the
1326-
// "Indirect" argument path gets confused and selects the second parameter
1327-
// (the thin metatype) instead of the first one.
1328-
SmallVector<SILParameterInfo, 4> adjustedSILParams;
13291318
// Convert each parameter to a Clang type.
13301319
for (auto param : params) {
13311320
auto clangTy = IGM.getClangType(param, FnType);
1332-
// If a parameter type is lowered to void, this means it should be ignored.
1333-
// For example, this happens for thin metatypes.
1334-
if (clangTy->isVoidType()) {
1335-
continue;
1336-
}
13371321
paramTys.push_back(clangTy);
1338-
adjustedSILParams.push_back(param);
13391322
}
13401323

13411324
// Generate function info for this signature.
@@ -1425,7 +1408,7 @@ void SignatureExpansion::expandExternalSignatureTypes() {
14251408
case clang::CodeGen::ABIArgInfo::Indirect: {
14261409
assert(i >= clangToSwiftParamOffset &&
14271410
"Unexpected index for indirect byval argument");
1428-
auto &param = adjustedSILParams[i - clangToSwiftParamOffset];
1411+
auto &param = params[i - clangToSwiftParamOffset];
14291412
auto paramTy = getSILFuncConventions().getSILType(
14301413
param, IGM.getMaximalTypeExpansionContext());
14311414
auto &paramTI = cast<FixedTypeInfo>(IGM.getTypeInfo(paramTy));

lib/IRGen/GenClangType.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -403,19 +403,7 @@ clang::CanQualType GenClangType::visitProtocolType(CanProtocolType type) {
403403
}
404404

405405
clang::CanQualType GenClangType::visitMetatypeType(CanMetatypeType type) {
406-
assert(type->hasRepresentation() &&
407-
"metatype should have been assigned a representation by SIL");
408-
switch (type->getRepresentation()) {
409-
case MetatypeRepresentation::Thin:
410-
return getClangASTContext().VoidTy;
411-
412-
case MetatypeRepresentation::Thick:
413-
llvm_unreachable("thick metatypes don't have a corresponding Clang type");
414-
415-
case MetatypeRepresentation::ObjC:
416-
return getClangMetatypeType(getClangASTContext());
417-
}
418-
llvm_unreachable("bad representation");
406+
return getClangMetatypeType(getClangASTContext());
419407
}
420408

421409
clang::CanQualType

lib/IRGen/GenDecl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,10 +2812,6 @@ emitCXXConstructorThunkIfNeeded(IRGenModule &IGM, SILFunction *initializer,
28122812
for (auto i = thunk->arg_begin(), e = thunk->arg_end(); i != e; ++i) {
28132813
auto *argTy = i->getType();
28142814
auto *paramTy = ctorFnType->getParamType(i - thunk->arg_begin());
2815-
// Thin metatypes are represented as "void". If we run across one of
2816-
// thesse, skip it.
2817-
if (paramTy == IGM.VoidTy)
2818-
continue;
28192815
if (paramTy != argTy)
28202816
Args.push_back(subIGF.coerceValue(i, paramTy, IGM.DataLayout));
28212817
else

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4222,7 +4222,17 @@ TypeConverter::getLoweredFormalTypes(SILDeclRef constant,
42224222
if (innerExtInfo.isAsync())
42234223
extInfo = extInfo.withAsync(true);
42244224

4225-
bridgedParams.push_back(selfParam);
4225+
// If this is a C++ constructor, don't add the metatype "self" parameter
4226+
// because we'll never use it and it will cause problems in IRGen.
4227+
if (constant.getDecl()->getClangDecl() &&
4228+
isa<clang::CXXConstructorDecl>(constant.getDecl()->getClangDecl())) {
4229+
// But, make sure it is actually a metatype that we're not adding. If
4230+
// changes to the self parameter are made in the future, this logic may
4231+
// need to be updated.
4232+
assert(selfParam.getParameterType()->is<MetatypeType>());
4233+
} else {
4234+
bridgedParams.push_back(selfParam);
4235+
}
42264236

42274237
auto uncurried =
42284238
CanAnyFunctionType::get(genericSig,

lib/SILGen/SILGenApply.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "swift/SIL/PrettyStackTrace.h"
3939
#include "swift/SIL/SILArgument.h"
4040
#include "llvm/Support/Compiler.h"
41+
#include "clang/AST/DeclCXX.h"
4142

4243
using namespace swift;
4344
using namespace Lowering;
@@ -559,6 +560,11 @@ class Callee {
559560
result.foreignError = func->getForeignErrorConvention();
560561
result.foreignSelf = func->getImportAsMemberStatus();
561562

563+
// Remove the metatype "self" parameter by making this a static member.
564+
if (constant->getDecl()->getClangDecl() &&
565+
isa<clang::CXXConstructorDecl>(constant->getDecl()->getClangDecl()))
566+
result.foreignSelf.setStatic();
567+
562568
return result;
563569
}
564570

test/Interop/Cxx/class/constructors-objc-silgen.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import ConstructorsObjC
66

77
// CHECK: [[VAR:%[0-9]+]] = alloc_stack $ConstructorWithNSArrayParam
8-
// CHECK: [[TYPE:%[0-9]+]] = metatype $@thin ConstructorWithNSArrayParam.Type
98
// CHECK: [[OPT_ARRAY:%[0-9]+]] = enum $Optional<NSArray>, #Optional.some!enumelt, %{{[0-9]+}} : $NSArray
10-
// CHECK: [[FUNC:%[0-9]+]] = function_ref @_ZN27ConstructorWithNSArrayParamC1EP7NSArray : $@convention(c) (Optional<NSArray>, @thin ConstructorWithNSArrayParam.Type) -> @out ConstructorWithNSArrayParam
11-
// CHECK: %{{[0-9]+}} = apply [[FUNC]]([[VAR]], [[OPT_ARRAY]], [[TYPE]]) : $@convention(c) (Optional<NSArray>, @thin ConstructorWithNSArrayParam.Type) -> @out ConstructorWithNSArrayParam
9+
// CHECK: [[FUNC:%[0-9]+]] = function_ref @_ZN27ConstructorWithNSArrayParamC1EP7NSArray : $@convention(c) (Optional<NSArray>) -> @out ConstructorWithNSArrayParam
10+
// CHECK: %{{[0-9]+}} = apply [[FUNC]]([[VAR]], [[OPT_ARRAY]]) : $@convention(c) (Optional<NSArray>) -> @out ConstructorWithNSArrayParam
1211
let _ = ConstructorWithNSArrayParam([])

test/Interop/Cxx/class/constructors-silgen.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import Constructors
55
// The most important thing to test here is that the constructor result is
66
// returned with an @out attribute.
77
// CHECK: [[VAR:%[0-9]+]] = alloc_stack $ConstructorWithParam
8-
// CHECK: [[TYPE:%[0-9]+]] = metatype $@thin ConstructorWithParam.Type
98
// CHECK: [[LITERAL:%[0-9]+]] = integer_literal $Builtin.Int32, 42
109
// CHECK: [[INT:%[0-9]+]] = struct $Int32 ([[LITERAL]] : $Builtin.Int32)
11-
// CHECK: [[FUNC:%[0-9]+]] = function_ref @{{_ZN20ConstructorWithParamC1Ei|\?\?0ConstructorWithParam@@QEAA@H@Z}} : $@convention(c) (Int32, @thin ConstructorWithParam.Type) -> @out ConstructorWithParam
12-
// CHECK: %{{[0-9]+}} = apply [[FUNC]]([[VAR]], [[INT]], [[TYPE]]) : $@convention(c) (Int32, @thin ConstructorWithParam.Type) -> @out ConstructorWithParam
10+
// CHECK: [[FUNC:%[0-9]+]] = function_ref @{{_ZN20ConstructorWithParamC1Ei|\?\?0ConstructorWithParam@@QEAA@H@Z}} : $@convention(c) (Int32) -> @out ConstructorWithParam
11+
// CHECK: %{{[0-9]+}} = apply [[FUNC]]([[VAR]], [[INT]]) : $@convention(c) (Int32) -> @out ConstructorWithParam
1312
let _ = ConstructorWithParam(42)

test/Interop/Cxx/class/synthesized-initializers-silgen.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,22 @@ import SynthesizedInitializers
44

55
// CHECK-LABEL: sil [ossa] @$s4main18emptyTypeNoArgInityyF : $@convention(thin) () -> ()
66
// CHECK: [[AS:%.*]] = alloc_stack $EmptyStruct
7-
// CHECK: [[META:%.*]] = metatype $@thin EmptyStruct.Type
8-
// CHECK: [[FN:%.*]] = function_ref @{{_ZN11EmptyStructC1Ev|\?\?0EmptyStruct@@QEAA@XZ}} : $@convention(c) (@thin EmptyStruct.Type) -> @out EmptyStruct
9-
// CHECK: apply [[FN]]([[AS]], [[META]]) : $@convention(c) (@thin EmptyStruct.Type) -> @out EmptyStruct
7+
// CHECK: [[FN:%.*]] = function_ref @{{_ZN11EmptyStructC1Ev|\?\?0EmptyStruct@@QEAA@XZ}} : $@convention(c) () -> @out EmptyStruct
8+
// CHECK: apply [[FN]]([[AS]]) : $@convention(c) () -> @out EmptyStruct
109
// CHECK-LABEL: end sil function '$s4main18emptyTypeNoArgInityyF'
1110

12-
// CHECL-LABEL: sil [clang EmptyStruct.init] @{{_ZN11EmptyStructC1Ev|\?\?0EmptyStruct@@QEAA@XZ}} : $@convention(c) (@thin EmptyStruct.Type) -> @out EmptyStruct
11+
// CHECL-LABEL: sil [clang EmptyStruct.init] @{{_ZN11EmptyStructC1Ev|\?\?0EmptyStruct@@QEAA@XZ}} : $@convention(c) () -> @out EmptyStruct
1312
public func emptyTypeNoArgInit() {
1413
let e = EmptyStruct()
1514
}
1615

1716
// CHECK-LABEL: sil [ossa] @$s4main25singleMemberTypeNoArgInityyF : $@convention(thin) () -> ()
1817
// CHECK: [[AS:%.*]] = alloc_stack $IntBox
19-
// CHECK: [[META:%.*]] = metatype $@thin IntBox.Type
20-
// CHECK: [[FN:%.*]] = function_ref @{{_ZN6IntBoxC1Ev|\?\?0IntBox@@QEAA@XZ}} : $@convention(c) (@thin IntBox.Type) -> @out IntBox
21-
// CHECK: apply [[FN]]([[AS]], [[META]]) : $@convention(c) (@thin IntBox.Type) -> @out IntBox
18+
// CHECK: [[FN:%.*]] = function_ref @{{_ZN6IntBoxC1Ev|\?\?0IntBox@@QEAA@XZ}} : $@convention(c) () -> @out IntBox
19+
// CHECK: apply [[FN]]([[AS]]) : $@convention(c) () -> @out IntBox
2220
// CHECK-LABEL: end sil function '$s4main25singleMemberTypeNoArgInityyF'
2321

24-
//CHECK-LABEL: sil [clang IntBox.init] @{{_ZN6IntBoxC1Ev|\?\?0IntBox@@QEAA@XZ}} : $@convention(c) (@thin IntBox.Type) -> @out IntBox
22+
//CHECK-LABEL: sil [clang IntBox.init] @{{_ZN6IntBoxC1Ev|\?\?0IntBox@@QEAA@XZ}} : $@convention(c) () -> @out IntBox
2523
public func singleMemberTypeNoArgInit() {
2624
let i = IntBox()
2725
}

test/Interop/Cxx/class/type-classification-non-trivial-silgen.swift

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ import TypeClassification
66
// "destroy_addr".
77
// CHECK-LABEL: sil [ossa] @$s4main24testStructWithDestructoryyF
88
// CHECK: [[AS:%.*]] = alloc_stack $StructWithDestructor
9-
// CHECK: [[META:%.*]] = metatype $@thin StructWithDestructor.Type
10-
// CHECK: [[FN:%.*]] = function_ref @{{_ZN20StructWithDestructorC1Ev|\?\?0StructWithDestructor@@QEAA@XZ}} : $@convention(c) (@thin StructWithDestructor.Type) -> @out StructWithDestructor
11-
// CHECK: apply [[FN]]([[AS]], [[META]]) : $@convention(c) (@thin StructWithDestructor.Type) -> @out StructWithDestructor
9+
// CHECK: [[FN:%.*]] = function_ref @{{_ZN20StructWithDestructorC1Ev|\?\?0StructWithDestructor@@QEAA@XZ}} : $@convention(c) () -> @out StructWithDestructor
10+
// CHECK: apply [[FN]]([[AS]]) : $@convention(c) () -> @out StructWithDestructor
1211
// CHECK: destroy_addr [[AS]]
1312
// CHECK: dealloc_stack %0 : $*StructWithDestructor
1413
// CHECK-LABEL: end sil function '$s4main24testStructWithDestructoryyF'
1514

16-
// CHECK-LABEL: sil [clang StructWithDestructor.init] @{{_ZN20StructWithDestructorC1Ev|\?\?0StructWithDestructor@@QEAA@XZ}} : $@convention(c) (@thin StructWithDestructor.Type) -> @out StructWithDestructor
15+
// CHECK-LABEL: sil [clang StructWithDestructor.init] @{{_ZN20StructWithDestructorC1Ev|\?\?0StructWithDestructor@@QEAA@XZ}} : $@convention(c) () -> @out StructWithDestructor
1716
public func testStructWithDestructor() {
1817
let d = StructWithDestructor()
1918
}
@@ -22,22 +21,20 @@ public func testStructWithDestructor() {
2221
// for a "destroy_addr".
2322
// CHECK-LABEL: sil [ossa] @$s4main33testStructWithSubobjectDestructoryyF : $@convention(thin) () -> ()
2423
// CHECK: [[AS:%.*]] = alloc_stack $StructWithSubobjectDestructor
25-
// CHECK: [[META:%.*]] = metatype $@thin StructWithSubobjectDestructor.Type
26-
// CHECK: [[FN:%.*]] = function_ref @{{_ZN29StructWithSubobjectDestructorC1Ev|\?\?1StructWithSubobjectDestructor@@QEAA@XZ}} : $@convention(c) (@thin StructWithSubobjectDestructor.Type) -> @out StructWithSubobjectDestructor
27-
// CHECK: apply [[FN]]([[AS]], [[META]]) : $@convention(c) (@thin StructWithSubobjectDestructor.Type) -> @out StructWithSubobjectDestructor
24+
// CHECK: [[FN:%.*]] = function_ref @{{_ZN29StructWithSubobjectDestructorC1Ev|\?\?1StructWithSubobjectDestructor@@QEAA@XZ}} : $@convention(c) () -> @out StructWithSubobjectDestructor
25+
// CHECK: apply [[FN]]([[AS]]) : $@convention(c) () -> @out StructWithSubobjectDestructor
2826
// CHECK: destroy_addr [[AS]]
2927
// CHECK-LABEL: end sil function '$s4main33testStructWithSubobjectDestructoryyF'
3028

31-
// CHECK-LABEL: sil [clang StructWithSubobjectDestructor.init] @{{_ZN29StructWithSubobjectDestructorC1Ev|\?\?1StructWithSubobjectDestructor@@QEAA@XZ}} : $@convention(c) (@thin StructWithSubobjectDestructor.Type) -> @out StructWithSubobjectDestructor
29+
// CHECK-LABEL: sil [clang StructWithSubobjectDestructor.init] @{{_ZN29StructWithSubobjectDestructorC1Ev|\?\?1StructWithSubobjectDestructor@@QEAA@XZ}} : $@convention(c) () -> @out StructWithSubobjectDestructor
3230
public func testStructWithSubobjectDestructor() {
3331
let d = StructWithSubobjectDestructor()
3432
}
3533

3634
// CHECK-LABLE: sil [ossa] @$s4main37testStructWithCopyConstructorAndValueSbyF
3735
// CHECK: [[AS:%.*]] = alloc_stack $StructWithCopyConstructorAndValue
38-
// CHECK: [[META:%.*]] = metatype $@thin StructWithCopyConstructorAndValue.Type
39-
// CHECK: [[FN:%.*]] = function_ref @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
40-
// CHECK: apply [[FN]]([[AS]], %{{.*}}, [[META]]) : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
36+
// CHECK: [[FN:%.*]] = function_ref @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
37+
// CHECK: apply [[FN]]([[AS]], %{{.*}}) : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
4138
// CHECK: [[OBJ_VAL_ADDR:%.*]] = struct_element_addr [[AS]] : $*StructWithCopyConstructorAndValue, #StructWithCopyConstructorAndValue.value
4239
// CHECK: [[OBJ_VAL:%.*]] = load [trivial] [[OBJ_VAL_ADDR]] : $*Int32
4340
// CHECK: [[IL_42:%.*]] = integer_literal $Builtin.IntLiteral, 42
@@ -49,17 +46,16 @@ public func testStructWithSubobjectDestructor() {
4946
// CHECK: return [[OUT]] : $Bool
5047
// CHECK-LABLE: end sil function '$s4main37testStructWithCopyConstructorAndValueSbyF'
5148

52-
// CHECK-LABEL: sil [clang StructWithCopyConstructorAndValue.init] @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
49+
// CHECK-LABEL: sil [clang StructWithCopyConstructorAndValue.init] @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
5350
public func testStructWithCopyConstructorAndValue() -> Bool {
5451
let obj = StructWithCopyConstructorAndValue(42)
5552
return obj.value == 42
5653
}
5754

5855
// CHECK-LABEL: sil [ossa] @$s4main46testStructWithSubobjectCopyConstructorAndValueSbyF : $@convention(thin) () -> Bool
5956
// CHECK: [[MEMBER_0:%.*]] = alloc_stack $StructWithCopyConstructorAndValue
60-
// CHECK: [[MEMBER_META:%.*]] = metatype $@thin StructWithCopyConstructorAndValue.Type
61-
// CHECK: [[MAKE_MEMBER_FN:%.*]] = function_ref @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
62-
// CHECK: apply [[MAKE_MEMBER_FN]]([[MEMBER_0]], %{{.*}}, [[MEMBER_META]]) : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
57+
// CHECK: [[MAKE_MEMBER_FN:%.*]] = function_ref @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
58+
// CHECK: apply [[MAKE_MEMBER_FN]]([[MEMBER_0]], %{{.*}}) : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
6359
// CHECK: [[AS:%.*]] = alloc_stack $StructWithSubobjectCopyConstructorAndValue
6460
// CHECK: [[META:%.*]] = metatype $@thin StructWithSubobjectCopyConstructorAndValue.Type
6561
// CHECK: [[MEMBER_1:%.*]] = alloc_stack $StructWithCopyConstructorAndValue
@@ -92,15 +88,13 @@ public func testStructWithSubobjectCopyConstructorAndValue() -> Bool {
9288
// testStructWithCopyConstructorAndSubobjectCopyConstructorAndValue()
9389
// CHECK-LABEL: sil [ossa] @$s4main041testStructWithCopyConstructorAndSubobjectefG5ValueSbyF : $@convention(thin) () -> Bool
9490
// CHECK: [[MEMBER_0:%.*]] = alloc_stack $StructWithCopyConstructorAndValue
95-
// CHECK: [[META_MEMBER:%.*]] = metatype $@thin StructWithCopyConstructorAndValue.Type
96-
// CHECK: [[CREATE_MEMBER_FN:%.*]] = function_ref @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
97-
// CHECK: apply [[CREATE_MEMBER_FN]]([[MEMBER_0]], %{{.*}}, [[META_MEMBER]]) : $@convention(c) (Int32, @thin StructWithCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndValue
91+
// CHECK: [[CREATE_MEMBER_FN:%.*]] = function_ref @{{_ZN33StructWithCopyConstructorAndValueC1Ei|\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z}} : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
92+
// CHECK: apply [[CREATE_MEMBER_FN]]([[MEMBER_0]], %{{.*}}) : $@convention(c) (Int32) -> @out StructWithCopyConstructorAndValue
9893
// CHECK: [[AS:%.*]] = alloc_stack $StructWithCopyConstructorAndSubobjectCopyConstructorAndValue
99-
// CHECK: [[META:%.*]] = metatype $@thin StructWithCopyConstructorAndSubobjectCopyConstructorAndValue.Type
10094
// CHECK: [[MEMBER_1:%.*]] = alloc_stack $StructWithCopyConstructorAndValue
10195
// CHECK: copy_addr [[MEMBER_0]] to [initialization] [[MEMBER_1]] : $*StructWithCopyConstructorAndValue
102-
// CHECK: [[FN:%.*]] = function_ref @{{_ZN60StructWithCopyConstructorAndSubobjectCopyConstructorAndValueC1E33StructWithCopyConstructorAndValue|\?\?0StructWithCopyConstructorAndSubobjectCopyConstructorAndValue@@QEAA@UStructWithCopyConstructorAndValue@@@Z}} : $@convention(c) (@in StructWithCopyConstructorAndValue, @thin StructWithCopyConstructorAndSubobjectCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndSubobjectCopyConstructorAndValue
103-
// CHECK: apply [[FN]]([[AS]], [[MEMBER_1]], [[META]]) : $@convention(c) (@in StructWithCopyConstructorAndValue, @thin StructWithCopyConstructorAndSubobjectCopyConstructorAndValue.Type) -> @out StructWithCopyConstructorAndSubobjectCopyConstructorAndValue
96+
// CHECK: [[FN:%.*]] = function_ref @{{_ZN60StructWithCopyConstructorAndSubobjectCopyConstructorAndValueC1E33StructWithCopyConstructorAndValue|\?\?0StructWithCopyConstructorAndSubobjectCopyConstructorAndValue@@QEAA@UStructWithCopyConstructorAndValue@@@Z}} : $@convention(c) (@in StructWithCopyConstructorAndValue) -> @out StructWithCopyConstructorAndSubobjectCopyConstructorAndValue
97+
// CHECK: apply [[FN]]([[AS]], [[MEMBER_1]]) : $@convention(c) (@in StructWithCopyConstructorAndValue) -> @out StructWithCopyConstructorAndSubobjectCopyConstructorAndValue
10498
// CHECK: [[OBJ_MEMBER_ADDR:%.*]] = struct_element_addr [[AS]] : $*StructWithCopyConstructorAndSubobjectCopyConstructorAndValue, #StructWithCopyConstructorAndSubobjectCopyConstructorAndValue.member
10599
// CHECK: [[MEMBER_2:%.*]] = alloc_stack $StructWithCopyConstructorAndValue
106100
// CHECK: copy_addr [[OBJ_MEMBER_ADDR]] to [initialization] [[MEMBER_2]] : $*StructWithCopyConstructorAndValue

0 commit comments

Comments
 (0)