1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
|
//===--- CompatibilityOverridesRuntime.def - Overrides Database -*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines x-macros used for metaprogramming with the set of
// compatibility override functions. See CompatibilityOverride.h for
// a detailed explanation of how this system works.
//
//===----------------------------------------------------------------------===//
/// #define OVERRIDE(name, ret, attrs, ccAttrs, namespace, typedArgs, namedArgs)
/// Provides information about an overridable function.
/// - name is the name of the function, without any leading swift_ or
/// namespace.
/// - ret is the return type of the function.
/// - attrs is the attributes, if any, applied to the function definition.
/// - ccAttrs is the calling convention attributes, if any, applied to the
/// function definition and corresponding typedefs
/// - namespace is the namespace, if any, the function is in, including a
/// trailing ::
/// - typedArgs is the argument list, including types, surrounded by
/// parentheses
/// - namedArgs is the list of argument names, with no types, surrounded by
/// parentheses
///
/// The entries are organized by group. A user may define OVERRIDE to get all
/// entries, or define one or more of the more specific OVERRIDE_* variants to
/// get only those entries. The more specific OVERRIDE_* variants group
/// entries into the functions that are emitted in the specified file;
/// for example, OVERRIDE_CASTING identifies the functions that are defined
/// in Casting.cpp.
// NOTE: the entries in this file are used to build the struct layout for
// the OverrideSection in the CompatibilityOverride.cpp that is built into
// the primary runtime. A matching file must be used to build the
// RuntimeOverrideSection in Overrides.cpp for future compatibility
// override libraries that target this release.
//
// Because compatibility override libraries target a specific release of
// Swift, there is no inherent reason the entries in this file cannot be
// arbitrarily rearranged between release cycles, as long as a matching
// file is used to build any future compatibility override library
// targeting this release. However, the targeting of compatibility
// override libraries is precise only to a specific major+minor release
// number (e.g. 5.6). Therefore, care must be taken to avoid ABI breaks
// in this file between patch releases, or else it will become impossible
// to create a compatibility override library for this release:
//
// - Moving or removing entries in this file will break the ABI.
//
// - Changing an entry to use a different implementation file is allowed,
// but do not move the entry to be grouped with the other entries for
// the implementation file, as this will break the ABI.
//
// - New entries can be added to the end without breaking the ABI. This
// is possible even if there have already been patch releases for this
// major+minor release, since older patch releases of the runtime will
// simply not read the new fields. It is not possible if a compatibility
// override library has already been released for this major+minor
// release, but that is unlikely for releases under active development.
//
// When creating a new compatibility override library, always clone the
// last .def files from the appropriate release branch and edit this comment.
#ifdef OVERRIDE
# define OVERRIDE_METADATALOOKUP OVERRIDE
# define OVERRIDE_CASTING OVERRIDE
# define OVERRIDE_DYNAMICCASTING OVERRIDE
# define OVERRIDE_OBJC OVERRIDE
# define OVERRIDE_FOREIGN OVERRIDE
# define OVERRIDE_PROTOCOLCONFORMANCE OVERRIDE
# define OVERRIDE_KEYPATH OVERRIDE
# define OVERRIDE_WITNESSTABLE OVERRIDE
# define OVERRIDE_CVW OVERRIDE
# define OVERRIDE_CVW_METADATA OVERRIDE
# define OVERRIDE_CVW_METADATA_ENUM OVERRIDE
#else
# ifndef OVERRIDE_METADATALOOKUP
# define OVERRIDE_METADATALOOKUP(...)
# endif
# ifndef OVERRIDE_CASTING
# define OVERRIDE_CASTING(...)
# endif
# ifndef OVERRIDE_DYNAMICCASTING
# define OVERRIDE_DYNAMICCASTING(...)
# endif
# ifndef OVERRIDE_OBJC
# define OVERRIDE_OBJC(...)
# endif
# ifndef OVERRIDE_FOREIGN
# define OVERRIDE_FOREIGN(...)
# endif
# ifndef OVERRIDE_PROTOCOLCONFORMANCE
# define OVERRIDE_PROTOCOLCONFORMANCE(...)
# endif
# ifndef OVERRIDE_KEYPATH
# define OVERRIDE_KEYPATH(...)
# endif
# ifndef OVERRIDE_WITNESSTABLE
# define OVERRIDE_WITNESSTABLE(...)
# endif
# ifndef OVERRIDE_CVW
# define OVERRIDE_CVW(...)
# endif
# ifndef OVERRIDE_CVW_METADATA
# define OVERRIDE_CVW_METADATA(...)
# endif
# ifndef OVERRIDE_CVW_METADATA_ENUM
# define OVERRIDE_CVW_METADATA_ENUM(...)
# endif
#endif
OVERRIDE_DYNAMICCASTING(dynamicCast, bool, , , swift::,
(OpaqueValue *dest, OpaqueValue *src,
const Metadata *srcType,
const Metadata *targetType,
DynamicCastFlags flags),
(dest, src, srcType, targetType, flags))
OVERRIDE_CASTING(dynamicCastClass, const void *, , , swift::,
(const void *object,
const ClassMetadata *targetType),
(object, targetType))
OVERRIDE_CASTING(dynamicCastClassUnconditional, const void *, , , swift::,
(const void *object,
const ClassMetadata *targetType,
const char *file, unsigned line, unsigned column),
(object, targetType, file, line, column))
OVERRIDE_CASTING(dynamicCastUnknownClass, const void *, , , swift::,
(const void *object, const Metadata *targetType),
(object, targetType))
OVERRIDE_CASTING(dynamicCastUnknownClassUnconditional, const void *, , , swift::,
(const void *object, const Metadata *targetType,
const char *file, unsigned line, unsigned column),
(object, targetType, file, line, column))
OVERRIDE_CASTING(dynamicCastMetatype, const Metadata *, , , swift::,
(const Metadata *sourceType,
const Metadata *targetType),
(sourceType, targetType))
OVERRIDE_CASTING(dynamicCastMetatypeUnconditional, const Metadata *, , , swift::,
(const Metadata *sourceType,
const Metadata *targetType,
const char *file, unsigned line, unsigned column),
(sourceType, targetType, file, line, column))
OVERRIDE_FOREIGN(dynamicCastForeignClassMetatype, const ClassMetadata *, , , swift::,
(const ClassMetadata *sourceType,
const ClassMetadata *targetType),
(sourceType, targetType))
OVERRIDE_FOREIGN(dynamicCastForeignClassMetatypeUnconditional,
const ClassMetadata *, , , swift::,
(const ClassMetadata *sourceType,
const ClassMetadata *targetType,
const char *file, unsigned line, unsigned column),
(sourceType, targetType, file, line, column))
OVERRIDE_PROTOCOLCONFORMANCE(conformsToProtocol, const WitnessTable *, , , swift::,
(const Metadata * const type,
const void *protocol),
(type, protocol))
OVERRIDE_PROTOCOLCONFORMANCE(conformsToProtocol2, const WitnessTable *, , , swift::,
(const Metadata * const type,
const ProtocolDescriptor *protocol),
(type, protocol))
OVERRIDE_PROTOCOLCONFORMANCE(conformsToProtocolCommon, const WitnessTable *, , , swift::,
(const Metadata * const type,
const ProtocolDescriptor *protocol),
(type, protocol))
OVERRIDE_KEYPATH(getKeyPath, const HeapObject *, , , swift::,
(const void *pattern, const void *arguments),
(pattern, arguments))
OVERRIDE_METADATALOOKUP(getTypeByMangledNode, TypeLookupErrorOr<TypeInfo>, , SWIFT_CC(swift), swift::,
(MetadataRequest request,
Demangler &demangler,
Demangle::NodePointer node,
const void * const *arguments,
SubstGenericParameterFn substGenericParam,
SubstDependentWitnessTableFn substWitnessTable),
(request, demangler, node, arguments, substGenericParam, substWitnessTable))
OVERRIDE_METADATALOOKUP(getTypeByMangledName, TypeLookupErrorOr<TypeInfo>, , SWIFT_CC(swift), swift::,
(MetadataRequest request,
StringRef typeName,
const void * const *arguments,
SubstGenericParameterFn substGenericParam,
SubstDependentWitnessTableFn substWitnessTable),
(request, typeName, arguments, substGenericParam, substWitnessTable))
OVERRIDE_WITNESSTABLE(getAssociatedTypeWitnessSlow, MetadataResponse,
SWIFT_RUNTIME_STDLIB_INTERNAL, SWIFT_CC(swift), swift::,
(MetadataRequest request, WitnessTable *wtable,
const Metadata *conformingType,
const ProtocolRequirement *reqBase,
const ProtocolRequirement *assocType),
(request, wtable, conformingType, reqBase, assocType))
OVERRIDE_WITNESSTABLE(getAssociatedConformanceWitnessSlow, const WitnessTable *,
SWIFT_RUNTIME_STDLIB_INTERNAL, SWIFT_CC(swift), swift::,
(WitnessTable *wtable, const Metadata *conformingType,
const Metadata *assocType,
const ProtocolRequirement *reqBase,
const ProtocolRequirement *assocConformance),
(wtable, conformingType, assocType, reqBase,
assocConformance))
OVERRIDE_CVW_METADATA(cvw_allocateGenericValueMetadataWithLayoutString, ValueMetadata *,
SWIFT_RUNTIME_EXPORT, , swift::,
(const ValueTypeDescriptor *description,
const void *arguments,
const GenericValueMetadataPattern *pattern,
size_t extraDataSize),
(description, arguments, pattern, extraDataSize))
OVERRIDE_CVW_METADATA(cvw_initStructMetadataWithLayoutString, void, SWIFT_RUNTIME_EXPORT,
, swift::, (StructMetadata *structType,
StructLayoutFlags layoutFlags,
size_t numFields,
const uint8_t *const *fieldTypes,
const uint8_t *fieldTags,
uint32_t *fieldOffsets),
(structType, layoutFlags, numFields, fieldTypes,
fieldTags, fieldOffsets))
OVERRIDE_CVW_METADATA(cvw_allocateGenericClassMetadataWithLayoutString, ClassMetadata *,
SWIFT_RUNTIME_EXPORT, , swift::,
(const ClassDescriptor *description,
const void *arguments,
const GenericClassMetadataPattern *pattern),
(description, arguments, pattern))
OVERRIDE_CVW_METADATA_ENUM(cvw_initEnumMetadataSingleCaseWithLayoutString, void,
SWIFT_RUNTIME_EXPORT, , swift::,
(EnumMetadata *self, EnumLayoutFlags layoutFlags,
const Metadata *payloadType),
(self, layoutFlags, payloadType))
OVERRIDE_CVW_METADATA_ENUM(cvw_initEnumMetadataSinglePayloadWithLayoutString, void,
SWIFT_RUNTIME_EXPORT, , swift::,
(EnumMetadata *self, EnumLayoutFlags layoutFlags,
const Metadata *payloadType, unsigned emptyCases),
(self, layoutFlags, payloadType, emptyCases))
OVERRIDE_CVW_METADATA_ENUM(cvw_initEnumMetadataMultiPayloadWithLayoutString, void,
SWIFT_RUNTIME_EXPORT, , swift::,
(EnumMetadata *self, EnumLayoutFlags layoutFlags,
unsigned numPayloads,
const Metadata * const *payloadLayouts),
(self, layoutFlags, numPayloads, payloadLayouts))
OVERRIDE_CVW(cvw_destroy, void, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
const Metadata *metadata),
(address, metadata))
OVERRIDE_CVW(cvw_assignWithCopy, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_assignWithTake, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_initWithCopy, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_initWithTake, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_initializeBufferWithCopyOfBuffer, swift::OpaqueValue *,
SWIFT_RUNTIME_EXPORT,
, swift::, (swift::ValueBuffer *dest,
swift::ValueBuffer *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_destroyMultiPayloadEnumFN, void, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
const Metadata *metadata),
(address, metadata))
OVERRIDE_CVW(cvw_assignWithCopyMultiPayloadEnumFN, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_assignWithTakeMultiPayloadEnumFN, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_initWithCopyMultiPayloadEnumFN, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_initWithTakeMultiPayloadEnumFN, swift::OpaqueValue *, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *dest,
swift::OpaqueValue *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_initializeBufferWithCopyOfBufferMultiPayloadEnumFN, swift::OpaqueValue *,
SWIFT_RUNTIME_EXPORT,
, swift::, (swift::ValueBuffer *dest,
swift::ValueBuffer *src,
const Metadata *metadata),
(dest, src, metadata))
OVERRIDE_CVW(cvw_enumSimple_getEnumTag, unsigned, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
const Metadata *metadata),
(address, metadata))
OVERRIDE_CVW(cvw_enumSimple_destructiveInjectEnumTag, void, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
unsigned tag,
const Metadata *metadata),
(address, tag, metadata))
OVERRIDE_CVW(cvw_enumFn_getEnumTag, unsigned, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
const Metadata *metadata),
(address, metadata))
OVERRIDE_CVW(cvw_multiPayloadEnumGeneric_getEnumTag, unsigned, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
const Metadata *metadata),
(address, metadata))
OVERRIDE_CVW(cvw_multiPayloadEnumGeneric_destructiveInjectEnumTag, void, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
unsigned tag,
const Metadata *metadata),
(address, tag, metadata))
OVERRIDE_CVW(cvw_singlePayloadEnumGeneric_getEnumTag, unsigned, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
const Metadata *metadata),
(address, metadata))
OVERRIDE_CVW(cvw_singlePayloadEnumGeneric_destructiveInjectEnumTag, void, SWIFT_RUNTIME_EXPORT,
, swift::, (swift::OpaqueValue *address,
unsigned tag,
const Metadata *metadata),
(address, tag, metadata))
#if SWIFT_OBJC_INTEROP
OVERRIDE_OBJC(dynamicCastObjCClass, const void *, , , swift::,
(const void *object,
const ClassMetadata *targetType),
(object, targetType))
OVERRIDE_OBJC(dynamicCastObjCClassUnconditional, const void *, , , swift::,
(const void *object,
const ClassMetadata *targetType,
const char *file, unsigned line, unsigned column),
(object, targetType, file, line, column))
OVERRIDE_OBJC(dynamicCastObjCClassMetatype, const ClassMetadata *, , , swift::,
(const ClassMetadata *sourceType,
const ClassMetadata *targetType),
(sourceType, targetType))
OVERRIDE_OBJC(dynamicCastObjCClassMetatypeUnconditional, const ClassMetadata *, , , swift::,
(const ClassMetadata *sourceType, const ClassMetadata *targetType,
const char *file, unsigned line, unsigned column),
(sourceType, targetType, file, line, column))
OVERRIDE_FOREIGN(dynamicCastForeignClass, const void *, , , swift::,
(const void *object,
const ForeignClassMetadata *targetType),
(object, targetType))
OVERRIDE_FOREIGN(dynamicCastForeignClassUnconditional, const void *, , , swift::,
(const void *object, const ForeignClassMetadata *targetType,
const char *file, unsigned line, unsigned column),
(object, targetType, file, line, column))
#endif
#undef OVERRIDE
#undef OVERRIDE_METADATALOOKUP
#undef OVERRIDE_CASTING
#undef OVERRIDE_DYNAMICCASTING
#undef OVERRIDE_OBJC
#undef OVERRIDE_FOREIGN
#undef OVERRIDE_PROTOCOLCONFORMANCE
#undef OVERRIDE_KEYPATH
#undef OVERRIDE_WITNESSTABLE
#undef OVERRIDE_CVW
#undef OVERRIDE_CVW_METADATA
#undef OVERRIDE_CVW_METADATA_ENUM
|