Commit Graph

1231 Commits

Author SHA1 Message Date
Dave Abrahams
22c8515558 <label> body => _ body 2016-07-18 14:29:08 -06:00
Dmitri Gribenko
b9f412974b StdlibUnittest: remove unused API 2016-07-18 02:41:19 -07:00
Chris Lattner
af30ae3222 Remove the last parts of the Boolean protocol, finishing up:
SE-0109: Remove the Boolean protocol.

We still love you George, even if we forgot your e.
2016-07-17 22:18:17 -07:00
swift-ci
8ca108521c Merge pull request #3558 from parkera/calendar_timezone_locale 2016-07-17 20:34:07 -07:00
Chris Lattner
a0d34852bb Revert "Fix the build."
This reverts commit 932fe9d6b9.
2016-07-17 12:35:42 -07:00
Tony Parker
8e814ac875 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-17 09:42:37 -07:00
Michael Gottesman
932fe9d6b9 Fix the build.
This reverts commit 4242af7503.
This reverts commit 76cf339694.
This reverts commit e97ed133a8.
This reverts commit 66961fcda8.
2016-07-17 01:02:48 -07:00
Chris Lattner
76cf339694 Implement the first half of SE-0109: Remove the Boolean protocol
This removes conformance of DarwinBool and ObjCBool to the Boolean protocol,
and makes the &&/||/! operators be concrete w.r.t. Bool instead of abstract
on Boolean.

