Skip to content

Commit 1698b26

Browse files
committed
Don’t import Builtin unless we actually need it
1 parent 9b97b05 commit 1698b26

19 files changed

+8
-68
lines changed

Sources/Atomics/AtomicBool.swift.gyb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
}%
1717
${autogenerated_warning()}
1818

19-
#if ATOMICS_NATIVE_BUILTINS
20-
import Builtin
21-
#else
19+
#if !ATOMICS_NATIVE_BUILTINS
2220
import _AtomicsShims
2321
#endif
2422

Sources/Atomics/AtomicInteger.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#endif
16-
1713
/// A type that supports atomic integer operations through a separate
1814
/// atomic storage representation.
1915
///

Sources/Atomics/AtomicLazyReference.swift.gyb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
}%
1515
${autogenerated_warning()}
1616

17-
#if ATOMICS_NATIVE_BUILTINS
18-
import Builtin
19-
#endif
20-
2117
/// An unsafe reference type holding a lazily initializable atomic
2218
/// strong reference, requiring manual memory management of the
2319
/// underlying storage representation.

Sources/Atomics/AtomicMemoryOrderings.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#endif
16-
1713
/// Specifies the memory ordering semantics of an atomic load operation.
1814
@frozen
1915
public struct AtomicLoadOrdering {

Sources/Atomics/AtomicOptional.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#endif
16-
1713
/// An atomic value that also supports atomic operations when wrapped
1814
/// in an `Optional`. Atomic optional wrappable types come with a
1915
/// standalone atomic representation for their optional-wrapped

Sources/Atomics/AtomicOptionalRawRepresentable.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#endif
16-
1713
extension RawRepresentable
1814
where
1915
Self: AtomicOptionalWrappable,

Sources/Atomics/AtomicRawRepresentable.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#endif
16-
1713
extension RawRepresentable
1814
where
1915
Self: AtomicValue,

Sources/Atomics/AtomicStrongReference.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#else
13+
#if !ATOMICS_NATIVE_BUILTINS
1614
import _AtomicsShims
1715
#endif
1816

Sources/Atomics/AtomicValue.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#endif
16-
1713
/// A type that supports atomic operations through a separate atomic storage
1814
/// representation.
1915
public protocol AtomicValue {

Sources/Atomics/DoubleWord.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if ATOMICS_NATIVE_BUILTINS
14-
import Builtin
15-
#else
13+
#if !ATOMICS_NATIVE_BUILTINS
1614
import _AtomicsShims
1715
public typealias DoubleWord = _AtomicsShims.DoubleWord
1816
#endif

0 commit comments

Comments
 (0)