Commit Graph

612 Commits

Author SHA1 Message Date
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
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
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
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
Dmitri Gribenko
6f139d7b5a Merge pull request #2975 from trentxintong/MISC
Limit inlining for stdlibunittest. This saves a lot of compilation time
2016-06-09 18:29:44 -07:00
Xin Tong
6430525edc Limit inlining for stdlibunittest. This saves a lot of compilation time
for some of the stdlibunittests.

i.e. For the FixPoint benchmark, from 256s on my machine to 27s.

rdar://26688483
2016-06-09 16:04:43 -07:00
Dave Abrahams
4fbed473e2 Add a missing @discardableResult 2016-06-08 11:35:16 -07:00
Dmitri Gribenko
8f118750a4 StdlibUnittest: add tests for expectEqual() on tuples 2016-06-04 02:33:30 -07:00
Dmitri Gribenko
fb6fb95fe2 Merge pull request #2801 from natecook1000/nc-nextup
[stdlib] Fix error in nextUp and nextDown
2016-06-02 14:31:45 -07:00
swift-ci
7c98b492e8 Merge pull request #2841 from ahoppen/SR-1236-tests-update 2016-06-02 11:38:34 -07:00
Nate Cook
b76630735a [stdlib] Add tests for FloatingPoint's nextUp and nextDown 2016-06-02 11:11:07 -05:00
Alex Hoppen
2108a235df [Tests] Update existing tests for the upcoming implementation of SE-0036 2016-06-02 17:50:55 +02:00
rintaro ishizaki
6401324993 [stdlib] Apply tail style "where" clause to stdlib/{internal,private} 2016-06-02 12:01:21 +09:00
Dmitri Gribenko
a1e73a6b0d CMake: remove dead code 2016-05-31 21:57:07 -07:00
Dmitri Gribenko
9574d03dfa StdlibUnittest: ask the child process to terminate, and check its termination status
If a child process crashes outside of a test context, the parent process
should signal test failure. This behavior is a sign of something bad
happening in the child (for example, memory corruption), and should not
go unnoticed.
2016-05-22 17:17:16 -07:00
Dmitri Gribenko
27a6be9897 StdlibUnittest: add labels to boolean return values 2016-05-22 14:37:53 -07:00
Dmitri Gribenko
d7dd6bdae3 StdlibUnittest: replace a magic value with an optional 2016-05-22 14:37:53 -07:00
Dmitri Gribenko
cd312ae12c StdlibUnittest: refactor child I/O code
Detangle protocol parsing logic from I/O handling.
2016-05-22 14:37:53 -07:00
Dmitri Gribenko
227cfa1695 StdlibUnittest: add a simple API for race tests 2016-05-20 14:23:31 -07:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
Trent Nadeau
0cc851568a Updated tests to use @discardableResult and _ = . 2016-05-11 22:53:38 -04:00
Ted Kremenek
942e524285 Revert "SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations" (#2477) 2016-05-11 11:02:37 -07:00
Jordan Rose
14a7334aef Merge pull request #2224: SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations
from @ahoppen
2016-05-10 19:58:09 -07:00
Doug Gregor
c808b00314 Merge pull request #2423 from koke/sr-1395
SE-0070: Make Optional Requirements Objective-C-only.
2016-05-07 20:27:32 -07:00
Alex Hoppen
0e8c69c56f [SE-0036]: Requiring Leading Dot Prefixes for Enum Instance Member Implementations 2016-05-07 22:39:26 +02:00
Ted Kremenek
d3c41c4668 Revert "Revert "SE-0072: Fully eliminate implicit bridging conversions from Swift"" (#2441) 2016-05-06 23:26:45 -07:00
Ted Kremenek
4df003c291 Revert "SE-0072: Fully eliminate implicit bridging conversions from Swift" (#2440) 2016-05-06 23:22:56 -07:00
Joe Pamer
6af546e89e Merge pull request #2419 from apple/se-0072
SE-0072: Fully eliminate implicit bridging conversions from Swift
2016-05-06 22:14:13 -07:00
Chris Lattner
8d3f88735d Add parens to the few cases in the stdlib that lack them for function types. 2016-05-06 21:07:08 -07:00
Jorge Bernal
0a3f913b20 SE-0070: Make Optional Requirements Objective-C-only.
Optional protocol requirements now require an explicit @objc attribute.

Fixes SR-1395
2016-05-06 11:05:52 +02:00
Joe Pamer
3b4d98445e SE-0072: Fully eliminate implicit bridging conversions from Swift
Per Swift Evolution proposal SE-0072, these changes prevent the compiler from introducing implicit bridging conversions during type checking.
2016-05-05 19:36:33 -07:00
Jordan Rose
54e4b59c59 StdlibUnittest: Fix NSException catching (broken by SE-0054).
Previously, the callback for objc_setUncaughtExceptionHandler
took a parameter of type 'AnyObject!', which was implicitly
unwrapped at all uses inside the closure. When that became
'AnyObject?', we started getting an extra layer of Optional in
the printed output.

This reverts the tests to their pre-4d540c2a state.
2016-05-04 14:17:15 -07:00
John McCall
50d58b2732 Add a lot of calling-convention annotations to the standard library / runtime.
The general rule here is that something needs to be SWIFT_CC(swift)
if it's just declared in Swift code using _silgen_name, as opposed to
importing something via a header.

Of course, SWIFT_CC(swift) expands to nothing by default for now, and
I haven't made an effort yet to add the indirect-result / context
parameter ABI attributes.  This is just a best-effort first pass.

I also took the opportunity to shift a few files to just implement
their shims header and to demote a few things to be private stdlib
interfaces.
2016-05-04 10:31:23 -07:00
Chris Willmore
af0c7bd620 Initial implementation of SE-0054 "Abolish IUO Type" (#2322)
This is a squash of the following commits:

* [SE-0054] Import function pointer arg, return types, typedefs as optional

IUOs are only allowed on function decl arguments and return types, so
don't import typedefs or function pointer args or return types as IUO.

* [SE-0054] Only allow IUOs in function arg and result type.

When validating a TypeRepr, raise a diagnostic if an IUO is found
anywhere other thn the top level or as a function parameter or return
tpye.

* [SE-0054] Disable inference of IUOs by default

When considering a constraint of the form '$T1 is convertible to T!',
generate potential bindings 'T' and 'T?' for $T1, but not 'T!'. This
prevents variables without explicit type information from ending up with
IUO type. It also prevents implicit instantiation of functions and types
with IUO type arguments.

* [SE-0054] Remove the -disable-infer-iuos flag.

* Add nonnull annotations to ObjectiveCTests.h in benchmark suite.
2016-05-03 14:06:19 -07:00
Dmitri Gribenko
069efee426 stdlib: SE-0065: change UnsafeBufferPointer.Indices to CountableRange<Int>
CountableRange is cheaper than DefaultRandomAccessIndices.
2016-04-28 17:13:55 -07:00
Dmitri Gribenko
75d9d9118c stdlib: check associated types of LazyMap and LazyFilter 2016-04-28 12:05:03 -07:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Dmitri Gribenko
fc9c1f6a61 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-26 10:20:31 -07:00
Max Moiseev
28060f0fdf [stdlib][swift-3-indexing-model] fixing tests for Linux 2016-04-25 16:24:25 -06:00
Nate Cook
03d0dfc237 Add comment for resilience-related default case 2016-04-25 16:13:55 -05:00
Dmitri Gribenko
8e886a3bdd stdlib: ranges: remove range protocols
The RangeProtocol was a very weak and fragile abstraction because it
didn't specify the interpretation of the endpoints.  To write a
non-trivial algorithm, one usually needed to consult that information.
The standard library code only actually worked correctly with half-open
and closed ranges (and didn't handle fully open ranges, for example).

The other two protocols, HalfOpenRangeProtocol and ClosedRangeProtocol,
were only used for code sharing, and present an ABI burden.  We can use
gyb instead.
2016-04-22 18:15:06 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00
Dmitri Gribenko
fc8d62dfbb Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-18 14:40:06 -07:00
practicalswift
db452dcbe9 [gardening] "[ a, b ]" → "[a, b]" 2016-04-17 21:26:08 +02:00