Commit Graph

147 Commits

Author SHA1 Message Date
Puyan Lotfi
6691fda8ec Appending SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS to SWIFT_COMPILE_FLAGS.
There are situations where you want to build against a libc that is out
of tree or that is not the system libc (Or for cross build scenarios).
This is a change for passing the -sdk and include paths for things like
this.
2019-07-01 09:43:47 -07:00
Ross Bayer
dfb2d31e74 Rename the LIBRARY_INSTALL_NAME_DIR argument in add_swift_target_library to DARWIN_INSTALL_NAME_DIR which better explains that this argument only controls the install_name_dir for Darwin platforms. 2019-04-29 16:46:09 -07:00
Ross Bayer
b855119fbe Added a new CMake cache variable to control the private standard library install_name_dir. Those libraries are not going to be installed in /usr/lib/swift and thus need to be controlled via a separate mechanism. 2019-04-29 16:46:09 -07:00
Saleem Abdulrasool
83b290438c Windows: bridge BOOL to Bool
This allows the conversion of the Windows `BOOL` type to be converted to
`Bool` implicitly.  The implicit bridging allows for a more ergonomic
use of the native Windows APIs in Swift.

Due to the ambiguity between the Objective C `BOOL` and the Windows
`BOOL`, we must manually map the `BOOL` type to the appropriate type.
This required lifting the mapping entry for `ObjCBool` from the mapped
types XMACRO definition into the inline definition in the importer.

Take the opportunity to simplify the mapping code.

Adjust the standard library usage of the `BOOL` type which is now
eclipsed by the new `WindowsBool` type, preferring to use `Bool`
whenever possible.

Thanks to Jordan Rose for the suggestion to do this and a couple of
hints along the way.
2019-04-25 17:52:08 -07:00
Mike Ash
4fb99998ae [Build] Use magic linker symbols to specify an @rpath-relative install name when targeting pre-stable-ABI OSes.
Magic symbols of the form $ld$install_name$os9.0$@rpath/libswiftCore.dylib tell the linker to use that install name when targeting that OS version. Use these symbols to specify an @rpath install name for all back-deployment libraries when targeting watchOS 2.0-5.1, iOS 7.0-12.1, and macOS 10.9-10.14.

rdar://problem/45027809
2019-03-22 10:04:39 -04:00
Michael Gottesman
384882d5f3 Merge pull request #23201 from compnerd/patience-is-not-always-a-virtue
build: introduce and switch to GYB_SOURCES
2019-03-20 13:27:32 -07:00
Saleem Abdulrasool
46bb45a51a SwiftPrivate: add isClosed property
Since the `_FDOutputStream` type does not conform to a protocol, the
required interface was missed.  The changes in
fbce6e7873 introduced a use of the
`isClosed` property which broke the Windows build.  This should fix the
windows build.
2019-03-18 08:05:26 -07:00
Saleem Abdulrasool
8ed5c1a4bc build: introduce and switch to GYB_SOURCES
This avoids us having to pattern match every source file which should
help speed up the CMake generation.  A secondary optimization is
possible with CMake 3.14 which has the ability to remove the last
extension component without having to resort to regular expressions.  It
also helps easily identify the GYB'ed sources.
2019-03-11 13:48:54 -07:00
Saleem Abdulrasool
6827b68a75 SwiftPrivate: correct dependencies on Windows
Ensure that we explicitly state the dependency on WinSDK to avoid issues
in parallel builds.  Caught by the Windows nightlies.
2019-01-06 11:41:18 -08:00
Saleem Abdulrasool
7ecaeb1727 stdlib: implement _FDStreams in terms of HANDLES
Use HANDLE on Windows to create the FDStreams.  This will be used by the
standard library unit test test harness.
2018-12-21 14:19:03 -08:00
Maxim Moiseev
165fe328c3 [stdlib] tee _stdlib_AtomicInt > SwiftPrivate
Turns out some people used this type despite it being prefixed with
`_stdlib_`, so we have to keep it, with an obsoletion message this time.
Second copy of the same type is kept available past Swift 5 in
SwiftPrivate for use in tests.
2018-12-18 16:12:47 -08:00
Saleem Abdulrasool
39f2ac98b7 SwiftPrivate: fix dependencies on Windows
This module needs MSVCRT and WinSDK on Windows.  Track the dependencies.
2018-12-16 22:26:44 -08:00
Mike Ash
9266cb7229 Merge branch 'master' into remove-swiftprivate-swiftdarwin-dependency 2018-11-06 19:45:26 -05:00
Max Moiseev
ddcd8d324a Merge pull request #20243 from arguiot/patch-1
Updated SwiftPrivate.swift using String Interpolation
2018-11-06 14:49:15 -08:00
Mike Ash
45693049bf [Stdlib] Remove SwiftPrivate's dependency on Darwin.
Revert #20194, which seems to be more trouble than it's worth. Instead, move the functions that SwiftPrivate needs back into LibcShims.h/cpp as SPI.

