Commit Graph

1144 Commits

Author SHA1 Message Date
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
Robert Widmann
cef4e66233 Merge pull request #6776 from ArtSabintsev/feature/XCTAssertNoThrow
Implementation for XCTAssertNoThrow
2017-01-13 01:39:26 -07:00
Arthur Ariel Sabintsev
5008ed8421 Changed constant to _XCTAssertionType.noThrow 2017-01-13 02:43:11 -05:00
Arthur Ariel Sabintsev
741056578f Revert "All declarations in XCTest in SDK and XCTest in validations-tests have 2 spaces instead of 4"
This reverts commit 43a7b31490.
2017-01-13 01:38:27 -05:00
Arthur Ariel Sabintsev
43a7b31490 All declarations in XCTest in SDK and XCTest in validations-tests have 2 spaces instead of 4 2017-01-13 01:36:37 -05:00
Arthur Ariel Sabintsev
ec8e6c5a38 Changed success condition 2017-01-13 01:31:29 -05:00
Arthur Ariel Sabintsev
5f9352c8d2 Fixed indentation. 2017-01-13 01:28:53 -05:00
Arthur Ariel Sabintsev
b6d36fa86e Simplified throwable function evaluation and success case requirements. 2017-01-13 01:24:53 -05:00
Arthur Ariel Sabintsev
13094af307 Fixed indentation 2017-01-13 01:18:21 -05:00
Arthur Ariel Sabintsev
31b96ad3cd Adjusted _XCTRegisterFailure conditions. Added validation test for XCTAssertNoThrow 2017-01-13 00:41:47 -05:00
Arthur Ariel Sabintsev
7d726f2f32 Fixed smal bug with how expression was called 2017-01-13 00:20:54 -05:00
Arthur Ariel Sabintsev
f329b3b8bb Implemented assertionType in failure cases 2017-01-13 00:20:30 -05:00
Arthur Ariel Sabintsev
93bc18129f Now outputting caughtError 2017-01-13 00:17:44 -05:00
Arthur Ariel Sabintsev
e19da0b6b5 Fixed copy-paste error in error case. XCTAssertLessThanOrEqual to XCTAssertThrowsError 2017-01-13 00:09:28 -05:00
Arthur Ariel Sabintsev
e5e8eb7603 First pass at implementing XCTAssertNoThrow 2017-01-13 00:08:31 -05:00