@@ -124,7 +124,7 @@ internal typealias _VAInt = Int32
124
124
/// The pointer argument is valid only for the duration of the function's
125
125
/// execution.
126
126
/// - Returns: The return value, if any, of the `body` closure parameter.
127
- @inlinable // FIXME(sil-serialize-all)
127
+ @inlinable // c-abi
128
128
public func withVaList< R> ( _ args: [ CVarArg ] ,
129
129
_ body: ( CVaListPointer ) -> R ) -> R {
130
130
let builder = _VaListBuilder ( )
@@ -135,7 +135,7 @@ public func withVaList<R>(_ args: [CVarArg],
135
135
}
136
136
137
137
/// Invoke `body` with a C `va_list` argument derived from `builder`.
138
- @inlinable // FIXME(sil-serialize-all)
138
+ @inlinable // c-abi
139
139
internal func _withVaList< R> (
140
140
_ builder: _VaListBuilder ,
141
141
_ body: ( CVaListPointer ) -> R
@@ -166,7 +166,7 @@ internal func _withVaList<R>(
166
166
/// pointer.
167
167
/// - Returns: A pointer that can be used with C functions that take a
168
168
/// `va_list` argument.
169
- @inlinable // FIXME(sil-serialize-all)
169
+ @inlinable // c-abi
170
170
public func getVaList( _ args: [ CVarArg ] ) -> CVaListPointer {
171
171
let builder = _VaListBuilder ( )
172
172
for a in args {
@@ -179,7 +179,7 @@ public func getVaList(_ args: [CVarArg]) -> CVaListPointer {
179
179
}
180
180
#endif
181
181
182
- @inlinable // FIXME(sil-serialize-all)
182
+ @inlinable // c-abi
183
183
public func _encodeBitsAsWords< T> ( _ x: T ) -> [ Int ] {
184
184
let result = [ Int] (
185
185
repeating: 0 ,
@@ -201,7 +201,7 @@ public func _encodeBitsAsWords<T>(_ x: T) -> [Int] {
201
201
extension Int : CVarArg {
202
202
/// Transform `self` into a series of machine words that can be
203
203
/// appropriately interpreted by C varargs.
204
- @inlinable // FIXME(sil-serialize-all)
204
+ @inlinable // c-abi
205
205
public var _cVarArgEncoding : [ Int ] {
206
206
return _encodeBitsAsWords ( self )
207
207
}
@@ -216,14 +216,14 @@ extension Bool : CVarArg {
216
216
extension Int64 : CVarArg , _CVarArgAligned {
217
217
/// Transform `self` into a series of machine words that can be
218
218
/// appropriately interpreted by C varargs.
219
- @inlinable // FIXME(sil-serialize-all)
219
+ @inlinable // c-abi
220
220
public var _cVarArgEncoding : [ Int ] {
221
221
return _encodeBitsAsWords ( self )
222
222
}
223
223
224
224
/// Returns the required alignment in bytes of
225
225
/// the value returned by `_cVarArgEncoding`.
226
- @inlinable // FIXME(sil-serialize-all)
226
+ @inlinable // c-abi
227
227
public var _cVarArgAlignment : Int {
228
228
// FIXME: alignof differs from the ABI alignment on some architectures
229
229
return MemoryLayout . alignment ( ofValue: self )
@@ -233,7 +233,7 @@ extension Int64 : CVarArg, _CVarArgAligned {
233
233
extension Int32 : CVarArg {
234
234
/// Transform `self` into a series of machine words that can be
235
235
/// appropriately interpreted by C varargs.
236
- @inlinable // FIXME(sil-serialize-all)
236
+ @inlinable // c-abi
237
237
public var _cVarArgEncoding : [ Int ] {
238
238
return _encodeBitsAsWords ( _VAInt ( self ) )
239
239
}
@@ -242,7 +242,7 @@ extension Int32 : CVarArg {
242
242
extension Int16 : CVarArg {
243
243
/// Transform `self` into a series of machine words that can be
244
244
/// appropriately interpreted by C varargs.
245
- @inlinable // FIXME(sil-serialize-all)
245
+ @inlinable // c-abi
246
246
public var _cVarArgEncoding : [ Int ] {
247
247
return _encodeBitsAsWords ( _VAInt ( self ) )
248
248
}
@@ -251,7 +251,7 @@ extension Int16 : CVarArg {
251
251
extension Int8 : CVarArg {
252
252
/// Transform `self` into a series of machine words that can be
253
253
/// appropriately interpreted by C varargs.
254
- @inlinable // FIXME(sil-serialize-all)
254
+ @inlinable // c-abi
255
255
public var _cVarArgEncoding : [ Int ] {
256
256
return _encodeBitsAsWords ( _VAInt ( self ) )
257
257
}
@@ -261,7 +261,7 @@ extension Int8 : CVarArg {
261
261
extension UInt : CVarArg {
262
262
/// Transform `self` into a series of machine words that can be
263
263
/// appropriately interpreted by C varargs.
264
- @inlinable // FIXME(sil-serialize-all)
264
+ @inlinable // c-abi
265
265
public var _cVarArgEncoding : [ Int ] {
266
266
return _encodeBitsAsWords ( self )
267
267
}
@@ -270,14 +270,14 @@ extension UInt : CVarArg {
270
270
extension UInt64 : CVarArg , _CVarArgAligned {
271
271
/// Transform `self` into a series of machine words that can be
272
272
/// appropriately interpreted by C varargs.
273
- @inlinable // FIXME(sil-serialize-all)
273
+ @inlinable // c-abi
274
274
public var _cVarArgEncoding : [ Int ] {
275
275
return _encodeBitsAsWords ( self )
276
276
}
277
277
278
278
/// Returns the required alignment in bytes of
279
279
/// the value returned by `_cVarArgEncoding`.
280
- @inlinable // FIXME(sil-serialize-all)
280
+ @inlinable // c-abi
281
281
public var _cVarArgAlignment : Int {
282
282
// FIXME: alignof differs from the ABI alignment on some architectures
283
283
return MemoryLayout . alignment ( ofValue: self )
@@ -287,7 +287,7 @@ extension UInt64 : CVarArg, _CVarArgAligned {
287
287
extension UInt32 : CVarArg {
288
288
/// Transform `self` into a series of machine words that can be
289
289
/// appropriately interpreted by C varargs.
290
- @inlinable // FIXME(sil-serialize-all)
290
+ @inlinable // c-abi
291
291
public var _cVarArgEncoding : [ Int ] {
292
292
return _encodeBitsAsWords ( _VAUInt ( self ) )
293
293
}
@@ -296,7 +296,7 @@ extension UInt32 : CVarArg {
296
296
extension UInt16 : CVarArg {
297
297
/// Transform `self` into a series of machine words that can be
298
298
/// appropriately interpreted by C varargs.
299
- @inlinable // FIXME(sil-serialize-all)
299
+ @inlinable // c-abi
300
300
public var _cVarArgEncoding : [ Int ] {
301
301
return _encodeBitsAsWords ( _VAUInt ( self ) )
302
302
}
@@ -305,7 +305,7 @@ extension UInt16 : CVarArg {
305
305
extension UInt8 : CVarArg {
306
306
/// Transform `self` into a series of machine words that can be
307
307
/// appropriately interpreted by C varargs.
308
- @inlinable // FIXME(sil-serialize-all)
308
+ @inlinable // c-abi
309
309
public var _cVarArgEncoding : [ Int ] {
310
310
return _encodeBitsAsWords ( _VAUInt ( self ) )
311
311
}
@@ -314,7 +314,7 @@ extension UInt8 : CVarArg {
314
314
extension OpaquePointer : CVarArg {
315
315
/// Transform `self` into a series of machine words that can be
316
316
/// appropriately interpreted by C varargs.
317
- @inlinable // FIXME(sil-serialize-all)
317
+ @inlinable // c-abi
318
318
public var _cVarArgEncoding : [ Int ] {
319
319
return _encodeBitsAsWords ( self )
320
320
}
@@ -323,7 +323,7 @@ extension OpaquePointer : CVarArg {
323
323
extension UnsafePointer : CVarArg {
324
324
/// Transform `self` into a series of machine words that can be
325
325
/// appropriately interpreted by C varargs.
326
- @inlinable // FIXME(sil-serialize-all)
326
+ @inlinable // c-abi
327
327
public var _cVarArgEncoding : [ Int ] {
328
328
return _encodeBitsAsWords ( self )
329
329
}
@@ -332,7 +332,7 @@ extension UnsafePointer : CVarArg {
332
332
extension UnsafeMutablePointer : CVarArg {
333
333
/// Transform `self` into a series of machine words that can be
334
334
/// appropriately interpreted by C varargs.
335
- @inlinable // FIXME(sil-serialize-all)
335
+ @inlinable // c-abi
336
336
public var _cVarArgEncoding : [ Int ] {
337
337
return _encodeBitsAsWords ( self )
338
338
}
@@ -352,14 +352,14 @@ extension AutoreleasingUnsafeMutablePointer : CVarArg {
352
352
extension Float : _CVarArgPassedAsDouble , _CVarArgAligned {
353
353
/// Transform `self` into a series of machine words that can be
354
354
/// appropriately interpreted by C varargs.
355
- @inlinable // FIXME(sil-serialize-all)
355
+ @inlinable // c-abi
356
356
public var _cVarArgEncoding : [ Int ] {
357
357
return _encodeBitsAsWords ( Double ( self ) )
358
358
}
359
359
360
360
/// Returns the required alignment in bytes of
361
361
/// the value returned by `_cVarArgEncoding`.
362
- @inlinable // FIXME(sil-serialize-all)
362
+ @inlinable // c-abi
363
363
public var _cVarArgAlignment : Int {
364
364
// FIXME: alignof differs from the ABI alignment on some architectures
365
365
return MemoryLayout . alignment ( ofValue: Double ( self ) )
@@ -369,14 +369,14 @@ extension Float : _CVarArgPassedAsDouble, _CVarArgAligned {
369
369
extension Double : _CVarArgPassedAsDouble , _CVarArgAligned {
370
370
/// Transform `self` into a series of machine words that can be
371
371
/// appropriately interpreted by C varargs.
372
- @inlinable // FIXME(sil-serialize-all)
372
+ @inlinable // c-abi
373
373
public var _cVarArgEncoding : [ Int ] {
374
374
return _encodeBitsAsWords ( self )
375
375
}
376
376
377
377
/// Returns the required alignment in bytes of
378
378
/// the value returned by `_cVarArgEncoding`.
379
- @inlinable // FIXME(sil-serialize-all)
379
+ @inlinable // c-abi
380
380
public var _cVarArgAlignment : Int {
381
381
// FIXME: alignof differs from the ABI alignment on some architectures
382
382
return MemoryLayout . alignment ( ofValue: self )
@@ -388,36 +388,37 @@ extension Double : _CVarArgPassedAsDouble, _CVarArgAligned {
388
388
/// An object that can manage the lifetime of storage backing a
389
389
/// `CVaListPointer`.
390
390
@_fixed_layout // FIXME(sil-serialize-all)
391
- @usableFromInline // FIXME(sil-serialize-all)
391
+ @_fixed_layout // c-abi
392
+ @usableFromInline // c-abi
392
393
final internal class _VaListBuilder {
393
394
394
- @_fixed_layout // FIXME(sil-serialize-all)
395
+ @_fixed_layout // c-abi
395
396
@usableFromInline
396
397
internal struct Header {
397
- @inlinable // FIXME(sil-serialize-all)
398
+ @inlinable // c-abi
398
399
internal init ( ) { }
399
400
400
- @usableFromInline // FIXME(sil-serialize-all)
401
+ @usableFromInline // c-abi
401
402
internal var gp_offset = CUnsignedInt ( 0 )
402
- @usableFromInline // FIXME(sil-serialize-all)
403
+ @usableFromInline // c-abi
403
404
internal var fp_offset =
404
405
CUnsignedInt ( _countGPRegisters * MemoryLayout< Int> . stride)
405
- @usableFromInline // FIXME(sil-serialize-all)
406
+ @usableFromInline // c-abi
406
407
internal var overflow_arg_area : UnsafeMutablePointer < Int > ?
407
- @usableFromInline // FIXME(sil-serialize-all)
408
+ @usableFromInline // c-abi
408
409
internal var reg_save_area : UnsafeMutablePointer < Int > ?
409
410
}
410
411
411
- @inlinable // FIXME(sil-serialize-all)
412
+ @inlinable // c-abi
412
413
internal init ( ) {
413
414
// prepare the register save area
414
415
storage = ContiguousArray ( repeating: 0 , count: _registerSaveWords)
415
416
}
416
417
417
- @inlinable // FIXME(sil-serialize-all)
418
+ @inlinable // c-abi
418
419
deinit { }
419
420
420
- @inlinable // FIXME(sil-serialize-all)
421
+ @inlinable // c-abi
421
422
internal func append( _ arg: CVarArg ) {
422
423
var encoded = arg. _cVarArgEncoding
423
424
@@ -459,7 +460,7 @@ final internal class _VaListBuilder {
459
460
460
461
}
461
462
462
- @inlinable // FIXME(sil-serialize-all)
463
+ @inlinable // c-abi
463
464
internal func va_list( ) -> CVaListPointer {
464
465
header. reg_save_area = storage. _baseAddress
465
466
header. overflow_arg_area
@@ -469,15 +470,15 @@ final internal class _VaListBuilder {
469
470
Builtin . addressof ( & self . header) ) )
470
471
}
471
472
472
- @usableFromInline // FIXME(sil-serialize-all)
473
+ @usableFromInline // c-abi
473
474
internal var gpRegistersUsed = 0
474
- @usableFromInline // FIXME(sil-serialize-all)
475
+ @usableFromInline // c-abi
475
476
internal var fpRegistersUsed = 0
476
477
477
- @usableFromInline // FIXME(sil-serialize-all)
478
+ @usableFromInline // c-abi
478
479
final // Property must be final since it is used by Builtin.addressof.
479
480
internal var header = Header ( )
480
- @usableFromInline // FIXME(sil-serialize-all)
481
+ @usableFromInline // c-abi
481
482
internal var storage : ContiguousArray < Int >
482
483
}
483
484
@@ -486,13 +487,14 @@ final internal class _VaListBuilder {
486
487
/// An object that can manage the lifetime of storage backing a
487
488
/// `CVaListPointer`.
488
489
@_fixed_layout // FIXME(sil-serialize-all)
489
- @usableFromInline // FIXME(sil-serialize-all)
490
+ @_fixed_layout // c-abi
491
+ @usableFromInline // c-abi
490
492
final internal class _VaListBuilder {
491
493
492
- @inlinable // FIXME(sil-serialize-all)
494
+ @inlinable // c-abi
493
495
internal init ( ) { }
494
496
495
- @inlinable // FIXME(sil-serialize-all)
497
+ @inlinable // c-abi
496
498
internal func append( _ arg: CVarArg ) {
497
499
// Write alignment padding if necessary.
498
500
// This is needed on architectures where the ABI alignment of some
@@ -519,7 +521,7 @@ final internal class _VaListBuilder {
519
521
// Marking it inlinable will cause it to resiliently use accessors to
520
522
// project `_VaListBuilder.alignedStorageForEmptyVaLists` as a computed
521
523
// property.
522
- @usableFromInline // FIXME(sil-serialize-all)
524
+ @usableFromInline // c-abi
523
525
internal func va_list( ) -> CVaListPointer {
524
526
// Use Builtin.addressof to emphasize that we are deliberately escaping this
525
527
// pointer and assuming it is safe to do so.
@@ -532,7 +534,7 @@ final internal class _VaListBuilder {
532
534
// but possibly more aligned than that.
533
535
// FIXME: this should be packaged into a better storage type
534
536
535
- @inlinable // FIXME(sil-serialize-all)
537
+ @inlinable // c-abi
536
538
internal func appendWords( _ words: [ Int ] ) {
537
539
let newCount = count + words. count
538
540
if newCount > allocated {
@@ -558,22 +560,22 @@ final internal class _VaListBuilder {
558
560
}
559
561
}
560
562
561
- @inlinable // FIXME(sil-serialize-all)
563
+ @inlinable // c-abi
562
564
internal func rawSizeAndAlignment(
563
565
_ wordCount: Int
564
566
) -> ( Builtin . Word , Builtin . Word ) {
565
567
return ( ( wordCount * MemoryLayout < Int > . stride) . _builtinWordValue,
566
568
requiredAlignmentInBytes. _builtinWordValue)
567
569
}
568
570
569
- @inlinable // FIXME(sil-serialize-all)
571
+ @inlinable // c-abi
570
572
internal func allocStorage( wordCount: Int ) -> UnsafeMutablePointer < Int > {
571
573
let ( rawSize, rawAlignment) = rawSizeAndAlignment ( wordCount)
572
574
let rawStorage = Builtin . allocRaw ( rawSize, rawAlignment)
573
575
return UnsafeMutablePointer < Int > ( rawStorage)
574
576
}
575
577
576
- @usableFromInline // FIXME(sil-serialize-all)
578
+ @usableFromInline // c-abi
577
579
internal func deallocStorage(
578
580
wordCount: Int ,
579
581
storage: UnsafeMutablePointer < Int >
@@ -582,21 +584,21 @@ final internal class _VaListBuilder {
582
584
Builtin . deallocRaw ( storage. _rawValue, rawSize, rawAlignment)
583
585
}
584
586
585
- @inlinable // FIXME(sil-serialize-all)
587
+ @inlinable // c-abi
586
588
deinit {
587
589
if let allocatedStorage = storage {
588
590
deallocStorage ( wordCount: allocated, storage: allocatedStorage)
589
591
}
590
592
}
591
593
592
594
// FIXME: alignof differs from the ABI alignment on some architectures
593
- @usableFromInline // FIXME(sil-serialize-all)
595
+ @usableFromInline // c-abi
594
596
internal let requiredAlignmentInBytes = MemoryLayout< Double> . alignment
595
- @usableFromInline // FIXME(sil-serialize-all)
597
+ @usableFromInline // c-abi
596
598
internal var count = 0
597
- @usableFromInline // FIXME(sil-serialize-all)
599
+ @usableFromInline // c-abi
598
600
internal var allocated = 0
599
- @usableFromInline // FIXME(sil-serialize-all)
601
+ @usableFromInline // c-abi
600
602
internal var storage : UnsafeMutablePointer < Int > ?
601
603
602
604
internal static var alignedStorageForEmptyVaLists : Double = 0
0 commit comments