Commit Graph

1358 Commits

Author SHA1 Message Date
Doug Gregor
75f88af29a Make NSError error domain enums Equatable and Hashable.
Swift SVN r28568
2015-05-14 16:42:12 +00:00
Doug Gregor
7449c3b6ff Use protocol extensions to eliminate boilerplate in bridged NSError domains.
Swift SVN r28567
2015-05-14 16:42:10 +00:00
Joe Groff
9153e2261d CoreGraphics overlay: Comment that the @transparent definitions really want to be @fragile.
Swift SVN r28566
2015-05-14 15:59:28 +00:00
Doug Gregor
79e93e358c Add _NSURLError enum to cover the NSURLError error domain.
Swift SVN r28564
2015-05-14 06:53:55 +00:00
Doug Gregor
88b679969c Get availability annotations right for NSCocoaError.
Fix the script to not wantonly drop availability annotations, and
update NSCocoError accordingly. Also drop in a reinterpret-casting
rawValue initializer, which matches what we get when importing enums
from C.

Swift SVN r28563
2015-05-14 06:53:52 +00:00
Doug Gregor
cfbe2e0921 Hard-code the Cocoa error domain mapping using the results of a simple script.
Bridging the Cocoa error domain requires us to gather constants from
Foundation, CoreData, and AppKit, then pulling those into a single
(_)NSCocoaError enum that conforms to
_ObjectiveCBridgeableErrorType.

Rather than using a table extracted from the appropriate Cocoa headers
and pushing that through gyb, just hardcode the resuting Swift code,
which is produced (manually) by an enumeration-parsing script. Thanks
to Dave for pointing out that I was holding gyb wrong.

... and apologies for the Perl.

Long term, we need a better solution here, but this will suffice for
the short term.

Swift SVN r28560
2015-05-14 05:39:45 +00:00
Dmitri Hrybenko
9b7ea14bae Disable the CoreImage overlay for watchOS
CoreImage framework is not present in the public watchOS SDK.

Swift SVN r28549
2015-05-14 00:54:02 +00:00
Doug Gregor
7cd80ec5dd Factor creation of enums for the Cocoa error domains into a reusable gyb template.
We'll need these for a number of framework overlays.

Swift SVN r28530
2015-05-13 21:02:41 +00:00
Joe Groff
0b9b9986e3 CoreGraphics overlay: Make most CGPoint/Size/Rect operations transparent (again).
Expose constructors, ==, and other operators so they can be inlined down to
their underlying C struct operations. Add overlays for CG{Point,Rect,Size}Zero
and CGAffineTransformIdentity as well so we avoid having to load from the
opaque extern storage of the C constants. Recommits r28387 and addresses
rdar://problem/20888179, now that the previous commit worked around
rdar://problem/20902115.

Swift SVN r28527
2015-05-13 20:53:29 +00:00
Doug Gregor
ce37291d10 Update NSCocoaError to contain the entire Cocoa domain.
Extend the NSCocoaError enum to cover all of the error codes in the
Cocoa error domain. Note that we need to do something awful for the
AppKit and CoreData errors, effectively redeclaring all of the
constants locally, because we cannot import AppKit and CoreData into
the Foundation overlay. It's not clear whether this blatant layering
violation will stand, but this at least improves coverage.

Also note that there are a number of warnings when building this code,
because some of the availability checks specify availability earlier
than our minimum deployment target. They're harmless and can be
cleaned up later.

Part of rdar://problem/20536610.

Swift SVN r28522
2015-05-13 20:19:45 +00:00
Dmitri Hrybenko
b94c4ce3a4 SDK overlay: add more dependencies for the CoreMedia overlay
Swift SVN r28519
2015-05-13 18:27:12 +00:00
Dmitri Hrybenko
9a81121b59 SDK overlay: there's no GameplayKit in current watchOS, disable it for now
Swift SVN r28506
2015-05-13 03:36:02 +00:00
Ted Kremenek
7f1119f690 Underscore properties of ErrorType.
The internal details of ErrorType are still being designed.
They should be underscored in the meantime to
indicate they are still evolving.

Implements rdar://problem/20927102.

Swift SVN r28500
2015-05-13 00:24:09 +00:00
Dmitri Hrybenko
c8e1ac8435 Add the GameplayKit overlay
Swift SVN r28495
2015-05-12 23:12:06 +00:00
Ted Kremenek
9be9444242 Adjust overlay to CoreImage nullability changes.
Implements rdar://problem/20645743.

