Commit Graph

4464 Commits

Author SHA1 Message Date
Tony Allevato
5352545f9c Apply review feedback 2018-07-16 18:00:39 -07:00
swift-ci
928ed50802 Merge remote-tracking branch 'origin/master' into master-next 2018-07-16 16:09:09 -07:00
Ben Cohen
57528ef458 De-gyb Stride.swift (#17956) 2018-07-16 16:02:22 -07:00
swift-ci
b4ebb5f916 Merge remote-tracking branch 'origin/master' into master-next 2018-07-16 12:49:11 -07:00
Michael Munday
e50f3ba592 [stdlib] Fix exact floating point to integer cast overflow detection (#16960)
LLVM specifies that the result of fptosi and fptoui instructions are
undefined if the target type cannot represent the value exactly. On
IBM Z (s390x) these instructions currently saturate when overflow
occurs. This means that the round-trip used to detect overflow
succeeds in situations where the conversion is not actually exact.

For example, casting Int32.max to a Float32 via a sitofp instruction
results in Int32.max + 1. This is inexact. However if we then convert
back to an Int32 via a fptosi instruction the result is clamped to
Int32.max and so the round trip has resulted in the same value. We
therefore cannot rely on round trips alone to verify the exactness
of this cast portably.

This commit modifies the conversion routines so that they do not
rely on undefined behavior and avoid using round trips in general.
2018-07-16 12:32:43 -07:00
swift-ci
c7a4d5fd76 Merge remote-tracking branch 'origin/master' into master-next 2018-07-16 08:29:07 -07:00
Ben Cohen
b77b544cdc Remove remaining @ininable from @_transparent (#17968) 2018-07-16 08:12:52 -07:00
swift-ci
895d5c4667 Merge remote-tracking branch 'origin/master' into master-next 2018-07-15 14:39:12 -07:00
Ben Cohen
bd7171bedf [stdlib] De-gyb Sort (#17954)
* [stdlib] De-gyb Sort
2018-07-15 14:23:06 -07:00
swift-ci
e9b00394f2 Merge remote-tracking branch 'origin/master' into master-next 2018-07-14 22:49:04 -07:00
Daiki Matsudate
a3552f393e [stdlib] Add compactMapValues(_:) to Dictionary (#15017)
add compact map values on hashed collections
2018-07-14 22:35:16 -07:00
swift-ci
b3490042bf Merge remote-tracking branch 'origin/master' into master-next 2018-07-14 22:29:11 -07:00
Ben Cohen
a8328a820f Factor a couple more universal inits into _Pointer (#17952) 2018-07-14 22:14:27 -07:00
swift-ci
ad8ce7e56f Merge remote-tracking branch 'origin/master' into master-next 2018-07-14 16:29:03 -07:00
Mark Lacey
51f8c93f58 Merge pull request #17918 from rudkx/remove-inc-dec-operators
Remove the '++' and '--' operators.
2018-07-14 16:27:57 -07:00
swift-ci
aef1ed620b Merge remote-tracking branch 'origin/master' into master-next 2018-07-14 07:59:20 -07:00
Ben Cohen
436b8610e7 [stdlib][WIP] Factor out common parts of pointer types and de-gyb (#17951)
* Add conformances to _Pointer and remove from pointer types

* De-gyb pointer files
2018-07-14 07:36:45 -07:00
swift-ci
a14d1db34b Merge remote-tracking branch 'origin/master' into master-next 2018-07-13 12:09:09 -07:00
Tony Allevato
f99109c552 [stdlib] NFC: Unicode.Scalar.Properties documentation fixes 2018-07-12 21:32:05 -07:00
Brent Royal-Gordon
b6e35038b2 [SILGen] Output a different message for failed IUO force-unwraps
Modifies SILGen and the `Swift._diagnoseUnexpectedNilOptional` call to print a slightly different message for force unwraps which were implicitly inserted by the compiler for IUOs. The message is chosen based on the presence of certain flags in the `ForceValueExpr`, not on the type of the value being unwrapped.
2018-07-12 19:09:56 -07:00
Mark Lacey
8ee52763f0 Remove the '++' and '--' operators.
We still had unavailable versions of these for floating-point types
only. We shouldn't need to keep these around, and can instead just
emit a helpful diagnostic for anyone that attempts to use them.

Unfortunately I don't see any way for the diagnostic to produce an
actual fix-it, so it just suggests '+= 1' or '-= 1' without actually
producing a fix.
2018-07-12 15:46:57 -07:00
Karoy Lorentey
cedfdaea0a [stdlib] Make _stdlib_initializeReturnAutoreleased non-@inlinable
This is merely a helper for StdlibUnittest; there is no reason to leave it inlinable.
2018-07-12 19:20:47 +01:00
swift-ci
1b7ad99e75 Merge remote-tracking branch 'origin/master' into master-next 2018-07-11 13:30:09 -07:00
Michael Ilseman
30450671fa Merge pull request #15593 from allevato/unicode-properties
[SE-0211] Add Unicode properties to Unicode.Scalar
2018-07-11 13:27:31 -07:00
swift-ci
f63e7973f0 Merge remote-tracking branch 'origin/master' into master-next 2018-07-11 09:49:18 -07:00
Arnold Schwaighofer
bf47f1b2d3 Never inline _stdlib_isOSVersionAtLeast
Follow-up to "AllocStackHoisting: Don't hoist alloc_stacks in the presence of
an availability guard". The standard libary could use availability macros in the
future.
2018-07-11 07:20:54 -07:00
swift-ci
c24b0839ad Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 15:59:27 -07:00
Michael Ilseman
88fb124643 Merge pull request #17835 from milseman/nfc
[stdlib] Some stubs and trivial refactorings; NFC
2018-07-10 15:10:22 -07:00
swift-ci
c0e8c409af Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 14:40:00 -07:00
swift-ci
3227916ba3 Merge pull request #17858 from aschwaighofer/fix_alloc_stack_hoisting_availability 2018-07-10 14:23:17 -07:00
Lance Parker
7c0ff47487 Merge pull request #17809 from lancep/kill_PointerFunction
[stdlib]remove _PointerFunction
2018-07-10 13:50:43 -07:00
Arnold Schwaighofer
0330ec0fd5 AllocStackHoisting: Don't hoist alloc_stacks in the presence of an availability guard
This disables inlinability of _stdlib_isOSVersionAtLeast. I don't see
value in making it inlinable as long as _swift_stdlib_operatingSystemVersion is
opaque.

rdar://41849700
2018-07-10 12:04:07 -07:00
swift-ci
8c0962f483 Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 11:49:21 -07:00
Lance Parker
6c0d325805 Merge pull request #17841 from lancep/print_mismatched_types
[stdlib]Better error message for Arrays with mismatched types
2018-07-10 11:33:43 -07:00
Lance Parker
ff9b80688f made initializeNewElements non-Optional 2018-07-10 11:05:27 -07:00
swift-ci
c566072cd5 Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 08:49:31 -07:00
Nate Cook
92900d4e7d Add an array initializer with access to uninitialized storage (#17774)
* Add an Array initializer for using an uninitialized capacity.

* Add tests for reserveCapacity & init(_unsafeUninitializedCapacity:...:)
2018-07-10 10:34:57 -05:00
Tony Allevato
b454e8d0f4 Make emoji properties Darwin only.
Ubuntu 16.04 doesn't have a recent enough ICU to support these; we need a better long-term solution, such as bundling ICU with the toolchain.
2018-07-09 18:42:42 -07:00
Lance Parker
6375508c92 print the types involved when the array's element type doesn't meet expectations 2018-07-09 13:07:15 -07:00
swift-ci
006c187c51 Merge remote-tracking branch 'origin/master' into master-next 2018-07-09 10:49:36 -07:00
Michael Ilseman
ac09eaa8c7 [stdlib] Refactor out impl methods of BidiCollection; NFC.
Refactor out the implementation of index(_:offsetBy) and others from
BidirectionalCollection so that conformers can choose to invoke the
default implementations explicitly. This is very useful for types such
as String which have common fast-paths to check before falling back on
the general approach.
2018-07-09 10:45:04 -07:00
Stephen Canon
4a89062efd Require .upperBound - .lowerBound be finite for FloatingPoint random (#17833)
This is a slightly conservative precondition; when we re-work the FloatingPoint random computation in a more principled fashion, we can relax this to only requiring that .upperBound and .lowerBound are both finite. However, the current computation will break down unless this conservative condition is used, and this is future proof--we will only relax it going forward.
2018-07-09 13:40:34 -04:00
Lance Parker
4c3bc53a4c put back _sanityCheck 2018-07-09 10:18:17 -07:00
swift-ci
73dea94f21 Merge remote-tracking branch 'origin/master' into master-next 2018-07-07 08:49:45 -07:00
Ben Cohen
a6952decab [stdlib] Remove inlineable annotation from transparent functions (#17800)
* Remove inlineable annotation from transparent functions
2018-07-07 08:47:02 -07:00
Lance Parker
0ccf21f9f1 remove _PointerFunction 2018-07-06 16:28:26 -07:00
swift-ci
d699e8cce0 Merge remote-tracking branch 'origin/master' into master-next 2018-07-06 13:09:52 -07:00
Ben Cohen
422ff83907 Inlineable: trivial implementation 2018-07-06 12:05:30 -07:00
Ben Cohen
eeb6721fb6 Inlineable: unsafe performance 2018-07-06 12:05:29 -07:00
Ben Cohen
c6b41a5ae5 Inlineable: protocol interface only 2018-07-06 12:03:34 -07:00