@@ -113,7 +113,6 @@ std::string swift::nameForMetadata(const Metadata *type,
113
113
return result;
114
114
}
115
115
116
- SWIFT_CC (swift)
117
116
TwoWordPair<const char *, uintptr_t >::Return
118
117
swift::swift_getTypeName (const Metadata *type, bool qualified) {
119
118
using Pair = TwoWordPair<const char *, uintptr_t >;
@@ -2972,9 +2971,13 @@ static id bridgeAnythingNonVerbatimToObjectiveC(OpaqueValue *src,
2972
2971
return (id)bridgeAnythingToSwiftValueObject (src, srcType, consume);
2973
2972
}
2974
2973
2975
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
2976
- id _swift_bridgeAnythingNonVerbatimToObjectiveC(OpaqueValue *src,
2977
- const Metadata *srcType) {
2974
+ // / public func _bridgeAnythingNonVerbatimToObjectiveC<T>(_ x: T) -> AnyObject
2975
+ // / Called by inlined stdlib code.
2976
+ #define _bridgeAnythingNonVerbatimToObjectiveC \
2977
+ MANGLE_SYM (s38_bridgeAnythingNonVerbatimToObjectiveCyXlxlF)
2978
+ SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
2979
+ id _bridgeAnythingNonVerbatimToObjectiveC(OpaqueValue *src,
2980
+ const Metadata *srcType) {
2978
2981
return bridgeAnythingNonVerbatimToObjectiveC (src, srcType, /* consume*/ true );
2979
2982
}
2980
2983
@@ -3031,8 +3034,12 @@ findBridgeWitness(const Metadata *T) {
3031
3034
return nullptr ;
3032
3035
}
3033
3036
3034
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
3035
- const Metadata *_swift_getBridgedNonVerbatimObjectiveCType(
3037
+ // public func _getBridgedNonVerbatimObjectiveCType<T>(_: T.Type) -> Any.Type?
3038
+ // Called by inlined stdlib code.
3039
+ #define _getBridgedNonVerbatimObjectiveCType \
3040
+ MANGLE_SYM (s36_getBridgedNonVerbatimObjectiveCTypeypXpSgxmlF)
3041
+ SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
3042
+ const Metadata *_getBridgedNonVerbatimObjectiveCType(
3036
3043
const Metadata *value, const Metadata *T
3037
3044
) {
3038
3045
// Classes and Objective-C existentials bridge verbatim.
@@ -3047,26 +3054,26 @@ const Metadata *_swift_getBridgedNonVerbatimObjectiveCType(
3047
3054
return nullptr ;
3048
3055
}
3049
3056
3050
- // @_silgen_name("_swift_bridgeNonVerbatimFromObjectiveCToAny ")
3057
+ // @_silgen_name("_bridgeNonVerbatimFromObjectiveCToAny ")
3051
3058
// func _bridgeNonVerbatimFromObjectiveCToAny(
3052
3059
// x: AnyObject,
3053
3060
// inout result: Any?
3054
3061
// )
3055
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
3062
+ SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERNAL
3056
3063
void
3057
- _swift_bridgeNonVerbatimFromObjectiveCToAny (HeapObject *sourceValue,
3058
- OpaqueValue *destValue);
3064
+ _bridgeNonVerbatimFromObjectiveCToAny (HeapObject *sourceValue,
3065
+ OpaqueValue *destValue);
3059
3066
3060
- // @_silgen_name("_swift_bridgeNonVerbatimBoxedValue ")
3067
+ // @_silgen_name("_bridgeNonVerbatimBoxedValue ")
3061
3068
// func _bridgeNonVerbatimBoxedValue<NativeType>(
3062
3069
// x: UnsafePointer<NativeType>,
3063
3070
// inout result: NativeType?
3064
3071
// )
3065
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
3072
+ SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERNAL
3066
3073
void
3067
- _swift_bridgeNonVerbatimBoxedValue (const OpaqueValue *sourceValue,
3068
- OpaqueValue *destValue,
3069
- const Metadata *nativeType);
3074
+ _bridgeNonVerbatimBoxedValue (const OpaqueValue *sourceValue,
3075
+ OpaqueValue *destValue,
3076
+ const Metadata *nativeType);
3070
3077
3071
3078
// Try bridging by conversion to Any or boxing if applicable.
3072
3079
static bool tryBridgeNonVerbatimFromObjectiveCUniversal (
@@ -3079,8 +3086,7 @@ static bool tryBridgeNonVerbatimFromObjectiveCUniversal(
3079
3086
if (auto nativeExistential = dyn_cast<ExistentialTypeMetadata>(nativeType)) {
3080
3087
if (nativeExistential->Protocols .NumProtocols == 0 &&
3081
3088
!nativeExistential->isClassBounded ()) {
3082
- _swift_bridgeNonVerbatimFromObjectiveCToAny (sourceValue,
3083
- destValue);
3089
+ _bridgeNonVerbatimFromObjectiveCToAny (sourceValue, destValue);
3084
3090
return true ;
3085
3091
}
3086
3092
}
@@ -3092,25 +3098,25 @@ static bool tryBridgeNonVerbatimFromObjectiveCUniversal(
3092
3098
3093
3099
std::tie (sourceType, sourceBoxedValue) = getValueFromSwiftValue (srcBox);
3094
3100
if (sourceType == nativeType) {
3095
- _swift_bridgeNonVerbatimBoxedValue (sourceBoxedValue,
3096
- destValue,
3097
- nativeType);
3101
+ _bridgeNonVerbatimBoxedValue (sourceBoxedValue, destValue, nativeType);
3098
3102
return true ;
3099
3103
}
3100
3104
}
3101
3105
3102
3106
return false ;
3103
3107
}
3104
3108
3105
- // @_silgen_name("_swift_bridgeNonVerbatimFromObjectiveC")
3106
3109
// func _bridgeNonVerbatimFromObjectiveC<NativeType>(
3107
3110
// x: AnyObject,
3108
3111
// nativeType: NativeType.Type
3109
3112
// inout result: T?
3110
3113
// )
3111
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
3114
+ // Called by inlined stdlib code.
3115
+ #define _bridgeNonVerbatimFromObjectiveC \
3116
+ MANGLE_SYM (s32_bridgeNonVerbatimFromObjectiveCyyXl_xmxSgztlF)
3117
+ SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
3112
3118
void
3113
- _swift_bridgeNonVerbatimFromObjectiveC (
3119
+ _bridgeNonVerbatimFromObjectiveC (
3114
3120
HeapObject *sourceValue,
3115
3121
const Metadata *nativeType,
3116
3122
OpaqueValue *destValue,
@@ -3145,15 +3151,14 @@ _swift_bridgeNonVerbatimFromObjectiveC(
3145
3151
swift::crash (" value type is not bridged to Objective-C" );
3146
3152
}
3147
3153
3148
- // @_silgen_name("_swift_bridgeNonVerbatimFromObjectiveCConditional")
3149
- // func _bridgeNonVerbatimFromObjectiveCConditional<NativeType>(
3150
- // x: AnyObject,
3151
- // nativeType: T.Type,
3152
- // inout result: T?
3153
- // ) -> Bool
3154
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
3154
+ // / func _bridgeNonVerbatimFromObjectiveCConditional<NativeType>(
3155
+ // / x: AnyObject, nativeType: T.Type, inout result: T?) -> Bool
3156
+ // / Called by inlined stdlib code.
3157
+ #define _bridgeNonVerbatimFromObjectiveCConditional \
3158
+ MANGLE_SYM (s43_bridgeNonVerbatimFromObjectiveCConditionalSbyXl_xmxSgztlF)
3159
+ SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
3155
3160
bool
3156
- _swift_bridgeNonVerbatimFromObjectiveCConditional (
3161
+ _bridgeNonVerbatimFromObjectiveCConditional (
3157
3162
HeapObject *sourceValue,
3158
3163
const Metadata *nativeType,
3159
3164
OpaqueValue *destValue,
@@ -3195,10 +3200,12 @@ _swift_bridgeNonVerbatimFromObjectiveCConditional(
3195
3200
}
3196
3201
3197
3202
// func _isBridgedNonVerbatimToObjectiveC<T>(x: T.Type) -> Bool
3198
- SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERFACE
3199
- bool _swift_isBridgedNonVerbatimToObjectiveC(
3200
- const Metadata *value, const Metadata *T
3201
- ) {
3203
+ // Called by inlined stdlib code.
3204
+ #define _isBridgedNonVerbatimToObjectiveC \
3205
+ MANGLE_SYM (s33_isBridgedNonVerbatimToObjectiveCSbxmlF)
3206
+ SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
3207
+ bool _isBridgedNonVerbatimToObjectiveC(const Metadata *value,
3208
+ const Metadata *T) {
3202
3209
assert (!swift_isClassOrObjCExistentialTypeImpl (T));
3203
3210
3204
3211
auto bridgeWitness = findBridgeWitness (T);
@@ -3213,20 +3220,22 @@ bool _swift_isClassOrObjCExistentialType(const Metadata *value,
3213
3220
return swift_isClassOrObjCExistentialTypeImpl (T);
3214
3221
}
3215
3222
3216
- SWIFT_CC (swift)
3223
+ SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERNAL
3217
3224
const Metadata *swift::_swift_class_getSuperclass(const Metadata *theClass) {
3218
3225
if (const ClassMetadata *classType = theClass->getClassObject ())
3219
3226
if (classHasSuperclass (classType))
3220
3227
return getMetadataForClass (classType->SuperClass );
3221
3228
return nullptr ;
3222
3229
}
3223
3230
3224
- SWIFT_CC (c) SWIFT_RUNTIME_EXPORT
3231
+ // Called by compiler-generated cast code.
3232
+ SWIFT_CC (c) SWIFT_RUNTIME_STDLIB_API
3225
3233
bool swift_isClassType(const Metadata *type) {
3226
3234
return Metadata::isAnyKindOfClass (type->getKind ());
3227
3235
}
3228
3236
3229
- SWIFT_CC (c) SWIFT_RUNTIME_EXPORT
3237
+ // Called by compiler-generated code.
3238
+ SWIFT_CC (c) SWIFT_RUNTIME_STDLIB_API
3230
3239
bool swift_isOptionalType(const Metadata *type) {
3231
3240
return type->getKind () == MetadataKind::Optional;
3232
3241
}
0 commit comments