Commit Graph

4494 Commits

Author SHA1 Message Date
Mark Lacey
8ee52763f0 Remove the '++' and '--' operators.
We still had unavailable versions of these for floating-point types
only. We shouldn't need to keep these around, and can instead just
emit a helpful diagnostic for anyone that attempts to use them.

Unfortunately I don't see any way for the diagnostic to produce an
actual fix-it, so it just suggests '+= 1' or '-= 1' without actually
producing a fix.
2018-07-12 15:46:57 -07:00
Karoy Lorentey
cedfdaea0a [stdlib] Make _stdlib_initializeReturnAutoreleased non-@inlinable
This is merely a helper for StdlibUnittest; there is no reason to leave it inlinable.
2018-07-12 19:20:47 +01:00
swift-ci
1b7ad99e75 Merge remote-tracking branch 'origin/master' into master-next 2018-07-11 13:30:09 -07:00
Michael Ilseman
30450671fa Merge pull request #15593 from allevato/unicode-properties
[SE-0211] Add Unicode properties to Unicode.Scalar
2018-07-11 13:27:31 -07:00
swift-ci
f63e7973f0 Merge remote-tracking branch 'origin/master' into master-next 2018-07-11 09:49:18 -07:00
Arnold Schwaighofer
bf47f1b2d3 Never inline _stdlib_isOSVersionAtLeast
Follow-up to "AllocStackHoisting: Don't hoist alloc_stacks in the presence of
an availability guard". The standard libary could use availability macros in the
future.
2018-07-11 07:20:54 -07:00
swift-ci
c24b0839ad Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 15:59:27 -07:00
Michael Ilseman
88fb124643 Merge pull request #17835 from milseman/nfc
[stdlib] Some stubs and trivial refactorings; NFC
2018-07-10 15:10:22 -07:00
swift-ci
c0e8c409af Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 14:40:00 -07:00
swift-ci
3227916ba3 Merge pull request #17858 from aschwaighofer/fix_alloc_stack_hoisting_availability 2018-07-10 14:23:17 -07:00
Lance Parker
7c0ff47487 Merge pull request #17809 from lancep/kill_PointerFunction
[stdlib]remove _PointerFunction
2018-07-10 13:50:43 -07:00
Arnold Schwaighofer
0330ec0fd5 AllocStackHoisting: Don't hoist alloc_stacks in the presence of an availability guard
This disables inlinability of _stdlib_isOSVersionAtLeast. I don't see
value in making it inlinable as long as _swift_stdlib_operatingSystemVersion is
opaque.

