185 Commits

Author SHA1 Message Date
Josh Learn
5c3814e4dd [OSSignpost] Update apinotes to allow usage of os_signpost ABI entrypoint
Currently, the `_os_signpost_emit_with_name_impl` function is not available to be called from Swift. This is the main ABI entrypoint for making os_signpost calls. In order to facilitate more efficient calls to os_signpost in future iterations of the Swift os_signpost API, we need to allow calling this function from Swift.

rdar://70015938
2020-10-06 14:18:01 -07:00
Alex Langford
61be4d969f [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.

This is a resubmission (with modifications) of an earlier change. I originally
committed this but there were problems with some installation rules.
2019-08-22 10:16:50 -07:00
Ben Langmuir
327c666b8a Revert "[CMake][NFC] Introduce component targets for proper dependency tracking" 2019-08-08 16:35:59 -07:00
Alex Langford
50a0e87c69 [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.
2019-08-08 11:50:35 -07:00
mishal_shah
1e38fc3030 Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs 2019-06-03 22:50:02 -07:00
Ross Bayer
83932c581b [Build System: CMake] Always copy the apinotes into the build directory when the apinotes directory is included via SWIFT_INCLUDE_APINOTES. 2019-05-06 12:03:44 -07:00
Ross Bayer
c10b815ba4 [Build System: CMake] Install the apinotes in the 'compiler' install component when compiling for Darwin platforms.
Setting the CMake cache variable SWIFT_INCLUDE_APINOTES to true will override the default behavior and unconditionally create the install targets.
2019-05-02 18:42:37 -07:00
Alex Langford
3d9a28925b [CMake] Modify swift_install_in_component to support cmake install components
CMake supports the notion of installation components. Right now we have some
custom code for supporting swift components. I think that for installation
purposes, it would be nice to use the CMake component system.

This should be a non-functional change. We should still only be generating
install rules for targets and files in components we want to install, and we
still use the install ninja target to install everything.
2019-04-19 14:06:11 -07:00
Ravi Kandhadai
592bca7202 [oslog] [stdlib-private] Add a prototype of the new os_log swift APIs
that accept string interpolations.

The prototypes are added to stdlib/private directory and will be
used only in tests and in experimental code.
2019-03-14 15:26:21 -07:00
Jordan Rose
bc35b34c64 [CMake] StandaloneOverlay: set components before including apinotes/ (#22592)
Otherwise, we'll think we don't need to install the API notes.

No test because this configuration isn't (yet) tested publicly
anywhere, but it is being tested within Apple.
2019-02-13 17:56:31 -08:00
Jordan Rose
aea1ef8175 Move API notes out of the arch-specific subdirectories in lib/swift/ (#21690)
They're all the same anyway, and no longer even need to be compiled,
just copied in as text.

And drastically simplify how we "generate" them. Instead of attaching
their build jobs to the appropriate overlays, if present, "just" have
one job to copy them all and attach it to the Darwin overlay. That's
what we do for the overlay shim headers, and it's good enough.
(Eventually we want to get out of the business of shipping them
altogether.)

This does have the same flaw as the shim headers: if you /just/ change
API notes, the corresponding overlay does not get rebuilt. You have to
touch that too. But in practice that'll happen most of the time
anyway.

Part of rdar://problem/43545560
2019-01-09 14:06:21 -08:00
Jordan Rose
0149129ed3 [CMake] Stop compiling API notes files to a binary format (#19205)
Clang's been able to read the textual format for a long time, and
indeed that's what's used in the SDK. This isn't even really a
performance win because the information is cached in PCMs.

rdar://problem/34293901
2018-09-12 14:19:59 -07:00
Mishal Shah
3f8ce7d2f9 Update master to build with Xcode 10 beta 1, OS X 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs. 2018-06-04 23:14:19 -07:00
superuserAV
cc611a11a7 OS X -> macOS
"OS X" was renamed to "macOS" a year ago.
2017-10-21 09:06:13 +03:00
Slava Pestov
cacd92e83f Fix an interesting typo 2017-08-24 04:31:24 -07:00
Jordan Rose
ec151ae504 Remove more API notes that are now shipped with the frameworks. (#11408)
No functionality change...if you're on Xcode 9b4 or later.
2017-08-10 15:10:30 -07:00
Jordan Rose
5c21e12fdb [API notes] Remove all API notes present in the Xcode 9 SDKs. (#10615)
The framework versions already superseded the files here, so let's not
even bother building and packaging them. There /are/ still a few
frameworks that aren't shipping their own API notes at the moment,
however, though some of them are deprecated in their entirety.

rdar://problem/32908357
2017-07-07 19:52:49 -07:00
Max Moiseev
46af654271 [overlay] Add ModelIO overlay 2017-06-26 10:56:13 -07:00
Ted Kremenek
2fe2328436 Merge pull request #10563 from tkremenek/screensaver-apinotes
Add Swift 3 backward compatibility apinotes for ScreenSaver.
2017-06-23 23:39:55 -07:00
Ted Kremenek
c13ba7f3a7 Add ScreenSaver.apinotes to CMakeLists.txt. 2017-06-23 22:51:00 -07:00
Ted Kremenek
e1b95e2d9c Add Swift 3 backward compatibility apinotes for ScreenSaver. 2017-06-23 22:38:23 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
Jordan Rose
08b6c5f0c9 [ClangImporter] Add support for 'SwiftImportAsNonGeneric' in API notes (#6962)
Generic Objective-C classes with this annotation will be imported as
non-generic in Swift. The Swift 3 behavior hardcoded a certain set of
class /hierarchies/ as permanently non-generic, and this is preserved
in Swift 3 mode.

Actually using this API note in a versioned way (as opposed to just
marking the class non-generic in all language versions) will cause
horrible source compatibility problems in the mix-and-match cases,
where Swift 3 code presents a non-generic type that Swift 4 expects to
be generic or vice versa.  Fixes for this will come later; right now
it's more important to add support for the feature at all.

To avoid unwanted changes in Swift 4, this commit also adds API notes
to make any existing classes in the previously-hardcoded set continue
to import as non-generic even in Swift 4. The difference is that
/subclasses/ of these classes may come in as generic. (If we want to
make a change here, that can be a separate commit.)

rdar://problem/31226414 (Swift side of rdar://problem/28455962)
2017-04-03 15:39:19 -07:00
Doug Gregor
57c607e339 [SE-0160] Map Clang's swift_objc_members attribute to @objcMembers.
This finishes the implementation of SE-0160, tracked by SR-4481 /
rdar://problem/28497874.
2017-04-03 11:48:55 -07:00
Mishal Shah
92ef777085 Update master to build with Xcode 8.3 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2017-01-25 16:13:36 -08:00
Jordan Rose
a3eb1a7ac0 [APINotes] Match the SwiftName for NSXMLDTDKind to the headers. (#6901)
In the SDK shipped with Swift 3, NSXMLNodeKind's enumerator
NSXMLDTDKind was mistakenly annotated with `NS_SWIFT_NAME(DTDKind)`
instead of `NS_SWIFT_NAME(dtd)`. We'd like to fix that in a later
version of the SDK, but we need to maintain Swift 3 compatibility on
the off-chance someone is using the bad name. If we /do/ decide to
change this, we can undo this change (going back to an API note
SwiftName of 'dtd') and add a Swift-3-versioned SwiftName of 'DTDKind'
instead.
2017-01-24 15:11:14 -08:00
Jordan Rose
99cdfa84f8 [APINotes] Source compatibility for nullability on array parameters. (#5800)
While the second argument to NSFastEnumeration's
countByEnumerating(with:objects:count:) really shouldn't be nil, it's
possible someone got away with it in Swift 3.

Follow-up for rdar://problem/25846421.
2016-11-15 14:18:09 -08:00
Tony Parker
8f8f6fd5f3 Fix AffineTransform initializer 2016-11-07 14:02:08 -08:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Kevin Perry
eba89a61a6 Switched from Availability: nonswift to SwiftPrivate: true 2016-10-27 12:50:40 -07:00
Kevin Perry
6f83a82d14 Ensure directory URL enumerator error handler block is invoked with non-nil URL 2016-10-26 16:18:51 -07:00
Jordan Rose
3778c79dc4 [SDK] Use SwiftPrivate to remove _silgen_name from the AppKit overlay. 2016-10-15 09:35:09 -07:00
Jordan Rose
6163679538 [APINotes] Replace old FactoryAsInit annotation with equivalent SwiftNames.
'processInfo' was removed entirely because it's now considered a class property,
and we don't ever import those as initializers.
2016-10-14 09:07:43 -07:00
Brian Gesiak
7fbf5014f0 Merge pull request #4999 from modocache/cmake-in-list
[cmake] Enable IN_LIST compare policy
2016-09-29 15:45:01 -04:00
Brian Gesiak
3123b47602 [cmake] Enable IN_LIST compare policy
Enable CMake policy CMP0057, which allows `if()` statements to use the `IN_LIST`
operator. In addition, simplify several `if()` statements that used the
`list(FIND ...)` operation instead.
2016-09-28 22:35:05 -04:00
Jordan Rose
98882a5050 Merge pull request #5039 from jrose-apple/NSErrorDomain-apinotes
[APINotes] Fix mis-annotated error code enums.

rdar://problem/28507946
2016-09-28 11:38:48 -07:00
Jordan Rose
3e6fa8b275 [APINotes] Fix mis-annotated error code enums.
Some files accidentally /renamed/ the enums using SwiftName rather than
associating them with an error domain constant. Amazingly, we've gotten
no complaints about this.
2016-09-27 17:49:17 -07:00
Jordan Rose
9a87ac17c8 [APINotes] Remove bogus QuartzCore API notes.
This would have been harmless, but there's no reason to keep it around!
(For those wondering what's going on, NSEnumerator is defined in Foundation.)
2016-09-27 17:38:19 -07:00
Jeff Kelley
41a8227f8b Recommend type(of:) instead of .dynamicType 2016-09-25 22:53:03 -04:00
Jordan Rose
258a0ade12 [APINotes] Protocols cannot use import-as-member. (#4482)
We could support this in the future but right now it's causing problems.
There's also a potential ambiguity issue here where a protocol and class
could have the same name.

In addition to updating the importer, remove the two entries from the
CryptoTokenKit API notes that were trying to use this feature.

rdar://problem/27990168
2016-08-24 16:02:28 -07:00
Ted Kremenek
7d015df9f2 Merge pull request #4334 from moiseev/metal-apinotes
[overlay] updating Metal API via apinotes
2016-08-18 14:47:03 -07:00
Maxim Moiseev
3757b36c37 [overlay] Nest CallKit enum types within their associated classes (#4312)
Addresses the <rdar://problem/27553337>
2016-08-18 12:24:00 -07:00
Max Moiseev
802a95384d [overlay] updating Metal API via apinotes
<rdar://problem/26723219>
2016-08-16 16:32:26 -07:00
Michael Ilseman
8105dc7541 [CoreGraphics] Remove redundant, potentially-warning-inducing SwiftName 2016-08-12 11:43:51 -07:00
Michael Ilseman
254173e69e [SceneKit] un-qualify nested type swift_name
We don't yet support nested types for the target of swift_name, which
is a very unfortunate omission. Instead, use un-qualified names in the
apinotes, which default to the decl's context, which in this case
fortunately interacts with swift_newtype to end up in the properly
nested struct in Swift proper. Gross.
2016-08-10 15:48:49 -07:00
Michael Ilseman
a8278c2da5 [SceneKit] Add apinotes for API renaming
Add in apinotes, and associated tests, that rename many APIs to be
more consistent with the API design guidelines.
2016-08-09 10:39:09 -07:00
Jordan Rose
449f4e470f [API notes] CTFontManagerError is not a valid Error at this time. (#4104)
CoreText is below Foundation in the framework stack, so its error enum
uses a CFStringRef constant as its domain instead of an NSString. The
importer doesn't know how to handle that yet, so for now, just don't
import CTFontManagerError as a first-class error type.

rdar://problem/27722004
2016-08-08 11:13:06 -07:00
Michael Ilseman
adb05235c5 [SceneKit] Explicitly control some renames
Nests some of the types created with swift_newtype, and gives more
appropriate names to many of the now-member globals.
2016-08-03 16:36:24 -07:00
Mishal Shah
d28ff854b9 Update master to build with Xcode 8 beta 4, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-08-02 11:47:10 -07:00
Jordan Rose
b5aca663bc [ClangImporter] Remove importer-based NS stripping. (#3880)
* [ClangImporter] Remove importer-based NS stripping.

As Tony puts it, in the end we wound up with more Foundation
declarations imported as members or keeping "NS" than those that
dropped it, and any further decisions will be made on a case-by-case
basis. Move all of the existing cases of prefix-stripping into
Foundation's API notes and drop the logic from the compiler.

Tested by dumping the generated interface for Foundation and its
submodules for both macOS and the iOS simulator, and comparing the
results. A few cases did slip through here because of the interaction
between "SwiftName" and "Availability: nonswift".

The next commit will re-add "NS" to some stragglers that we missed.

rdar://problem/26880017

* APINotes: Add "NS" back to a few types.

NSKeyedUnarchiverDelegate
NSKeyedArchiverDelegate
NSTextCheckingTypes
NSBinarySearchingOptions
NSEnumerationOptions
NSSortOptions

More rdar://problem/26880017

* Remove now-redundant SwiftNames from API notes.

No change observed in the generated interface of Foundation and its
submodules.

Finishes rdar://problem/26880017.
2016-08-01 20:54:26 -07:00