Commit Graph

13406 Commits

Author SHA1 Message Date
Valeriy Van
78fb0f7774 Removes redundant buffer zeroing 2020-02-28 23:32:05 +01:00
Valeriy Van
47acd72a6b Removes redundand buffer zeroing 2020-02-28 23:23:49 +01:00
Saleem Abdulrasool
3a12738ebc stdlib: repair the macOS -stdlib build
When building on macOS without the standard library but building the
extra toolchain content, we would fail to configure due to the missing
include of the `AddSwiftStdlib`.
2020-02-27 20:45:24 -08:00
Kuba Mracek
84c4864911 [arm64e] Add Swift compiler support for arm64e pointer authentication 2020-02-27 16:10:31 -08:00
Butta
c2a73c88ce [build] Don't reset 'swiftlib_link_flags_all' unnecessarily 2020-02-28 03:11:44 +05:30
Saleem Abdulrasool
fc67fc74fb build: shuffle around some functions
This is a purely code motion change.  It moves the functions that are
specific to `SwiftSource.cmake` into `SwiftSource.cmake`.  Target
functions are moved to `stdlib/cmake/modules/AddSwiftStdlib.cmake`.
2020-02-26 12:47:43 -08:00
Michael Gottesman
48939898f6 Merge pull request #30064 from gottesmm/pr-f768cd12b2b9ed81d02c7df2f86e47aa07ef8cbe
[stdlib] Mark Unmanaged._withUnsafeGuaranteedRef as _transparent and add a test/comments as requested in the original PR where this landed.
2020-02-25 19:32:26 -08:00
Ravi Kandhadai
482c82cee5 Merge pull request #30060 from ravikandhadai/oslog-dynamic-precision
[os log][stdlib/private] Enable precision and alignment values to be dynamic.
2020-02-25 19:08:19 -08:00
Michael Gottesman
59823811b5 [stdlib] Mark Unmanaged._withUnsafeGuaranteedRef as _transparent and add a test/comments as requested in the original PR where this landed.
rdar://59735604
2020-02-25 15:46:19 -08:00
Ravi Kandhadai
7c9ddca1d4 [os log][stdlib/private] Enable precision and alignment values to be dynamic.
The format specifier constructed by the os log implementation uses '*' for
width and precision, and passes those values to the os_log ABIs as additional
arguments of the message. (The precision/alignment arguments have the
type: count).

Update tests to handle this change.
2020-02-25 15:11:48 -08:00
Michael Gottesman
9e8d65fbf8 Merge pull request #30033 from gottesmm/pr-89ff0d5130b608cdfae1e68dfc8c4b10de0f78cd
[stdlib] Change _withUnsafeGuaranteedRef to use Builtin.convertUnownedUnsafeToGuaranteed.
2020-02-25 14:25:48 -08:00
Daniel Rodríguez Troitiño
073e44d6e8 Merge pull request #29296 from buttaface/droid
[android] Get build scripts working natively, fix tests and install
2020-02-24 21:05:47 -08:00
Michael Gottesman
7820ddc7c7 [stdlib] Change _withUnsafeGuaranteedRef to use Builtin.convertUnownedUnsafeToGuaranteed.
This builtin (which lowers to raw SIL that doesn't use an actual builtin
instruction) allows us to access an unmanaged value at +0 with a language
guarantee rather than relying on the optimizer.

Previously, we did not do this directly since without OSSA, we were scared that
the frontend/optimizer would not be able to safely emit this code. Now that we
have ownership ssa, we are able to ensure that the frontend always copies the +0
value passed into the closure if the value +0 escapes from the closure (either
via a return, storing into memory, or by passing off as a +1 parameter to a
function).

