Commit Graph

1358 Commits

Author SHA1 Message Date
Brian King
29c1fc472b Generate an error message on protocol extensions with the final attribute. 2017-03-09 14:18:39 -05:00
Joe Groff
294913e114 Fix _stdlib_getErrorDefaultUserInfo to have the signature the runtime expects.
The ABI mismatch here would cause a crash in cases when the Foundation overlay wasn't available, or its implementation of swift_Foundation_getErrorDefaultUserInfo wasn't dynamically resolvable, such as in a stripped statically linked binary. Fixes rdar://problem/29173132.
2017-03-08 14:56:02 -08:00
Max Moiseev
835b8809d2 Merge branch 'master' into new-integer-protocols 2017-03-07 16:18:54 -08:00
Philippe Hausler
dc783c064c [Foundation] Remove @_silgen thunks and replace them with shims instead
This avoids indirection by making calls directly to the C implementations which prevents potentials of mismatched intent or changes of calling convention of @_silgen. The added benefit is that all of the shims in this case are no longer visible symbols (anyone using them was not authorized out side of the Foundation overlay). Also the callout methods in the headers now all share similar naming shcemes for easier refactoring and searching in the style of __NS<class><action> style. The previous compiled C/Objective-C source files were built with MRR the new headers MUST be ARC by Swift import rules.

The one caveat is that certain functions MUST avoid the bridge case (since they are part of the bridging code-paths and that would incur a recursive potential) which have the types erased up to NSObject * via the macro NS_NON_BRIDGED.

