Commit Graph

1226 Commits

Author SHA1 Message Date
Joe Groff
c748ba6c12 Merge pull request #3870 from jckarter/no-bridged-default-literal-types
Sema: Don't try bridged classes as default literal types.
2016-07-29 22:16:53 -07:00
Robert Widmann
b79fa44da5 Merge pull request #3878 from CodaFi/decltype
[SE-0096] Implement type(of:)
2016-07-29 18:05:01 -07:00
Dave Abrahams
f06a9a1154 Merge 'origin/master' into new-integer-protocols 2016-07-29 17:52:49 -07:00
Doug Gregor
b9363fe6bd [SE-0111] Enable SE-0111 by default. 2016-07-29 17:28:24 -07:00
Robert Widmann
4f465224ea Polish off uses of dynamicType in tests 2016-07-29 16:59:14 -07:00
Dmitri Gribenko
99dffd7682 Merge pull request #3854 from rintaro/SE-0101-memorylayout
[SE-0101] Implement: Reconfiguring sizeof and related functions into a unified MemoryLayout struct - Part 1
2016-07-29 15:56:27 -07:00
Joe Groff
11f03cd8b5 Sema: Don't try bridged classes as default literal types.
One last bit of SE-0072. We shouldn't fall back to bridged classes in the absence of type context for literals anymore. By itself, this kind of hoses the use of literals with NS types, but I think we can get most of the QoI back with overlay changes I plan to propose following this.
2016-07-29 15:18:31 -07:00
Michael Ilseman
25ac879aea [noescape by default] Fix benchmarks and incorporate feedback
Adds @escaping to internal benchmark code to fix it. References SR for
known limitation. Use stdlib coding style for arguments.
2016-07-29 13:49:08 -07:00
Michael Ilseman
ccda8f33d1 [noescape by default] Proliferate @escaping
Adds an explicit @escaping throughout the standard library, validation
test suite, and tests. This will be necessary as soon as noescape is
the default for closure parameters.
2016-07-29 13:48:07 -07:00
Maxim Moiseev
a99221bfde [overlay] CryptoTokenKit (#3859)
This is work in progress
2016-07-29 12:39:37 -07:00
Rintaro Ishizaki
c6f4bcd01e [SE-0101] MemoryLayout: Migrate testsuite and benchmarks 2016-07-30 03:11:45 +09:00
Arnold Schwaighofer
f41e626ff0 Merge pull request #3795 from aschwaighofer/fix_optimizebridgedswifttoobjccast
Fix _bridgeToObjectiveC lookup code in optimizeBridgedSwiftToObjCCast
2016-07-29 07:18:14 -07:00
Max Moiseev
28a252e33d Operators compile 2016-07-29 13:31:21 +03:00
Dmitri Gribenko
e5db796212 Merge pull request #3843 from atrick/rawptr-convert
Remove "illegal" UnsafePointer casts from the stdlib.
2016-07-28 22:40:16 -07:00
Dmitri Gribenko
4bed3391f7 Merge pull request #3849 from kballard/data_iterator
Implement a custom Data.Iterator
2016-07-28 22:27:36 -07:00
Jacob Bandes-Storch
308f990550 [stdlib] default separator for joining strings (SE-0133) (#3838) 2016-07-28 22:16:48 -07:00
Andrew Trick
0b75ee975e Remove "illegal" UnsafePointer casts from the stdlib.
Update for SE-0107: UnsafeRawPointer

This adds a "mutating" initialize to UnsafePointer to make
Immutable -> Mutable conversions explicit.

These are quick fixes to stdlib, overlays, and test cases that are necessary
in order to remove arbitrary UnsafePointer conversions.

Many cases can be expressed better up by reworking the surrounding
code, but we first need a working starting point.
2016-07-28 20:42:23 -07:00
Robert Widmann
7ad2620f5b Keep cleaning up 2016-07-28 18:50:22 -07:00
Kevin Ballard
a021c89236 Implement a custom Data.Iterator
This iterator uses an inline 32-byte buffer so it doesn't have to call
copyBytes(to:count:) for every single byte. It results in an approximate
6x speedup on my computer.
2016-07-28 18:45:40 -07:00
Ted Kremenek
4a872ed636 Revert "Implement a custom Data.Iterator" (#3848) 2016-07-28 18:33:31 -07:00
Dmitri Gribenko
69255f02cb Merge pull request #3831 from kballard/data_iterator
Implement a custom Data.Iterator
2016-07-28 18:11:16 -07:00
Robert Widmann
35fe7c7ad6 Cleanup validation tests after SE-0089 2016-07-28 18:01:44 -07:00
Dmitri Gribenko
4a1d2e8797 Merge pull request #3809 from jtbandes/se-0133
[stdlib] Rename flatten() to joined() (SE-0133)
2016-07-28 17:28:13 -07:00
Arnold Schwaighofer
c65e1a31e3 Fix _bridgeToObjectiveC lookup code in optimizeBridgedSwiftToObjCCast
Previously it assumed that if we succeed in looking up the method in the current
module we must be able to request a definition (vs a declaration).

This is not true. It could be that we had declared the type in a different
module. Always ask for a declaration.

rdar://27547957
2016-07-28 14:54:16 -07:00
Kevin Ballard
69c3d71ba3 Implement a custom Data.Iterator
This iterator uses an inline 32-byte buffer so it doesn't have to call
copyBytes(to:count:) for every single byte. It results in an approximate
6x speedup on my computer.
2016-07-28 13:27:31 -07:00
Mishal Shah
bc08704464 Merge pull request #3807 from jckarter/collection-ambiguity
Remove unnecessary type annotations.
2016-07-28 12:11:42 -07:00
Jacob Bandes-Storch
301c0688dc Merge branch 'master' into se-0133 2016-07-28 11:46:03 -07:00
Dmitri Gribenko
f4944f4a30 stdlib: AnyHashable tests: add a FIXME 2016-07-28 01:49:50 -07:00
Dmitri Gribenko
f4127dc85e stdlib: AnyHashable tests: more descriptive test names 2016-07-28 01:49:49 -07:00
Dmitri Gribenko
5921846ae7 stdlib: AnyHashable: tests for Swift errors and enums 2016-07-28 01:49:49 -07:00
Dmitri Gribenko
2d2c76f6ec stdlib: AnyHashable tests: finish tests for CF types 2016-07-28 01:35:58 -07:00
Dmitri Gribenko
438712ca03 stdlib: AnyHashable tests: remove variables used once 2016-07-28 01:35:58 -07:00
Jacob Bandes-Storch
039ad2bf09 [stdlib] Rename flatten() to joined() (SE-0133) 2016-07-27 23:19:31 -07:00
Joe Groff
b8528812e4 Remove unnecessary type annotations.
Scoring collection conversions should hopefully make these coercions unnecessary now.
2016-07-27 14:31:52 -07:00
Dmitri Gribenko
c0b183a208 Merge pull request #3781 from apple/stdlib-AnyHashable-for-Foundation.NSDecimalNumber
Add AnyHashable support for Foundation.Decimal
2016-07-27 09:22:48 -07:00
John McCall
108c102c54 Fix test for precedence groups. 2016-07-27 09:00:29 -07:00
Arnold Schwaighofer
37b789007d Disable Dictionary/Set.swift tests that fail in optimize mode
Disable the tests in optimize mode until we have fix to unblock builders.

rdar://27547957
2016-07-27 07:50:32 -07:00
Dmitri Gribenko
ea693dd8d1 Add AnyHashable support for Foundation.Decimal
Add a custom AnyHashable representation to Foundation.Decimal, so that
it behaves like all other bridged types.
2016-07-27 01:14:16 -07:00
Roman Levenstein
8ea999e19f Fix a failing test 2016-07-26 23:30:06 -07:00
Michael Gottesman
3b7a5c6dd8 Disable test while Roman is looking into it to fix the build.
rdar://17028332
2016-07-26 23:07:18 -07:00
swiftix
9756755e68 Merge pull request #3758 from swiftix/SE-130-implementation
Implementation of the SE-130 proposal.
2016-07-26 22:15:13 -07:00
Roman Levenstein
a798852cb4 Implementation of the SE-130 proposal.
It replaces String initializers taking Character or UnicodeScalar as a repeating value by a more general initializer that takes a String as a repeating value. This is done to avoid the ambiguities in the current String API, which can be only resolved by explicit casting.
String.append(_:UnicodeScalar) APIs is also removed to match these changes.
2016-07-26 20:08:11 -07:00
Bob Wilson
58395b3b2f [SE-0127] Add "to:" argument label to withUnsafe[Mutable]Pointer.
rdar://problem/26529498
2016-07-26 17:44:33 -07:00
Bob Wilson
112451c44a [SE-0127] Remove withUnsafePointers and withUnsafeMutablePointers APIs.
These provide the same functionality as the one-argument versions for both
2 and 3 argument closures. Since these are less common, the same thing can be
achieved by composing the one-argument version. rdar://problem/26529498
2016-07-26 17:43:33 -07:00
Michael Gottesman
7680f418bc Disable test to unbreak the builds.
rdar://27558848
2016-07-26 17:32:40 -07:00
Xin Tong
9709b0e510 Merge pull request #3662 from trentxintong/unicodescalar
SE-0128 - Change unicodescalar initializer to failable
2016-07-26 16:44:14 -07:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
David Farler
4a57e647e6 Merge pull request #3762 from bitjammer/se-0081-diagnostic-and-crashes
[SE-0081] Warn on deprecated where clause inside angle brackets
2016-07-26 09:09:30 -07:00
Arnold Schwaighofer
39389b9c09 [SE-0125] Remove isUniquelyReferenced and the NonObjectiveCBase class
We can express the same using the `isUniquelyReferencedNonObjC` API.

- Rename `isUniquelyReferencedNonObjC` to `isKnownUniquelyReferenced`.
- Cleanup `ManagedBufferPointer` by removing holdsUniqueOrPinnedReference` and
  renaming `holdsUniqueReference` to `isUniqueReference`.
- No longer promise to return false from `isKnownUniquelyReferenced` for @objc
  class instances.

SR-1962
rdar://21886410
2016-07-26 07:09:29 -07:00
Dmitri Gribenko
0b82d78ec3 stdlib: add indicator tests for more custom AnyHashable representations that will be needed in future 2016-07-26 03:10:52 -07:00