Commit Graph

515 Commits

Author SHA1 Message Date
David Hart
66131c01d3 [SR-2626] Fix String to Float/Double “snan” conversion (#8036)
Adds an explicit check for `[+-]snan` to create an sNaN from a string.
2017-03-13 21:07:31 -04:00
Hugh Bellamy
329d437933 Fix Visual Studio squigglies/code-completion in GlobalObjects.cpp 2017-03-08 15:17:19 +07:00
Gonzalo Larralde
85f3fd1ebf [SR-4166] Change on how __mode__ attribute presence is checked to fix compilation issue. 2017-03-05 21:23:39 -03:00
Argyrios Kyrtzidis
9f62e5584f Fix -Wformat-pedantic warning. 2017-03-02 21:58:05 -08:00
Hugh Bellamy
6564a8b3b5 Use std::thread::hardware_concurrency instead of our own solution 2017-02-21 11:46:32 +07:00
Hugh Bellamy
3a96ded085 Don't use certain attributes in shims or stubs if the attribute doesn't exist 2017-02-20 10:16:30 +07: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
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
Hugh Bellamy
05a50fd978 Remove extern "C" from uses of SWIFT_RUNTIME_STDLIB_INTERFACE 2017-01-22 18:32:17 +00:00
practicalswift
2b4a6a573a [gardening] Use nullptr instead of NULL 2017-01-21 10:31:29 +01:00
Stephen Canon
d89f8f423e Go back to using static inline stubs for sqrt and remainder (#6769)
* Go back to using static inline implementations of sqrt and remainder now that SR-2089 is resolved.

* Fix typo: sqrt -> squareRoot.

* Added test for constant-folding sqrt with -O.

* Added test case requested by jrose.
2017-01-13 13:26:46 -05:00
Max Moiseev
195691523f [stdlib] Eliminating some 'unsafeBitcast' related warnings 2017-01-10 12:36:22 -08:00
swift-ci
294359bd69 Merge pull request #4804 from kstaring/master 2017-01-10 00:01:46 -08:00
Dave Abrahams
9392ac5d09 Merge pull request #6239 from hughbe/stubs-rand
Port stdlib/public/stubs/GlobalObjects to Windows
2017-01-09 15:21:07 -08:00
Slava Pestov
e0fa2e0872 Merge pull request #6238 from hughbe/stubs-clang-cl
Fix documentation warnings building runtime with clang-cl
2017-01-09 12:26:41 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Hugh Bellamy
3f802bb2ab Fix documentation warnings building runtime with clang-cl 2016-12-27 14:55:35 +00:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
Hugh Bellamy
aeaf0463af Port stdlib/public/stubs/GlobalObjects to Windows 2016-12-14 15:36:16 +00:00
K Staring
cd52ed65c9 fix erroneous logic pointed and commas out by @jrose-apple and @llvm-beanz 2016-12-14 00:10:22 +01:00
Hugh Bellamy
eca5b3da34 Change _MSC_VER conditions to _WIN32 conditions in stubs 2016-12-13 14:15:39 +00:00
Saleem Abdulrasool
c67a33fbc7 build: remove TARGET_SDKS from the runtime
The runtime and stubs are built for ALL targets, not specific ones.  This allows
us to configure when cross-compiling to Windows again.  Collapse the dual
addition of the swiftRuntime into a single build.  This unifies the runtime
build for the apple and non-Apple SDKs.  The difference here was the ObjC
interop sources.  In order to deal with that unification add a CPP macro to
indicate whether the interop sources should be included or not.
2016-12-03 17:02:44 -08:00
Erik Eckstein
9f8b68ae11 Mangling: use macros instead of hard-coded swift symbol names.
This makes it easier to switch between the old and new mangling scheme.
2016-12-02 15:55:30 -08:00
Jordan Rose
7d61a5e6a2 [SDK] Use an extra shims header to remove _silgen_name from Dispatch.
We still have a bunch of redeclarations of Dispatch functions to avoid
the automatic bridging of dispatch_data_t and dispatch_block_t, but
mostly this is a vast reduction in complexity (and increase in safety).
2016-12-01 16:06:15 -08:00
Saleem Abdulrasool
d4b5ceabfd stubs: match types in the stubs
The various uses where using `unsigned char` rather than `char`.  Adjust the one
instance accordingly.  Noticed when building the stubs for Windows.
2016-11-27 17:01:39 -08:00
practicalswift
01fe943de5 [gardening] Fix typo. 2016-11-24 17:58:40 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Alexis Beingessner
21405f1ac1 [runtime] statically construct the Dictionary and Set singletons 2016-11-18 13:56:57 -05:00
K Staring
5462fb235d different solution for detecting icu (not needed on Darwin, required on other platforms) 2016-11-17 21:08:44 +01:00
K Staring
536c1ac6ce Merge branch 'master' of https://github.com/apple/swift 2016-10-31 07:10:16 +01:00
practicalswift
f44686d825 [gardening] Fix trailing whitespace in *.cfg.in, *.html, *.mm and *.sil files 2016-10-29 14:06:43 +02:00
K Staring
5384630a18 don't require ICU on Darwin as per jrose-apple's comment 2016-10-25 20:42:17 +02:00
K Staring
f3b612a835 Merge branch 'master' of https://github.com/apple/swift 2016-10-21 22:37:25 +02:00
K Staring
22c0b4a9c8 fix ICU include paths. Please check this commit and verify that the previous solution simply coudn't have worked *at all*. The usage of slightly differently named variables (e.g. *LIB vs *LIBS) and lower-case module in the include for loop while a TOUPPER variable should have been used, caused the INCLUDE variables to never be filled. Apart from that, a find_package() was missing in the stubs CMakeFiles.txt . 2016-10-21 22:25:19 +02:00
K Staring
db8878e3e8 incoorporate @landonf and @dcci's suggestions wrt dynamic sysct KERN_PROC_ARGS buffer 2016-10-21 22:23:44 +02:00
Saleem Abdulrasool
7f088d3fe0 stdlib: mark shims with the visibility attribute
Ensure that the header and the implementation matches the ABI interface
annotations.
2016-10-18 11:36:15 -07:00
K Staring
8bda672c70 Merge branch 'master' of https://github.com/apple/swift 2016-10-15 18:36:36 +02:00
K Staring
ede70f2513 rolled back FreeBSD /proc changes and rewrote as per @landonf suggestion, through sysctl() call. Kept the function as similar to the other functions as possible. 2016-10-04 08:47:26 +02:00
Brian Gesiak
49248a44c2 [stubs] Prevent CMake from linking with object lib
Attempting to link against an object library results in a CMake error.
Prevent such an error by removing a line I mistakenly added in b86125ac.
2016-10-02 19:51:45 -04:00
K Staring
69085ae4eb Merge branch 'master' of https://github.com/apple/swift 2016-09-29 07:24:25 +02:00
Brian Gesiak
b86125accf [stubs] Update CMake to use TARGET_SDKS (NFC)
The `add_swift_library` CMake function takes an optional `TARGET_SDKS`
parameter. When used, only CMake targets for the specified SDKs are added.

Refactor `stdlib/public/stubs` to use this parameter. This also eliminates
logic that determines additional flags or source files to include based on
`SWIFT_HOST_VARIANT`, which makes it easier for hosts to add targets for
different platforms.
2016-09-28 22:41:15 -04:00
Brian Gesiak
7fc8d14630 Merge pull request #4862 from modocache/stubs_link_libraries
[stubs] Remove empty CMake variable
2016-09-26 08:08:40 -04:00
Joe Groff
2bfe9214ed Merge pull request #4869 from jckarter/optional-bridging
(take 2) SR-0140: Bridge Optionals to nonnull ObjC objects by bridging their payload, or using a sentinel.
2016-09-20 14:35:13 -07:00
Joe Groff
1a52e3f2c2 SR-0140: Bridge Optionals to nonnull ObjC objects by bridging their payload, or using a sentinel.
id-as-Any lets you pass Optional to an ObjC API that takes `nonnull id`, and also lets you bridge containers of `Optional` to `NSArray` etc. When this occurs, we can unwrap the value and bridge it so that inhabited optionals still pass into ObjC in the expected way, but we need something to represent `none` other than the `nil` pointer. Cocoa provides `NSNull` as the canonical "null for containers" object, which is the least bad of many possible answers. If we happen to have the rare nested optional `T??`, there is no precedented analog for these in Cocoa, so just generate a unique sentinel object to preserve the `nil`-ness depth so we at least don't lose information round-tripping across the ObjC-Swift bridge.

Making Optional conform to _ObjectiveCBridgeable is more or less enough to make this all work, though there are a few additional edge case things that need to be fixed up. We don't want to accept `AnyObject??` as an @objc-compatible type, so special-case Optional in `getForeignRepresentable`.

Implements SR-0140 (rdar://problem/27905315).
2016-09-20 13:04:09 -07:00
airspeedswift
ed5231b47c Numbered all FIXME(ABI) entries for tracking purposes. (#4868) 2016-09-19 16:41:41 -07:00
Brian Gesiak
4e552479b4 [stubs] Remove empty CMake variable
`swift_stubs_link_libraries` was removed in d227aeb64d. Remove the
`LINK_LIBRARIES` parameter, since its argument will always be empty.
2016-09-19 13:15:39 -04:00
K Staring
b267fda3c8 Merge branch 'master' of https://github.com/apple/swift 2016-09-18 13:09:34 +02:00
practicalswift
8d6251de66 [gardening] Fix accidental uses of \t 2016-09-17 13:15:26 +02:00
Greg Parker
cd9a8afd5d Revert "SR-0140: Bridge Optionals to nonnull ObjC objects by bridging their payload, or using a sentinel." (#4820) 2016-09-15 18:18:07 -07:00
Joe Groff
cfa9cd9a08 SR-0140: Bridge Optionals to nonnull ObjC objects by bridging their payload, or using a sentinel.
id-as-Any lets you pass Optional to an ObjC API that takes `nonnull id`, and also lets you bridge containers of `Optional` to `NSArray` etc. When this occurs, we can unwrap the value and bridge it so that inhabited optionals still pass into ObjC in the expected way, but we need something to represent `none` other than the `nil` pointer. Cocoa provides `NSNull` as the canonical "null for containers" object, which is the least bad of many possible answers. If we happen to have the rare nested optional `T??`, there is no precedented analog for these in Cocoa, so just generate a unique sentinel object to preserve the `nil`-ness depth so we at least don't lose information round-tripping across the ObjC-Swift bridge.

Making Optional conform to _ObjectiveCBridgeable is more or less enough to make this all work, though there are a few additional edge case things that need to be fixed up. We don't want to accept `AnyObject??` as an @objc-compatible type, so special-case Optional in `getForeignRepresentable`.

Implements SR-0140 (rdar://problem/27905315).
2016-09-14 15:50:13 -07:00