This fixes some outstanding bugs w.r.t diagnostics, but exposes some cases
where an existing diagnostic is not great.  I'll fix that in a later patch
(tracked by rdar://27391581).
2016-07-16 23:23:45 -07:00
Andrew Trick
888ff1ae99 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 46a9f57329.

This broke Swift CI, OSS incremental RA:

./swift/stdlib/public/SDK/Foundation/TimeZone.swift:228:45: error: 'NSTimeZone' is not implicitly convertible to 'TimeZone'; did you mean to use 'as' to explicitly convert?
        return lhs._wrapped.isEqual(to: rhs._wrapped)
2016-07-16 18:34:32 -07:00
Tony Parker
46a9f57329 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 17:58:27 -07:00
Dmitri Gribenko
8c14b7dee0 StdlibUnittest: improve failure message 2016-07-16 13:31:21 -07:00
Michael Gottesman
40e1991e12 Revert "Name and label changes for closure parameters (for review only) (#2981)"
This reverts commit 18406900ba.
2016-07-15 19:45:26 -07:00
Michael Gottesman
ac5a9789e7 Revert "A fix for 33023b389f95d1577ee15a10393a2fcc865472bb"
This reverts commit 220bd9cc5a.
2016-07-15 19:45:25 -07:00
Dmitri Gribenko
c7b1ef8833 Merge pull request #3535 from apple/stdlib-StdlibUnittest-better-error-messages
StdlibUnittest: improve error messages in checkEquatable() and checkHashable()
2016-07-15 17:43:20 -07:00
Dave Abrahams
220bd9cc5a A fix for 33023b389f95d1577ee15a10393a2fcc865472bb 2016-07-15 16:04:34 -07:00
Dave Abrahams
18406900ba Name and label changes for closure parameters (for review only) (#2981)
Implement SE-0118 Name and label changes for closure parameters

[SE-0118](https://github.com/apple/swift-evolution/blob/master/proposals/0118-closure-parameter-names-and-labels.md)
2016-07-15 15:31:48 -07:00
Dmitri Gribenko
bd0a638d79 StdlibUnittest: improve error messages in checkEquatable() and checkHashable() 2016-07-15 13:44:07 -07:00
Saleem Abdulrasool
a05fd17b64 Platform: port to msvcrt, add msvcrt module
This adds the swiftMSVCRT module which is similar in spirit to swiftGlibc and
swiftDarwin, exposing the Microsoft C Runtime library to swift.  Furthermore,
disable pieces of the standard library which are not immediately trivially
portable to Windows.  A lot of this functionality can still be implemented and
exposed to the user, however, this is the quickest means to a PoC for native
windows support.

As a temporary solution, add a -DCYGWIN flag to indicate that we are building
for the cygwin windows target.  This allows us to continue supporting the cygwin
environment whilst making the windows port work natively against the windows
environment (msvc).  Eventually, that will hopefully be replaced with an
environment check in swift.
2016-07-12 17:31:06 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Dmitri Gribenko
824bccc871 stdlib: change Collection._copyToNativeArrayBuffer() to be defined in terms of public types 2016-07-11 10:54:43 -07:00
Saleem Abdulrasool
4a4b54ea73 stdlib: clean up framework depends
This is no longer necessary as the imports will correctly create the dependency.
Clean up the unnecessary dependencies.  Noticed by Dimitri Gribenko.
2016-07-10 17:54:36 -07:00
Saleem Abdulrasool
65fd24de5c stdlib: restrict pthreads to POSIX platforms
pthreads is not available on non-POSIX platforms (i.e. Windows).  Restrict the
target platforms that we build SwiftPrivatePthreadExtras and things which depend
on it.
2016-07-08 09:38:02 -07:00
practicalswift
9a8bbe0014 [gardening] Fix recently introduced typos. 2016-07-07 13:14:25 +02:00
Saleem Abdulrasool
34dce93062 Merge pull request #3316 from compnerd/multiple-platforms
stdlib: build multiple platform libraries simultaneously
2016-07-06 21:25:47 -07:00
Mishal Shah
23b646eed2 Update master to build with Xcode 8 beta 2, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs 2016-07-06 10:48:45 -07:00
Dmitri Gribenko
fd7f55d5a2 stdlib: replace 'forAllPermutations()' with a non-recursive implementation 2016-07-06 02:53:27 -07:00
Saleem Abdulrasool
7e229f7247 build: support multiple builds of StdlibUnittest 2016-07-05 17:33:56 -07:00
Saleem Abdulrasool
c6a2fb4302 build: support multiple builds of SwiftPrivatePthreadExtras 2016-07-05 17:33:20 -07:00
Saleem Abdulrasool
43ea70cade build: support multiple builds of SwiftPrivateLibcExtras
Support building SwiftPrivateLibcExtras for a number of targets simultaneously.
This will enable cross-compiling the standard library for multiple foreign
targets.
2016-07-05 17:32:38 -07:00
Chris Lattner
45f2cfaaa0 Implement SE-0099, but where the migration diagnostics are left as warnings
for now.  I'll upgrade them to errors in a week or two to give downstream
projects a chance to update.
2016-07-02 15:44:57 -07:00
Saleem Abdulrasool
83901998c9 Port for PS4
Add support for the PS4 OS.  Update the standard library and add a target unit
test.
2016-06-30 20:14:50 -07:00
swift-ci
1419fc962c Merge pull request #3178 from CodaFi/leak-by-example 2016-06-30 18:24:51 -07:00
Dmitri Gribenko
b8ba955198 stdlib: add a prototype implementation of a persistent vector 2016-06-30 00:49:02 -07:00
Robert Widmann
56f495c170 [WIP] Enable leaks tracking
This is part 1 of many to enable leaks tracking in the unit test suite.
 To compile with leak tracking enabled run

swift/utils/build-script -- --swift-runtime-enable-leak-checker
2016-06-28 19:22:54 -07:00
Rintaro Ishizaki
37dccea4bc [StdlibUnitTest] Fix argument order of defaulted parameters 2016-06-29 11:13:16 +09:00
Austin Zheng
dfcc13dc69 [stdlib] Bounds checks and tests for Unsafe*BufferPointer
Changes:
- Added bounds checks to Unsafe*BufferPointer's subscript getter and setter
- Added tests for Unsafe*BufferPointer's subscript getter for all four range types
2016-06-20 21:41:20 -07:00
Dmitri Gribenko
0892c2210e stdlib tests: fix indentation 2016-06-19 17:54:24 -07:00
swift-ci
004d85e448 Merge pull request #3043 from modocache/pr-2057-linux-sdk-overlay-fix 2016-06-18 18:41:37 -07:00
swift-ci
8f632a467c Merge pull request #3056 from austinzheng/az-fix-tests 2016-06-18 18:41:36 -07:00
Dmitri Gribenko
5dd3ce9195 Merge pull request #3020 from modocache/sr-1738-add-swift-library-shared-static-args
[SR-1738] add_swift_library takes SHARED/STATIC arg
2016-06-18 15:38:57 -07:00
Austin Zheng
f074bf7f03 [stdlib] Fixing several collection-related tests
Changes:
- Parameterized a number of tests in CheckCollectionType.swift.gyb expected to crash during one or more runthroughs
- Fixed an issue with the tests uncovered by this change
2016-06-17 22:35:00 -07:00
Austin Zheng
9138b73097 [stdlib] Addressing Dmitri Gribenko's feedback re #2993
Changes:
- Moved only-used-once helper methods into call sites
- Parameterized tests that might expect a crash
- Fixed some comments and formatting; renamed some test helper APIs
2016-06-17 00:26:27 -07:00
Brian Gesiak
83daa49a5a [CMake] Only build StdlibUnittest when SDK overlay is built
On Linux it used to be possible to build only the stdlib, without the
SDK overlays, like so:

```
utils/build-script -- --build-swift-stdlib --build-swift-sdk-overlay=0
```

However this invocation now results in the following error:

```
+ /usr/bin/cmake --build /home/modocache/GitHub/apple/build/Ninja-ReleaseAssert/swift-linux-x86_64 -- -j8 all swift-stdlib-linux-x86_64
ninja: error: '/home/modocache/GitHub/apple/swift/stdlib/private/SwiftPrivatePthreadExtras/swiftGlibc-linux-x86_64', needed by 'stdlib/private/SwiftPrivatePthreadExtras/linux/x86_64/SwiftPrivatePthreadExtras.o', missing and no known rule to make it
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
```

The problem is that SwiftPrivatePthreadExtras is always built, regardless
of whether the SDK overlay is built. I believe there's an explicit check
against this for Darwin platforms to prevent the same error.

The solution, implemented here, is to add the same check for Linux.
2016-06-16 14:29:30 -04:00
Austin Zheng
51f19eafdf [stdlib] Adding new indices model tests (#2991)
* [stdlib] Adding new tests for collection indices

Changes:
- Added tests for 'index(next:)'
- Added tests for all 'formIndex' API variants
- Modified existing tests to better test bidirectional collections

* Fixes reflecting review feedback
2016-06-16 10:53:47 -07:00
Brian Gesiak
328de9e280 [SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.

Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
2016-06-16 13:15:58 -04:00
Austin Zheng
4872e546b0 [stdlib] Adding tests for removeSubrange overloads for range types 2016-06-14 23:57:49 -07:00
Austin Zheng
6042ee0244 [gardening] Add .self to suppress compiler warnings 2016-06-14 18:24:29 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Doug Gregor
2807a17eb8 [Type checker SR-899] Warning on missing ".self" for single-parameter functions.
Due to a modeling error in the type checker's folding of type
references into type expressions, code such as "strideof(Int)" would
be accepted without the required ".self". Commit
4a60b6cbf4 fixes the modeling issue but
left the historical accepts-invalid; now, diagnose these cases with a
warning + Fix-It to ease the transition.

Fixes SR-899.
2016-06-12 22:31:59 -07:00
practicalswift
c74273dfd1 [gardening] Remove "-*- swift -*-" from non-.gyb file. 2016-06-12 19:03:54 +02:00