Commit Graph

8969 Commits

Author SHA1 Message Date
Max Moiseev
2aa3583e1f [tests] Remove unnecessary test output 2017-12-20 11:22:54 -08:00
Max Moiseev
d4359b83c7 Merge pull request #12819 from moiseev/filtermap
[stdlib] Introduce compactMap and deprecate one flatMap variant
2017-12-19 17:06:32 -08:00
swift-ci
4be14da2c0 Merge pull request #13542 from moiseev/flatten-tests 2017-12-19 16:53:15 -08:00
swift-ci
ed1db5f73f Merge pull request #13540 from DougGregor/infer-from-concrete-sr-6640 2017-12-19 15:36:42 -08:00
Max Moiseev
f5e93f63e9 [tests] Add conformance tests for FlattenSequence/FlattenCollection 2017-12-19 14:58:25 -08:00
swift-ci
4ffbd12635 Merge pull request #13355 from xwu/lilliput-and-blefuscu 2017-12-19 14:52:32 -08:00
Doug Gregor
a55adb2622 [Standard library] Remove extraneous associated type defaults.
These are no longer required by associated type inference.
2017-12-19 13:03:51 -08:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
Doug Gregor
b85be28611 [Runtime] Print demangled names in conditional conformances warning. 2017-12-19 10:30:00 -08:00
Doug Gregor
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -08:00
Doug Gregor
7f09b36015 [Runtime] Warn about dynamically querying conditional conformances.
Rather than silently returning "false" when we are unable to attempt
to satisfy a conditional conformance at runtime, produce a runtime
warning first, to note to users that this behavior is incorrect and
will change in the future.
2017-12-18 22:52:39 -08:00
Pavel Yaskevich
9616f53fe7 [Demangle/Metadata] Fix buildDemanglingForMetadata to construct function/tuple trees correctly
While creating demangled tree for function and tuple types
`_swift_buildDemanglingForMetadata` should use correct format
established by mangler and respected by printer/demangler.
2017-12-18 15:45:50 -08:00
Pavel Yaskevich
10c385d1b7 [Mangling/ABI] Add special LabelList to store parameter labels
Instead of mangling parameter labels as part of the function type
move them to the end of the function name instead, to match the
language semantics.
2017-12-18 15:44:24 -08:00
Ben Cohen
9361a6b66f [stdlib] Nest Iterator and Index types for various stdlib types (#13489)
* Nest various top-level Iterator and Index types, and flatten extensions.

* Fix tests from nesting iterator

* Nest Unsafe*BufferPointer.Iterator, extensionify UnsafeBufferPointer

* Degyb LazyCollection

* Nest Flatten iterator and index
2017-12-18 15:27:35 -08:00
Maxim Moiseev
128092a7d6 Rename filterMap to compactMap 2017-12-18 09:22:41 -08:00
Max Moiseev
8ec6c45d2d Use filterMap to avoid deprecation warnings 2017-12-18 09:16:37 -08:00
Max Moiseev
6f7aecd030 [stdlib] Introduce filterMap and deprecate one flatMap variant
This is the implementation of
[SE-0187](https://github.com/apple/swift-evolution/blob/master/proposals/0187-introduce-filtermap.md)

<rdar://problem/34918180>
2017-12-18 09:16:37 -08:00
Max Moiseev
c27b366f46 [stdlib] Utilize conditional conformances for FlattenCollection (#13476)
* [stdlib] Utilize conditional conformances for FlattenCollection

* Fix indentation [NFC]
2017-12-16 10:57:02 -08:00
Erik Eckstein
5d1827b5ba Remove a wrong assert in the specializer.
In case of partial specialization, the replacement type of a substitution can be generic.
I couldn't find a small unit test for this bug fix. But it is tested by compiling the stdlib with the change in Collection.swift.

rdar://problem/36033852
2017-12-14 15:28:07 -08:00
Arsen Gasparyan
c4c1589b84 Make expectCrash(executing:_) safer 2017-12-14 15:31:30 +03:00
Arsen Gasparyan
5d6935af04 Rename param name in expectCrash function 2017-12-13 21:23:33 +03:00
Arsen Gasparyan
a6d2c2f05d Add expectCrash function to StdlibUnittest 2017-12-13 12:16:25 +03:00
Thomas Roughton
f10ef1ab9a [runtime] Always use SwiftCC (#13311) 2017-12-12 17:11:38 -08:00
swift-ci
9633c91146 Merge pull request #13082 from glessard/patch-1 2017-12-12 10:14:53 -08:00
Max Moiseev
e920a1cbdf Merge pull request #13379 from moiseev/bnns-availability
[overlay] Add more explicit availabilities to BNNS
2017-12-12 09:55:52 -08:00
Joe Groff
e353f76db0 Merge pull request #13373 from jckarter/ntd-trailing-objects
Runtime: Refactor NominalTypeDescriptor to use TrailingObjects.
2017-12-11 20:04:00 -08:00
Greg Parker
96c0ef6e48 [runtime] Clean up an unnecessary C++ template trampoline. (#13381) 2017-12-11 19:26:52 -08:00
Max Moiseev
aa320815b5 [overlay] Add more explicit availabilities to BNNS
Fixes <rdar://problem/35914058>
2017-12-11 16:52:59 -08:00
Joe Groff
fe192c6daf Runtime: Refactor NominalTypeDescriptor to use TrailingObjects.
NFC intended. The layout of trailing matter here is getting fairly complex, so it's good to use LLVM's existing library code to keep track of it. We use a fork of llvm's TrailingObjects.h header so that future changes to LLVM don't disturb the ABI of Swift runtime objects that use the template.
2017-12-11 16:26:29 -08:00
Max Moiseev
fd4e8667ed Implement a custom distance(from:to:) for LazyFilterCollection 2017-12-11 11:31:37 -08:00
Max Moiseev
25a28bc048 Enforce forward collection preconditions in LazyFilterCollection
(cherry picked from commit 229dcd6275)
2017-12-11 10:46:55 -08:00
Max Moiseev
f2f103d56d Rearrange code in LazyFilterCollection and provide delegating overrides
(cherry picked from commit 1388064e37)
2017-12-11 10:46:50 -08:00
Max Moiseev
1c75bd2433 Conditional conformances for LazyCollection
(cherry picked from commit 6e7b36a66c)
2017-12-11 10:46:40 -08:00
Max Moiseev
9e73d092ea Fix tests
(cherry picked from commit a1b1778c53)
2017-12-11 10:46:35 -08:00
Max Moiseev
1f78f3927b [stdlib] Conditional conformances for LazyMapCollection
(cherry picked from commit b927254564)
2017-12-11 10:46:30 -08:00
Max Moiseev
ea02806f28 [stdlib] Conditional conformances for LazyFilterCollection
(cherry picked from commit 833721a172)
2017-12-11 10:46:25 -08:00
Graydon Hoare
62a6b74ad1 Revert "[stdlib] Conditional conformances for Lazy[Filter|Map]Collection" 2017-12-10 12:48:36 -08:00
Xiaodi Wu
81311bebf8 Match memory layout of DoubleWidth to base integer types 2017-12-10 02:30:40 -06:00
swift-ci
a93717988c Merge pull request #13211 from compnerd/COFF-registration 2017-12-09 14:41:41 -08:00
Saleem Abdulrasool
899103cfa8 COFF: restructure metadata registration
Restructure the COFF metadata handling to use the linker section
grouping to emit section start/stop markers in the appropriate location.
This allows us to lookup the sections statically without having to the
walk the entire image structure.

Introduce a constructor for PE/COFF binaries.  This will ensure that the
registration occurs for all modules appropriately.  This should resolve
rdar://problem/19045112.  The registration should occur prior to
`DllMain` being invoked from `DllMainCRTStartup`.
2017-12-08 16:15:07 -08:00
Slava Pestov
48a8b2655a Merge pull request #13338 from slavapestov/class-resilience-part-4
Class resilience part 4
2017-12-08 15:38:23 -08:00
Max Moiseev
7d0b73a253 Merge pull request #13199 from moiseev/conditional-collections
[stdlib] Conditional conformances for Lazy[Filter|Map]Collection
2017-12-08 14:07:12 -08:00
Slava Pestov
ffabf60118 IRGen: Hollow out generic class templates
Don't emit placeholders for field offsets and vtable entries,
since they were always null. Instead, calculate the final size
of class metadata at runtime using the size of the superclass
metadata and the number of immediate members, and only copy
this prefix from the template to the instantiated metadata,
zero-filling the rest.

For this to work with non-generic resilient classes and
non-generic subclasses of generic classes, we need a new
runtime entry point to relocate non-generic class metadata,
calculating its size at runtime using the same strategy.
2017-12-08 13:50:56 -08:00
swift-ci
5891a6d0f5 Merge pull request #13315 from ikesyo/os-macos 2017-12-08 13:43:26 -08:00
Max Moiseev
e4f94a318f [stdlib] Improve default implementation of Collection.distance(from:to:)
(cherry picked from commit 72948cae9a)
2017-12-08 13:07:07 -08:00
Max Moiseev
229dcd6275 Enforce forward collection preconditions in LazyFilterCollection 2017-12-08 13:07:07 -08:00
Max Moiseev
1388064e37 Rearrange code in LazyFilterCollection and provide delegating overrides 2017-12-08 13:04:28 -08:00
Max Moiseev
6e7b36a66c Conditional conformances for LazyCollection 2017-12-08 12:53:24 -08:00
Max Moiseev
a1b1778c53 Fix tests 2017-12-08 12:53:24 -08:00
Max Moiseev
b927254564 [stdlib] Conditional conformances for LazyMapCollection 2017-12-08 12:52:12 -08:00