@@ -684,10 +684,10 @@ extern "C" id swift_stdlib_getErrorEmbeddedNSErrorIndirect(
684
684
/* *****************************************************************************/
685
685
686
686
// / Nominal type descriptor for Swift.AnyHashable.
687
- extern " C" const NominalTypeDescriptor _TMnVs11AnyHashable ;
687
+ extern " C" const NominalTypeDescriptor STRUCT_TYPE_DESCR_SYM (s11AnyHashable) ;
688
688
689
689
static bool isAnyHashableType (const StructMetadata *type) {
690
- return type->getDescription () == &_TMnVs11AnyHashable ;
690
+ return type->getDescription () == &STRUCT_TYPE_DESCR_SYM (s11AnyHashable) ;
691
691
}
692
692
693
693
static bool isAnyHashableType (const Metadata *type) {
@@ -1436,10 +1436,10 @@ static bool _dynamicCastUnknownClassIndirect(OpaqueValue *dest,
1436
1436
/* *****************************************************************************/
1437
1437
1438
1438
#if SWIFT_OBJC_INTEROP
1439
- extern " C" const ProtocolDescriptor _TMps5Error ;
1439
+ extern " C" const ProtocolDescriptor PROTOCOL_DESCR_SYM (s5Error) ;
1440
1440
1441
1441
static const WitnessTable *findErrorWitness (const Metadata *srcType) {
1442
- return swift_conformsToProtocol (srcType, &_TMps5Error );
1442
+ return swift_conformsToProtocol (srcType, &PROTOCOL_DESCR_SYM (s5Error) );
1443
1443
}
1444
1444
#endif
1445
1445
@@ -2138,13 +2138,13 @@ static bool tryDynamicCastBoxedSwiftValue(OpaqueValue *dest,
2138
2138
/* *****************************************************************************/
2139
2139
2140
2140
// / Nominal type descriptor for Swift.Array.
2141
- extern " C" const NominalTypeDescriptor _TMnSa ;
2141
+ extern " C" const NominalTypeDescriptor NOMINAL_TYPE_DESCR_SYM (Sa) ;
2142
2142
2143
2143
// / Nominal type descriptor for Swift.Dictionary.
2144
- extern " C" const NominalTypeDescriptor _TMnVs10Dictionary ;
2144
+ extern " C" const NominalTypeDescriptor STRUCT_TYPE_DESCR_SYM (s10Dictionary) ;
2145
2145
2146
2146
// / Nominal type descriptor for Swift.Set.
2147
- extern " C" const NominalTypeDescriptor _TMnVs3Set ;
2147
+ extern " C" const NominalTypeDescriptor STRUCT_TYPE_DESCR_SYM (s3Set) ;
2148
2148
2149
2149
SWIFT_CC (swift)
2150
2150
extern "C"
@@ -2212,10 +2212,10 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
2212
2212
auto descriptor = sourceType->Description .get ();
2213
2213
auto targetDescriptor = targetType->Description .get ();
2214
2214
if (descriptor != targetDescriptor) {
2215
- if (descriptor == &_TMnVs11AnyHashable ) {
2215
+ if (descriptor == &STRUCT_TYPE_DESCR_SYM (s11AnyHashable) ) {
2216
2216
return _dynamicCastFromAnyHashable (destination, source,
2217
2217
sourceType, targetType, flags);
2218
- } else if (targetDescriptor == &_TMnVs11AnyHashable ) {
2218
+ } else if (targetDescriptor == &STRUCT_TYPE_DESCR_SYM (s11AnyHashable) ) {
2219
2219
return _dynamicCastToAnyHashable (destination, source,
2220
2220
sourceType, targetType, flags);
2221
2221
} else {
@@ -2229,7 +2229,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
2229
2229
bool result;
2230
2230
2231
2231
// Arrays.
2232
- if (descriptor == &_TMnSa ) {
2232
+ if (descriptor == &NOMINAL_TYPE_DESCR_SYM (Sa) ) {
2233
2233
if (flags & DynamicCastFlags::Unconditional) {
2234
2234
_swift_arrayDownCastIndirect (source, destination,
2235
2235
sourceArgs[0 ], targetArgs[0 ]);
@@ -2241,7 +2241,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
2241
2241
}
2242
2242
2243
2243
// Dictionaries.
2244
- } else if (descriptor == &_TMnVs10Dictionary ) {
2244
+ } else if (descriptor == &STRUCT_TYPE_DESCR_SYM (s10Dictionary) ) {
2245
2245
if (flags & DynamicCastFlags::Unconditional) {
2246
2246
_swift_dictionaryDownCastIndirect (source, destination,
2247
2247
sourceArgs[0 ], sourceArgs[1 ],
@@ -2257,7 +2257,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
2257
2257
}
2258
2258
2259
2259
// Sets.
2260
- } else if (descriptor == &_TMnVs3Set ) {
2260
+ } else if (descriptor == &STRUCT_TYPE_DESCR_SYM (s3Set) ) {
2261
2261
if (flags & DynamicCastFlags::Unconditional) {
2262
2262
_swift_setDownCastIndirect (source, destination,
2263
2263
sourceArgs[0 ], targetArgs[0 ],
@@ -2707,7 +2707,7 @@ struct _ObjectiveCBridgeableWitnessTable {
2707
2707
2708
2708
} // unnamed namespace
2709
2709
2710
- extern " C" const ProtocolDescriptor _TMps21_ObjectiveCBridgeable ;
2710
+ extern " C" const ProtocolDescriptor PROTOCOL_DESCR_SYM (s21_ObjectiveCBridgeable) ;
2711
2711
2712
2712
// / Dynamic cast from a value type that conforms to the _ObjectiveCBridgeable
2713
2713
// / protocol to a class type, first by bridging the value to its Objective-C
@@ -2973,12 +2973,16 @@ id _swift_bridgeAnythingNonVerbatimToObjectiveC(OpaqueValue *src,
2973
2973
// documentation.
2974
2974
// ===----------------------------------------------------------------------===//
2975
2975
2976
- extern " C" const _ObjectiveCBridgeableWitnessTable
2977
- _TWPVs19_BridgeableMetatypes21_ObjectiveCBridgeables;
2976
+ #define BRIDGING_CONFORMANCE_SYM \
2977
+ SELECT_MANGLING (_TWPVs19_BridgeableMetatypes21_ObjectiveCBridgeables, \
2978
+ _Ss19_BridgeableMetatypeVs21_ObjectiveCBridgeablesWP)
2979
+
2980
+ extern "C" const _ObjectiveCBridgeableWitnessTable BRIDGING_CONFORMANCE_SYM;
2978
2981
2979
2982
static const _ObjectiveCBridgeableWitnessTable *
2980
2983
findBridgeWitness (const Metadata *T) {
2981
- auto w = swift_conformsToProtocol (T, &_TMps21_ObjectiveCBridgeable);
2984
+ auto w = swift_conformsToProtocol (T,
2985
+ &PROTOCOL_DESCR_SYM (s21_ObjectiveCBridgeable));
2982
2986
if (LLVM_LIKELY (w))
2983
2987
return reinterpret_cast <const _ObjectiveCBridgeableWitnessTable *>(w);
2984
2988
// Class and ObjC existential metatypes can be bridged, but metatypes can't
@@ -2988,14 +2992,14 @@ findBridgeWitness(const Metadata *T) {
2988
2992
case MetadataKind::Metatype: {
2989
2993
auto metaTy = static_cast <const MetatypeMetadata *>(T);
2990
2994
if (metaTy->InstanceType ->isAnyClass ())
2991
- return &_TWPVs19_BridgeableMetatypes21_ObjectiveCBridgeables ;
2995
+ return &BRIDGING_CONFORMANCE_SYM ;
2992
2996
break ;
2993
2997
}
2994
2998
case MetadataKind::ExistentialMetatype: {
2995
2999
auto existentialMetaTy =
2996
3000
static_cast <const ExistentialMetatypeMetadata *>(T);
2997
3001
if (existentialMetaTy->isObjC ())
2998
- return &_TWPVs19_BridgeableMetatypes21_ObjectiveCBridgeables ;
3002
+ return &BRIDGING_CONFORMANCE_SYM ;
2999
3003
break ;
3000
3004
}
3001
3005
0 commit comments