Swift SVN r28490
2015-05-12 22:15:03 +00:00
Dmitri Hrybenko
0e52761783 Integrate the CoreMedia overlay for CMTime and CMTimeRange
rdar://19815011

Swift SVN r28489
2015-05-12 22:14:52 +00:00
Ted Kremenek
62feb5c949 Change @availability to @available.
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.

This is a divergence from Objective-C.

Swift SVN r28484
2015-05-12 20:06:13 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Dave Abrahams
106b39a497 [stdlib] Indent bullet continuations in doc comments
The text is a lot more readable that way.

Swift SVN r28471
2015-05-12 16:59:08 +00:00
Doug Gregor
985896905e Ban generic parameters on extensions.
We no longer allow extensions to provide generic parameters, and the
ability to parse the syntax

  extension Array<String> { ... }

is causing confusion. Fixes rdar://problem/20873336.

Swift SVN r28468
2015-05-12 16:26:04 +00:00
Jordan Rose
d92a039ba7 Make the CoreImage overlay (nee QuartzCore) work for both 10.11 and older OSs.
On OS X 10.10 and earlier, CoreImage is a sub-framework of QuartzCore.
Users of CoreImage use "import QuartzCore" and link against QuartzCore.

On OS X 10.11 (and in the OS X 10.11 SDK), CoreImage is a top-level
framework. Users of CoreImage use "import CoreImage" and would link against
CoreImage. Of course, QuartzCore continues to re-export CoreImage's API.

When backwards-deploying, we need to continue linking against QuartzCore,
but still need to bring in the overlay if you import CoreImage. That's
what this patch does.

rdar://problem/20196610

Swift SVN r28449
2015-05-12 01:29:37 +00:00
Ted Kremenek
64ec51ab85 Convert a few 'var' to 'let' in the SDK overlay.
Swift SVN r28448
2015-05-12 00:24:36 +00:00
Dmitri Hrybenko
61214ec55b stdlib: remove Sliceable conformance from String
Swift SVN r28442
2015-05-11 20:58:31 +00:00
Joe Groff
0348bbccf4 Take -sil-serialize-all off of CoreGraphics overlay again.
It causes test failures: rdar://problem/20891746

Swift SVN r28407
2015-05-11 00:42:33 +00:00
Joe Groff
bdfc83639a CoreGraphics overlay: Provide concrete definitions of CG*Zero and CGAffineTransformIdentity.
These are opaque externs in C for no good reason.

Swift SVN r28399
2015-05-10 18:23:34 +00:00
Joe Groff
3ee5bbcb68 Build CoreGraphics overlay with -sil-serialize-all.
A more robust way to expose its definitions to inlining, for rdar://problem/20888179.

Swift SVN r28398
2015-05-10 18:23:33 +00:00
Chris Lattner
c1df892d47 improve stdlib hygiene a bit.
Swift SVN r28392
2015-05-10 02:55:18 +00:00
Joe Groff
1968b85a03 Revert "CoreGraphics overlay: Make most CGPoint/Size/Rect operations transparent."
This reverts commit r28387. It causes SIL linkage issues on the bots, and several people have noted that -sil-serialize-all is a better approach.

Swift SVN r28391
2015-05-10 00:51:08 +00:00
Joe Groff
e910c14bc2 CoreGraphics overlay: Make most CGPoint/Size/Rect operations transparent.
Expose constructors, ==, and other operators so they can be inlined down to their underlying C struct operations. Add overlays for CG{Point,Rect,Size}Zero and CGAffineTransformIdentity as well so we avoid having to load from the opaque extern storage of the C constants. rdar://problem/20888179

Swift SVN r28387
2015-05-09 23:44:54 +00:00
Joe Groff
0722dd26ff stdlib: Roll the SIMD module back to C++ parity.
Committing on behalf of Steve Canon again. We'll hold off on innovating till we have a more complete story here.

Swift SVN r28385
2015-05-09 23:03:36 +00:00
David Farler
8c2248a482 Don't embed LLVM bitcode into the XCTest overlay
With bitcode enabled, the XCTest overlay fails to link because
XCTest.framework itself was not built with bitcode. For now, we should
not build this overlay with bitcode. It isn't embedded in apps.

