Skip to content

Commit 59f7fbf

Browse files
authored
Merge pull request #36 from apple/unsupported-library-evolution-fixes
Fix build errors with library evolution enabled
2 parents 8dbc766 + 1d4afa4 commit 59f7fbf

9 files changed

+26
-6
lines changed

Diff for: Sources/Atomics/AtomicBool.swift.gyb

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ${autogenerated_warning()}
2020
import _AtomicsShims
2121

2222
extension Bool: AtomicValue {
23+
@frozen
2324
public struct AtomicRepresentation {
2425
public typealias Value = Bool
2526
@usableFromInline

Diff for: Sources/Atomics/AtomicLazyReference.swift.gyb

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -124,6 +124,7 @@ extension UnsafeAtomicLazyReference {
124124
///
125125
/// These values can be set (initialized) exactly once, but read many
126126
/// times.
127+
@_fixed_layout
127128
public class ManagedAtomicLazyReference<Instance: AnyObject> {
128129
/// The value logically stored in an atomic lazy reference value.
129130
public typealias Value = Instance?

Diff for: Sources/Atomics/AtomicStrongReference.swift

+2
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ internal struct _AtomicReferenceStorage {
318318
}
319319
}
320320

321+
@frozen
321322
public struct AtomicReferenceStorage<Value: AnyObject> {
322323
@usableFromInline
323324
internal var _storage: _AtomicReferenceStorage
@@ -441,6 +442,7 @@ extension AtomicReferenceStorage: AtomicStorage {
441442
}
442443
}
443444

445+
@frozen
444446
public struct AtomicOptionalReferenceStorage<Instance: AnyObject> {
445447
@usableFromInline
446448
internal var _storage: _AtomicReferenceStorage

Diff for: Sources/Atomics/HighLevelTypes.swift.gyb

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -72,6 +72,7 @@ public struct UnsafeAtomic<Value: AtomicValue> {
7272
}
7373

7474
/// A reference type holding an atomic value, with automatic memory management.
75+
@_fixed_layout
7576
public class ManagedAtomic<Value: AtomicValue> {
7677
@usableFromInline
7778
internal var _storage: Value.AtomicRepresentation

Diff for: Sources/Atomics/IntegerConformances.swift.gyb

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -30,6 +30,7 @@ import _AtomicsShims
3030
#if !(os(Linux) && arch(x86_64)) || ENABLE_DOUBLEWIDE_ATOMICS
3131
% end
3232
extension ${swiftType}: AtomicValue {
33+
@frozen
3334
public struct AtomicRepresentation {
3435
public typealias Value = ${swiftType}
3536

Diff for: Sources/Atomics/autogenerated/AtomicBool.swift

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import _AtomicsShims
2222

2323
extension Bool: AtomicValue {
24+
@frozen
2425
public struct AtomicRepresentation {
2526
public typealias Value = Bool
2627
@usableFromInline

Diff for: Sources/Atomics/autogenerated/AtomicLazyReference.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -127,6 +127,7 @@ extension UnsafeAtomicLazyReference {
127127
///
128128
/// These values can be set (initialized) exactly once, but read many
129129
/// times.
130+
@_fixed_layout
130131
public class ManagedAtomicLazyReference<Instance: AnyObject> {
131132
/// The value logically stored in an atomic lazy reference value.
132133
public typealias Value = Instance?

Diff for: Sources/Atomics/autogenerated/HighLevelTypes.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -74,6 +74,7 @@ public struct UnsafeAtomic<Value: AtomicValue> {
7474
}
7575

7676
/// A reference type holding an atomic value, with automatic memory management.
77+
@_fixed_layout
7778
public class ManagedAtomic<Value: AtomicValue> {
7879
@usableFromInline
7980
internal var _storage: Value.AtomicRepresentation

Diff for: Sources/Atomics/autogenerated/IntegerConformances.swift

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -20,6 +20,7 @@
2020
import _AtomicsShims
2121

2222
extension Int: AtomicValue {
23+
@frozen
2324
public struct AtomicRepresentation {
2425
public typealias Value = Int
2526

@@ -512,6 +513,7 @@ extension Int.AtomicRepresentation: AtomicIntegerStorage {
512513
}
513514

514515
extension Int64: AtomicValue {
516+
@frozen
515517
public struct AtomicRepresentation {
516518
public typealias Value = Int64
517519

@@ -1004,6 +1006,7 @@ extension Int64.AtomicRepresentation: AtomicIntegerStorage {
10041006
}
10051007

10061008
extension Int32: AtomicValue {
1009+
@frozen
10071010
public struct AtomicRepresentation {
10081011
public typealias Value = Int32
10091012

@@ -1496,6 +1499,7 @@ extension Int32.AtomicRepresentation: AtomicIntegerStorage {
14961499
}
14971500

14981501
extension Int16: AtomicValue {
1502+
@frozen
14991503
public struct AtomicRepresentation {
15001504
public typealias Value = Int16
15011505

@@ -1988,6 +1992,7 @@ extension Int16.AtomicRepresentation: AtomicIntegerStorage {
19881992
}
19891993

19901994
extension Int8: AtomicValue {
1995+
@frozen
19911996
public struct AtomicRepresentation {
19921997
public typealias Value = Int8
19931998

@@ -2480,6 +2485,7 @@ extension Int8.AtomicRepresentation: AtomicIntegerStorage {
24802485
}
24812486

24822487
extension UInt: AtomicValue {
2488+
@frozen
24832489
public struct AtomicRepresentation {
24842490
public typealias Value = UInt
24852491

@@ -2972,6 +2978,7 @@ extension UInt.AtomicRepresentation: AtomicIntegerStorage {
29722978
}
29732979

29742980
extension UInt64: AtomicValue {
2981+
@frozen
29752982
public struct AtomicRepresentation {
29762983
public typealias Value = UInt64
29772984

@@ -3464,6 +3471,7 @@ extension UInt64.AtomicRepresentation: AtomicIntegerStorage {
34643471
}
34653472

34663473
extension UInt32: AtomicValue {
3474+
@frozen
34673475
public struct AtomicRepresentation {
34683476
public typealias Value = UInt32
34693477

@@ -3956,6 +3964,7 @@ extension UInt32.AtomicRepresentation: AtomicIntegerStorage {
39563964
}
39573965

39583966
extension UInt16: AtomicValue {
3967+
@frozen
39593968
public struct AtomicRepresentation {
39603969
public typealias Value = UInt16
39613970

@@ -4448,6 +4457,7 @@ extension UInt16.AtomicRepresentation: AtomicIntegerStorage {
44484457
}
44494458

44504459
extension UInt8: AtomicValue {
4460+
@frozen
44514461
public struct AtomicRepresentation {
44524462
public typealias Value = UInt8
44534463

@@ -4943,6 +4953,7 @@ extension UInt8.AtomicRepresentation: AtomicIntegerStorage {
49434953
// on Linux distributions, and we cannot currently enable them automatically.
49444954
#if !(os(Linux) && arch(x86_64)) || ENABLE_DOUBLEWIDE_ATOMICS
49454955
extension DoubleWord: AtomicValue {
4956+
@frozen
49464957
public struct AtomicRepresentation {
49474958
public typealias Value = DoubleWord
49484959

0 commit comments

Comments
 (0)