Commit Graph

8969 Commits

Author SHA1 Message Date
Alexander Belonogov
bf56b09395 [SR-6361] Fix Data.withUnsafeMutableBytes() for slices with length < range.lowerBound 2017-11-14 09:08:21 +01:00
Max Moiseev
759aad57c1 Merge pull request #12640 from moiseev/strides
[stdlib] Implement StrideTo and StrideThrough collections [WIP]
2017-11-13 14:15:09 -08:00
Itai Ferber
6e2e554a2f Merge pull request #12844 from itaiferber/codable-use-concrete-type-parameter
Use the concrete type parameter passed to JSON/plist decode
2017-11-13 13:09:39 -08:00
David Zarzycki
986beb7522 [CMake] Localize a build hack
The '-Wl,-z,defs' flag is useful, so let's disable it only where needed.
2017-11-13 07:40:54 -05:00
David Zarzycki
56a3aa97ac [Cross compile] Add missing standard include from C++ 2017-11-11 14:55:15 -05:00
Max Moiseev
9b98303a95 Temporarily add an O(N) underestimatedCount to StrideTo and StrideThrough 2017-11-09 14:42:04 -08:00
Itai Ferber
ae8f815f64 Use the concrete type parameter passed to JSON/plist decode 2017-11-09 13:06:00 -08:00
Jordan Rose
1598a21e43 DI: Warn on non-delegating cross-module struct initializers
...as detected by initializing an individual field without having
initialized the whole object (via `self = value`).

This only applies in pre-Swift-5 mode because the next commit will
treat all cross-module struct initializers as delegating in Swift 5.
2017-11-09 11:24:28 -08:00
Max Moiseev
67763cd92d Mark Stride collections as internal while waiting for conditional conformances 2017-11-09 11:16:06 -08:00
Sam Ding
1c2b2eb1ad fixed test case KeyPath.swift for s390x 2017-11-09 16:44:22 +00:00
Huon Wilson
b9336c7389 [IRGen] Dynamically fill in conditional conformance wtables.
This requires the witness table accessor function to gain two new parameters: a
pointer to an array of witness tables and their count. These are then passed down
to the instantiation function which reads them out of the array and writes them
into the newly-allocated witness table.

