Commit Graph

5277 Commits

Author SHA1 Message Date
Karoy Lorentey
b77351548a Merge pull request #21045 from lorentey/modify-vs-throw
[stdlib] Dictionary: Support throwing yields in _modify accessors
2018-12-07 17:08:42 +00:00
Saleem Abdulrasool
41d9c2cc59 stdlib: restructure for OS family layout of SDK overlay
The SDK directory is now confusing as the Windows target also has a SDK
overlay.  In order to make this more uniform, move the SDK directory to
Darwin which covers the fact that this covers the XNU family of OSes.
The Windows directory contains the SDK overlay for the Windows target.
2018-12-06 11:32:05 -08:00
Lance Parker
2b3eb6a1d6 Merge pull request #21029 from lancep/opaqueNormalizationTests
[stdlib]Add an opaque flavor of the normalization tests
2018-12-05 17:30:47 -08:00
Lance Parker
407a3fc34f Put the requires back in its place 2018-12-05 11:42:22 -08:00
Lance Parker
f051d6b9e4 added an opaque flavor of the normalization tests 2018-12-05 11:42:22 -08:00
Karoy Lorentey
ce96f1e528 [stdlib] _modify: Use defer to ensure invariants are restored when yield throws
_modify mustn’t leave Collection storage in an inconsistent state when the code to which we’re yielding happens to throw. In practice this means that any cleanup code must happen in defer blocks before the yield.

Fix Dictionary to do just that and add tests to cover this functionality (as well as some other aspects of _modify).
2018-12-05 17:35:24 +00:00
Michael Gottesman
0af0d5fddc [ownership] Replace ValueOwnershipKind::Trivial with ValueOwnershipKind::Any.
In a previous commit, I banned in the verifier any SILValue from producing
ValueOwnershipKind::Any in preparation for this.

This change arises out of discussions in between John, Andy, and I around
ValueOwnershipKind::Trivial. The specific realization was that this ownership
kind was an unnecessary conflation of the a type system idea (triviality) with
an ownership idea (@any, an ownership kind that is compatible with any other
ownership kind at value merge points and can only create). This caused the
ownership model to have to contort to handle the non-payloaded or trivial cases
of non-trivial enums. This is unnecessary if we just eliminate the any case and
in the verifier separately verify that trivial => @any (notice that we do not
verify that @any => trivial).

NOTE: This is technically an NFC intended change since I am just replacing
Trivial with Any. That is why if you look at the tests you will see that I
actually did not need to update anything except removing some @trivial ownership
since @any ownership is represented without writing @any in the parsed sil.

