Commit Graph

3744 Commits

Author SHA1 Message Date
Xiaodi Wu
9fac17e6e2 Fix bug in String(_:radix:uppercase:) 2018-01-06 03:27:17 -06:00
Pavel Yaskevich
12980335cd [CSRanking] Fix self types to be unrelated when comparing operator decls
Such declarations should already have self bound as one of the parameters
which would enforce subtype relationship.

Resolves: rdar://problem/36333688
2018-01-05 23:24:24 -08:00
Doug Gregor
e04ded99c9 Merge pull request #13764 from DougGregor/type-by-mangled-name
[Runtime] Retrieve type metadata given a mangled name
2018-01-05 18:31:19 -08:00
Max Moiseev
5a01af3da8 Merge pull request #13736 from moiseev/rrc-ops
[stdlib] Rearrange + on RangeReplaceableCollection/Sequence once again
2018-01-05 16:04:43 -08:00
Doug Gregor
7148e84099 [Runtime] Stub out the implementation of _typeByMangledName().
Introduce a standard library/runtime entry point that produces type metadata
given a mangled name, based on the TypeDecoder logic lifted from the remote
mirrors library.

Implement support for tuple types as a proof-of-concept.
2018-01-05 15:42:45 -08:00
Nate Cook
0782b482b3 [stdlib] Documentation improvements
- Revise Equatable and Hashable for synthesized requirements
- Complete Strideable and stride(from:...:by:) documentation
- Revise DoubleWidth type docs
- Add complexity notes for Set.index(of:) and .contains(_:)
- Fix typos in Set.formUnion docs
- Add missing axioms for SetAlgebra (SR-6319)
- Improve guidance for description and debugDescription
- Add note about the result of passing duplicate keys to
  Dictionary(uniqueKeysWithValues:)
- Fix typo in BinaryInteger docs
- Update Substring docs with better conversion example
- Improve docs for withMemoryRebound and isKnownUniquelyReferenced
- Add missing docs not propagated from protocols
2018-01-05 17:06:44 -06:00
swift-ci
81879f54e4 Merge pull request #12809 from natecook1000/nc-gyb-codable 2018-01-04 23:48:12 -08:00
Nate Cook
b2f75d5970 [stdlib] Add documentation for concrete Codable methods 2018-01-05 00:29:50 -06:00
Max Moiseev
9bf8d773ab [stdlib] Rearrange + on RangeReplaceableCollection/Sequence once again 2018-01-04 13:58:45 -08:00
swift-ci
9fbd809c5f Merge pull request #13548 from xwu/toil-and-trouble 2018-01-04 12:02:45 -08:00
swift-ci
ceba366a07 Merge pull request #13305 from Dante-Broggi/master 2018-01-04 11:41:01 -08:00
Max Moiseev
8246ce8b20 Merge pull request #13697 from moiseev/static-func-ops-rrc
[stdlib] Free function + into static func +
2018-01-04 11:24:56 -08:00
Xiaodi Wu
5236a37df8 Make some improvements to DoubleWidth.&<<= and &>>= 2018-01-03 21:54:05 -06:00
swift-ci
4dbf89b91a Merge pull request #13703 from moiseev/sequence-plus 2018-01-03 17:47:12 -08:00
Max Moiseev
e8a8067f71 [stdlib] Move a + overload from extension String to extension Sequence 2018-01-03 16:18:57 -08:00
Max Moiseev
f764ff33db Fix an @available attribute 2018-01-03 16:15:23 -08:00
Ben Cohen
c7e05cb21e [stdlib][Gardening] Delete few rogue IndexDistance numericCasts that slipped through (#13684) 2018-01-03 15:53:28 -08:00
Max Moiseev
fe48e8c662 [stdlib] Free function + into static func + 2018-01-03 14:09:14 -08:00
swift-ci
9512d3ea20 Merge pull request #13111 from tdimeco/underestimatedcount-docs 2018-01-02 16:24:02 -08:00
Chris Lattner
415cd50ba2 Reduce array abstraction on apple platforms dealing with literals (#13665)
* Reduce array abstraction on apple platforms dealing with literals

Part of the ongoing quest to reduce swift array literal abstraction
penalties: make the SIL optimizer able to eliminate bridging overhead
 when dealing with array literals.

Introduce a new classify_bridge_object SIL instruction to handle the
logic of extracting platform specific bits from a Builtin.BridgeObject
value that indicate whether it contains a ObjC tagged pointer object,
or a normal ObjC object. This allows the SIL optimizer to eliminate
these, which allows constant folding a ton of code. On the example
added to test/SILOptimizer/static_arrays.swift, this results in 4x
less SIL code, and also leads to a lot more commonality between linux
and apple platform codegen when passing an array literal.

This also introduces a couple of SIL combines for patterns that occur
in the array literal passing case.
2018-01-02 15:23:48 -08:00
Thomas Di Meco
ea49459b75 [stdlib] Updated underestimatedCount doc related to complexity
There were inconsistencies in the documentation about the complexity of the underestimatedCount property.
2018-01-02 18:48:29 +01:00
Xiaodi Wu
cf179dada0 Fix a bug with unsigned integers in FixedWidthInteger._convert(from:) 2018-01-01 14:56:17 -06:00
Xiaodi Wu
b7ef345c88 Update DoubleWidth.hashValue to align with derived hashValue algorithm 2018-01-01 14:56:16 -06:00
Xiaodi Wu
869b9257cc Clean up DoubleWidth implementation 2018-01-01 14:56:16 -06:00
Slava Pestov
1704e9320b Merge pull request #13575 from slavapestov/fix-linux-resilient-build
stdlib: Fix resilient build on Linux
2017-12-21 17:32:27 -08:00
swift-ci
2c7ccd08a1 Merge pull request #13579 from DougGregor/flatten-collection-index-reqs 2017-12-21 11:50:41 -08:00
Doug Gregor
fc253e8a23 [Stdlib] Fix requirements on FlattenCollectionIndex.
FlattenCollectionIndex recently became a typealias, but overstated its
requirements.
2017-12-21 10:07:11 -08:00
Karoy Lorentey
f481530a92 Merge pull request #13056 from xwu/much-of-a-muchness
[stdlib/Sema/AST] Adopt a commonly used implementation for combining hashes
2017-12-21 18:27:56 +01:00
Slava Pestov
d0d4b61837 stdlib: Fix resilient build on Linux 2017-12-20 23:42:08 -08:00
Doug Gregor
077a8a10d4 [Sequence] Add default Iterator typealias for Sequences that are also Iterators 2017-12-20 23:11:51 -08:00
Doug Gregor
cf89ea77f1 Introduce _Default_Indices typealias into RandomAccessCollection.
Use the new `_Default_Foo` typealias trickery to define a conditional
default type witness for the collection `Indices` associated type, so
`Indices` becomes `CountableRange<Index>` when the `Index` type is
`Strideable` with `Int` as its `Stride` type.

This fixes the major regression with associated type inference for
“minimal” random access collection types with `Int` index types, which
has come up in a number of places.

Note that I dropped the `@_implements` requirement because `_Default_Foo`
is already off in its own namespace, and eventually we should get a real
syntax for this.

Fixes rdar://problem/35035322.
2017-12-20 23:11:51 -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
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -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
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
swift-ci
9633c91146 Merge pull request #13082 from glessard/patch-1 2017-12-12 10:14:53 -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