Commit Graph

812 Commits

Author SHA1 Message Date
Jordan Rose
f12afd2ffa Merge pull request #8010 from KingOfBrian/bugfix/SR-1762-Remove-Final-In-Protocol-Extensions
Remove final in protocol extensions
2017-03-13 16:23:24 -07:00
Max Moiseev
7d73b2e1ca Arithmetic => Numeric 2017-03-13 11:50:02 -07:00
Philippe Hausler
ce3ccfbd9b Change shims to always be counted as system headers via -isystem instead of conditionally marking them in debug versus non debug builds. (#7979) 2017-03-09 16:09:16 -08:00
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
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
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
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
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
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
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
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
Max Moiseev
d128ed42b0 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-19 14:16:32 -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
Max Moiseev
d5e56d674f Removing explicit implementation of arithmetic operators from Decimal in favor of defaults 2017-01-12 15:54:37 -08:00
Max Moiseev
fa7368ad7d Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-11 14:37:01 -08:00
Syo Ikeda
b1011ca176 [Foundation][gardening] Remove unnecessary breaks 2017-01-12 02:06:56 +09:00
Tony Parker
3345050957 Merge pull request #6615 from phausler/data_append_truncation_fix
[Foundation] Correct sequence initializers for Data when repeating:count: is called and add a memset fast-path
2017-01-10 13:26:09 -08:00
Max Moiseev
aecccc7e48 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-09 17:38:04 -08:00
Tony Parker
d34d36ecbc Remove errant definition of a URLResourceValue key 2017-01-09 16:13:32 -08:00
practicalswift
3918d9d251 [gardening] Replace likely word processor artefacts with ASCII equivalents (— → --, … → ...) 2017-01-08 15:23:06 +01:00
Ben Cohen
578a52627a Merge branch 'master' into se-147 2017-01-07 13:19:15 -08:00
Ben Cohen
3bdada1773 Merge pull request #6506 from airspeedswift/im-not-warning-you-again
[stdlib] Squash various warnings
2017-01-06 16:51:06 -08:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
Robert Widmann
7d427aa62e Merge pull request #6569 from mekjaer/mk-inconsistent-spacing-on-properties-and-arguments
[gardening] spacing on properties and arguments in IndexSet (stdlib)
2017-01-06 16:11:00 -07:00
Philippe Hausler
45714e6263 [Foundation] Correct sequence initializers for Data when repeating:count: is called and add a memset fast-path 2017-01-06 13:56:08 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
Ben Cohen
4dc5eacef5 Merge branch 'master' into im-not-warning-you-again 2017-01-05 10:11:48 -08:00
mekjaer
272dfb26df Gardening spacing on properties and arguments in IndexSet (stdlib) 2017-01-04 23:09:17 +01:00
Slava Pestov
6bea9534fe Merge pull request #6523 from jpsim/jp-inconsistent-closure-spacing
[gardening] fix mismatched closure open/close spacing in stdlib source
2017-01-03 20:59:38 -08:00
JP Simard
65688bdc39 [gardening] replace unused closure parameters with '_' in stdlib source (#6522)
* replace unused closure parameters with '_' in stdlib source

* fold some _ closure arguments into line above

* fold more _ closure arguments into line above
2017-01-03 20:10:41 -07:00
Robert Widmann
fca7b66b7c Merge pull request #6521 from jpsim/jp-void-return
[gardening] prefer '-> Void' over '-> ()' in stdlib source
2017-01-03 20:10:13 -07:00
JP Simard
891729f6c2 remove redundant '-> Void' return types from functions in stdlib source
since omitting it appears to be the convention followed elsewhere in
the code base.
2017-01-03 16:38:57 -08:00
Robert Widmann
359a66488f Merge pull request #6520 from jpsim/jp-trailing-semicolon
[gardening] remove trailing semicolons in stdlib source
2017-01-03 17:31:34 -07:00
Robert Widmann
6dd2dda53e Merge pull request #6525 from jpsim/jp-omit-control-statement-parens
[gardening] remove superfluous parentheses in control statements in stdlib source
2017-01-03 17:27:23 -07:00
JP Simard
83b6d3c29c remove redundant optional nil assignment in stdlib source
since this appears to be the convention followed elsewhere in the code base.
2016-12-31 18:45:01 -08:00
JP Simard
7301b79342 remove superfluous parentheses in control statements in stdlib source
since this appears to be the convention followed elsewhere in the code base.
2016-12-31 18:40:15 -08:00