-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathStdlib.cpp
530 lines (375 loc) · 13.1 KB
/
Stdlib.cpp
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
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 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
//
//===----------------------------------------------------------------------===//
#include "swift/Runtime/Metadata.h"
#include "swift/Demangling/ManglingMacros.h"
using namespace swift;
// Placeholders for Swift functions that the C++ runtime references
// but that the test code does not link to.
// AnyHashable
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _swift_makeAnyHashableUsingDefaultRepresentation(
const OpaqueValue *value,
const void *anyHashableResultPointer,
const Metadata *T,
const WitnessTable *hashableWT
) {
abort();
}
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss11AnyHashableVMn[1] = {0};
// SwiftHashableSupport
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool _swift_stdlib_Hashable_isEqual_indirect(
const void *lhsValue, const void *rhsValue, const Metadata *type,
const void *wt) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
intptr_t _swift_stdlib_Hashable_hashValue_indirect(
const void *value, const Metadata *type, const void *wt) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _swift_convertToAnyHashableIndirect(
OpaqueValue *source, OpaqueValue *destination, const Metadata *sourceType,
const void *sourceConformance) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool _swift_anyHashableDownCastConditionalIndirect(
OpaqueValue *source, OpaqueValue *destination, const Metadata *targetType) {
abort();
}
// SwiftEquatableSupport
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool _swift_stdlib_Equatable_isEqual_indirect(
const void *lhsValue, const void *rhsValue, const Metadata *type,
const void *wt) {
abort();
}
// Casting
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _swift_arrayDownCastIndirect(OpaqueValue *destination,
OpaqueValue *source,
const Metadata *sourceValueType,
const Metadata *targetValueType) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool _swift_arrayDownCastConditionalIndirect(OpaqueValue *destination,
OpaqueValue *source,
const Metadata *sourceValueType,
const Metadata *targetValueType) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _swift_setDownCastIndirect(OpaqueValue *destination,
OpaqueValue *source,
const Metadata *sourceValueType,
const Metadata *targetValueType,
const void *sourceValueHashable,
const void *targetValueHashable) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool _swift_setDownCastConditionalIndirect(OpaqueValue *destination,
OpaqueValue *source,
const Metadata *sourceValueType,
const Metadata *targetValueType,
const void *sourceValueHashable,
const void *targetValueHashable) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _swift_dictionaryDownCastIndirect(OpaqueValue *destination,
OpaqueValue *source,
const Metadata *sourceKeyType,
const Metadata *sourceValueType,
const Metadata *targetKeyType,
const Metadata *targetValueType,
const void *sourceKeyHashable,
const void *targetKeyHashable) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool _swift_dictionaryDownCastConditionalIndirect(OpaqueValue *destination,
OpaqueValue *source,
const Metadata *sourceKeyType,
const Metadata *sourceValueType,
const Metadata *targetKeyType,
const Metadata *targetValueType,
const void *sourceKeyHashable,
const void *targetKeyHashable) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _bridgeNonVerbatimBoxedValue(const OpaqueValue *sourceValue,
OpaqueValue *destValue,
const Metadata *nativeType) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void _bridgeNonVerbatimFromObjectiveCToAny(HeapObject *sourceValue,
OpaqueValue *destValue) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool swift_unboxFromSwiftValueWithType(OpaqueValue *source,
OpaqueValue *result,
const Metadata *destinationType) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
bool swift_swiftValueConformsTo(const Metadata *destinationType) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
HeapObject *$ss27_bridgeAnythingToObjectiveCyyXlxlF(OpaqueValue *src, const Metadata *srcType) {
abort();
}
// ErrorObject
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
int $ss13_getErrorCodeySiSPyxGs0B0RzlF(void *) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void *$ss23_getErrorDomainNSStringyyXlSPyxGs0B0RzlF(void *) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void *$ss29_getErrorUserInfoNSDictionaryyyXlSgSPyxGs0B0RzlF(void *) {
abort();
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
void *$ss32_getErrorEmbeddedNSErrorIndirectyyXlSgSPyxGs0B0RzlF(void *) {
abort();
}
// Hashable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $SkMp[1] = {0};
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSHMp[1] = {0};
// Array
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSaMn[1] = {0};
// Dictionary
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ssSdVMn[1] = {0};
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSDMn[1] = {0};
// Set
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ssSeVMn[1] = {0};
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sShMn[1] = {0};
// Bool
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSbMn[1] = {0};
// Binary Floating Point
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSBMp[1] = {0};
// Double
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSdMn[1] = {0};
// RandomNumberGenerator
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSGMp[1] = {0};
// Int
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSiMn[1] = {0};
// DefaultIndices
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSIMn[1] = {0};
// Character
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSJMn[1] = {0};
// Numeric
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSjMp[1] = {0};
// RandomAccessCollection
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSkMp[1] = {0};
// BidirectionalCollection
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSKMp[1] = {0};
// RangeReplacementCollection
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSmMp[1] = {0};
// MutationCollection
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSMMp[1] = {0};
// Range
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSnMn[1] = {0};
// ClosedRange
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSNMn[1] = {0};
// ObjectIdentifier
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSOMn[1] = {0};
// UnsafeMutablePointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSpMn[1] = {0};
// Optional
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSqMn[1] = {0};
// Equatable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSQMp[1] = {0};
// UnsafeMutableBufferPointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSrMn[1] = {0};
// UnsafeBufferPointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSRMn[1] = {0};
// String
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSSMn[1] = {0};
// Sequence
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSTMp[1] = {0};
// UInt
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSuMn[1] = {0};
// UnsignedInteger
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSUMp[1] = {0};
// UnsafeMutableRawPointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSvMn[1] = {0};
// Strideable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSxMp[1] = {0};
// RangeExpression
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSXMp[1] = {0};
// StringProtocol
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSyMp[1] = {0};
// RawRepresentable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSYMp[1] = {0};
// BinaryInteger
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSzMp[1] = {0};
// Decodable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSeMp[1] = {0};
// Encodable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSEMp[1] = {0};
// Float
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSfMn[1] = {0};
// FloatingPoint
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSFMp[1] = {0};
// Collection
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSlMp[1] = {0};
// Comparable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSLMp[1] = {0};
// UnsafePointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSPMn[1] = {0};
// Substring
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSsMn[1] = {0};
// IteratorProtocol
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sStMp[1] = {0};
// UnsafeRawPointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSVMn[1] = {0};
// UnsafeMutableRawBufferPointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSwMn[1] = {0};
// UnsafeRawBufferPointer
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSWMn[1] = {0};
// SignedInteger
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $sSZMp[1] = {0};
// Mirror
// protocol witness table for Swift._ClassSuperMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss17_ClassSuperMirrorVs01_C0sWP[1] = {0};
// type metadata accessor for Swift._ClassSuperMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss17_ClassSuperMirrorVMa[1] = {0};
// protocol witness table for Swift._MetatypeMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss15_MetatypeMirrorVs01_B0sWP[1] = {0};
// type metadata accessor for Swift._MetatypeMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss15_MetatypeMirrorVMa[1] = {0};
// protocol witness table for Swift._EnumMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss11_EnumMirrorVs01_B0sWP[1] = {0};
// type metadata accessor for Swift._EnumMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss11_EnumMirrorVMa[1] = {0};
// protocol witness table for Swift._OpaqueMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss13_OpaqueMirrorVs01_B0sWP[1] = {0};
// type metadata accessor for Swift._OpaqueMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss13_OpaqueMirrorVMa[1] = {0};
// protocol witness table for Swift._StructMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss13_StructMirrorVs01_B0sWP[1] = {0};
// type metadata accessor for Swift._StructMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss13_StructMirrorVMa[1] = {0};
// protocol witness table for Swift._TupleMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss12_TupleMirrorVs01_B0sWP[1] = {0};
// type metadata accessor for Swift._TupleMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss12_TupleMirrorVMa[1] = {0};
// protocol witness table for Swift._ClassMirror : Swift._Mirror in Swift
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss12_ClassMirrorVs01_B0sWP[1] = {0};
// type metadata accessor for Swift._ClassMirror
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss12_ClassMirrorVMa[1] = {0};
// KeyPath
SWIFT_RUNTIME_STDLIB_SPI
const HeapObject *swift_getKeyPathImpl(const void *p,
const void *e,
const void *a) {
abort();
}
// playground print hook
struct swift_closure {
void *fptr;
HeapObject *context;
};
SWIFT_RUNTIME_STDLIB_API SWIFT_CC(swift) swift_closure
MANGLE_SYM(s20_playgroundPrintHookySScSgvg)() {
return {nullptr, nullptr};
}
// ObjectiveC Bridgeable
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss21_ObjectiveCBridgeableMp[1] = {0};
// Key Path
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss7KeyPathCMo[1] = {0};
// Boxing
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss12__SwiftValueCMn[1] = {0};
// Never and Error
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss5NeverOMn[1] = {0};
SWIFT_RUNTIME_STDLIB_INTERNAL
const long long $ss5ErrorMp[1] = {0};