Commit Graph

6693 Commits

Author SHA1 Message Date
Karl
d16f4679e5 [stdlib] Do not allocate when creating a Set from a generic Sequence which happens to be another Set 2022-11-17 13:47:20 +01:00
Valeriy Van
95d25d3ba5 Minor comment typo fix 2022-11-15 10:40:43 +02:00
Saleem Abdulrasool
04dd83983b Merge pull request #61756 from mhjacobson/freebsd-define-CLongDouble-typealias
stdlib: define typealias CLongDouble for FreeBSD
2022-11-02 10:02:26 -07:00
Saleem Abdulrasool
0a2b10b777 Merge pull request #61815 from MillerTechnologyPeru/trunk/riscv64
[stdlib] Add RISCV64 support
2022-11-02 09:53:34 -07:00
Alsey Coleman Miller
62b7be4e9c [stdlib] Add RISCV64 support 2022-11-01 23:59:42 -07:00
Joe Groff
121adf6eb2 Merge pull request #60758 from fibrechannelscsi/faster-keypaths
KeyPath performance improvement: Omit projection across trivially-typed memory.
2022-11-01 11:59:44 -07:00
Martin Cwikla
bc4b38d747 Removed an unnecessary disabling of isPureStruct.
This would have prevented explicitly specified KeyPaths through pure structs, e.g., \A.b.c, from taking the optimized path.
2022-10-31 14:43:44 -06:00
Matt Jacobson
802d877460 stdlib: define typealias CLongDouble for FreeBSD on i386, x86_64
This fixes a failure compiling the stdlib where the importer cannot find (i.e.,
refuses to import) functions _stdlib_remainderl and _stdlib_squareRootl.
2022-10-31 15:52:26 -04:00
Martin Cwikla
92d7cf5725 Revised _tryToAppendKeyPaths(). Removed two instances of isPureStruct.append() that weren't needed. 2022-10-26 11:05:02 -06:00
Martin Cwikla
21f175ae3c Added missing instances of pureStruct information propagation.
This means we no longer need to check for empty KeyPath Walker results.
2022-10-24 17:43:00 -06:00
유재호
c0c84f4a95 [stdlib] Fix typo in Hashable.swift 2022-10-22 10:31:19 +09:00
Martin Cwikla
a6a2f509b3 Use Int(bitPattern) rather than distance(to) to compute the offset. 2022-10-20 14:26:35 -06:00
Martin Cwikla
4fb2f9e15e Modified storage of valid offsets in assignOffsetToStorage() and getOffsetFromStorage().
Got rid of isTuple(). Moved determination of pure struct KeyPaths into _instantiateKeyPathBuffer.
2022-10-20 14:26:35 -06:00
Martin Cwikla
d2912dca75 Fixed .unresolvedFieldOffset should count as an optimized offset. Restored optimization for KeyPath writes. 2022-10-20 14:25:40 -06:00
Martin Cwikla
2d5086c085 Fixed the failing unit tests in capture_propagate_keypath.swift.
Revisited formatting. Pulled in changes from the past four weeks.
2022-10-20 14:25:39 -06:00
Martin Cwikla
afebae5694 Moved computation of offset for pureStructKeyPaths into KeyPathPatternVisitors.
Next expected commit: Move information stored in _pureStructValueOffset to _kvcKeyPathStringPtr (or similar).
2022-10-20 14:25:39 -06:00
Martin Cwikla
353eb9ffd5 KeyPath offset tests were breaking on Ubuntu 20.04. It's possible _storedInlineOffset wasn't factored out correctly. 2022-10-20 14:25:39 -06:00
Martin Cwikla
5efc87c67e ABI stability fix: isPureStructKeyPath should be internal. 2022-10-20 14:25:39 -06:00
Martin Cwikla
9fb8f598eb Clarified a comment in isTuple(). 2022-10-20 14:25:38 -06:00
Martin Cwikla
ebdd00c071 Proposed design for skipping of KeyPath projections across trivially-typed memory. 2022-10-20 14:25:38 -06:00
Karoy Lorentey
2f2c5b6f6b Merge pull request #61379 from lorentey/add-docs-for-customContainsEquatableElement
[stdlib] Add docs for Sequence._customContainsEquatableElement
2022-10-15 16:21:31 -07:00
Karoy Lorentey
b799866b8f Update stdlib/public/core/Sequence.swift 2022-10-14 09:11:55 -07:00
Karoy Lorentey
e1429dd36e Update stdlib/public/core/Sequence.swift
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
2022-10-12 12:54:27 -07:00
Karoy Lorentey
704b565d40 [stdlib] String.Index: Add _description & _debugDescription
While we’re vacillating on how best to add CustomStringConvertible
and CustomDebugStringConvertible conformances to String.Index, add
the prospective implementations as underscored-but-public members,
to make life a little more bearable for people who need to debug
string index operations.
2022-10-11 14:37:20 -07:00
Jake
5c3459f2a8 Added Builtin.unreachable() calls (#61422)
Previously unavailable due to #57622 (fixed)
2022-10-04 09:01:59 -07:00
Guillaume Lessard
1ccc36cbd2 Merge pull request #61082 from glessard/source-equals-destination 2022-10-03 14:50:25 -07:00
Karoy Lorentey
9fc062e106 [stdlib] Add docs for Sequence._customContainsEquatableElement 2022-09-29 18:34:54 -07:00
Anthony Latsis
c731089068 Gardening: Migrate stdlib sources to GH issues 2022-09-26 06:30:49 +03:00
David Smith
3292f4e97e Separate out ASCII and UTF8 in NSString accessors, and use the ASCII one where we really need ASCII (#61086)
Separate out ASCII and UTF8 in NSString accessors, and use the ASCII one where we really need ASCII
2022-09-23 12:31:45 -07:00
Tony Allevato
2415288450 Merge pull request #60936 from natecook1000/stable_sort
[stdlib] Document stable sort guarantee
2022-09-21 07:32:45 -07:00
Guillaume Lessard
df0adc815d Merge pull request #61122 from glessard/rdar99890632-use-copyContents
[stdlib] use `_copyContents` after all
2022-09-15 10:30:44 -06:00
Guillaume Lessard
03d37a9538 [stdlib] use _copyContents after all
- originally had avoided `_copyContents` because all the standard library fast paths were already covered.
- however Swift Collections piecewise-contiguous collections still rely on `_copyContents` to accelerate copies.
2022-09-14 16:23:21 -06:00
Guillaume Lessard
2689b6044b Merge pull request #41608 from glessard/se-pointer-family-initialization 2022-09-13 22:00:59 -06:00
Guillaume Lessard
874cd336ab [stdlib] avoid work when source and destination are the same 2022-09-13 16:15:42 -06:00
Guillaume Lessard
7f4caede90 [stdlib] avoid primary associated type for the time being 2022-09-13 13:31:44 -06:00
Ben Pious
57d82317c1 Add CustomDebugDescription conformance to AnyKeyPath (#60133)
* initial

* it works

demangling mostly works

fix dots

printing works

add tests

add conformance to AnyKeyPath

implement SPI

subscripts fully work

comments

use cross platform image inspection

remove unnecessary comment

fix

fix issues

add conditional conformance

add types

try to fix the api-digester test

cr feedback: move impls behind flag, remove addChain(), switch statement, fallthrough instead of if-elses, move import

cr feedback: refactor switch statement

fix #ifdef

reindent, cr feedback: removes manual memory management

fix missing whitespace

fix typo

fix indentation issues

switch to regexes

checks should test in on all platforms

print types in subscripts

add test for empty subscript

Update test/api-digester/stability-stdlib-abi-without-asserts.test

Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>

add commas

fix failing test

fix stdlib annotation

cr feedback: remove global, refactor ifdef

cr feedback: switch back to manual memory management

switch to 5.8 macro

add new weakly linked functions to the allowlist

fix one more failing test

more cr feedback

more cr feedback

* fix invisible unicode
2022-09-13 09:23:32 -07:00
Guillaume Lessard
1152347699 [stdlib] remove primary associated type from copyBytes
- this caused an unexpected test failure, will change separately.
2022-09-12 14:18:47 -06:00
Karoy Lorentey
5d0c6e6fab Merge pull request #60973 from lorentey/fix-modify-implementations
[stdlib] _modify: Ensure cleanup is always executed
2022-09-12 11:12:39 -07:00
Guillaume Lessard
ffa7b0e78c [se-0370] add notes regarding overlapping memory regions 2022-09-08 18:23:45 -06:00
Erik Eckstein
9c1e7cac0f stdlib: fix compilation error when compiling with an old compiler
Fix wrong/missing check for `$BuiltinUnprotectedAddressOf` around the new "unprotectedAddressOf" builtins.

rdar://99713099
2022-09-08 23:05:17 +02:00
Erik Eckstein
5eff9066cc stdlib: use _withUnprotected... functions instead of Builtin.unprotectedAddressOf 2022-09-08 08:42:25 +02:00
Erik Eckstein
0f8dd3a551 stdlib: opt out of stack protection in places where there can't be buffer overflows.
We trust the internal implementation of the stdlib to not cause any unintentional buffer overflows.
In such cases we can use the "unprotected" address-to-pointer conversions.
This avoids inserting stack protections where it's not needed.
2022-09-08 08:42:25 +02:00
Erik Eckstein
ba135dc493 stdlib: add underscored "withUnprotected..Pointer" functions
Those functions work the same way as their "unprotected" counterparts, except that they don't trigger stack protection for the pointers.

* `_withUnprotectedUnsafeMutablePointer`
* `_withUnprotectedUnsafePointer`
* `_withUnprotectedUnsafeBytes` (two times)
2022-09-08 08:42:25 +02:00
Guillaume Lessard
559e5ed54b [stdlib] use the internal precondition calls 2022-09-07 16:47:08 -06:00
Guillaume Lessard
d9a448860b [se-0370] use primary associated type 2022-09-07 15:24:41 -06:00
Guillaume Lessard
44a349f8e0 [se-0370] edit doc-comments for consistency 2022-09-07 15:22:49 -06:00
Guillaume Lessard
88225a2584 [se-0370] some consistency tweaks 2022-09-07 10:07:10 -06:00
Guillaume Lessard
6512840469 [stdlib] update copyBytes with primary associated type 2022-09-07 10:07:04 -06:00
Karoy Lorentey
7cbadf2c8d [stdlib] _modify: Ensure cleanup is always executed
Cleanup code in _modify accessors will only run reliably if it is put in a defer statement.

(Statements that follow the `yield` aren’t executed if the yielded-to code throws an error.)
2022-09-06 21:15:58 -07:00
Karoy Lorentey
486dc27e1d Merge pull request #60917 from lorentey/no-conversions-please
[stdlib] Don’t do full integer conversions in _roundUp
2022-09-04 16:44:56 -07:00