rdar://problem/45817565
2018-11-06 17:41:56 -05:00
Maxim Moiseev
ca51626fd3 [stdlib] Move _stdlib_AtomicInt and friends out of the stdlib 2018-11-06 09:53:58 -08:00
Xiaodi Wu
049b89ce4d Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:19:20 +08:00
Xiaodi Wu
977a9558ce Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:19:12 +08:00
Xiaodi Wu
577e5534fd Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:19:06 +08:00
Xiaodi Wu
f76be9b08f Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:59 +08:00
Xiaodi Wu
dc9d2b5da9 Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:51 +08:00
Xiaodi Wu
3228c800a6 Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:46 +08:00
Xiaodi Wu
aede4b07ab Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:42 +08:00
Arthur Guiot
117d7baab8 Fixed indentation to 2 spaces in SwiftPrivate.swift 2018-11-03 11:27:20 +08:00
Arthur Guiot
e6fea9e6ed Fixed header in SwiftPrivate.swift 2018-11-02 23:46:19 +08:00
Arthur Guiot
b957a3b9d4 Fixed git error... 2018-11-02 23:44:34 +08:00
Arthur Guiot
08f5db8de5 Updated SwiftPrivate.swift using String Interpolation
I updated /stdlib/private/SwiftPrivate/SwiftPrivate.swift using String Interpolations, so the code is more readable and more "Swifty"
2018-11-02 23:32:28 +08:00
Mike Ash
0ce854abf9 [Stdlib] Add Darwin/Glibc as a dependency for SwiftPrivate.
The changes in https://github.com/apple/swift/pull/19614 require Darwin/Glibc to build first. This usually happened anyway (and thus the problem wasn't noticed for a while) but sometimes SwiftPrivate would win the race and the build would fail.

rdar://problem/45624328
2018-10-31 16:46:28 -04:00
Michael Gottesman
3f17bb6ddf Carefully split the build's invocation of add_swift_library into host/target variants.
The key thing here is that all of the underlying code is exactly the same. I
purposely did not debride anything. This is to ensure that I am not touching too
much and increasing the probability of weird errors from occurring. Thus the
exact same code should be executed... just the routing changed.
2018-10-27 12:58:51 -07:00
Mike Ash
5f17b450c3 [Stdlib] Make all the functions in LibcShims.h either INTERNAL or inline. Move LibcShimsInline.h to LibcOverlayShims.h for more consistent naming. Fix up several tests that needed the mock Darwin overlay built. Fix one SourceKit test that no longer produces is_system: 1 on an import Darwin line. 2018-10-03 09:55:34 -04:00
Mike Ash
ec25f928ff [Stdlib] Move _swift_stdlib_read/write/close into LibcShimsInline.h. 2018-10-03 09:55:34 -04:00
Mike Ash
e18e03171f [Stdlib] Change SWIFT_RUNTIME_STDLIB_INTERNAL to not export the symbol.
The functions in LibcShims are used externally, some directly and some through @inlineable functions. These are changed to SWIFT_RUNTIME_STDLIB_SPI to better match their actual usage. Their names are also changed to add "_swift" to the front to match our naming conventions.

Three functions from SwiftObject.mm are changed to SPI and get a _swift prefix.

A few other support functions are also changed to SPI. They already had a prefix and look like they were meant to be SPI anyway. It was just hard to notice any mixup when they were #defined to the same thing.

rdar://problem/35863717
2018-10-03 09:55:33 -04:00
Pavel Yaskevich
6c5e73d177 [stdlib] NFC: Fix deprecation warning related to index(of:)
`index(of:)` has been replaced with `firstIndex(of:)`.
2018-08-31 13:21:12 -07:00
Ben Rimmington
2f326bcc88 [stdlib] Remove theGlobalMT19937
SwiftPrivate/PRNG.swift:

- currently uses `theGlobalMT19937`;
- previously used `arc4random` (see #1939);
- is obsoleted by SE-0202: Random Unification.
2018-08-01 13:00:16 +01:00
Ben Cohen
4694310e51 [stdlib] Some minor cleanup (#18130)
* Remove case destructuring to _

* Remove some Iterator.Element

* Which idiot wrote this? Oh.

* Switch NibbleSort to just use default impls... shouldn't change perf
2018-07-21 17:29:57 -07:00
Michael Ilseman
459833725e [String] Streamline more String creation logic.
Streamline and de-genericize non-inlinable internal functions to
create a String from UTF-8 efficiently.
2018-05-13 07:38:55 -07:00
Michael Ilseman
683fb47c01 Merge pull request #14755 from milseman/so_smol
Smol String
2018-03-28 18:29:50 -07:00
Michael Ilseman
cdfeb88cfe [string] Simplify creation logic, especially for C strings.
Streamline internal String creation. Previously, everything funneled
into a single generic function, however, every single call of the
generic funnel had relevant specific information that could be used
for a more efficient algorithm.

In preparation for efficiently forming small strings, refactor this
logic into a handful of more specialized subroutines to preserve more
specific information from the callers.
2018-03-27 10:49:02 -07:00
Devin Coughlin
e9d0be2365 [stdlib] Fix exclusivity warning in SwiftPrivate/IO.swift. NFC. 2018-03-25 16:13:18 -07:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
taylor swift
c85880899d implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods 2017-11-17 21:28:03 -08:00
Roman Levenstein
c3bc08ec06 Remove any mention of sil-serialize-all related flags from CMake files and build-script-impl
These flags are not needed anymore.
2017-10-21 19:18:15 -07:00
Xiaodi Wu
3528479730 Silence compiler warnings 2017-07-05 23:56:44 -05:00
Dave Abrahams
ddf7ad517f UnicodeScalar => Unicode.Scalar 2017-05-11 15:23:25 -07:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Max Moiseev
70b2343626 Merge branch 'master' into new-integer-protocols 2016-11-28 15:25:01 -08: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
Maxim Moiseev
655bfe2a57 FIXMEs to change FixedWidthInteger to BinaryInteger in generic code 2016-07-29 13:31:21 +03:00
Maxim Moiseev
6dbb572038 toIntMax is gone 2016-07-29 13:31:21 +03:00