rdar://41849700
2018-07-10 12:04:07 -07:00
swift-ci
8c0962f483 Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 11:49:21 -07:00
Lance Parker
6c0d325805 Merge pull request #17841 from lancep/print_mismatched_types
[stdlib]Better error message for Arrays with mismatched types
2018-07-10 11:33:43 -07:00
Lance Parker
ff9b80688f made initializeNewElements non-Optional 2018-07-10 11:05:27 -07:00
swift-ci
c566072cd5 Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 08:49:31 -07:00
Nate Cook
92900d4e7d Add an array initializer with access to uninitialized storage (#17774)
* Add an Array initializer for using an uninitialized capacity.

* Add tests for reserveCapacity & init(_unsafeUninitializedCapacity:...:)
2018-07-10 10:34:57 -05:00
Tony Allevato
b454e8d0f4 Make emoji properties Darwin only.
Ubuntu 16.04 doesn't have a recent enough ICU to support these; we need a better long-term solution, such as bundling ICU with the toolchain.
2018-07-09 18:42:42 -07:00
Lance Parker
6375508c92 print the types involved when the array's element type doesn't meet expectations 2018-07-09 13:07:15 -07:00
swift-ci
006c187c51 Merge remote-tracking branch 'origin/master' into master-next 2018-07-09 10:49:36 -07:00
Michael Ilseman
ac09eaa8c7 [stdlib] Refactor out impl methods of BidiCollection; NFC.
Refactor out the implementation of index(_:offsetBy) and others from
BidirectionalCollection so that conformers can choose to invoke the
default implementations explicitly. This is very useful for types such
as String which have common fast-paths to check before falling back on
the general approach.
2018-07-09 10:45:04 -07:00
Stephen Canon
4a89062efd Require .upperBound - .lowerBound be finite for FloatingPoint random (#17833)
This is a slightly conservative precondition; when we re-work the FloatingPoint random computation in a more principled fashion, we can relax this to only requiring that .upperBound and .lowerBound are both finite. However, the current computation will break down unless this conservative condition is used, and this is future proof--we will only relax it going forward.
2018-07-09 13:40:34 -04:00
Lance Parker
4c3bc53a4c put back _sanityCheck 2018-07-09 10:18:17 -07:00
swift-ci
73dea94f21 Merge remote-tracking branch 'origin/master' into master-next 2018-07-07 08:49:45 -07:00
Ben Cohen
a6952decab [stdlib] Remove inlineable annotation from transparent functions (#17800)
* Remove inlineable annotation from transparent functions
2018-07-07 08:47:02 -07:00
Lance Parker
0ccf21f9f1 remove _PointerFunction 2018-07-06 16:28:26 -07:00
swift-ci
d699e8cce0 Merge remote-tracking branch 'origin/master' into master-next 2018-07-06 13:09:52 -07:00
Ben Cohen
422ff83907 Inlineable: trivial implementation 2018-07-06 12:05:30 -07:00
Ben Cohen
eeb6721fb6 Inlineable: unsafe performance 2018-07-06 12:05:29 -07:00
Ben Cohen
c6b41a5ae5 Inlineable: protocol interface only 2018-07-06 12:03:34 -07:00
swift-ci
559eaf8de2 Merge remote-tracking branch 'origin/master' into master-next 2018-07-06 10:29:01 -07:00
Alejandro
79cb33fa78 [SR-8178] Fix BinaryFloatingPoint.random(in:) open range returning upperBound (#17794) 2018-07-06 13:13:19 -04:00
Tony Allevato
d0e93acb00 Various fixes to Unicode.Scalar.Properties.
- numericValue returns nil instead of .nan for non-numerics
- Remove small-string optimizations from _scalarName that failed on 32-bit archs
- Put case mappings back into U.S.Properties
- Added more sanity tests
2018-07-05 20:42:56 -07:00
swift-ci
4861515b25 Merge remote-tracking branch 'origin/master' into master-next 2018-07-05 12:29:17 -07:00
swift-ci
003ec25cfa Merge pull request #17742 from lorentey/nsdictionary-speedup 2018-07-05 12:19:30 -07:00
swift-ci
7d38bcf09c Merge remote-tracking branch 'origin/master' into master-next 2018-07-05 12:09:21 -07:00
Stephen Canon
86ba697151 Add constraints to FixedWidthInteger.Stride and .Magnitude (#17716)
* Add constraints to FixedWidthInteger.Stride and .Magnitude

Add the constraint that these associatedtypes themselves conform to FixedWidthInteger and to SignedInteger and UnsignedInteger, respectively. These are effectively part of the semantic requirement of the protocol already, because the requirements on .min and .max effectively force FixedWidthInteger to be twos-complement, which requires Magnitude not be Self for signed types. Also, in practice it's generally necessary to have these two constraints in order to effectively use the FixedWidthInteger protocol anyway; witness that by adding them to the protocol, we eliminate them as constraints from a number of extensions.

This also resolves https://bugs.swift.org/browse/SR-8156
2018-07-05 15:04:33 -04:00
Karoy Lorentey
cf7e4385de [stdlib] Dictionary: Optimize loops in getObjects:andKeys:count: implementations
This breaks out of the loop immediately when the last slot has been filled in the output buffer, skipping a final sequence of iterations over empty buckets.
2018-07-05 18:22:43 +01:00
Karoy Lorentey
93ab7677e6 [stdlib] _NSDictionary: Replace getObjects:andKeys: with getObjects:andKeys:count: 2018-07-05 15:53:43 +01:00
Karoy Lorentey
a951cf2cf2 [stdlib] Dictionary: Fix getObjects:andKeys:count: implementations 2018-07-05 15:52:45 +01:00
swift-ci
dec37b0fc7 Merge remote-tracking branch 'origin/master' into master-next 2018-07-05 05:29:46 -07:00
Xiaodi Wu
47f13ec9ff [stdlib] Align behavior of generic NaN conversion to that of concrete types (#17746) 2018-07-05 08:28:51 -04:00
Tony Allevato
8eef50f6a9 Merge branch 'master' into unicode-properties 2018-07-04 08:42:35 -07:00
Karoy Lorentey
6aec05aa44 [stdlib] Dictionary: Override getObjects:andKeys:count:
Dictionary’s native storage classes and _SwiftDeferredNSDictionary override -[NSDictionary getObjects:andKeys:] instead of its safer replacement, -[NSDictionary getObjects:andKeys:count:].

Overriding the correct method will considerably speed up some Cocoa operations on bridged dictionaries.

rdar://problem/39285882
2018-07-04 16:35:46 +01:00
swift-ci
e689a0dc91 Merge remote-tracking branch 'origin/master' into master-next 2018-07-02 11:29:09 -07:00
Lance Parker
78e9e9062b Merge pull request #17636 from lancep/specialize_remaining
[stdlib]Specialize `remaining` on _CollectionSource
2018-07-02 11:16:45 -07:00
swift-ci
3f31f6cc3c Merge remote-tracking branch 'origin/master' into master-next 2018-07-02 04:28:59 -07:00
Karoy Lorentey
9286b3627d Merge pull request #17604 from Azoy/moar-random-improvements
[stdlib] Remove _random() customization point
2018-07-02 12:28:07 +01:00
swift-ci
5a31f3bdd8 Merge remote-tracking branch 'origin/master' into master-next 2018-07-01 04:49:04 -07:00
David Zarzycki
75b0d3c70b [stdlib] NFC: Fix var to let warning 2018-06-30 18:53:39 -04:00