The remaining @_silgen declarations are either swift functions exposed externally to the rest of Swift’s runtime or are included in NSNumber.gyb which the Foundation team has other plans for removing those @_silgen functions at a later date and Data.swift has one external function left with @_silgen which is blocked by a bug in the compiler which seems to improperly import that particular method as an inline c function.
2017-03-06 09:59:37 -08:00
Jordan Rose
51d0715434 [CMake] Update dependencies for CloudKit for Apple-internal configs. (#7693)
rdar://problem/30432611
2017-02-23 13:40:01 -08:00
swift-ci
6c981c8f64 Merge pull request #7432 from ktopley-apple/dispatch-after-mach 2017-02-21 13:21:38 -08:00
Jordan Rose
20bdedf17e Merge pull request #6689 from parkera/pr27556178_wrong_image_thumbnail_key
Use the right key for the image thumbnail dictionaries in the URL resources struct
2017-02-21 09:27:30 -08:00
Kevin Ballard
bbd71b987d [SDK] Convert URLError.Code to a struct and add missing cases
URLError.Code was an enum, which is a bad idea because it can lead to
crashes if the enum doesn't cover a legitimate error code. Convert it to
a struct to match how CocoaError.Code is implemented.

Also add the missing cases `. dataLengthExceedsMaximum` and
`. appTransportSecurityRequiresSecureConnection`, and fix the broken
cases `.backgroundSessionRequiresSharedContainer`,
`.backgroundSessionInUseByAnotherProcess`, and
`.backgroundSessionWasDisconnected`.
2017-02-19 23:33:25 -08:00
swift-ci
9f132d4dd0 Merge pull request #7566 from moiseev/ck-watch 2017-02-17 12:15:41 -08:00
Max Moiseev
95e2bb4746 [overlay] watchOS availability for CKError 2017-02-17 10:37:42 -08:00
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
Philippe Hausler
525ffcc605 Merge pull request #7155 from phausler/Data_as_own_SubSequence
[Foundation] Convert Data’s SubSequence type to be Data
2017-02-15 11:02:27 -08:00
Maxim Moiseev
36ec947c06 Fix for the Intents overlay on watchOS (#7493) 2017-02-15 10:37:28 -08:00
Slava Pestov
13d6b183c0 Merge pull request #7370 from llvm-beanz/simplify-add_swift_library
[CMake] Simplify add_swift_library
2017-02-14 19:16:59 -08:00
Chris Bieneman
e096d1c033 [CMake] Simplify add_swift_library
This patch splits add_swift_library into two functions one which handles
the simple case of adding a library that is part of the compiler being
built and the second handling the more complicated case of "target"
libraries, which may need to build for one or more targets.

The new add_swift_library is built using llvm_add_library, which re-uses
LLVM's CMake modules. In adapting to use LLVM's modules some of
add_swift_library's named parameters have been removed and
LINK_LIBRARIES has changed to LINK_LIBS, and LLVM_LINK_COMPONENTS
changed to LINK_COMPONENTS.

This patch also cleans up libswiftBasic's handling of UUID library and
headers, and how it interfaces with gyb sources.

add_swift_library also no longer has the FILE_DEPENDS parameter, which
doesn't matter because llvm_add_library's DEPENDS parameter has the same
behavior.
2017-02-14 14:28:10 -08:00
Arnold Schwaighofer
39fa2f0228 Use the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.

Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.

Use the 'swiftself' attribute on self parameters and for closures contexts.

Use the 'swifterror' parameter for swift error parameters.

Change functions in the runtime that are called as native swift functions to use
the swift calling convention.

rdar://19978563
2017-02-14 12:17:57 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Kim Topley
fe8d8bb88a Fix the DispatchTime.init(uptimeNanoseconds:) initializer to convert its argument to Mach absolute time instead of treating it as Mach absolute time.
(Radar 29660448)
2017-02-13 12:24:38 -08:00
Kim Topley
5229d1a777 Revert "Fix the DispatchTime.init(uptimeNanoseconds:) initializer to convert its argument to Mach absolute time instead of treating it as Mach absolute time."
This reverts commit 1377cae2b9.
2017-02-13 12:22:06 -08:00
Kim Topley
1377cae2b9 Fix the DispatchTime.init(uptimeNanoseconds:) initializer to convert its argument to Mach absolute time instead of treating it as Mach absolute time.
(Radar 29660448)
2017-02-13 11:19:40 -08:00
Slava Pestov
8b01cb6e24 Merge pull request #7243 from ikesyo/gardening-seq-to-array-conversion
[gardening] Prefer `Array(seq)` over `seq.map { $0 }`
2017-02-11 19:42:23 -08:00
swift-ci
fd6b9fe0ec Merge pull request #7338 from ktopley-apple/dispatch-time-nanos 2017-02-10 13:29:49 -08:00
ktopley-apple
0cb1561035 Adding documentation to clarify the result of DispatchTime(uptimeNanoseconds: 0) (#7342)
(Radar 28814085)
(SR-2807)
2017-02-10 12:37:57 -08:00
Kim Topley
65032a6898 DispatchTime.uptimeNanoseconds returns incorrect value on some platforms.
(Radar 30332506)
2017-02-08 10:34:08 -08:00
Maxim Moiseev
8b95cc48de [stdlib] Fixing compilation warnings (#7314)
<rdar://problem/30320630>
2017-02-08 10:07:49 -08:00
Syo Ikeda
e2b03a98dd [gardening] Prefer Array(seq) over seq.map { $0 } 2017-02-04 10:37:22 +09:00
practicalswift
23b09dac73 [gardening] Use correct year in copyright headers 2017-02-03 20:38:30 +01:00
ktopley-apple
4854530db0 Fixes crash when DispatchData is created from an UnsafeBufferPointer<Uint8> with a nil address. (#7194)
Radar 29337927
2017-02-02 09:33:45 -08:00
Philippe Hausler
1a2687a72e [Foundation] Convert Data’s SubSequence type to be Data
Data can encapsulate it’s own sub-sequence type by housing a range of the slice in the structural type for Data. By doing this it avoids the API explosion of supporting all APIs that take Data would need overloads to take a slice of Data. This does come at a small conceptual cost: any index based iteration should always account for the startIndex and endIndex of the Data (which was an implicit requirement previously by being a Collection). Moreover this prevents the requirement of O(n) copies of Data if it is never mutated while parsing sub sequences; so more than an API amelioration this also could offer a more effecient code-path for applications to use.
2017-02-01 08:50:23 -08:00
Max Moiseev
0e7863129c Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-30 16:51:16 -08:00
swift-ci
138f75c80e Merge pull request #7036 from ktopley-apple/dispatch-data-copy 2017-01-30 11:06:25 -08:00
Jordan Rose
db45e57379 [SDK] Resolve unsafeBitCast warnings in the 'os' overlay. (#7120) 2017-01-27 19:36:20 -08:00
Jordan Rose
2c48542f2f [SDK] Resolve unsafeBitCast warnings in the CoreData overlay (#7118)
No intended functionality change.
2017-01-27 19:35:50 -08:00
Max Moiseev
90ef26824f Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-26 15:28:42 -08:00
Kim Topley
7d9ed86d8c Fixes handling of range indices in DispatchData.copyBytes() and adds tests for the copyBytes() method (Radar 29005050) 2017-01-26 09:13:25 -08: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
Brian Croom
dc4e856875 Merge pull request #6991 from briancroom/fix-XCTAssert-perf-regression
[SR-3701] [XCTest] Reduce bridging overhead from the exception-catching trampoline
2017-01-24 10:53:22 -08:00
Max Moiseev
441d2c03e2 Adding CustomDebugStringConvertible conformance to CGVector 2017-01-23 15:42:49 -08:00
Brian Croom
42b6577aa9 [XCTest] Reduce bridging overhead from the exception-catching trampoline
By returning `nil` instead of an empty dictionary in the common case where
no exception is encountered, we skip any dictionary-bridging work which
can become expensive if making assertions in a tight loop.
2017-01-23 15:02:38 -08:00
Max Moiseev
b5ab7263c1 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-23 11:00:33 -08:00
Max Moiseev
1265f0792a Implementing arithmetic operators on NSDecimal, CGFloat, and concrete FP types 2017-01-23 10:59:24 -08:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
Maxim Moiseev
89840c738a [dispatch] Fix + and - operations on DispatchTime and DispatchWallTime (#6961)
... for the cases where `seconds` parameter is NaN or infinite.
Fixes <rdar://problem/29764171>
2017-01-20 21:44:47 -08:00
NachoSoto
a12e739fb8 Fix the fixits for dispatch_async and dispatch_group_async
They erroneously suggested `DispatchQueue.asynchronously`, but it's actually `DispatchQueue.async`.
2017-01-20 15:05:15 -08:00
Max Moiseev
d128ed42b0 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-19 14:16:32 -08:00
Slava Pestov
5accebf556 Merge pull request #5344 from karwa/clearspecific
[Overlay/Dispatch]: Change DispatchQueue.setSpecific to take an optional
2017-01-18 15:59:45 -08:00
swift-ci
1b75481ab8 Merge pull request #6802 from moiseev/no-pi-warning 2017-01-17 12:23:48 -08:00
Max Moiseev
b2efca54d6 Removing unnecessary CGFloat->Double->CGFloat conversions 2017-01-17 11:29:50 -08:00
Kevin Ballard
aa0cfa33af Better default domain for CustomNSError
We were creating domains that looked like `"main.SomeError.Type"`
instead of the expected `"main.SomeError"`. Fix this and add some basic
tests.
2017-01-16 15:50:35 -08:00
Max Moiseev
764fc0aa13 Replacing M_PI with .pi 2017-01-13 18:25:04 -08:00