Skip to content

Commit ef5d11a

Browse files
committed
[interop][SwiftToCxx] NFC, Make swift::getTypeMetadata accessor part of struct template
This allows partial template specializations for adding metadata accessor for generic types 🤩
1 parent 4154b56 commit ef5d11a

11 files changed

+105
-73
lines changed

lib/PrintAsClang/ClangSyntaxPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ void ClangSyntaxPrinter::printGenericRequirementInstantiantion(
256256
assert(!requirement.Protocol && "protocol requirements not supported yet!");
257257
auto *gtpt = requirement.TypeParameter->getAs<GenericTypeParamType>();
258258
assert(gtpt && "unexpected generic param type");
259-
os << "swift::getTypeMetadata<";
259+
os << "swift::TypeMetadataTrait<";
260260
printGenericTypeParamTypeName(gtpt);
261-
os << ">()";
261+
os << ">::getTypeMetadata()";
262262
}
263263

264264
void ClangSyntaxPrinter::printGenericRequirementsInstantiantions(

lib/PrintAsClang/PrintClangFunction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,9 @@ void DeclAndTypeClangFunctionPrinter::printCxxThunkBody(
650650
assert(!genericRequirement.Protocol);
651651
if (auto *gtpt = genericRequirement.TypeParameter
652652
->getAs<GenericTypeParamType>()) {
653-
os << "swift::getTypeMetadata<";
653+
os << "swift::TypeMetadataTrait<";
654654
ClangSyntaxPrinter(os).printGenericTypeParamTypeName(gtpt);
655-
os << ">()";
655+
os << ">::getTypeMetadata()";
656656
return;
657657
}
658658
os << "ERROR";

lib/PrintAsClang/PrintClangValueType.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,17 +559,17 @@ void ClangValueTypePrinter::printTypeGenericTraits(
559559
os << "::";
560560
printer.printBaseName(typeDecl);
561561
os << "> = true;\n";
562-
os << "template<>\n";
563-
os << "inline void * _Nonnull getTypeMetadata<";
562+
os << "template<>\nstruct TypeMetadataTrait<";
564563
printer.printBaseName(typeDecl->getModuleContext());
565564
os << "::";
566565
printer.printBaseName(typeDecl);
567-
os << ">() {\n";
568-
os << " return ";
566+
os << "> {\n";
567+
os << " static inline void * _Nonnull getTypeMetadata() {\n";
568+
os << " return ";
569569
printer.printBaseName(typeDecl->getModuleContext());
570570
os << "::" << cxx_synthesis::getCxxImplNamespaceName()
571571
<< "::" << typeMetadataFuncName << "(0)._0;\n";
572-
os << "}\n";
572+
os << " }\n};\n";
573573

574574
os << "namespace " << cxx_synthesis::getCxxImplNamespaceName() << "{\n";
575575

lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ void printPrimitiveGenericTypeTraits(raw_ostream &os, ASTContext &astContext,
214214
os << "static inline const constexpr bool isUsableInGenericContext<"
215215
<< typeInfo.name << "> = true;\n\n";
216216

217-
os << "template<>\ninline void * _Nonnull getTypeMetadata<";
218-
os << typeInfo.name << ">() {\n";
219-
os << " return &" << cxx_synthesis::getCxxImplNamespaceName()
220-
<< "::" << typeMetadataVarName << ";\n";
221-
os << "}\n\n";
217+
os << "template<>\nstruct TypeMetadataTrait<" << typeInfo.name << "> {\n"
218+
<< " static inline void * _Nonnull getTypeMetadata() {\n"
219+
<< " return &" << cxx_synthesis::getCxxImplNamespaceName()
220+
<< "::" << typeMetadataVarName << ";\n"
221+
<< " }\n};\n\n";
222222
}
223223
}
224224

stdlib/public/SwiftShims/_SwiftCxxInteroperability.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ using UInt = size_t;
140140
template <class T>
141141
static inline const constexpr bool isUsableInGenericContext = false;
142142

143-
/// Returns the type metadat for the given Swift type T.
144-
template <class T> inline void *_Nonnull getTypeMetadata();
143+
/// Returns the type metadata for the given Swift type T.
144+
template <class T> struct TypeMetadataTrait {
145+
static inline void *_Nonnull getTypeMetadata();
146+
};
145147

146148
namespace _impl {
147149

test/Interop/SwiftToCxx/class/swift-class-in-cxx.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ public final class ClassWithIntField {
6666
// CHECK-NEXT: template<>
6767
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<Class::ClassWithIntField> = true;
6868
// CHECK-NEXT: template<>
69-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<Class::ClassWithIntField>() {
70-
// CHECK-NEXT: return Class::_impl::$s5Class0A12WithIntFieldCMa(0)._0;
71-
// CHECK-NEXT: }
69+
// CHECK-NEXT: struct TypeMetadataTrait<Class::ClassWithIntField> {
70+
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata() {
71+
// CHECK-NEXT: return Class::_impl::$s5Class0A12WithIntFieldCMa(0)._0;
72+
// CHECK-NEXT: }
73+
// CHECK-NEXT: };
7274
// CHECK-NEXT: namespace _impl{
7375
// CHECK-NEXT: template<>
7476
// CHECK-NEXT: struct implClassFor<Class::ClassWithIntField> { using type = Class::_impl::_impl_ClassWithIntField; };

test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx.swift

Lines changed: 60 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -119,97 +119,121 @@
119119
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<bool> = true;
120120
// CHECK-EMPTY:
121121
// CHECK-NEXT: template<>
122-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<bool>() {
123-
// CHECK-NEXT: return &_impl::$sSbN;
124-
// CHECK-NEXT: }
122+
// CHECK-NEXT: struct TypeMetadataTrait<bool> {
123+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
124+
// CHECK-NEXT: return &_impl::$sSbN;
125+
// CHECK-NEXT: }
126+
// CHECK-NEXT: };
125127
// CHECK-EMPTY:
126128
// CHECK-NEXT: template<>
127129
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<int8_t> = true;
128130
// CHECK-EMPTY:
129131
// CHECK-NEXT: template<>
130-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<int8_t>() {
131-
// CHECK-NEXT: return &_impl::$ss4Int8VN;
132-
// CHECK-NEXT: }
132+
// CHECK-NEXT: struct TypeMetadataTrait<int8_t> {
133+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
134+
// CHECK-NEXT: return &_impl::$ss4Int8VN;
135+
// CHECK-NEXT: }
136+
// CHECK-NEXT: };
133137
// CHECK-EMPTY:
134138
// CHECK-NEXT: template<>
135139
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<uint8_t> = true;
136140
// CHECK-EMPTY:
137141
// CHECK-NEXT: template<>
138-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<uint8_t>() {
139-
// CHECK-NEXT: return &_impl::$ss5UInt8VN;
140-
// CHECK-NEXT: }
142+
// CHECK-NEXT: struct TypeMetadataTrait<uint8_t> {
143+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
144+
// CHECK-NEXT: return &_impl::$ss5UInt8VN;
145+
// CHECK-NEXT: }
146+
// CHECK-NEXT: };
141147
// CHECK-EMPTY:
142148
// CHECK-NEXT: template<>
143149
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<int16_t> = true;
144150
// CHECK-EMPTY:
145151
// CHECK-NEXT: template<>
146-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<int16_t>() {
147-
// CHECK-NEXT: return &_impl::$ss5Int16VN;
148-
// CHECK-NEXT: }
152+
// CHECK-NEXT: struct TypeMetadataTrait<int16_t> {
153+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
154+
// CHECK-NEXT: return &_impl::$ss5Int16VN;
155+
// CHECK-NEXT: }
156+
// CHECK-NEXT: };
149157
// CHECK-EMPTY:
150158
// CHECK-NEXT: template<>
151159
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<uint16_t> = true;
152160
// CHECK-EMPTY:
153161
// CHECK-NEXT: template<>
154-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<uint16_t>() {
155-
// CHECK-NEXT: return &_impl::$ss6UInt16VN;
156-
// CHECK-NEXT: }
162+
// CHECK-NEXT: struct TypeMetadataTrait<uint16_t> {
163+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
164+
// CHECK-NEXT: return &_impl::$ss6UInt16VN;
165+
// CHECK-NEXT: }
166+
// CHECK-NEXT: };
157167
// CHECK-EMPTY:
158168
// CHECK-NEXT: template<>
159169
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<int32_t> = true;
160170
// CHECK-EMPTY:
161171
// CHECK-NEXT: template<>
162-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<int32_t>() {
163-
// CHECK-NEXT: return &_impl::$ss5Int32VN;
164-
// CHECK-NEXT: }
172+
// CHECK-NEXT: struct TypeMetadataTrait<int32_t> {
173+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
174+
// CHECK-NEXT: return &_impl::$ss5Int32VN;
175+
// CHECK-NEXT: }
176+
// CHECK-NEXT: };
165177
// CHECK-EMPTY:
166178
// CHECK-NEXT: template<>
167179
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<uint32_t> = true;
168180
// CHECK-EMPTY:
169181
// CHECK-NEXT: template<>
170-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<uint32_t>() {
171-
// CHECK-NEXT: return &_impl::$ss6UInt32VN;
172-
// CHECK-NEXT: }
182+
// CHECK-NEXT: struct TypeMetadataTrait<uint32_t> {
183+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
184+
// CHECK-NEXT: return &_impl::$ss6UInt32VN;
185+
// CHECK-NEXT: }
186+
// CHECK-NEXT: };
173187
// CHECK-EMPTY:
174188
// CHECK-NEXT: template<>
175189
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<int64_t> = true;
176190
// CHECK-EMPTY:
177191
// CHECK-NEXT: template<>
178-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<int64_t>() {
179-
// CHECK-NEXT: return &_impl::$ss5Int64VN;
180-
// CHECK-NEXT: }
192+
// CHECK-NEXT: struct TypeMetadataTrait<int64_t> {
193+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
194+
// CHECK-NEXT: return &_impl::$ss5Int64VN;
195+
// CHECK-NEXT: }
196+
// CHECK-NEXT: };
181197
// CHECK-EMPTY:
182198
// CHECK-NEXT: template<>
183199
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<uint64_t> = true;
184200
// CHECK-EMPTY:
185201
// CHECK-NEXT: template<>
186-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<uint64_t>() {
187-
// CHECK-NEXT: return &_impl::$ss6UInt64VN;
188-
// CHECK-NEXT: }
202+
// CHECK-NEXT: struct TypeMetadataTrait<uint64_t> {
203+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
204+
// CHECK-NEXT: return &_impl::$ss6UInt64VN;
205+
// CHECK-NEXT: }
206+
// CHECK-NEXT: };
189207
// CHECK-EMPTY:
190208
// CHECK-NEXT: template<>
191209
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<float> = true;
192210
// CHECK-EMPTY:
193211
// CHECK-NEXT: template<>
194-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<float>() {
195-
// CHECK-NEXT: return &_impl::$sSfN;
196-
// CHECK-NEXT: }
212+
// CHECK-NEXT: struct TypeMetadataTrait<float> {
213+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
214+
// CHECK-NEXT: return &_impl::$sSfN;
215+
// CHECK-NEXT: }
216+
// CHECK-NEXT: };
197217
// CHECK-EMPTY:
198218
// CHECK-NEXT: template<>
199219
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<double> = true;
200220
// CHECK-EMPTY:
201221
// CHECK-NEXT: template<>
202-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<double>() {
203-
// CHECK-NEXT: return &_impl::$sSdN;
204-
// CHECK-NEXT: }
222+
// CHECK-NEXT: struct TypeMetadataTrait<double> {
223+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
224+
// CHECK-NEXT: return &_impl::$sSdN;
225+
// CHECK-NEXT: }
226+
// CHECK-NEXT: };
205227
// CHECK-EMPTY:
206228
// CHECK-NEXT: template<>
207229
// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext<void *> = true;
208230
// CHECK-EMPTY:
209231
// CHECK-NEXT: template<>
210-
// CHECK-NEXT: inline void * _Nonnull getTypeMetadata<void *>() {
211-
// CHECK-NEXT: return &_impl::$ss13OpaquePointerVN;
212-
// CHECK-NEXT: }
232+
// CHECK-NEXT: struct TypeMetadataTrait<void *> {
233+
// CHECK-NEXT: static inline void * _Nonnull getTypeMetadata() {
234+
// CHECK-NEXT: return &_impl::$ss13OpaquePointerVN;
235+
// CHECK-NEXT: }
236+
// CHECK-NEXT: };
213237
// CHECK-EMPTY:
214238
// CHECK-NEXT: #endif
215239
// CHECK-EMPTY:

test/Interop/SwiftToCxx/generics/generic-function-in-cxx.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,66 +122,66 @@ public func createTestSmallStruct(_ x: UInt32) -> TestSmallStruct {
122122
// CHECK: template<class T_0_0>
123123
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>
124124
// CHECK-NEXT: inline void genericPrintFunction(const T_0_0& x) noexcept {
125-
// CHECK-NEXT: return _impl::$s9Functions20genericPrintFunctionyyxlF(swift::_impl::getOpaquePointer(x), swift::getTypeMetadata<T_0_0>());
125+
// CHECK-NEXT: return _impl::$s9Functions20genericPrintFunctionyyxlF(swift::_impl::getOpaquePointer(x), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
126126
// CHECK-NEXT: }
127127

128128

129129
// CHECK: template<class T_0_0, class T_0_1>
130130
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0> && swift::isUsableInGenericContext<T_0_1>
131131
// CHECK-NEXT: inline void genericPrintFunctionMultiGeneric(swift::Int x, const T_0_0& t1, const T_0_0& t1p, swift::Int y, const T_0_1& t2) noexcept {
132-
// CHECK-NEXT: return _impl::$s9Functions32genericPrintFunctionMultiGenericyySi_xxSiq_tr0_lF(x, swift::_impl::getOpaquePointer(t1), swift::_impl::getOpaquePointer(t1p), y, swift::_impl::getOpaquePointer(t2), swift::getTypeMetadata<T_0_0>(), swift::getTypeMetadata<T_0_1>());
132+
// CHECK-NEXT: return _impl::$s9Functions32genericPrintFunctionMultiGenericyySi_xxSiq_tr0_lF(x, swift::_impl::getOpaquePointer(t1), swift::_impl::getOpaquePointer(t1p), y, swift::_impl::getOpaquePointer(t2), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata(), swift::TypeMetadataTrait<T_0_1>::getTypeMetadata());
133133
// CHECK-NEXT: }
134134

135135

136136
// CHECK: template<class T_0_0>
137137
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>
138138
// CHECK-NEXT: inline void genericPrintFunctionTwoArg(const T_0_0& x, swift::Int y) noexcept {
139-
// CHECK-NEXT: return _impl::$s9Functions26genericPrintFunctionTwoArgyyx_SitlF(swift::_impl::getOpaquePointer(x), y, swift::getTypeMetadata<T_0_0>());
139+
// CHECK-NEXT: return _impl::$s9Functions26genericPrintFunctionTwoArgyyx_SitlF(swift::_impl::getOpaquePointer(x), y, swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
140140
// CHECK-NEXT: }
141141

142142
// CHECK: template<class T_0_0>
143143
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>
144144
// CHECK-NEXT: inline T_0_0 genericRet(const T_0_0& x) noexcept SWIFT_WARN_UNUSED_RESULT {
145145
// CHECK-NEXT: if constexpr (std::is_base_of<::swift::_impl::RefCountedClass, T_0_0>::value) {
146146
// CHECK-NEXT: void *returnValue;
147-
// CHECK-NEXT: _impl::$s9Functions10genericRetyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), swift::getTypeMetadata<T_0_0>());
147+
// CHECK-NEXT: _impl::$s9Functions10genericRetyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
148148
// CHECK-NEXT: return ::swift::_impl::implClassFor<T_0_0>::type::makeRetained(returnValue);
149149
// CHECK-NEXT: } else if constexpr (::swift::_impl::isValueType<T_0_0>) {
150150
// CHECK-NEXT: return ::swift::_impl::implClassFor<T_0_0>::type::returnNewValue([&](void * _Nonnull returnValue) {
151-
// CHECK-NEXT: _impl::$s9Functions10genericRetyxxlF(returnValue, swift::_impl::getOpaquePointer(x), swift::getTypeMetadata<T_0_0>());
151+
// CHECK-NEXT: _impl::$s9Functions10genericRetyxxlF(returnValue, swift::_impl::getOpaquePointer(x), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
152152
// CHECK-NEXT: });
153153
// CHECK-NEXT: } else {
154154
// CHECK-NEXT: T_0_0 returnValue;
155-
// CHECK-NEXT: _impl::$s9Functions10genericRetyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), swift::getTypeMetadata<T_0_0>());
155+
// CHECK-NEXT: _impl::$s9Functions10genericRetyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
156156
// CHECK-NEXT: return returnValue;
157157
// CHECK-NEXT: }
158158
// CHECK-NEXT: }
159159

160160
// CHECK: template<class T_0_0>
161161
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>
162162
// CHECK-NEXT: inline void genericSwap(T_0_0& x, T_0_0& y) noexcept {
163-
// CHECK-NEXT: return _impl::$s9Functions11genericSwapyyxz_xztlF(swift::_impl::getOpaquePointer(x), swift::_impl::getOpaquePointer(y), swift::getTypeMetadata<T_0_0>());
163+
// CHECK-NEXT: return _impl::$s9Functions11genericSwapyyxz_xztlF(swift::_impl::getOpaquePointer(x), swift::_impl::getOpaquePointer(y), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
164164
// CHECK-NEXT: }
165165

166166
// CHECK: template<class T_0_0>
167167
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>
168168
// CHECK-NEXT: inline T_0_0 TestSmallStruct::genericMethodPassThrough(const T_0_0& x) const {
169169
// CHECK-NEXT: if constexpr (std::is_base_of<::swift::_impl::RefCountedClass, T_0_0>::value) {
170170
// CHECK-NEXT: void *returnValue;
171-
// CHECK-NEXT: _impl::$s9Functions15TestSmallStructV24genericMethodPassThroughyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), _impl::swift_interop_passDirect_Functions_TestSmallStruct(_getOpaquePointer()), swift::getTypeMetadata<T_0_0>());
171+
// CHECK-NEXT: _impl::$s9Functions15TestSmallStructV24genericMethodPassThroughyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), _impl::swift_interop_passDirect_Functions_TestSmallStruct(_getOpaquePointer()), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
172172
// CHECK-NEXT: return ::swift::_impl::implClassFor<T_0_0>::type::makeRetained(returnValue);
173173
// CHECK-NEXT: } else if constexpr (::swift::_impl::isValueType<T_0_0>) {
174174
// CHECK-NEXT: return ::swift::_impl::implClassFor<T_0_0>::type::returnNewValue([&](void * _Nonnull returnValue) {
175-
// CHECK-NEXT: _impl::$s9Functions15TestSmallStructV24genericMethodPassThroughyxxlF(returnValue, swift::_impl::getOpaquePointer(x), _impl::swift_interop_passDirect_Functions_TestSmallStruct(_getOpaquePointer()), swift::getTypeMetadata<T_0_0>());
175+
// CHECK-NEXT: _impl::$s9Functions15TestSmallStructV24genericMethodPassThroughyxxlF(returnValue, swift::_impl::getOpaquePointer(x), _impl::swift_interop_passDirect_Functions_TestSmallStruct(_getOpaquePointer()), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
176176
// CHECK-NEXT: });
177177
// CHECK-NEXT: } else {
178178
// CHECK-NEXT: T_0_0 returnValue;
179-
// CHECK-NEXT: _impl::$s9Functions15TestSmallStructV24genericMethodPassThroughyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), _impl::swift_interop_passDirect_Functions_TestSmallStruct(_getOpaquePointer()), swift::getTypeMetadata<T_0_0>());
179+
// CHECK-NEXT: _impl::$s9Functions15TestSmallStructV24genericMethodPassThroughyxxlF(reinterpret_cast<void *>(&returnValue), swift::_impl::getOpaquePointer(x), _impl::swift_interop_passDirect_Functions_TestSmallStruct(_getOpaquePointer()), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata());
180180
// CHECK-NEXT: return returnValue;
181181
// CHECK-NEXT: }
182182
// CHECK-NEXT: }
183183
// CHECK-NEXT: template<class T_0_0>
184184
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>
185185
// CHECK-NEXT: inline void TestSmallStruct::genericMethodMutTake(const T_0_0& x) {
186-
// CHECK-NEXT: return _impl::$s9Functions15TestSmallStructV20genericMethodMutTakeyyxlF(swift::_impl::getOpaquePointer(x), swift::getTypeMetadata<T_0_0>(), _getOpaquePointer());
186+
// CHECK-NEXT: return _impl::$s9Functions15TestSmallStructV20genericMethodMutTakeyyxlF(swift::_impl::getOpaquePointer(x), swift::TypeMetadataTrait<T_0_0>::getTypeMetadata(), _getOpaquePointer());
187187
// CHECK-NEXT: }

0 commit comments

Comments
 (0)