Commit Graph

3089 Commits

Author SHA1 Message Date
Dave Abrahams
c3391023a4 [stdlib] Inline integer parsing 2017-05-02 18:44:23 -07:00
Dave Abrahams
fe38ab1579 [stdlib] Inline var first default implementation 2017-05-02 18:36:04 -07:00
Joe Groff
525001f7a7 Support key paths on 32-bit platforms.
I had optimistically written the code here optimistically hoping #7837 would land in time for me to merge, but that didn't happen, so adjust some things to match the current 12-byte object header size on 32-bit, and introduce some ABI constants for the expected 32- and 64-bit object header sizes we can assert against so that we have some robustness when it eventually changes again. Implements rdar://problem/31768303.
2017-05-02 18:19:07 -07:00
Dave Abrahams
4e878a28b6 [stdlib] Inline _encodeSomeUTF8 2017-05-02 18:10:57 -07:00
Tony Parker
ff65a2b2a1 Revert "[stdlib] Reformatting and gybbification for Codable &co" 2017-05-02 17:06:51 -07:00
Itai Ferber
1eb73b3b62 Add Dictionary and Set {En,De}codable conformance 2017-05-02 17:03:48 -07:00
Dave Abrahams
b1ebc5cd48 [stdlib] Inline legacy UTF8.decode 2017-05-02 16:54:28 -07:00
Dave Abrahams
a9c8d415df [stdlib] Inline parseScalar 2017-05-02 16:54:28 -07:00
Dave Abrahams
e8cb3cabd8 [stdlib] Inline transcode() 2017-05-02 16:54:28 -07:00
Dave Abrahams
2226cbacc0 [stdlib] Inline all of IndexingIterator 2017-05-02 16:54:27 -07:00
Dave Abrahams
40b66e5935 [stdlib] Implement legacy UTF8 APIs in terms of new components 2017-05-02 16:54:27 -07:00
Dave Abrahams
f155d499c0 [stdlib] Drop redundant constraint 2017-05-02 16:54:27 -07:00
Jordan Rose
de969c66c6 [ClangImporter] Don't infer 'Comparable' for swift_wrapper. (#9120)
The underlying type's ordering may not be appropriate for the wrapped
type (think an ordered list whose underlying type is NSString).
Frameworks can always add a Comparable conformance explicitly.

We squeak out of this being a source-breaking change by virtue of
never having released a working version of it. Rintaro fixed the
ambiguity problems back in f11b74176b, but that was after the last
rebranch for Swift 3.1.

rdar://problem/30166538
2017-05-02 11:41:03 -07:00
Nate Cook
f7abeb0a66 [stdlib] GYB Codable and remove duplicated code 2017-05-02 02:31:13 -05:00
Nate Cook
443dbd727a [stdlib] Rename Codable.swift to .gyb 2017-05-01 23:05:10 -05:00
Nate Cook
cde3b920c1 [gardening] Indentation and comment formatting 2017-05-01 23:05:10 -05:00
Dave Abrahams
feea061d32 [stdlib] Move new Unicode decoders into the stdlib
No expected change in benchmarks, as legacy components aren't using this yet.
2017-05-01 17:08:08 -07:00
Max Moiseev
bfb1824f44 [stdlib] Adding the StringProtocol 2017-05-01 16:41:26 -07:00
Nate Cook
3f68f2876a Fix dictionary merge bug under optimization 2017-05-01 16:06:19 -05:00
Nate Cook
2e2e4d9bda Revert "Revert "[stdlib] Dictionary/Set enhancements""
This reverts commit 328ebe8567.
2017-05-01 16:06:14 -05:00
Max Moiseev
288eee0b1b [stdlib] New overload for joined()
Now that `String` conforms to the `BidirectionalCollection` protocol, in
the expression `let x = [""].joined()` the best matching overload for
`joined` is no longer the one returning `String`.