rdar://problem/20884313

Swift SVN r28355
2015-05-09 01:28:05 +00:00
Dmitri Hrybenko
e24c262d6e Foundation overlay: add String.stringByApplyingTransform()
This API is new in OS X 10.11 and iOS 9.0.

rdar://20645458

Swift SVN r28315
2015-05-08 08:36:44 +00:00
Ted Kremenek
9f9bb725cf Rename '_ErrorType' to 'ErrorType'.
Swift SVN r28293
2015-05-07 21:59:29 +00:00
Dmitri Hrybenko
8b392eeea9 Revert "Remove Array.count, it is redundant with protocol extensions"
This reverts commit r28247 while we discuss the change.

Swift SVN r28292
2015-05-07 21:45:30 +00:00
Dmitri Hrybenko
10ab07ade5 Revert "Remove {Dictionary,Set,UnsafeMutableBufferPointer,UnsafeBufferPointer}.count"
This reverts commit r28248 while we discuss the change.

Swift SVN r28291
2015-05-07 21:45:28 +00:00
Ted Kremenek
7a96e55cde Revert "Foundation overlay: add String.stringByApplyingTransform()"
Speculatively reverted because of iOS bot failure.

Swift SVN r28261
2015-05-07 14:00:16 +00:00
Dmitri Hrybenko
15a558f919 Foundation overlay: add String.stringByApplyingTransform()
This API is new in OS X 10.11 and iOS 9.0.

rdar://20645458

Swift SVN r28257
2015-05-07 06:54:15 +00:00
Dmitri Hrybenko
8ac6c7cf8f Remove {Dictionary,Set,UnsafeMutableBufferPointer,UnsafeBufferPointer}.count
These APIs are redundant with APIs that come from protocol extensions.

Swift SVN r28248
2015-05-07 00:30:43 +00:00
Dmitri Hrybenko
58601fafc8 Remove Array.count, it is redundant with protocol extensions
Swift SVN r28247
2015-05-07 00:30:41 +00:00
Dmitri Hrybenko
c109ec9125 stdlib: protocol extensions: de-underscore count()
Swift SVN r28246
2015-05-07 00:30:38 +00:00
Dmitri Hrybenko
e253881b02 stdlib: protocol extensions: de-underscore indices
Swift SVN r28245
2015-05-07 00:30:35 +00:00
Dave Abrahams
04d6928390 [stdlib] Pinging the compiler doesn't usually help
Swift SVN r28225
2015-05-06 23:06:58 +00:00
Chris Lattner
37f5452d15 require -> guard.
Swift SVN r28223
2015-05-06 22:53:38 +00:00
Ted Kremenek
92e6051cce Revert "[stdlib] NSStringAPI: add stringByApplyingTransform"
Right now this is breaking our iOS bots.  Let's temporarily revert while we investigate.

Swift SVN r28201
2015-05-06 15:58:05 +00:00
Dmitri Hrybenko
0453656f31 Adapt to Foundation API modernization: NSRectEdge is now an enum
This commit adds the initializers requested in rdar://20169260.

Swift SVN r28185
2015-05-05 22:50:59 +00:00
Dave Abrahams
a3270c105c [stdlib] NSStringAPI: add stringByApplyingTransform
Swift SVN r28171
2015-05-05 17:35:43 +00:00
Doug Gregor
6e114e3cfe Reinstate r26814: Allow 'var' parameters in @objc methods.
'var' parameters affect the definition of the method itself, not its
signature. Fixes rdar://problem/20543054.

Swift SVN r28167
2015-05-05 16:34:09 +00:00
Dmitri Hrybenko
3c30738fc1 Adjust to SpriteKit nullability annotations in the new SDKs
Swift SVN r28136
2015-05-04 23:18:14 +00:00
Dmitri Hrybenko
5d96abc4a2 Revert "Adjust SpriteKit overlay to SDK change."
This reverts commit r28117.  A complete commit (paired w/EPOCH) to
follow, to make it easier to cherry-pick the change.

Swift SVN r28135
2015-05-04 23:18:13 +00:00
Dmitri Hrybenko
33b74a0976 GLKit depends on simd through ModelKit
Swift SVN r28124
2015-05-04 18:28:18 +00:00