Commit Graph

3744 Commits

Author SHA1 Message Date
Doug Gregor
29a15ce402 [Stdlib] Apply SE-0142 to fix ABI FIXME #92, part of ABI FIXME #99. 2017-04-19 23:15:33 -07:00
Doug Gregor
d1d4238c40 [Stdlib] Remove ABI FIXMEs #94 and #96, which are consequences of other FIXMEs.
There isn't any work related to SE-0142 associated type where clauses
for these particular ABI FIXMEs. Rather, we get all of the constraints
we need from Collection and the recursive constraint we cannot yet
express, all of which are covered by other ABI FIXMEs.
2017-04-19 23:15:32 -07:00
Doug Gregor
0dd1da35d4 [Stdlib] Use SE-0142 to address ABI FIXMEs #68, #89, #90, #91.
Address ABI FIXME #68 by using same-type constraints directly on an
associated type to describe the requirements on the Indices associated
type of the Collection protocol. ABI FIXMEs #89, #90, #91 are all in
StdlibUnittest, and provoke warnings once #68 is fixed, but it's nice
to clear them out.

Fixes SR-2121.
2017-04-19 23:15:32 -07:00
Joe Groff
595e0e4ede Merge branch 'master' into keypaths 2017-04-19 18:38:24 -07:00
Max Moiseev
e611911cc3 [stdlib] _fixed_layout for ArithmeticOverflow
Fixes: <rdar://problem/31702435>
2017-04-19 11:59:04 -07:00
Max Moiseev
a1cb7a8d73 [stdlib] Removing redundand requirement 2017-04-19 11:24:59 -07:00
Max Moiseev
3101c4f8e3 [stdlib] Arithmetic operators on floating point types to static funcs 2017-04-19 11:24:59 -07:00
Max Moiseev
fe6d9255c1 [stdlib] _sizeInBits and _sizeInBytes for Swift 3 source compatibility 2017-04-19 11:24:58 -07:00
Max Moiseev
b41dd17edd [stdlib] Swift 3 XXXWithOverflow methods for integers 2017-04-19 11:24:58 -07:00
Max Moiseev
830b2edf54 [stdlib] Check overflow in integer init from literal
Fixes: <rdar://problem/29911715>
And partially: <rdar://problem/29937936>
2017-04-19 11:06:26 -07:00
Joe Groff
a6cd471c2b IRGen/stdlib: Instantiate non-generic computed key path components. 2017-04-18 21:51:12 -07:00
practicalswift
7eb7d5b109 [gardening] Fix 100 typos. 2017-04-18 17:01:42 +02:00
Joe Groff
0bb83bb185 KeyPaths: Support out-of-place instantiation of generic key paths. 2017-04-17 22:36:26 -07:00
Max Moiseev
8ca814cc8c Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-04-17 14:40:20 -07:00
Max Moiseev
b7f715f7e5 Fixing the iOS test failures 2017-04-17 14:05:34 -07:00
Max Moiseev
71b2c1fb41 Adding Swift 3 alias for _SignedInteger 2017-04-17 11:01:59 -07:00
Max Moiseev
192c11217f Adding arithmetic methods to FloatingPoint for Swift 3 mode 2017-04-17 10:43:40 -07:00
Max Moiseev
9b53efd72c Merge branch 'master' into new-integer-protocols 2017-04-17 09:53:44 -07:00
Dave Abrahams
6177af57dd [stdlib] Eliminate redundant capacity reservation
append(contentsOf:) already reserves capacity.
2017-04-15 22:00:28 -07:00
Max Moiseev
7b98267d78 Fixing the unicode tests by removing the potential optimization 2017-04-14 17:03:26 -07:00
Max Moiseev
8de33b4824 Overloads for +/- on Strideable for Swift 3 compatibility mode 2017-04-13 17:29:42 -07:00
Max Moiseev
54e5f5d741 Handling the differences in << and >> for Swift 3 vs Swift 4
In Swift 3 shifts used to be defined on the concrete integer types, so
the right-hand-side value in the shift expression could define a type
for the result, as in `1 << i32` would have the type Int32. Swift 4
makes shift operators heterogeneous, so now `1 << i32` will result in an
Int, according to the type of the left-hand-side value, which gets a
default type for integer literals.
2017-04-13 15:34:32 -07:00
Max Moiseev
bc7918b94c Commenting out deprecated +/- on Strideable 2017-04-12 17:03:30 -07:00
swift-ci
967e2d9653 Merge pull request #8721 from natecook1000/nc-fixes-73-1 2017-04-12 10:33:53 -07:00
Arnold Schwaighofer
69e6f07167 Merge pull request #8701 from aschwaighofer/wip_ast_silgen_const_string_literal
AST/SILGen support for constant string literals
2017-04-12 09:52:18 -07:00
Nate Cook
909c4c8714 [stdlib] Fix Collection discussion typo 2017-04-12 00:14:53 -05:00
Dave Abrahams
1f7ec57b04 Merge pull request #1527 from codestergit/master
[Stdlib] Improves Collection.sort  to accept throwing closure
2017-04-11 18:03:17 -07:00
Max Moiseev
3d7ddc53c9 More typealiases for Swift 3 protocols 2017-04-11 17:05:22 -07:00
Max Moiseev
def49e8fa4 Adding SignedInteger.&+ and &- for source compatibility 2017-04-11 17:05:21 -07:00
Arnold Schwaighofer
4d60ec333b AST/SILGen support for constant string literals
rdar://30545013
2017-04-11 11:41:43 -07:00
Dave Abrahams
9b0e80079c [stdlib] EmptyCollection: release-mode checks-=10
These checks weren't protecting memory safety; let's see if benchmarks go faster without them in release mode.
2017-04-10 16:01:17 -07:00
Max Moiseev
d30a2f95e6 Adding non-masking shifts on concrete types 2017-04-10 15:18:21 -07:00
Max Moiseev
cb82daa282 Speculatively replacing a couple more transparent's with inline-always'es 2017-04-10 13:43:02 -07:00
Joe Groff
39a0849362 SILGen: Codegen for key path applications. 2017-04-09 16:38:34 -07:00
Max Moiseev
dfc8c65dca Adding overloads for << and >> with the literal on the left-hand side 2017-04-07 13:56:40 -07:00
Max Moiseev
9bf43d632f Arithmetic operators for Strideable where Stride : ExpressibleByIntegerLiteral for compatibility 2017-04-07 11:41:23 -07:00
Max Moiseev
5b613b3f44 Adding deprecated mixed-type arithmetic operators for Strideable & SignedInteger for compatibility 2017-04-07 11:41:22 -07:00
Max Moiseev
ed90d8c908 Adding a few Swift 3 compatibilty APIs 2017-04-07 11:41:22 -07:00
Joe Groff
85ad6b355e Merge branch 'master' into keypaths 2017-04-06 18:02:07 -07:00
Andrew Trick
8668f9bd72 Add init(rebasing:) to UnsafeBufferPointer.
This is required for consistency with UnsafeRawBufferPointer.
2017-04-06 17:12:18 -07:00
Andrew Trick
c12740a8a2 Add UnsafeRawBuffer(rebasing:) initializers.
Allows converting a raw slice into a zero-based raw buffer,
which is a common operation on flat memory.