rdar://59735604
2020-02-24 12:49:45 -08:00
Xiaodi Wu
4d59bc51b0 Merge pull request #30021 from xwu/private-not-fileprivate
[NFC] Minimize uses of 'fileprivate' after SE-0169
2020-02-24 12:05:21 -05:00
Saleem Abdulrasool
2e2e886832 build: bifurcate _add_swift_executable_single 2020-02-23 14:20:12 -08:00
Xiaodi Wu
1d7ec4c129 [NFC][Foundation] Remove or replace unnecessary uses of 'fileprivate' 2020-02-23 13:45:13 -05:00
Xiaodi Wu
ae423c5bcd [NFC] Replace two uses of 'fileprivate' with 'private' 2020-02-23 12:05:39 -05:00
Nate Cook
c6183ee71b Add RangeSet and discontiguous collection operations (#28161)
This adds the RangeSet and DiscontiguousSlice types, as well as collection
operations for working with discontiguous ranges of elements. This also adds
a COWLoggingArray type to the test suite to verify that mutable collection
algorithms don't perform unexpected copy-on-write operations when mutating
slices mid-operation.
2020-02-22 15:33:03 -06:00
Slava Pestov
20048bdc0d Runtime: Bounds check method override descriptors 2020-02-21 02:05:47 -05:00
Slava Pestov
dd94d57504 Merge pull request #29972 from slavapestov/clean-up-metadata-relative-pointers
ABI: Clean up context and method descriptor pointers
2020-02-20 22:22:41 -05:00
David Smith
428a08d498 Merge pull request #29978 from Catfish-Man/get-in-the-zone
Cache the default malloc zone
2020-02-20 18:25:46 -08:00
David Smith
71b8d03990 Cache the default malloc zone 2020-02-20 16:43:58 -08:00
Slava Pestov
dd5b967bc9 Merge pull request #29971 from slavapestov/fix-reflection-warning
Reflection: Fix a compiler warning
2020-02-20 19:22:25 -05:00
Michael Ilseman
bfd0de4928 Revert "Revert "Revert "swift-lang: shuffle the source directory structure (N…" 2020-02-20 15:39:51 -08:00
Slava Pestov
a98f446f5f ABI: Clean up context and method descriptor pointers 2020-02-20 17:20:19 -05:00
Slava Pestov
2ae049121f Reflection: Fix a compiler warning 2020-02-20 17:19:21 -05:00
Michael Ilseman
2897daa434 Merge pull request #22616 from karwa/substring_inline
[stdlib] Make some trivial Substring methods inlinable
2020-02-20 09:25:38 -08:00
Saleem Abdulrasool
f00cf8a1a3 Merge pull request #29941 from compnerd/it-just-works
Revert "Revert "swift-lang: shuffle the source directory structure (N…
2020-02-20 08:13:03 -08:00
Alexis Laferrière
814491af50 Merge pull request #29942 from xymus/spitdlib
[stdlib] Update one String initializer and client to use @_spi
2020-02-19 19:43:39 -08:00
David Smith
3fe6b65899 Merge pull request #24303 from Catfish-Man/uninitialized-initialize
Add the new uninitialized buffer String initializer privately and use it to fix a perf TODO in append
2020-02-19 16:42:25 -08:00
Alexis Laferrière
4055c94d6d [stdlib] Update one String initializer and client to use @_spi 2020-02-19 16:38:51 -08:00
Saleem Abdulrasool
200b96df81 Revert "Revert "swift-lang: shuffle the source directory structure (NFC)""
This reverts commit beb8ecd8cc.  Add a
workaround for the dependency issue.

It is unclear why `sourcekitd` is getting added improperly as a
dependency on `lib/sourcekitd.framework/sourcekitd`.  This workaround
adjusts the dependency such that we end up with a dependency on
`lib/sourcekitd.framework/Versions/A/sourcekitd` as an order-only
dependency.  This should fix the compile issue.  I am unable to
reproduce this issue with the `add_library` usage for adding a Swift
library.  This allows us to cleave the host and target libraries, and so
the workaround is sufficient to make progress and the problem will be
resolved with the migration towards CMake for handling the dependencies.
2020-02-19 16:09:37 -08:00
Ben Langmuir
beb8ecd8cc Revert "swift-lang: shuffle the source directory structure (NFC)"
This reverts commit edbe22b63c.
2020-02-19 13:33:08 -08:00
Ben Langmuir
089d347104 Revert "[swift-lang] Fix dependency on sourcekitd module"
This reverts commit 0ab98fc0e4.
2020-02-19 13:32:54 -08:00
David Smith
35e21b0bbd SR-10556 _foreignGrow should use the uninitialized-buffer String initializer once it's in 2020-02-19 11:17:11 -08:00
Ben Langmuir
0ab98fc0e4 [swift-lang] Fix dependency on sourcekitd module
The link dependency is not sufficient, because this code depends on the
sourcekitd header and module map, which are produced during the build
process.  This started failing after edbe22b63c, where the dependency
on `sourcekitd-test` was removed. That dependency was itself wrong,
but it happened to be a good enough approximation that we never saw
issues.
2020-02-19 08:45:38 -08:00
David Smith
6616e812c6 Merge pull request #29909 from Catfish-Man/cant-switch-off-a-switched-off-lightswitch
Avoid incorrectly asserting when we disable pure Swift deallocation on an object that has a side table
2020-02-18 15:10:56 -08:00
Mike Ash
6c19d6f257 Merge pull request #29904 from mikeash/fix-swiftnativeerror-description-memory-management
[Stdlib] Fix an overrelease in -[__SwiftNativeNSError description].
2020-02-18 15:07:26 -05:00
David Smith
4bd56334ef Avoid incorrectly asserting when we disable pure Swift deallocation on an object that has a side table 2020-02-18 11:44:37 -08:00
Mike Ash
2763e13a9a [Stdlib] Fix an overrelease in -[__SwiftNativeNSError description].
getDescription takes its argument at +1, but the implementation was passing the value directly. This caused the contained error value to be destroyed.

rdar://problem/59512630
2020-02-18 11:30:03 -05:00
Saleem Abdulrasool
61832cb3da Merge pull request #29823 from compnerd/swift-lang-rises
swift-lang: shuffle the source directory structure (NFC)
2020-02-18 08:22:36 -08:00
swift-ci
04fafd7e26 Merge pull request #29881 from swiftwasm/swiftwasm-string 2020-02-18 04:22:21 -08:00
Slava Pestov
c4203ddafa Merge pull request #29887 from slavapestov/conformance-cache-sillyness
Runtime: Less eager instantiation of type metadata in the conformance cache
2020-02-17 20:47:47 -05:00
Slava Pestov
4e39455173 Update ProtocolConformance.cpp 2020-02-17 17:54:26 -05:00
Slava Pestov
1ca2b61f7a Runtime: Less eager instantiation of type metadata in the conformance cache
The ConformanceCandidate constructor would eagerly instantiate metadata for
all non-generic types in the conformance cache. This was not the intention
of the code though, because it can compare nominal type descriptors --
which are emitted statically -- for those types that have them, namely
everything except for foreign and Objective-C classes.

Change the order of two calls so that the lazy path has a chance to run.
This fixes a crash when type metadata uses weakly-linked symbols
which are not available, which can come up in backward deployment
scenarios.

Fixes <rdar://problem/59460603>.
2020-02-17 16:24:42 -05:00
Mike Ash
57a3df5da9 Merge pull request #29848 from mikeash/eagerly-realize-empty-singletons
[Stdlib] Eagerly realize EmptyDictionarySingleton and EmptySetSingleton.
2020-02-17 09:56:19 -05:00
Max Desiatov
8e705f3413 [WebAssembly] Add wasm32 support to stdlib String 2020-02-17 12:51:34 +00:00
Saleem Abdulrasool
edbe22b63c swift-lang: shuffle the source directory structure (NFC)
This moves the swift-lang library out of the tools/SourceKit directory
and into the stdlib directory.  As it stands, the library required that
the standard library and the SDK overlay was being built.  This is
implicitly done when building the stdlib subdirectory.  Furthermore, it
had an odd tie between the flags for Swift and SourceKit which now have
the logic separated.  This clearly delineates the host and target
components in the repository.
2020-02-16 19:12:47 -08:00
tbkka
4d0e2adbef Further refinement of {Float,Double,Float80}.init(_:String) (#29028)
* Further refinement of {Float,Double,Float80}.init(_:String)

After talking with @stephentyrone, I found some additional simplifications. No
functional change, just shorter/simpler.

This makes the generic inlineable part a small stub that delegates to the full
non-inlined version.

ABI compatibility:
* We support the same generic init() as before
* _swift_stdlib_strtoXYZ_clocale is still available to
  support old inlined code

API addition:
* We now have a public specialized form of init?(_: Substring)
  in addition to the generic init?<S:StringProtocol> form.

* Add @available marker to new API

* Support back-deployment to older OSes by inlining the full version
2020-02-14 16:16:29 -08:00
Mike Ash
440d2799f7 [Stdlib] Eagerly realize EmptyDictionarySingleton and EmptySetSingleton.
These objects can escape into ObjC without their class being realized first, which can cause a crash if the unrealized class gets passed into the ObjC runtime.

rdar://problem/59295395
2020-02-14 11:57:52 -05:00