rdar://46294760
2018-12-04 23:01:43 -08:00
Ben Cohen
fc7830a4ed Remove Swift 3-only Compatibility Shims (#21019) 2018-12-04 18:22:27 -08:00
Lance Parker
da8ff3adee Merge pull request #20889 from lancep/NFC-codeunit-tests
Add tests for normalizing random unicode strings
2018-12-04 16:36:09 -08:00
Michael Ilseman
3e8b015afe Merge pull request #20983 from milseman/comparison_reform
[String] Comparison Speedups
2018-12-04 14:53:45 -08:00
Slava Pestov
e62795eda6 Merge pull request #21011 from slavapestov/post-commit-review-backward-deployment
Evolution: Code review feedback for backward deployment tests
2018-12-04 16:30:12 -05:00
Slava Pestov
a6f4c8a60d Evolution: Code review feedback for backward deployment tests 2018-12-04 15:13:44 -05:00
Lance Parker
135476d594 These tests require unicode 11 2018-12-04 11:25:04 -08:00
Mark Lacey
bcf046a5f9 Merge pull request #20998 from rudkx/scale-test-simd-add
Add a scale test for SIMD addition.
2018-12-03 21:55:29 -08:00
Mark Lacey
b41b1c04e3 Add a scale test for SIMD addition. 2018-12-03 20:26:32 -08:00
Slava Pestov
f5b448f75a Evolution: Add backward deployment tests 2018-12-03 20:36:03 -05:00
Slava Pestov
57c4dc3831 Evolution: Stylistic fixes for tests 2018-12-03 20:36:03 -05:00
Michael Ilseman
c0c530aef8 [String] Speed up constant factors on comparison.
Include some tuning and tweaking to reduce the constant factors
involved in string comparison. This yields considerable improvement on
our micro-benchmarks, and allows us to make less inlinable code and
have a smaller ABI surface area.

Adds more extensive testing of corner cases in our existing
fast-paths.
2018-12-03 15:49:38 -08:00
Michael Ilseman
94942c5b3b [String] Fix corner case in comparison fast-path. (#20937)
When in a post-binary-prefix-scan fast-path, we need to make sure we
are comparing a full-segment scalar, otherwise we miss situations
where a combining end-of-segment scalar would be reordered with a
prior combining scalar in the same segment under normalization in one
string but not the other.

This was hidden by the fact that many combining scalars are not
NFC_QC=maybe, but those which are not present in any precomposed form
have NFC_QC=yes. Added tests.
2018-12-03 10:41:45 -08:00
Stephen Canon
28962b5754 Move most of the simd operators into an optional module (#20914)
* Move most of the simd operators into an optional module

Adding simd to the stdlib caused some typechecker regressions. We can resolve them in the near-term by making the types universally available, but moving the arithmetic operators into a separate module that must be explicitly imported.

* Move two fuzzing tests back to fixed.

* Add SIMDOperators as a dependency for MediaPlayer.

* Move the .-prefixed operator declarations back into the stdlib.
2018-11-30 16:30:15 -05:00
Karoy Lorentey
1ef6cf4813 Merge pull request #20866 from lorentey/deprecate-hashValue-1
[test] Modernize hashing throughout the test suite
2018-11-30 14:21:04 +00:00
Slava Pestov
a5abb9d7ed Evolution: Add some tests for @_fixed_layout classes
@_fixed_layout classes have resilient vtables now, so we can add and
re-order methods.

Removing overrides is not legal though because they are subject to
devirtualization.
2018-11-29 23:20:02 -05:00
Slava Pestov
9af20c71f0 Evolution: Clean up superclass insertion tests a bit
- We don't want to support changing a root class of a class, so don't
  pretend that works. Some of these tests got removed recently in
  d8104e7e43 but one still remained.

- For the tests that insert a non-root superclass in the inheritance
  hierarchy, also test calling a method of the derived class. This
  works now that we no longer hardcode vtable offsets and instead use
  dispatch thunks.
2018-11-29 23:20:02 -05:00
Lance Parker
24e6a590b8 remove unecessary change to RUN: line 2018-11-29 15:32:17 -08:00
Lance Parker
dd700641d2 Add tests for normalizing random unicode strings 2018-11-29 14:53:01 -08:00
Stephen Canon
fb8b9e143d SIMD into stdlib
Implements SE-0229.

Also updates simd module types in the Apple SDKs to use the new types, and updates a couple tests to work with the new types and protocols.
2018-11-29 17:09:01 -05:00
Karoy Lorentey
666a22feff [test] Modernize hashing throughout the test suite 2018-11-29 17:38:29 +00:00
Saleem Abdulrasool
c9cf8fcd20 Merge pull request #20719 from compnerd/threading-extras
port SwiftPrivatePthreadExtras to Windows
2018-11-29 08:45:57 -08:00
Slava Pestov
547746719a Evolution: Test adding a new convenience init to an open class 2018-11-28 12:39:04 -05:00
Slava Pestov
e24c4c3f63 Evolution: Test that adding willSet/didSet to a stored property works 2018-11-28 12:39:04 -05:00
Slava Pestov
6028912131 Evolution: Test that adding or removing weak/unowned is a resilient change 2018-11-28 12:39:04 -05:00
Slava Pestov
890bf2eeed Evolution: Test adding a class deinit 2018-11-28 12:39:04 -05:00
Slava Pestov
16fccd6a51 Evolution: Test moving methods between class/struct and extension 2018-11-28 12:39:04 -05:00
Slava Pestov
0781ab85b6 Evolution: Add test changing a lazy property a computed property with a mutating getter 2018-11-28 12:39:04 -05:00
Slava Pestov
62d44a3a4f Evolution: Rename some tests in preparation for testing @_fixed_layout classes more 2018-11-28 12:39:04 -05:00
Andrew Trick
ff132a711f Merge pull request #20630 from atrick/fix-quadratic-block-merge
Fix block merging after inlining to be linear, not quadratic.
2018-11-27 11:08:59 -08:00
Jordan Rose
db7529fa5c Merge pull request #20784 from jrose-apple/generated-nine-out-of-ten
[CMake] Conditionalize generation of .swiftinterface files
2018-11-27 09:09:55 -08:00
Doug Gregor
411c124248 Merge pull request #20776 from DougGregor/remangle-old-ext-generic-args
[Mangle] Include generic arguments of extensions for the Objective-C runtime
2018-11-26 20:18:36 -08:00
Jordan Rose
605c9f619f [CMake] Conditionalize generation of .swiftinterface files
SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.

rdar://problem/44942414
2018-11-26 17:04:46 -08:00
Andrew Trick
8de89c392a Add a scale-test validation test for quadratic behavior during inlining.
Adds a stat to SILInstruction's transferNodesFromList to record the
number of times an instruction is transfered to another block. This is
the only way I can think of to detect quadratic behavior of passes
that split basic blocks.
2018-11-26 15:24:41 -08:00
swift-ci
68884b286c Merge pull request #20768 from milseman/empty_range 2018-11-26 14:59:06 -08:00
Doug Gregor
cfc0f892e3 [Mangle] Include generic arguments of extensions for the Objective-C runtime
The remangler for the Objective-C runtime was dropping generic arguments
of extension contents, leading to collisions with @objc class names.
Include the generic arguments of extensions.

Fixes rdar://problem/45956357.
2018-11-26 13:51:40 -08:00
Saleem Abdulrasool
ce40d72641 stdlib: implement _stdlib_pthread_join in terms of Windows threading
Implement `_stdlib_pthread_join` in terms of windows threading.
Additionally, rename it to `_stdlib_thread_join`.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
6bf7b9e711 stdlib: implement _stdlib_create_pthread_block in terms of Windows threaing
Port the block based thread constructor to Windows threading model, and
rename it to `_stdlib_create_thread_block`.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
65bdce00b6 stdlib: rename _stdlib_PTHREAD_BARRIER_SERIAL_THREAD -> _stdlib_THREAD_BARRIER_SERIAL_THREAD 2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
7b06586fe1 stdlib: rename _stdlib_pthread_barrier_t to _stdlib_thread_barrier_t 2018-11-26 13:09:49 -08:00
Saleem Abdulrasool
940db1b0cf stdlib: remove pthread_attr_t from _stdlib_pthread_create_block
The attributes were not being used currently.  Since this is a private
interface, remove the parameter as it makes it easier to port to
Windows.
2018-11-26 13:09:31 -08:00
Saleem Abdulrasool
82360c6b27 stdlib: remove pthread_barrier attributes
These were not in use, and removing this from the signature makes it
possible to re-use the exact signature on Windows more easily.
2018-11-26 13:09:31 -08:00
Saleem Abdulrasool
0693bec1f1 sdlib: rename SwiftPrivatePthreadExtras to SwiftPrivateThreadExtras
This is in preparation to make the code here more target agnostic for
porting to the Windows threading primitives.  This is used pretty
extensively in the tests, so disabling tests would lose a chunk of
coverage.
2018-11-26 13:09:31 -08:00
Doug Gregor
d5f6d7f2cb Merge pull request #20491 from DougGregor/runtime-conformance-descriptor-cache
[Runtime] Cache protocol conformance descriptors, not witness tables.
2018-11-26 12:56:23 -08:00