Skip to content

Commit e24b9b4

Browse files
committed
[nfc] document legacy ABI in the implementation of sort
1 parent a1e2ebb commit e24b9b4

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

stdlib/public/core/Sort.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,13 @@ extension MutableCollection where Self: BidirectionalCollection {
329329
}
330330
}
331331

332+
// FIXME(ABI): unused return value
332333
/// Merges the elements in the ranges `lo..<mid` and `mid..<hi` using `buffer`
333334
/// as out-of-place storage. Stable.
334335
///
336+
/// The unused return value is legacy ABI. It was originally added as a
337+
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
338+
///
335339
/// - Precondition: `lo..<mid` and `mid..<hi` must already be sorted according
336340
/// to `areInIncreasingOrder`.
337341
/// - Precondition: `buffer` must point to a region of memory at least as large
@@ -506,9 +510,13 @@ internal func _findNextRun<C: RandomAccessCollection>(
506510
}
507511

508512
extension UnsafeMutableBufferPointer {
513+
// FIXME(ABI): unused return value
509514
/// Merges the elements at `runs[i]` and `runs[i - 1]`, using `buffer` as
510515
/// out-of-place storage.
511516
///
517+
/// The unused return value is legacy ABI. It was originally added as a
518+
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
519+
///
512520
/// - Precondition: `runs.count > 1` and `i > 0`
513521
/// - Precondition: `buffer` must have at least
514522
/// `min(runs[i].count, runs[i - 1].count)` uninitialized elements.
@@ -537,10 +545,14 @@ extension UnsafeMutableBufferPointer {
537545

538546
return true
539547
}
540-
548+
549+
// FIXME(ABI): unused return value
541550
/// Merges upper elements of `runs` until the required invariants are
542551
/// satisfied.
543552
///
553+
/// The unused return value is legacy ABI. It was originally added as a
554+
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
555+
///
544556
/// - Precondition: `buffer` must have at least
545557
/// `min(runs[i].count, runs[i - 1].count)` uninitialized elements.
546558
/// - Precondition: The ranges in `runs` must be consecutive, such that for
@@ -611,9 +623,13 @@ extension UnsafeMutableBufferPointer {
611623

612624
return true
613625
}
614-
626+
627+
// FIXME(ABI): unused return value
615628
/// Merges elements of `runs` until only one run remains.
616629
///
630+
/// The unused return value is legacy ABI. It was originally added as a
631+
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
632+
///
617633
/// - Precondition: `buffer` must have at least
618634
/// `min(runs[i].count, runs[i - 1].count)` uninitialized elements.
619635
/// - Precondition: The ranges in `runs` must be consecutive, such that for

0 commit comments

Comments
 (0)