Skip to content

Commit 3ebeed2

Browse files
committed
Foundation: swift 5.1 syntax update (NFC)
Replace `@_fixed_layout` and `@_frozen` with the new `@frozen` attribute. This avoids the warnings during the build. NFC.
1 parent 280d6a8 commit 3ebeed2

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Foundation/CGFloat.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_fixed_layout
10+
@frozen
1111
public struct CGFloat {
1212
#if arch(i386) || arch(arm)
1313
/// The native type used to store the CGFloat, which is Float on

Foundation/Data.swift

+5-6
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ internal class __NSSwiftData : NSData {
635635
#endif
636636
}
637637

638-
@_fixed_layout
638+
@frozen
639639
public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection, MutableDataProtocol, ContiguousBytes {
640640
public typealias ReferenceType = NSData
641641

@@ -651,7 +651,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
651651
// A small inline buffer of bytes suitable for stack-allocation of small data.
652652
// Inlinability strategy: everything here should be inlined for direct operation on the stack wherever possible.
653653
@usableFromInline
654-
@_fixed_layout
654+
@frozen
655655
internal struct InlineData {
656656
#if arch(x86_64) || arch(arm64) || arch(s390x) || arch(powerpc64) || arch(powerpc64le)
657657
@usableFromInline typealias Buffer = (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8,
@@ -872,7 +872,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
872872
// A buffer of bytes too large to fit in an InlineData, but still small enough to fit a storage pointer + range in two words.
873873
// Inlinability strategy: everything here should be easily inlinable as large _DataStorage methods should not inline into here.
874874
@usableFromInline
875-
@_fixed_layout
875+
@frozen
876876
internal struct InlineSlice {
877877
// ***WARNING***
878878
// These ivars are specifically laid out so that they cause the enum _Representation to be 16 bytes on 64 bit platforms. This means we _MUST_ have the class type thing last
@@ -1090,7 +1090,6 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
10901090
// A reference wrapper around a Range<Int> for when the range of a data buffer is too large to whole in a single word.
10911091
// Inlinability strategy: everything should be inlinable as trivial.
10921092
@usableFromInline
1093-
@_fixed_layout
10941093
internal final class RangeReference {
10951094
@usableFromInline var range: Range<Int>
10961095

@@ -1118,7 +1117,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
11181117
// A buffer of bytes whose range is too large to fit in a signle word. Used alongside a RangeReference to make it fit into _Representation's two-word size.
11191118
// Inlinability strategy: everything here should be easily inlinable as large _DataStorage methods should not inline into here.
11201119
@usableFromInline
1121-
@_fixed_layout
1120+
@frozen
11221121
internal struct LargeSlice {
11231122
// ***WARNING***
11241123
// These ivars are specifically laid out so that they cause the enum _Representation to be 16 bytes on 64 bit platforms. This means we _MUST_ have the class type thing last
@@ -1294,7 +1293,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
12941293
// The actual storage for Data's various representations.
12951294
// Inlinability strategy: almost everything should be inlinable as forwarding the underlying implementations. (Inlining can also help avoid retain-release traffic around pulling values out of enums.)
12961295
@usableFromInline
1297-
@_frozen
1296+
@frozen
12981297
internal enum _Representation {
12991298
case empty
13001299
case inline(InlineData)

Foundation/NSSwiftRuntime.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import WinSDK
3232
/// On 64-bit iOS, the Objective-C BOOL type is a typedef of C/C++
3333
/// bool. Elsewhere, it is "signed char". The Clang importer imports it as
3434
/// ObjCBool.
35-
@_fixed_layout
35+
@frozen
3636
public struct ObjCBool : ExpressibleByBooleanLiteral {
3737
#if os(macOS) || (os(iOS) && (arch(i386) || arch(arm)))
3838
// On macOS and 32-bit iOS, Objective-C's BOOL type is a "signed char".

0 commit comments

Comments
 (0)