We use the count to assert that the number of conditional witness tables passed
in is what the protocol conformance expects, which is especially useful while
the feature is still experimental: it is a compiler/runtime bug if an incorrect
number is passed.
2017-11-08 17:02:50 -08:00
Pavel Yaskevich
cbee90cf5d Merge pull request #12812 from xedin/bring-back-function-metadata-changes
[IRGen] Improve function type metadata representation
2017-11-08 12:03:54 -08:00
Max Moiseev
e0ff7fe022 Merge pull request #12302 from moiseev/appkit-swift4
[overlay] Build AppKit overlay with Swift version 4
2017-11-08 11:48:40 -08:00
Greg Parker
9a38e609af [IRGen][runtime] Reduce object header to 8 bytes on 32-bit platforms. (#12790)
SR-4353, rdar://29765800
2017-11-08 02:50:11 -08:00
Pavel Yaskevich
cf0c757b1f [RemoteAST] Fix metadata reader to properly read function metadata 2017-11-07 17:56:11 -08:00
swift-ci
87021527b3 Merge pull request #12783 from natecook1000/nc-fixes-710-1 2017-11-07 14:23:59 -08:00
Pavel Yaskevich
be3d1af525 [ABI/Runtime] NFC: Rename function metadata arguments to parameters 2017-11-07 12:45:32 -08:00
Pavel Yaskevich
622cc1c64a [ABI/IRGen] Add custom function parameter flags representation for metadata use 2017-11-07 12:45:32 -08:00
Pavel Yaskevich
e9d4a5304e [IRGen] Fix function metadata endpoints to use separate parameter/flags arguments
Switch most general endpoint to be `flags, parameters, parameterFlags, result`,
instead of opaque `void **`, more specialized ones to use follow argument scheme:
`flags, param0, [flags0], ..., paramN, [flagsN], result` and store parameter/flags
information separately in `FunctionCacheEntry::{Key, Data}` as well.
2017-11-07 12:45:32 -08:00
Pavel Yaskevich
f5ed1a8759 [IRGen] Switch function metdata to use Metdata * for parameter references 2017-11-07 12:45:32 -08:00
Pavel Yaskevich
9b3739b91d [IRGen] Add parameter flags to function type metadata
Currently only single 'inout' flag has been encoded into function
metadata, these changes extend function metadata to support up to
32 flags per parameter.
2017-11-07 12:45:32 -08:00
Max Moiseev
0bc9c05b2f Use the ClosedRangeIndex for StrideThrough collections 2017-11-07 11:45:48 -08:00
Nate Cook
0b62b0608d [stdlib] Doc revisions
- Add missing docs & parameter lists
- Remove deprecated `characters` usage in examples
- Revise documentation for Mirror and CVarArg
- Revise documentation for swap(_:_:)
- Various typo and grammar fixes
2017-11-07 11:11:23 -06:00
Pavel Yaskevich
659c1bc2e0 Revert "[IRGen] Add parameter flags to function type metadata"
This reverts commit b33a6c7cdf.
2017-11-07 00:24:24 -08:00
Pavel Yaskevich
37185390f8 Revert "[IRGen] Switch function metdata to use Metdata * for parameter references"
This reverts commit 99f188e311.
2017-11-07 00:24:23 -08:00
Pavel Yaskevich
72bf180d0f Revert "[IRGen] Fix function metadata endpoints to use separate parameter/flags arguments"
This reverts commit 728d2a4c2f.
2017-11-07 00:24:22 -08:00
Pavel Yaskevich
aa89c4f4a8 Revert "[ABI/IRGen] Add custom function parameter flags representation for metadata use"
This reverts commit f6b0d2d2cf.
2017-11-07 00:24:21 -08:00
Pavel Yaskevich
4f354a7f09 Revert "[ABI/Runtime] NFC: Rename function metadata arguments to parameters"
This reverts commit 801b35e28c.
2017-11-07 00:24:20 -08:00
Pavel Yaskevich
e23a6f1359 Merge pull request #12500 from xedin/fn-metadata-changes
[IRGen] Improvements to function type metadata
2017-11-06 19:50:19 -08:00
Max Moiseev
1f7d155702 Use RandomAccessSlice for StrideToCollection.SubSequence 2017-11-06 15:59:04 -08:00
Max Moiseev
f00fb5d478 Relax the ClosedRangeIndex constraints 2017-11-06 15:59:04 -08:00
Max Moiseev
10f880c3dc [stdlib] Implement StrideTo and StrideThrough collections
In the absence of conditional conformances, they are now extra types
with different constraints, plus extra overloads to the
stride(from:to:by:) and stride(from:through:by:).
2017-11-06 15:59:04 -08:00
Max Moiseev
b49adc2398 Update UIKit
Changes simlar to those in AppKit.

<rdar://problem/34131288>
2017-11-06 15:52:52 -08:00
Max Moiseev
6cf8f9ba52 Extract operators into a protocol 2017-11-06 15:52:52 -08:00
Max Moiseev
e0f4985fbe Enable comparability and some numeric operations for specific wrapper types 2017-11-06 15:52:52 -08:00
Max Moiseev
d4d89d1854 Use swift 4 with the AppKit overlay 2017-11-06 15:52:52 -08:00
Nate Cook
dcf6e2b409 [stdlib] Fix FloatingPoint.init(exactly:) (#12739)
* [stdlib] Fix FloatingPoint.init(exactly:)

This initializer wasn't actually checking the exact conversion.

SR-4634, rdar://problem/31836766
2017-11-06 15:24:44 -08:00
Lance Parker
414614cf88 Revert "Revert "[stdlib]Enable Swift 4 mode for the overlays (#12608)"" (#12751)
This reverts commit bcf5d66c8e.
2017-11-06 14:03:48 -08:00
Mark Lacey
0b076faccd Merge pull request #12773 from rudkx/illegal-iuo-glibc
Another fix for an initialization using a cast involving an IUO.
2017-11-06 11:38:36 -08:00
Joe Groff
f8aef0a7e3 Merge pull request #12732 from jckarter/objc-class-metadata-unwrapping
[WIP] Runtime: Put ObjC class wrapper unwrapping behind a runtime call.
2017-11-06 11:32:15 -08:00
Pavel Yaskevich
801b35e28c [ABI/Runtime] NFC: Rename function metadata arguments to parameters 2017-11-06 11:16:46 -08:00
Pavel Yaskevich
f6b0d2d2cf [ABI/IRGen] Add custom function parameter flags representation for metadata use 2017-11-06 11:16:46 -08:00
Pavel Yaskevich
728d2a4c2f [IRGen] Fix function metadata endpoints to use separate parameter/flags arguments
Switch most general endpoint to be `flags, parameters, parameterFlags, result`,
instead of opaque `void **`, more specialized ones to use follow argument scheme:
`flags, param0, [flags0], ..., paramN, [flagsN], result` and store parameter/flags
information separately in `FunctionCacheEntry::{Key, Data}` as well.
2017-11-06 11:16:46 -08:00
Pavel Yaskevich
99f188e311 [IRGen] Switch function metdata to use Metdata * for parameter references 2017-11-06 11:16:46 -08:00
Pavel Yaskevich
b33a6c7cdf [IRGen] Add parameter flags to function type metadata
Currently only single 'inout' flag has been encoded into function
metadata, these changes extend function metadata to support up to
32 flags per parameter.
2017-11-06 11:16:46 -08:00
Mark Lacey
1236b4ece5 Another fix for an initialization using a cast involving an IUO.
Like the change in cbca1f23f6, this is not
allowed under SE-0054.
2017-11-06 08:34:42 -08:00
Arnold Schwaighofer
2e5b982c72 Merge pull request #12745 from aschwaighofer/runtime_swift_deallocUninitializedObject
runtime: Add and use swift_deallocUninitializedObject for uninitialized objects
2017-11-03 19:28:39 -07:00
Joe Groff
95d251051b Runtime: Put ObjC class wrapper unwrapping behind a runtime call.
This is a small code size win, and also gives us some abstraction so that future cooperative ObjC compilers/runtimes might be able to interoperate ObjC class objects with Swift type metadata efficiently than they currently are in the fragile Swift runtime.

While I'm here, I also noticed that swift_getObjCClassMetadata was unnecessarily getting exposed in non-ObjC-interop runtime builds, so I fixed that as well.
2017-11-03 10:18:38 -07:00
Arnold Schwaighofer
e7dbf7cc4d runtime: Add and use swift_deallocUninitializedObject for uninitialized objects
This is different from swift_deallocObject in that it applies to objects
at +1 while swift_deallocObject actually only applies to objects whose
state is deiniting (swift_release was called).
2017-11-03 09:44:07 -07:00
Arnold Schwaighofer
7489bf717d runtime: Fix swift_deallocBox
We need to set the object into deallocating state (+1 -> +0).
2017-11-03 08:43:14 -07:00