Commit Graph

7726 Commits

Author SHA1 Message Date
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
Karoy Lorentey
ea795a2ffb Merge pull request #17909 from lorentey/outline-arc-warmup
[stdlib] Make _stdlib_initializeReturnAutoreleased non-@inlinable
2018-07-13 20:07:18 +01:00
Matt Wright
1ff4ca0d41 dispatch_source_create returns NULL but is marked up as nonnull
dispatch_source_create is marked up as non-null but can actually return
null in programming error issues. In order to maintain the nullabilty
contract, these issues will now cause the overlay to assert and crash
rather than return a null pointer out of a non-null call.

Resolves: <rdar://problem/39937177>
2018-07-13 10:47:09 -07:00
swift-ci
829e88f371 Merge remote-tracking branch 'origin/master' into master-next 2018-07-13 09:19:33 -07:00
Jordan Rose
db4ceae85d Merge pull request #17910 from jrose-apple/better-class_getImageName
Override ObjC's class_getImageName to handle Swift classes

https://bugs.swift.org/browse/SR-1917
2018-07-13 08:56:27 -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
Jordan Rose
3ed3774e07 Override ObjC's class_getImageName to handle Swift classes
This not only restores the correct behavior for classes with generic
ancestry, but also handles actual generic classes as well. (This is
the function that backs Foundation's Bundle.init(for: AnyClass)
initializer.)

https://bugs.swift.org/browse/SR-1917
rdar://problem/33450609&40367300
2018-07-12 15:48:58 -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
Erik Eckstein
d62f4888ad Merge remote-tracking branch 'origin/master' into master-next 2018-07-12 11:25:42 -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
Ben Cohen
d82eed458e Migrate UnsafeMutableAudioBufferListPointer off _writeBackMutableSlice. (#17824)
The current behavior is the default you get "for free" from
MutableCollection so there's no good reason for accessing the std lib
file directly, and it requires access to std lib internals to do so.
2018-07-12 10:49:36 -07:00
swift-ci
a61c2a916f Merge remote-tracking branch 'origin/master' into master-next 2018-07-11 17:29:44 -07:00
Mike Ash
e4f8e6e79f Merge pull request #17879 from mikeash/fix-metadata-read-out-of-bounds
[Runtime] In various enumTagSinglePayload functions, don't read getEx traInhabitantIndex or storeExtraInhabitant unless it actually has extra inhabitants.
2018-07-11 20:21:34 -04: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
Mike Ash
b964cde3dc [Runtime] In various enumTagSinglePayload functions, don't read getExtraInhabitantIndex or storeExtraInhabitant unless it actually has extra inhabitants.
This code would previously read off the end of the allocated metadata to fetch these values. This was usually harmless, as the value was never used in that case. However, on rare occasions the metadata would be right before unmapped memory, and this read would crash trying to access that unmapped memory.

rdar://problem/39866044
2018-07-11 11:17:23 -04: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
Lance Parker
af68a30438 Merge pull request #17846 from lancep/deprecated_simulator_macro
[stdlib]Remove deprecated TARGET_IPHONE_SIMULATOR reference
2018-07-10 13:49:48 -07:00
swift-ci
b22fb292d2 Merge remote-tracking branch 'origin/master' into master-next 2018-07-10 13:29:21 -07:00
Mike Ash
8a2705548d Merge pull request #17709 from mikeash/fix-const-cast-warning
[Runtime] Fix a warning about casting away constness in _swift_getClassOfAllocated.
2018-07-10 16:26:18 -04: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
b3a08414f7 TARGET_IPHONE_SIMULATOR -> TARGET_OS_SIMULATOR 2018-07-09 14:53:31 -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
468e401436 Merge remote-tracking branch 'origin/master' into master-next 2018-07-09 12:29:36 -07:00
Michael Gottesman
493136267c Merge pull request #17815 from gottesmm/pr-861b0b35b2be7673bc8ea0c903f50247d1bc502b
[+0-all-args] Clean up remains of +1 convention from the runtime.
2018-07-09 12:24:36 -07:00
swift-ci
006c187c51 Merge remote-tracking branch 'origin/master' into master-next 2018-07-09 10:49:36 -07:00
Michael Ilseman
5358401d35 [string] Add UText shims; NFC
Add ICU shims for creating UTexts and performing grapheme breaking
using UTexts. This will allow us to explore multi-encoding grapheme
support throughout string.
2018-07-09 10:47:37 -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
Michael Gottesman
5648ef219d [+0-all-args] Clean up remains of +1 convention from the runtime. 2018-07-06 23:10:12 -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