Fixes: <rdar://problem/31899440>
2017-05-01 12:41:57 -07:00
swift-ci
2dce594005 Merge pull request #9143 from apple/revert-9139-revert_8710 2017-04-30 18:49:17 -07:00
Ben Cohen
43211b602a [stdlib] De-gyb sorting (#9135)
* [stdlib] De-gyb sort algorithms

* [stdlib] Rename Sort.swift.gyb

* Update tests for de-gybbed sort
2017-04-30 18:11:27 -07:00
Ben Cohen
38903764df Revert "Revert "[stdlib] One-sided ranges and RangeExpression (#8710)"" 2017-04-30 16:47:23 -07:00
Arnold Schwaighofer
7d5d63eaf8 Revert "[stdlib] One-sided ranges and RangeExpression (#8710)"
This reverts commit 946b776e37.
2017-04-30 15:51:16 -07:00
Nate Cook
ad8d5a97ec [stdlib] Stop precounting lazily filtered collections (#8038)
This eliminates the counting step for a lazy filtered collection
when converting it into an array by treating the collection
as a sequence when copying elements. FlattenCollections already
have this behavior. (SR-4164)
2017-04-30 13:37:28 -07:00
swift-ci
8fea2f7ac2 Merge pull request #9134 from airspeedswift/delete-dead-code 2017-04-30 08:26:38 -07:00
ben-cohen
a7def4bba9 Delete old unused String._splitFirst 2017-04-30 06:04:15 -07:00
swift-ci
c24e1b2772 Merge pull request #9128 from rudkx/subscript-ambiguity 2017-04-29 17:50:13 -07:00
Mark Lacey
bcdf09d166 [stdlib] Disambiguate a subscript operation.
This is only flagged by some type checker changes that I have, but it
appears to be a legitimate ambiguity.
2017-04-29 17:15:02 -07:00
Ted Kremenek
09775ffa13 Merge pull request #9005 from itaiferber/foundation-encoders
Foundation Encoders
2017-04-29 15:51:48 -07:00
Dave Abrahams
0c61db5129 Merge pull request #9074 from apple/reverse-collection-iterator
Custom Reverse[RandomAccess]Collection.Iterator
2017-04-29 12:45:49 -07:00
Itai Ferber
7778fc2fb3 Fix encoding container linker errors
The box types were previously fileprivate because they lived in
the Foundation overlay. As part of the Swift stdlib, though, they need
to be internal so they can be linked against.
2017-04-29 12:18:49 -07:00
Ben Cohen
1163ea7c7a [stdlib] swapAt method (#9119)
* Add swapAt method

* Migrate sorting to swapAt

* Migrate further stdlib usage
2017-04-29 11:55:00 -07:00
Arnold Schwaighofer
328ebe8567 Revert "[stdlib] Dictionary/Set enhancements" 2017-04-29 07:02:57 -07:00
Itai Ferber
f7cd0a6343 Add Codable conformance to Array 2017-04-28 23:38:25 -07:00
Doug Gregor
447dce6c1f Merge pull request #9004 from itaiferber/swift-archival-serialization
Swift Archival & Serialization API
2017-04-28 20:02:33 -07:00
Doug Gregor
e90b7f9655 Merge pull request #9030 from natecook1000/nc-dictionary
[stdlib] Dictionary/Set enhancements
2017-04-28 19:42:17 -07:00
Ben Cohen
946b776e37 [stdlib] One-sided ranges and RangeExpression (#8710)
* One-sided ranges and RangeExpression

* Remove redundant ClosedRange methods from String

* Fix up brittle tests

* Account for Substring update

* XFAIL range diagnostics on Linux
2017-04-28 12:59:04 -07:00
Itai Ferber
e1e67844a8 Split RawRep extensions for Encodable + Decodable
You shouldn't need to be Codable in order to get these implementations;
being either Encodable or Decodable should be enough to get the relevant
default implementation
2017-04-28 11:15:04 -07:00
swift-ci
2e6bdbc1fa Merge pull request #9078 from apple/stateful-unicode-decoding 2017-04-27 14:33:37 -07:00
Dave Abrahams
5ad4ef4508 [stdlib] UnicodeDecoders: bidirectional UnicodeScalar view
Reverse iteration over a collection is significantly slower than forward.

REVERSE_COLLECTION

user	0m4.609s
user	0m4.587s
user	0m4.585s

COLLECTION

user	0m3.423s
user	0m3.517s
user	0m3.492s
2017-04-27 14:00:18 -07:00
Dave Abrahams
6227932519 [stdlib] Custom Reverse[RandomAccess]Collection.Iterator
In local tests this has accounted for some major speedups by helping the optimizer eliminate ARC traffic
2017-04-27 13:15:29 -07:00
Itai Ferber
53d82b1923 Rename sequence type to avoid ambiguity 2017-04-27 10:22:03 -07:00
Erik Eckstein
9ac13ae606 stdlib, optimizer: add Array. reserveCapacityForAppend as a new array semantics operation.
This function reserves capacity in an Array for new elements which are about to be appended.
2017-04-27 09:06:55 -07:00
Doug Gregor
966c9b5754 [Stdlib] Remove a return statement after a fatalError().
Eliminates a warning about unreachable code because, you know, it's
unreachable code. Fixes rdar://problem/31766069.
2017-04-26 23:30:53 -07:00
Maxim Moiseev
41b00c57ab Merge pull request #9044 from moiseev/substring-in
[stdlib] Substring
2017-04-26 19:25:59 -07:00
Ben Cohen
7b0eb29db5 Undo Sequence constraint on BinaryInteger.Words (#9047) 2017-04-26 17:22:34 -07:00
Max Moiseev
f741caf04e hasSuffix and hasPrefix are not available on Linux 2017-04-26 16:15:20 -06:00
Max Moiseev
e1f502f6cd Swift 3 compatible String and Substring range subscripts 2017-04-26 12:13:43 -07:00