Add and update UnsafeRawBufferPointer unit tests.
2017-04-06 17:12:18 -07:00
Andrew Trick
3782925a29 Give UnsafeRawBufferPointer a distinct slice type.
SubSequence = RandomAccessSlice<Self>
2017-04-06 17:12:18 -07:00
Joe Groff
631bb632d0 KeyPaths: Dummy out an AnyKeyPath._kvcKeyPathString property for ObjC interop in overlays. 2017-04-06 13:40:04 -07:00
Andrew Trick
849421799a Revert "SE-0138: Proposed amendment to SE-0138: Normalize UnsafeRawBufferPointer Slices (#8222)"
This reverts commit 1d32586d28.
2017-04-06 10:38:52 -07:00
Max Moiseev
8fe28b4e32 Merge branch 'master' into new-integer-protocols 2017-04-06 10:22:37 -07:00
Andrew Trick
1d32586d28 SE-0138: Proposed amendment to SE-0138: Normalize UnsafeRawBufferPointer Slices (#8222)
* Add sliceability tests for Unsafe(Raw)BufferPointer.

Improve the generic sliceability tests to verify that SubSequence indices are
compatible with their parents indices.

* Fix and enable testing stdlib Collection instances.

Top-level entry points fully testing a collection instance:
check${Traversal}Collection

One level of recursion into all slices of the collection instance
O(n^2). (Not combinatorial).

Previously, checkCollection() did nothing. So much of the testing infrastructure was inactive. Now it runs all forward collection tests.

Fixes a bug in subscriptRangeTests.

The UnsafeRawBufferPointer and Data collection testing is disabled and
will be fixed in the following commit.

* Give UnsafeRawBufferPointer a distinct slice type.

SubSequence = RandomAccessSlice<Self>

* Fix raw buffer pointer tests after changing the API

* Add UnsafeRawBuffer(rebasing:) initializers.

Allows converting a raw slice into a zero-based raw buffer,
which is a common operation on flat memory.

Add and update UnsafeRawBufferPointer unit tests.

* Do not run recursive O(n^2) collection slice testing on large collections.

Now, even with collection unit testing wired up, the validation tests
take the same amount of time to execute.

* Add init(rebasing:) to UnsafeBufferPointer.

This is required for consistency with UnsafeRawBufferPointer.

* Update CHANGELOG.md for SE-0138 amendment: UnsafeRawBufferPointer slice type.
2017-04-06 10:08:09 -07:00
Max Moiseev
4b201754c1 Replacing @_transparent with @inline(__always)
Mandatory inlining of a few very frequently used functions caused the
SIL size explosion, which in turn made the inliner use up to 6Gb of
memory to compile the standard library. @inline(__always) helps avoid
that without affecting benchmark results.

Related to: <rdar://problem/31375011>
2017-04-05 15:51:38 -07:00
Max Moiseev
9feb799c6d Adding an explicit type context 2017-04-05 11:21:50 -07:00
Joe Groff
d42f2049f7 KeyPaths: Implement in-place instantiation of invariant key paths.
For key paths without generic or subscript parameterization, we can turn the compiler-generated key path pattern into a global object in-place.
2017-04-05 08:46:45 -07:00
Max Moiseev
a1682a887c Speeding up the build by breaking complex expressions into smaller pieces 2017-04-04 16:29:54 -07:00