Commit Graph

7767 Commits

Author SHA1 Message Date
Doug Gregor
447dce6c1f Merge pull request #9004 from itaiferber/swift-archival-serialization
Swift Archival & Serialization API
2017-04-28 20:02:33 -07:00
swift-ci
9296437d16 Merge pull request #9118 from gparker42/GrP-PR-C9756690-99CD-40B8-9279-4DBB2EA1DEFA 2017-04-28 20:02:08 -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
Greg Parker
9c80b23953 [stdlib] Make StdlibUnittest nullability-agnostic for ObjC runtime functions. 2017-04-28 18:08:41 -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
Slava Pestov
0ad6f73f60 Merge pull request #9090 from slavapestov/enable-subclass-existentials
Enable subclass existentials
2017-04-27 21:33:03 -07:00
swift-ci
97a9bfa8a2 Merge pull request #9082 from devincoughlin/test-global-access-traps 2017-04-27 21:19:42 -07:00
Slava Pestov
1615915780 Runtime: Dynamic casts to subclass existentials 2017-04-27 20:46:36 -07:00
Slava Pestov
e032d916f9 Runtime: Update _swift_buildDemanglingForMetadata() for subclass existentials 2017-04-27 20:46:36 -07:00
Devin Coughlin
73aabd73f7 [Exclusivity] Fix insertion/remove in AccessSet in runtime.
And add some basic tests for trapping on accesses to globals.
2017-04-27 15:38:07 -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
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
swift-ci
f31edcc4dd Merge pull request #9066 from DougGregor/stdlib-unreachable-warning 2017-04-27 08:08:09 -07:00
Arnold Schwaighofer
9fca4ccc37 Revert "Merge pull request #9057 from erg/overlay-deps-round5"
This reverts commit ea82bd19ec, reversing
changes made to ffdc8e15d9.

It broke the i386 build.
2017-04-27 07:23:08 -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
Doug Coleman
9a28931001 overlays: Update dependencies and amend the script to add headers. 2017-04-26 18:27:44 -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
a2d3914e02 Disambiguating expectEqual for String/Substring 2017-04-26 12:31:22 -07:00
Max Moiseev
e1f502f6cd Swift 3 compatible String and Substring range subscripts 2017-04-26 12:13:43 -07:00
Nate Cook
e2328885c1 [stdlib] Dictionary/Set enhancements
A variety of enhancements from SE-154 and SE-165:

- Custom Keys and Values collections for Dictionary
- Two sequence-based Dictionary initializers
- Merging methods for Dictionary
- Capacity checking and reserving for Dictionary and Set
- Type-specific filter(_:) methods for Dictionary and Set
- A mapValues(_:) method for Dictionary
- A grouping Dictionary initializer
2017-04-26 11:21:16 -05:00
Michael Ilseman
111d6200eb Merge pull request #8979 from milseman/parse_my_tweets_faster
[stdlib] Parse my tweets faster! 2x forwards, 3x reverse
2017-04-26 07:36:18 -07:00
practicalswift
ab5aaeb359 Merge pull request #9001 from practicalswift/gardening-20170425
[gardening] Unused variables. Unused diagnostics. Namespace comments. Typos.
2017-04-26 09:28:24 +02:00
Michael Ilseman
fa61a665c5 [stdlib] Fix relative-offset computing bug in grapheme breaking.
Many of StringCore private APIs, when the StringCore is itself a
substring, expect relative offsets rather than absolute offsets. This
fixes a bug in the sub-0x300 fast path where we were using absolute
offsets. Test cases added.
2017-04-25 16:51:35 -07:00
Max Moiseev
8e55b1dd8a Adding ExpressibleBy protocol conformances to Substring 2017-04-25 15:03:26 -07:00
Max Moiseev
457b8fcdb2 Substring conforms to _ObjectiveCBridgeable 2017-04-25 15:03:18 -07:00
Max Moiseev
79f4c9c80e Making one of Substring initializers public 2017-04-25 15:02:02 -07:00
Max Moiseev
7e8f8681bf Unavailable String returning subscripts 2017-04-25 15:00:15 -07:00
Max Moiseev
2216a6360e CustomDebugStringConvertible and var characters 2017-04-25 14:59:20 -07:00
Max Moiseev
161ef05de7 Adding TextOutputStream and TextOutputStreamable conformances 2017-04-25 14:58:51 -07:00
Max Moiseev
f19b9db421 Reimplementing Substring using the RangeReplaceableBidirectionalSlice 2017-04-25 14:58:25 -07:00
Max Moiseev
b1898ab768 Porting String APIs to Subtring and fixing some tests 2017-04-25 14:58:06 -07:00
Max Moiseev
9a40996253 Introducing the Substring type 2017-04-25 14:52:46 -07:00
Max Moiseev
d6dedd2523 [stdlib] Constraining BinaryInteger.Words to Sequence at least 2017-04-25 14:35:51 -07:00
Greg Parker
5eeb029371 [stdlib] sel_getName() never returns nil. 2017-04-25 13:09:48 -07:00
Itai Ferber
cecf00d1f1 Integrate *Codable protocols and associated types
Add Encodable and Decodable protocols, along with associated container
types, default implementations, and extensions to the standard library
2017-04-25 13:04:27 -07:00
practicalswift
ff827e0455 [gardening] Fix recently introduced typos 2017-04-25 21:03:44 +02:00
practicalswift
861f70e13d [gardening] Use consistent spacing 2017-04-25 21:03:43 +02:00
practicalswift
f2fb2475da [gardening] Use consistent end-of-namespace comments 2017-04-25 21:03:41 +02:00
Maxim Moiseev
13abb9a0a7 [stdlib] BinaryInteger func word(at:) => var words: Words (#8984)
* [stdlib] Underscoring BinaryInteger.word(at:)

* [stdlib] Implementing var words in terms of _word(at:)
2017-04-25 08:45:01 -07:00
swift-ci
c5f47670ac Merge pull request #8963 from aschwaighofer/stdlib_resilience_bitwidth_inlineable 2017-04-25 04:19:30 -07:00
Slava Pestov
7e3f17c0c8 Keypaths: Remove workaround for rdar://problem/31749245 2017-04-25 03:32:52 -07:00
Slava Pestov
58f2f35313 Runtime: Add superclass constraint to existential type metadata 2017-04-25 01:32:44 -07:00
Maxim Moiseev
0f142591e3 [stdlib] Making BitwiseOperations typealias public 2017-04-24 15:32:14 -07:00
Michael Ilseman
2d8164e552 [stdlib] Parse my tweets faster! 2x forwards, 3x reverse
Adds in a special case grapheme break detection between two values
within scalar ranges where we have special knowledge. Any sub-0x300
scalars, except CR-LF, are guaranteed to have grapheme breaks between
them. We're reasonably confident this will not change in future
versions of Unicode. We might add more ranges in the future, but
should do so conservatively, anticipating future Unicode changes.

In these cases we can very quickly break, even for strings that have
mixed latin and emoji characters. In a ASCII string with a single
emoji in it, we traverse the string 2x faster forwards and 3x faster
in reverse. (Reverse is 3x faster as it involves some forwards
traversal inside of the index). For a string that's half Latin half
non-Latin, we're about 1.5x faster forwards and backwards.
2017-04-24 15:17:25 -07:00
Arnold Schwaighofer
915c066dac [stdlib/resilience] Mark FixedWidthInteger.bitwidth as inlinable
Fixes test/IRGen/enum_derived.swift test case in resilient mode.

rdar://31757974
2017-04-24 13:47:57 -07:00