Commit Graph

8969 Commits

Author SHA1 Message Date
Dave Abrahams
b3a3b52783 Merge pull request #9798 from apple/inline-stable-grapheme-fastpaths
Inline stable grapheme fastpaths
2017-05-23 15:18:32 -07:00
Michael Ilseman
527f2c4dd7 Merge pull request #9858 from milseman/got_no_cache
[stdlib] String: drop TLS setText cache.
2017-05-23 12:24:13 -07:00
Dave Abrahams
3d789cff2d Inlineable character fast paths 2017-05-23 01:42:28 -07:00
swift-ci
1c390bc578 Merge pull request #9846 from apple/remove-redundant-slicing 2017-05-23 00:52:56 -07:00
Ted Kremenek
dbe77601f3 Merge pull request #9791 from itaiferber/swift-archival-serialization-updates
Enhancements to Codable API
2017-05-22 23:53:49 -07:00
Dave Abrahams
0016379d82 Merge branch 'master' into remove-redundant-slicing 2017-05-22 20:48:23 -07:00
Dave Abrahams
56466332f4 Merge pull request #9848 from apple/no-optionals-in-specialization
[stdlib] Eliminate optionals from specialization code
2017-05-22 18:59:50 -07:00
Michael Ilseman
1bc1011e31 [stdlib] String: drop TLS setText cache.
The overhead of the weak reference overwhelms the savings from
avoiding the setText, when there's a fair amount of reference counting
involved. The real solution will be to use an unowned reference. For
now, drop the cache and introduce it once we have more runtime
functionality.
2017-05-22 18:59:06 -07:00
John Holdsworth
e45ddc8955 Ensure fatalError message logged on Android 2017-05-23 01:47:07 +01:00
Dave Abrahams
b677e1d6e4 [stdlib] Remove now-redundant slicing operations 2017-05-22 16:34:05 -07:00
Dave Abrahams
72f5e7c0c2 [stdlib] Eliminate _Element 2017-05-22 16:17:58 -07:00
Dave Abrahams
4f5e14845b [stdlib] Eliminate optionals from specialization code
Apparently this makes the optimizer happier.  Still waiting on #9792 for truly
efficient specialization.

https://github.com/apple/swift/pull/9792
2017-05-22 15:59:43 -07:00
Max Moiseev
4179fcb390 [overlay] Fix CMTimeRange.isValid
<rdar://problem/30576556>
2017-05-22 10:36:38 -07:00
Maxim Moiseev
421684b12f Merge pull request #9755 from moiseev/affine-transform-hashvalue
[Foundation] Unbreaking the expression that used to be too complex
2017-05-22 10:03:33 -07:00
Itai Ferber
d16297dad5 Introduces changes to Codable stdlib API
* Adds conformance of Optional to Codable
* encode(...) arguments are no longer Optional; Optional values go
  through generic version
* encodeIfPresent added to KeyedEncodingContainerProtocol to mirror
  decodeIfPresent
