Commit Graph

4494 Commits

Author SHA1 Message Date
swift-ci
37faf21f51 Merge pull request #18289 from Dante-Broggi/patch-6 2018-07-30 10:04:35 -07:00
swift-ci
be42f56e2c Merge remote-tracking branch 'origin/master' into master-next 2018-07-27 17:19:18 -07:00
Doug Gregor
ee1713ce67 [Standard library] Break up another “large” expression.
Bitwise arithmetic is a killer for the type checker :(. Shave off another
half second of typecheck time in the standard library.
2018-07-27 15:37:59 -07:00
Doug Gregor
6ffcbc5eff [Standard library] Faster formulation for the _HasherTailBuffer sanity check 2018-07-27 15:37:59 -07:00
Doug Gregor
fa9a24538f [Standard library] Ascribe types to some literals to improve typecheck time.
One expression in the new hashing implementation is going exponential,
accounting for a huge amount of type-checking type. Add (admittedly ugly)
“as UInt64” annotations to greatly reduce the time to type-check this
expression.

*Ahem* type-checking time for the standard library goes from 24s->14s with
this change. Added a type-checker “slow” performance test and captured
the problem in rdar://problem/42672946.
2018-07-27 14:10:49 -07:00
Joe Groff
b89ed05148 KeyPaths: Followup fix for computed component size 2018-07-27 13:16:14 -07:00
Joe Groff
c4806b5889 KeyPaths: Centralize alignment manipulations in helpers. 2018-07-27 13:15:49 -07:00
Joe Groff
f01c731a6b KeyPaths: Fix alignment skew issue when key path pattern ends with a less-than-pointer-aligned element. 2018-07-27 13:15:49 -07:00
Dante Broggi
6e5b471aad "if is RandomAccessCollection" is unnecessary
* remove the performance qualifiers on API redeclared from `Collection`, because they are necessarily satisfied.
2018-07-27 14:28:21 -04:00
swift-ci
f2623b8659 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 10:29:20 -07:00
Max Moiseev
26790d0c72 Merge pull request #18165 from moiseev/bidirectional-decls
[stdlib] Explicitly declare Collection requirements on child protocols
2018-07-26 10:15:16 -07:00
swift-ci
87fc9d2cf8 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 00:49:24 -07:00
swift-ci
128d33cb85 Merge pull request #18169 from ravikandhadai/InconsistentUnreachWarning 2018-07-26 00:37:33 -07:00
swift-ci
a39a50d142 Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 21:09:25 -07:00
Joe Groff
665bcb99a5 Merge pull request #18100 from jckarter/keypath-external-irgen
IRGen and runtime support for key path resilience.
2018-07-25 21:04:40 -07:00
swift-ci
e5e4bab96e Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 18:09:16 -07:00
Michael Ilseman
296ee295a1 [gardening] De-gyb Substring; NFC 2018-07-25 15:42:48 -07:00
Maxim Moiseev
7cbfed3f3a [stdlib] Explicitly declare Collection requirements on child protocols
Fixes: <rdar://problem/42408692> and SR-8022
2018-07-25 15:12:40 -07:00
Michael Ilseman
ba591b3f3c [stdlib] Drop some inlinability annotations.
ThreadLocalStorage is not accessible in an inlinable context, so drop
all such annotations. Also, drop a redundant one from Optional to
suppress a warning.

NFC
2018-07-25 15:04:48 -07:00
Joe Groff
4098aa02c7 KeyPaths: Support instantiating property descriptors with captured arguments. 2018-07-25 14:28:33 -07:00
Michael Ilseman
463e3747a8 [gardening] Factor out String bidi conformance
Add StringCharacterView.swift for String's bidi conformance. NFC.
2018-07-25 14:14:37 -07:00
Michael Ilseman
2195cda3ec [gardening] Rename StringUTFx.swift to StringUTFxView.swift 2018-07-25 14:09:45 -07:00
Michael Ilseman
4a66c4719f [gardening] Move string creation internals to StringCreate.swift
NFC
2018-07-25 14:05:46 -07:00
Ravi Kandhadai
81fad3c367 [Stdlib] Make the comparison operators (<, >, <= and >=) on concrete Int types transparent.
This makes all operators symmetric, and makes constant folding
and unreachable code analysis more precise and consistent.

<rdar://39516135>
2018-07-25 12:02:02 -07:00
Joe Groff
fceea87bf4 KeyPaths: Support instantiating generic property descriptors from concrete contexts.
This is a bit easier than the fully general case where both the external descriptor and local pattern have captured arguments (because of generics or subscript indices) since we don't have to combine the two argument files in one component.
2018-07-25 11:09:04 -07:00
Joe Groff
02fa6311ae KeyPaths: Centralize some flag testing logic. 2018-07-25 11:09:04 -07:00
Joe Groff
36882aae7a Remove test/stdlib/KeyPathImplementation test.
This was useful for bringup before compiler support for building key path patterns was implemented, but now it just hardcodes a bunch of implementation details that expose some internal details as ABI and interfere with refactorings. Remove it now that the same functionality is tested at a higher level.
2018-07-25 11:09:04 -07:00
Joe Groff
add80edea9 KeyPaths: Rationalize fragility attributes. 2018-07-25 11:09:04 -07:00
Joe Groff
3b9501a283 KeyPaths: Handle computed property descriptor instantiation w/o indexes or generics. 2018-07-25 11:09:04 -07:00
Joe Groff
e96472807f KeyPaths: Instantiate external property descriptors for stored properties. 2018-07-25 11:09:04 -07:00
Joe Groff
f1cd3122fc KeyPaths: Stub out support for instantiating external components with trivial descriptors. 2018-07-25 11:09:04 -07:00
swift-ci
e2a1a689de Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 11:08:56 -07:00
Stephen Canon
35db40c9f9 Make BinaryInteger._binaryLogarithm() return Int instead of Self (#18219)
Returning `Self` was probably a hack from when shifts were required to be homogenous and we didn't have good generic inits between integer types. Returning Int is more natural, because:

1. Dimensional analysis says that we shouldn't expect the logarithm to have the same type.
2. Int is guaranteed to be able to represent any object size, and BinaryInteger does not admit sparse representations, so the logarithm of the value cannot exceed allocated storage size.
3. Every single use case in the stdlib and tests is either unchanged or simplified by this change.
2018-07-25 14:04:32 -04:00
swift-ci
066dd10dfb Merge remote-tracking branch 'origin/master' into master-next 2018-07-24 20:49:47 -07:00
Ben Cohen
df22c3647c [stdlib] Build the standard library as Swift 5 (#18121)
* Update std lib to Swift 5.0

* Disable Unicode.* warnings for now

* Slow path to resiliently handle the case where an unknown rounding rule is passed

* Remove resilience from Encoding/DecodingError (which should only happen on slow paths anyway)

* internal typealiases now need @usableFromInline

* Force inlining on Array._owner.get
2018-07-24 20:47:58 -07:00
swift-ci
d98fd93c77 Merge remote-tracking branch 'origin/master' into master-next 2018-07-24 18:29:48 -07:00
Ben Cohen
345879429b [stdlib] Take several underscored stdlib functions private (#18134)
* Make _sanityCheck internal

* Make _debugPrecondition internal

* Make Optional._unsafelyUnwrappedUnchecked internal.

* Make _precondition internal

* Switch Foundation _sanityChecks to assertions

* Update file check tests

* Remove one more _debugPrecondition

* Update Optimization-with-check tests
2018-07-24 18:26:19 -07:00
swift-ci
36ead37964 Merge remote-tracking branch 'origin/master' into master-next 2018-07-24 17:49:02 -07:00
swift-ci
4edbd83576 Merge pull request #17923 from allevato/unicode-properties-docs 2018-07-24 17:45:06 -07:00
swift-ci
0dd8fb0061 Merge remote-tracking branch 'origin/master' into master-next 2018-07-23 23:09:57 -07:00
Nate Cook
3d7dfc232b [stdlib] Update complexity docs for seq/collection algorithms (#17254)
* [stdlib] Update complexity docs for seq/collection algorithms

This corrects and standardizes the complexity documentation for Sequence
and Collection methods. The use of constants is more consistent, with `n`
equal to the length of the target collection, `m` equal to the length of
a collection passed in as a parameter, and `k` equal to any other passed
or calculated constant.

* Apply notes from @brentdax about complexity nomenclature

* Change `n` to `distance` in `index(_:offsetBy:)`

* Use equivalency language more places; sync across array types

* Use k instead of n for parameter names

* Slight changes to index(_:offsetBy:) discussion.

* Update tests with new parameter names
2018-07-24 01:01:34 -05:00
swift-ci
9095b8762a Merge remote-tracking branch 'origin/master' into master-next 2018-07-23 10:29:27 -07:00
Ben Cohen
f4eae3fff0 Clean up debug printing code (#18126) 2018-07-23 10:11:37 -07:00
swift-ci
ad5dab2227 Merge remote-tracking branch 'origin/master' into master-next 2018-07-23 03:49:27 -07:00
Karoy Lorentey
9ff95733f4 Merge pull request #17974 from lorentey/hide-hashed-collection-details
[stdlib] Set/Dictionary: Make some implementation details non-inlinable
2018-07-23 11:40:37 +01:00
swift-ci
6f74f5bb5c Merge remote-tracking branch 'origin/master' into master-next 2018-07-21 17:49:44 -07:00
Ben Cohen
4694310e51 [stdlib] Some minor cleanup (#18130)
* Remove case destructuring to _

* Remove some Iterator.Element

* Which idiot wrote this? Oh.

* Switch NibbleSort to just use default impls... shouldn't change perf
2018-07-21 17:29:57 -07:00
swift-ci
1c77358086 Merge remote-tracking branch 'origin/master' into master-next 2018-07-20 14:29:50 -07:00
swift-ci
48eb400a93 Merge pull request #17826 from brentdax/public-optional 2018-07-20 14:12:55 -07:00
swift-ci
107dfa1aa5 Merge remote-tracking branch 'origin/master' into master-next 2018-07-19 15:09:31 -07:00