Commit Graph

185 Commits

Author SHA1 Message Date
Jordan Rose
9aeb542e22 [APINotes] Add CloudKit NS_SWIFT_NAME entries. (#3251)
(as requested by the CloudKit team)

rdar://problem/27065698
2016-06-28 18:01:00 -07:00
Jordan Rose
c6a5223876 [CMake] Bump missing entry for an added .apinotes file to an error.
It was a warning because I didn't want to break anything when I first
added the check, but we've been warning-free for a while now. Let's
keep it that way.
2016-06-28 15:24:38 -07:00
Mike Ferris
f6618b106c <rdar://problem/26611147> Swift names for expectation APIs don't match API guidelines 2016-06-28 08:06:10 -07:00
Michael Ilseman
dc232f6279 [Core Graphics] Disambiguate the CGContext PDF endPage
This changes how we import CGPDFContextEndPage to be
CGContext.endPDFPage(), instead of .endPage() which conflicts with
another CGContext function. Also does .beginPDFPage() for consistency,
which is consistent with e.g. drawPDFPage().
2016-06-20 14:44:11 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Jordan Rose
d5e3deece9 [apinotes] Rename a few XCTest APIs.
...as requested by the XCTest team, of course.

rdar://problem/26705624
2016-06-08 16:35:07 -07:00
Jordan Rose
70e3ebb8f4 [APINotes] Fix mistyped selector in 4091e54d.
Note that the Swift name here is deliberately different from the
Objective-C name. It is the authorization that changed, even though
the argument is an authorization status.

    - (void)locationManager:(CLLocationManager *)manager
didChangeAuthorizationStatus:(CLAuthorizationStatus)status;

    optional func locationManager(_ manager: CLLocationManager,
 didChangeAuthorization status: CLAuthorizationStatus)

rdar://problem/26586048
2016-06-01 14:31:13 -07:00
Jordan Rose
7a0a44e4d8 [CMake] Stop using globs on the apinotes directory.
The problem here is that there isn't an obvious way to force a CMake
reconfiguration when you need to add new apinotes. This dates back to
when we (internally) had the apinotes in a separate repo, but that
hasn't been the case for a long time.

We're still not using a /normal/ CMake add_subdirectory for these
because we compile the apinotes as part of building overlays for
frameworks that have both overlays and apinotes, and I didn't want to
touch any of that stuff right now.
2016-05-31 12:22:37 -07:00
Jordan Rose
4091e54d67 Add API notes for a few poorly-imported CoreLocation APIs.
rdar://problem/26526454
2016-05-31 12:22:37 -07:00
Jordan Rose
ca97762da6 Fix more broken API notes caught by manual inspection.
rdar://problem/26403143
2016-05-23 15:11:17 -07:00
Jordan Rose
24030eb2ed [APINotes] Use non-"Ref" names for CG import-as-member renamings.
That is, import something like 'CGColorCreateGenericGray' as
"CGColor.init(gray:alpha:)" rather than "CGColorRef.init(gray:alpha:)".
Since we print the type name in diagnostic text and in fix-its, it's
important to use the name that Swift sources use.

Finishes rdar://problem/26347297.
2016-05-19 18:07:27 -07:00
Joe Groff
37d96dca6d Fix broken API notes uncovered by strengthened Clang-side validation. 2016-05-19 13:11:34 -07:00
Michael Ilseman
7fddadf9db [Core Graphics] Fix apinotes for CGPathCreateMutableCopy
CGPathCreateMutableCopy and CGPathCreateMutableCopyByTransformingPath
have 'self' type of CGPath, and thus must be imported as members of
CGPath proper, not CGMutablePath. Does so by following common naming
conventions for producing mutable copies.
2016-05-18 16:10:28 -07:00
Michael Ilseman
22ddf81047 [CG Import as Member] Fix argument label swap 2016-05-12 11:59:36 -07:00
Michael Ilseman
633d968c90 [Import as Member] Remove broken swift_name for CGPDFPageGetBoxRect 2016-05-12 10:18:08 -07:00
Michael Ilseman
8c65ef209e [CoreGraphics Renaming] Overhaul CG apinotes
Adds many more API renamings to CoreGraphics.apinotes
2016-05-06 14:52:24 -07:00
Dave Abrahams
debde16e2c Merge set-api branch into swift-3-indexing-model 2016-04-26 15:56:42 -07:00
Michael Ilseman
ba431a9954 [Import as member] CoreGraphics: Import global vars onto classes
With support from 16baa6, we can now use correct inference bahavior,
which is to import global variables as members on classes.
2016-04-12 10:48:18 -07:00
practicalswift
637db8809b Merge pull request #2143 from practicalswift/osx
[gardening] "OSX" → "OS X"
2016-04-12 09:24:03 +02:00
practicalswift
befbebcd30 [gardening] "OSX" → "OS X" 2016-04-11 23:12:40 +02:00
Michael Ilseman
151a19d3b8 [Import as member] Fixes to apinotes and tests
Fixes and clarifies a few API notes, and adds some test cases showing
current SILGen issues.
2016-04-11 11:31:12 -07:00
practicalswift
7bfe5c48f0 [gardening] Fix recently introduced typo: "auxilary" → "auxiliary" 2016-04-09 12:19:05 +02:00
Ted Kremenek
8e91efb39d Revert "Revert "[Import as member] First draft of renaming CG APIs"" 2016-04-08 21:26:03 -07:00
Ted Kremenek
18504de7dd Revert "[Import as member] First draft of renaming CG APIs" 2016-04-08 21:00:00 -07:00
Michael Ilseman
dc34fd61af [Import as member] Need to keep pre-9.0 APIs available 2016-04-08 17:17:44 -07:00
Michael Ilseman
3a2fed44f5 [Import as member] First draft of renaming CG APIs
This includes several large manual renaming of CG APIs where we want
different results than what the inference system produces.
2016-04-08 15:27:59 -07:00
Michael Ilseman
8a31b4b9f3 [Import as member] Mark CG APIs as nonswift
Several CG APIs are meant to be imported as nonswift, so mark them so
in our API notes.
2016-04-08 15:27:59 -07:00
Chris Willmore
73d5077bae Add API notes for Foundation following internal Swift 3 naming audit. 2016-04-07 20:35:18 -07:00
Michael Ilseman
2b5b839686 [Import as member] Turn on CoreGraphics.
Introduces CoreGraphics.apinotes, in which we enable the
import-as-member inference system. Additionally, include some explicit
SwiftNames, for when inference doesn't produce the right result, and
to aid compatibility with the overlays.

Refactors many of the trivial overlays out, shrinking the
CoreGraphics.swift overlay by over half. Updates in-tree test
cases. The names we currently have will be highly in flux for a while,
and are likely to change frequently over the near term.

There are a few remaining known bugs that are worked around by
apinotes entries.
2016-04-06 11:03:18 -07:00
Chris Willmore
40103ce628 Add API notes for frameworks following internal audit of Swift 3 API. 2016-04-04 19:55:17 -07:00
Doug Gregor
0e40128d1a [Clang importer] Use Clang swift_bridge attribute for bridging.
When an Objective-C class type is annotated with the swift_bridge
value type, bridge it to the named type. Use API notes on Foundation
rather than special cases.

For Objective-C classes where bridging was baked into the Clang
importer (NSString, NSArray, NSDictionary, NSSet), add API notes to
put the appropriate swift_bridge attribute on these Objective-C
classes.

Note: requires Clang update.
2016-03-10 23:10:28 -08:00
Doug Gregor
c1cc39accc [Clang importer] Rely on Clang's mapping of API notes to attributes directly.
Rather than managing API notes directly in the Clang importer, tell
Clang where to find the API notes files and let it map them directly
to attributes. Then, use the existing attribute-mapping
mechanisms---with minor extensions for cases where Clang previously
didn't map some Swift-specific API notes---to get at that information.

There is a minor regression where we can no longer apply API notes to
declarations that don't have a specific Clang declaration. The
specific example (NSError's inherited init()) comes from
rdar://problem/21042412; we've regressed here, but the correct fix is
(and has always been) on the Objective-C side
(rdar://problem/19977891).

Finishes rdar://problem/24447420.
2016-02-18 16:48:02 -08:00
yyx290799684
b829926d95 Update README.md 2015-12-05 15:24:42 +08:00
Pascal Welsch
e8009daa31 converted ApiNotes Readme.txt to markdown
makes the apinotes Readme more readable on github
2015-12-03 18:20:55 +01:00
David Farler
4ac9c80809 Add back remaining files for building and testing in Open Source 2015-10-31 00:19:20 -07:00
Jordan Rose
ff7b6b74fe Foundation overlay: Add a generic NSCoder.decodeObjectOfClass(_:forKey:).
Like decodeTopLevelObjectOfClass(_:forKey:), this API works very nicely
as a generic method in Swift, and this one is actually the one we expect
to be commonly used. One thing to note here is that these methods are
stricter than their ObjC counterparts: they will do a forced checked cast
even when the unarchiver does not use "secure" coding.

This depends on the previous commit; without it, we do not actually
enforce type safety for these methods.

The API notes change is to make the non-generic version of this method
unavailable so that it does not participate in overload resolution.
Without this we prefer the non-generic method unless there's a contextual
type for the result. I've filed rdar://problem/22243198 to track taking
this out once Foundation has updated their headers.

rdar://problem/17060110 (again)

Swift SVN r31154
2015-08-12 01:36:08 +00:00
Ben Langmuir
0fa6d7b65f Revert "Move GameKit overlay to GameCenter."
The headers went back to GameKit in a new SDK.

This reverts commit r30322.

Swift SVN r31015
2015-08-04 22:27:47 +00:00
Jordan Rose
965285f13d Move GameKit overlay to GameCenter.
In iOS 9 and OS X 10.11 the old GameKit was effectively renamed GameCenter, while
the new GameKit is a sort of umbrella framework like Cocoa. We need to support
backwards deployment, though, so the GameCenter overlay links to GameKit.framework.
(This is essentially the same solution implemented for CoreImage moving out of
QuartzCore in r28449)

rdar://problem/21340738

Swift SVN r30322
2015-07-17 19:54:38 +00:00
Jordan Rose
5619b5dd44 [apinotes] Remove information that has been migrated into the SDKs.
I'll be filing Radars for the rest of these. (Some of them already have them.)

rdar://problem/19003559&19756368&20276854

Swift SVN r29324
2015-06-05 23:02:17 +00:00
Jordan Rose
fa5bd4c6c8 [ClangImporter] Allow apinotes to affect inherited initializers.
Then use that to ban NSError.init(), because it doesn't create a valid
NSError. In the long run Foundation will hopefully add this to their
headers, but they can't yet (rdar://problem/19977891).

rdar://problem/21042412

Swift SVN r28881
2015-05-21 18:11:17 +00:00
Anna Zaks
57cac6a9fd [apinotes] Mark UIView's motionEffects as optional for backward compatibility.
Swift SVN r25016
2015-02-05 21:11:50 +00:00
Anna Zaks
8e8425a3ce [apinotes] Update nullability info for WatchKit
Swift SVN r24963
2015-02-04 18:15:57 +00:00
Argyrios Kyrtzidis
dfe9a2de57 [apinotes] Change to nullable parameter for NSZoneName.
Documentation for NSZoneName says:
"If zone is nil, the default zone is used".

Swift SVN r24731
2015-01-26 19:44:04 +00:00
Anna Zaks
7af94af837 [API Notes] Fix inconsistency between NSURLCredential's init and the factory method.
Swift SVN r24632
2015-01-22 03:48:46 +00:00
Anna Zaks
c2a7613612 [API Notes] Address outstanding nullability issues + new audited pieces
<rdar://problem/17902944> UIView's motionEffects property should never return 'nil'
<rdar://problem/17971360> [factor-init] SKPhysicsJointPin's factory method is not converted to a Swift API initializer
<rdar://problem/18553910> #IUO UICollectionViewUpdateItem properties
<rdar://problem/18875692> NSEntityDescription subentities/subentitiesByName should be marked optional
<rdar://problem/18919879> Swift: NSTableView's preparedCellAtColumn(_:row:) should return an optional
<rdar://problem/18940072> NSPredicate's init(format:) should not be optional
<rdar://problem/18987481> NSURLRequest without NSURL crashes Swift
<rdar://problem/19034448> UIPrintInfo’s -init is banned, should use +printInfo
<rdar://problem/19147412> NSUserInterfaceItemIdentification declares identifier as a non-optional String and it should be optional or IUO
<rdar://problem/19347931> Declaration of a parameter in Cocoa API in Swift is wrong (NSDateFormatter)
+ additions to the WatchKit audit

+ additions to HealthKit and HomeKit.

Swift SVN r24630
2015-01-22 03:29:07 +00:00
Greg Parker
bf88270ff8 Remove literal tab characters from an apinotes file.
Swift SVN r24565
2015-01-20 21:06:55 +00:00
Jordan Rose
09fb741f17 Prevent +[UIPrintInfo printInfo] from being imported as an initializer.
...because -[UIPrintInfo init] throws an exception saying not to call it
directly.

rdar://problem/19034448

Swift SVN r24561
2015-01-20 20:41:58 +00:00
Anna Zaks
474eeb2aef [apinotes] Audit WKInterfaceController's awakeWithContext.
See radar://19129934

Swift SVN r23710
2014-12-05 01:02:06 +00:00
Anna Zaks
9064df226a [apinotes] Add fresh API audit drop.
Here, we mark the null_resettable properties as explicit "U".
Fixed UIColor and NSColor's initWithCGColor as returning an optional (radar://18420272)
Fixed fontDescriptorWithSymbolicTraits (rdar://problem/18812268)
Contains audit for NSXMLParserDelegate (rdar://problem/18227344)
+ a few other newly audited APIs

Swift SVN r23698
2014-12-05 00:16:08 +00:00
Anna Zaks
ed9a765d43 [API Notes] Commit the WatchKit audit.
Swift SVN r23252
2014-11-11 23:29:43 +00:00