* JSONEncoder and PropertyListEncoder updated to reflect these changes
2017-05-22 09:29:36 -07:00
Ben Cohen
02e2bd5380 Re-gyb sorting (#9818) 2017-05-21 16:59:46 -07:00
Tony Parker
cf364ec58c Merge pull request #9795 from kballard/indexset_empty_iteration
Fix iterating empty IndexSets
2017-05-21 12:29:35 -07:00
Dave Abrahams
70a437c846 [stdlib] Remove invalid _sanityCheck
A `Character` _should_ contain only a single grapheme, but we can't formally require it because of grapheme cluster literals and the shifting sands of Unicode.  Fixes https://bugs.swift.org/browse/SR-4955
2017-05-21 08:00:43 -07:00
Pavol Vaskovic
b57aa7c057 Sequence internals with struct instead of class.
_DropFirstSequence, _PrefixSequence and _DropWhileSequence as structs.

I turns out we DON’T require reference semantics to keep track of how many elements we've already taken from the underlying sequence.

… that’s taken care of by the underlying sequence, which has to have reference semantics if it needs them.
2017-05-21 08:02:37 +02:00
Michael Ilseman
2b92530dfa Merge pull request #9780 from milseman/the_missing_link
[stubs] Autolink against icucore on Darwin.
2017-05-19 15:52:05 -07:00
Kevin Ballard
7be57bbf95 [SDK] Fix broken rangeIndex test for IndexSet.Index comparisons
It was always testing `rhs` against `rhs`, so it could never fail. But
we don't actually need the test at all, because the `value` field is
sufficient to compare indices.
2017-05-19 15:18:04 -07:00
Kevin Ballard
76fe9ea214 [SDK] Fix IndexSet.startIndex for empty sets that used to have values
We can't rely on `_range(at:)` producing valid results for sets that
have no ranges.

Fixes SR-4947.
2017-05-19 15:18:04 -07:00
Michael Ilseman
8e0362e2c1 [stubs] Autolink against icucore on Darwin.
Programs using a statically linked build of the standard library need
to explicitly link against icucore. There are various potential
hacks^Wsolutions to this problem, and this is an attempt at a lesser
of evils approach.

Emit a linker directive to perform autolinking against icucore on
Darwin systems. This allows us to avoid hacking the compiler driver
and propagating that hack onto any build systems that don't go through
the driver.
2017-05-19 10:39:24 -07:00
Maxim Moiseev
4ec2838e8d Merge pull request #9757 from moiseev/renamed-intmax
[stdlib] Providing fixits for IntMax and UIntMax
2017-05-19 07:31:54 -07:00
eeckstein
bc4ad8f079 Merge pull request #9754 from eeckstein/enable-gen-inline
Enable generic inlining and partial specialization in libswiftFoundation
2017-05-18 19:03:50 -07:00
swift-ci
32b4e56ca5 Merge pull request #7183 from apple/rdar-25398370 2017-05-18 18:29:02 -07:00
Max Moiseev
368847b5c7 [stdlib] Providing fixits for IntMax and UIntMax 2017-05-18 18:00:45 -07:00
Max Moiseev
d9117f560a [Foundation] Unbreaking the expression that used to be too complex 2017-05-18 17:43:53 -07:00
Dave Abrahams
fe76f6b147 [stdlib] Add and use _identityCast 2017-05-18 17:41:15 -07:00
Jordan Rose
c117679695 [SDK] Remove accidentally-internal "renaming shims" from AppKit. (#9751)
These were supposed to help during the early days of Swift 3, when our
omission of needless words was being tempered by framework authors'
explicitly-specified names in API notes...but they were accidentally
not made public, and no one noticed. After checking with the AppKit
team, we decided to just drop them.
2017-05-18 17:24:39 -07:00
Erik Eckstein
e69ab79348 Enable generic inlining and partial specialization in libswiftFoundation.
This brings back performance for ObjC bridging.
2017-05-18 17:13:50 -07:00
Dave Abrahams
fd30b72ee1 [stdlib] Fix a race
Lock-free programming is almost always a bug.
Fixes <rdar://25398370> Data Race in StringBuffer.append (found by TSan)
2017-05-18 16:29:59 -07:00
swift-ci
2a5d7a13f1 Merge pull request #9745 from eeckstein/disable-gen-inline 2017-05-18 16:14:49 -07:00
Maxim Moiseev
84144d8ee8 Merge pull request #9741 from moiseev/rrc-filter
[stdlib] Adding RangeReplaceable.filter returning Self
2017-05-18 16:12:23 -07:00
Erik Eckstein
74fa0bcc87 Disable generic inlining and partial specialization, except in libswiftCore
This avoids code size regressions in programs while still getting the performance improvements in generic code in the stdlib.

rdar://problem/32277313
2017-05-18 15:38:54 -07:00
Max Moiseev
fd2ac31c6e [stdlib] Adding RangeReplaceable.filter returning Self
This overload allows `String.filter` to return a `String`, and not
`[Character]`.

In the other hand, introduction of this overload makes `[123].filter`
somewhat ambiguous in a sence, that the compiler will now prefer an
implementatin from a more concrete protocol, which is less efficient for
arrays, therefore extra work is needed to make sure Array types fallback
to the `Sequence.filter`.

Implements: <rdar://problem/32209927>
2017-05-18 12:24:13 -07:00
Doug Gregor
684bddf667 Merge pull request #9733 from DougGregor/cgcolor-color-literal
[CoreGraphics] Make CGColor adopt _ExpressibleByColorLiteral.
2017-05-18 11:06:36 -07:00
Dave Abrahams
2655dd4c58 Merge pull request #9729 from apple/replace-integer-parsing
[stdlib] Replace Integer Parsing Code
2017-05-18 10:48:59 -07:00
Michael Ilseman
90a86334dc Merge pull request #9734 from jckarter/implicit-objc-log-newline
Runtime: Add newline to implicit ObjC entrypoint log message.
2017-05-18 10:16:47 -07:00
Joe Groff
56a52ae9eb Runtime: Add newline to implicit ObjC entrypoint log message.
See if this clears up buffering issues in CI. rdar://problem/32272992
2017-05-18 10:08:49 -07:00
Doug Gregor
2a9867bf88 [CoreGraphics] Make CGColor adopt _ExpressibleByColorLiteral.
The backflips here are because we cannot add initializers to imported
CF types; they would be factory initializers. Fixes
rdar://problem/32196175.
2017-05-18 09:57:52 -07:00
Doug Gregor
663c747cc5 [CoreGraphics] Move == operators into their respective types. 2017-05-18 09:46:27 -07:00
Itai Ferber
012ea9373b Add Codable conformance to common Foundation types
Add conformances + unit tests for

* CGFloat
* AffineTransform
* Calendar
* CharacterSet
* DateComponents
* DateInterval
* Decimal
* IndexPath
* IndexSet
* Locale
* Measurement
* NSRange
* PersonNameComponents
* TimeZone
* URL
* UUID

along with some unit tests for each.
2017-05-18 07:56:03 -07:00
Dave Abrahams
c67977a881 [stdlib] Replace Integer Parsing Code 2017-05-18 07:00:34 -07:00
Nate Cook
ca5c65f93c [stdlib] Nest some additional operators (#9646) 2017-05-17 19:44:08 -07:00
Ben Cohen
89515f8485 [Foundation] Add initializers for NSRange<-->Range (#9709)
* Add initializers to NSRange/Range

* Create Ranges unchecked
2017-05-17 19:29:45 -07:00
swift-ci
c0623c42ce Merge pull request #9722 from apple/stringprotocol-interchange 2017-05-17 19:13:25 -07:00
Michael Ilseman
948ba4d4e3 Merge pull request #9684 from milseman/tls_ftw
[stdlib] Unicode 9 and Thread Local Storage (again)
2017-05-17 18:32:25 -07:00
Maxim Moiseev
130231456b Merge pull request #9714 from moiseev/int-perf
[stdlib] Speeding up typechecking for complex expressions with integers
2017-05-17 17:33:47 -07:00
Dave Abrahams
d6fee05375 [stdlib] Enable interchange among StringProtocol models 2017-05-17 17:21:43 -07:00