Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/public/core/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ extension Array: RandomAccessCollection, MutableCollection {
/// // Prints "[30, 40, 50]"
///
/// If the array is empty, `endIndex` is equal to `startIndex`.
@inlinable // FIXME(sil-serialize-all)
@inlinable
public var endIndex: Int {
@inlinable
get {
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/ArraySlice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ extension ArraySlice: RandomAccessCollection, MutableCollection {
/// // Prints "[30, 40, 50]"
///
/// If the array is empty, `endIndex` is equal to `startIndex`.
@inlinable // FIXME(sil-serialize-all)
@inlinable
public var endIndex: Int {
return _buffer.endIndex
}
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Assert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public func precondition(
/// where `assertionFailure(_:file:line:)` is called.
/// - line: The line number to print along with `message`. The default is the
/// line number where `assertionFailure(_:file:line:)` is called.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always)
public func assertionFailure(
_ message: @autoclosure () -> String = String(),
Expand Down
9 changes: 4 additions & 5 deletions stdlib/public/core/AssertCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func _fatalErrorFlags() -> UInt32 {
///
/// This function should not be inlined because it is cold and inlining just
/// bloats code.
@usableFromInline // FIXME(sil-serialize-all)
@usableFromInline
@inline(never)
internal func _assertionFailure(
_ prefix: StaticString, _ message: StaticString,
Expand Down Expand Up @@ -105,7 +105,7 @@ internal func _assertionFailure(
///
/// This function should not be inlined because it is cold and inlining just
/// bloats code.
@usableFromInline // FIXME(sil-serialize-all)
@usableFromInline
@inline(never)
internal func _assertionFailure(
_ prefix: StaticString, _ message: String,
Expand Down Expand Up @@ -135,7 +135,7 @@ internal func _assertionFailure(
///
/// This function should not be inlined because it is cold and inlining just
/// bloats code.
@usableFromInline // FIXME(sil-serialize-all)
@usableFromInline
@inline(never)
internal func _assertionFailure(
_ prefix: StaticString, _ message: String,
Expand All @@ -160,7 +160,7 @@ internal func _assertionFailure(
///
/// This function should not be inlined because it is cold and it inlining just
/// bloats code.
@usableFromInline // FIXME(sil-serialize-all)
@usableFromInline
@inline(never)
@_semantics("arc.programtermination_point")
internal func _fatalErrorMessage(
Expand Down Expand Up @@ -246,7 +246,6 @@ func _unimplementedInitializer(className: StaticString,
Builtin.int_trap()
}

// FIXME(ABI)#21 (Type Checker): rename to something descriptive.
@inlinable // FIXME(sil-serialize-all)
public // COMPILER_INTRINSIC
func _undefined<T>(
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/Builtin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import SwiftShims
// This function is the implementation of the `_roundUp` overload set. It is
// marked `@inline(__always)` to make primary `_roundUp` entry points seem
// cheap enough for the inliner.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always)
internal func _roundUpImpl(_ offset: UInt, toAlignment alignment: Int) -> UInt {
_sanityCheck(alignment > 0)
Expand All @@ -31,12 +31,12 @@ internal func _roundUpImpl(_ offset: UInt, toAlignment alignment: Int) -> UInt {
return x & ~(UInt(bitPattern: alignment) &- 1)
}

@inlinable // FIXME(sil-serialize-all)
@inlinable
internal func _roundUp(_ offset: UInt, toAlignment alignment: Int) -> UInt {
return _roundUpImpl(offset, toAlignment: alignment)
}

@inlinable // FIXME(sil-serialize-all)
@inlinable
internal func _roundUp(_ offset: Int, toAlignment alignment: Int) -> Int {
_sanityCheck(offset >= 0)
return Int(_roundUpImpl(UInt(bitPattern: offset), toAlignment: alignment))
Expand Down
10 changes: 5 additions & 5 deletions stdlib/public/core/CTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public struct OpaquePointer {
}

extension OpaquePointer: Equatable {
@inlinable // FIXME(sil-serialize-all)
@inlinable // unsafe-performance
public static func == (lhs: OpaquePointer, rhs: OpaquePointer) -> Bool {
return Bool(Builtin.cmp_eq_RawPointer(lhs._rawValue, rhs._rawValue))
}
Expand Down Expand Up @@ -193,7 +193,7 @@ extension Int {
///
/// - Parameter pointer: The pointer to use as the source for the new
/// integer.
@inlinable // FIXME(sil-serialize-all)
@inlinable // unsafe-performance
public init(bitPattern pointer: OpaquePointer?) {
self.init(bitPattern: UnsafeRawPointer(pointer))
}
Expand All @@ -207,7 +207,7 @@ extension UInt {
///
/// - Parameter pointer: The pointer to use as the source for the new
/// integer.
@inlinable // FIXME(sil-serialize-all)
@inlinable // unsafe-performance
public init(bitPattern pointer: OpaquePointer?) {
self.init(bitPattern: UnsafeRawPointer(pointer))
}
Expand All @@ -216,10 +216,10 @@ extension UInt {
/// A wrapper around a C `va_list` pointer.
@_fixed_layout
public struct CVaListPointer {
@usableFromInline // FIXME(sil-serialize-all)
@usableFromInline // unsafe-performance
internal var value: UnsafeMutableRawPointer

@inlinable // FIXME(sil-serialize-all)
@inlinable // unsafe-performance
public // @testable
init(_fromUnsafeMutablePointer from: UnsafeMutableRawPointer) {
value = from
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/CollectionOfOne.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
/// The position of the first element.
///
/// In a `CollectionOfOne` instance, `startIndex` is always `0`.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public var startIndex: Index {
return 0
}
Expand Down
4 changes: 1 addition & 3 deletions stdlib/public/core/CommandLine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import SwiftShims

/// Command-line arguments for the current process.
@_frozen // FIXME(sil-serialize-all)
@_frozen // namespace
public enum CommandLine {
/// The backing static variable for argument count may come either from the
/// entry point or it may need to be computed e.g. if we're in the REPL.
Expand All @@ -31,15 +31,13 @@ public enum CommandLine {
= _swift_stdlib_getUnsafeArgvArgc(&_argc)

/// Access to the raw argc value from C.
@inlinable // FIXME(sil-serialize-all)
public static var argc: Int32 {
_ = CommandLine.unsafeArgv // Force evaluation of argv.
return _argc
}

/// Access to the raw argv value from C. Accessing the argument vector
/// through this pointer is unsafe.
@inlinable // FIXME(sil-serialize-all)
public static var unsafeArgv:
UnsafeMutablePointer<UnsafeMutablePointer<Int8>?> {
return _unsafeArgv
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/ContiguousArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ extension ContiguousArray: RandomAccessCollection, MutableCollection {
/// // Prints "[30, 40, 50]"
///
/// If the array is empty, `endIndex` is equal to `startIndex`.
@inlinable // FIXME(sil-serialize-all)
public var endIndex: Int {
@inlinable
get {
Expand Down
4 changes: 0 additions & 4 deletions stdlib/public/core/Dump.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
/// - maxItems: The maximum number of elements for which to write the full
/// contents. The default is `Int.max`.
/// - Returns: The instance passed as `value`.
@inlinable // FIXME(sil-serialize-all)
@discardableResult
@_semantics("optimize.sil.specialize.generic.never")
public func dump<T, TargetStream : TextOutputStream>(
Expand Down Expand Up @@ -64,7 +63,6 @@ public func dump<T, TargetStream : TextOutputStream>(
/// - maxItems: The maximum number of elements for which to write the full
/// contents. The default is `Int.max`.
/// - Returns: The instance passed as `value`.
@inlinable // FIXME(sil-serialize-all)
@discardableResult
@_semantics("optimize.sil.specialize.generic.never")
public func dump<T>(
Expand All @@ -85,7 +83,6 @@ public func dump<T>(
}

/// Dump an object's contents. User code should use dump().
@inlinable // FIXME(sil-serialize-all)
@_semantics("optimize.sil.specialize.generic.never")
internal func _dump_unlocked<TargetStream : TextOutputStream>(
_ value: Any,
Expand Down Expand Up @@ -185,7 +182,6 @@ internal func _dump_unlocked<TargetStream : TextOutputStream>(

/// Dump information about an object's superclass, given a mirror reflecting
/// that superclass.
@inlinable // FIXME(sil-serialize-all)
@_semantics("optimize.sil.specialize.generic.never")
internal func _dumpSuperclass_unlocked<TargetStream : TextOutputStream>(
mirror: Mirror,
Expand Down
38 changes: 19 additions & 19 deletions stdlib/public/core/EmptyCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,38 @@
//===----------------------------------------------------------------------===//

/// A collection whose element type is `Element` but that is always empty.
@_fixed_layout // FIXME(sil-serialize-all)
@_fixed_layout // trivial-implementation
public struct EmptyCollection<Element> {
// no properties

/// Creates an instance.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public init() {}
}

extension EmptyCollection {
/// An iterator that never produces an element.
@_fixed_layout // FIXME(sil-serialize-all)
@_fixed_layout // trivial-implementation
public struct Iterator {
// no properties

/// Creates an instance.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public init() {}
}
}

extension EmptyCollection.Iterator: IteratorProtocol, Sequence {
/// Returns `nil`, indicating that there are no more elements.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public mutating func next() -> Element? {
return nil
}
}

extension EmptyCollection: Sequence {
/// Returns an empty iterator.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func makeIterator() -> Iterator {
return Iterator()
}
Expand All @@ -65,13 +65,13 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
public typealias SubSequence = EmptyCollection<Element>

/// Always zero, just like `endIndex`.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public var startIndex: Index {
return 0
}

/// Always zero, just like `startIndex`.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public var endIndex: Index {
return 0
}
Expand All @@ -80,7 +80,7 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
///
/// `EmptyCollection` does not have any element indices, so it is not
/// possible to advance indices.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func index(after i: Index) -> Index {
_preconditionFailure("EmptyCollection can't advance indices")
}
Expand All @@ -89,15 +89,15 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
///
/// `EmptyCollection` does not have any element indices, so it is not
/// possible to advance indices.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func index(before i: Index) -> Index {
_preconditionFailure("EmptyCollection can't advance indices")
}

/// Accesses the element at the given position.
///
/// Must never be called, since this collection is always empty.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public subscript(position: Index) -> Element {
get {
_preconditionFailure("Index out of range")
Expand All @@ -107,7 +107,7 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
}
}

@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public subscript(bounds: Range<Index>) -> SubSequence {
get {
_debugPrecondition(bounds.lowerBound == 0 && bounds.upperBound == 0,
Expand All @@ -121,18 +121,18 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
}

/// The number of elements (always zero).
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public var count: Int {
return 0
}

@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func index(_ i: Index, offsetBy n: Int) -> Index {
_debugPrecondition(i == startIndex && n == 0, "Index out of range")
return i
}

@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func index(
_ i: Index, offsetBy n: Int, limitedBy limit: Index
) -> Index? {
Expand All @@ -142,20 +142,20 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
}

/// The distance between two indexes (always zero).
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func distance(from start: Index, to end: Index) -> Int {
_debugPrecondition(start == 0, "From must be startIndex (or endIndex)")
_debugPrecondition(end == 0, "To must be endIndex (or startIndex)")
return 0
}

@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func _failEarlyRangeCheck(_ index: Index, bounds: Range<Index>) {
_debugPrecondition(index == 0, "out of bounds")
_debugPrecondition(bounds == indices, "invalid bounds for an empty collection")
}

@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func _failEarlyRangeCheck(
_ range: Range<Index>, bounds: Range<Index>
) {
Expand All @@ -165,7 +165,7 @@ extension EmptyCollection: RandomAccessCollection, MutableCollection {
}

extension EmptyCollection : Equatable {
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public static func == (
lhs: EmptyCollection<Element>, rhs: EmptyCollection<Element>
) -> Bool {
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/Equatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ extension Equatable {
/// - Parameters:
/// - lhs: A reference to compare.
/// - rhs: Another reference to compare.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func === (lhs: AnyObject?, rhs: AnyObject?) -> Bool {
switch (lhs, rhs) {
case let (l?, r?):
Expand All @@ -266,7 +266,7 @@ public func === (lhs: AnyObject?, rhs: AnyObject?) -> Bool {
/// - Parameters:
/// - lhs: A reference to compare.
/// - rhs: Another reference to compare.
@inlinable // FIXME(sil-serialize-all)
@inlinable // trivial-implementation
public func !== (lhs: AnyObject?, rhs: AnyObject?) -> Bool {
return !(lhs === rhs)
}
Expand Down
Loading