Commit Graph

13406 Commits

Author SHA1 Message Date
David Smith
0ae4b0ab64 Merge pull request #25866 from Catfish-Man/someone-set-up-us-the-bom
Bridge non-ASCII SmallStrings as native Swift Strings rather than by creating CFStrings
2019-07-02 23:59:29 -07:00
David Smith
27359bdec6 Bridge non-ASCII SmallStrings as native Swift Strings rather than by creating CFStrings. This gets consistent behavior with non-smol Strings when the String contains a BOM 2019-07-02 16:34:22 -07:00
Michael Ilseman
63a6794cf9 [String] Switch scalar-aligned bit to a reserved bit.
Since scalar-alignment is set in inlinable code, switch the alignment
bit to one of the previously-reserved bits rather than a grapheme
cache bit. Setting a grapheme cache bit in inlinable would break
backward deployment, as older versions would interpret it as a cached
value.

Also adjust the name to "scalar-aligned", which is clearer, and
removed assertion (which should be a real precondition).
2019-07-02 16:25:04 -07:00
Slava Pestov
7cc4be421f Fix invalid method overrides in StdlibCollectionUnittest 2019-07-02 15:43:02 -04:00
Saleem Abdulrasool
88f8a3c597 Merge pull request #25846 from plotfi/master2
Appending SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS to SWIFT_COMPILE_FLAGS.
2019-07-01 16:34:40 -07:00
David Smith
e4989cd749 Merge pull request #25923 from Catfish-Man/turn-fast-dealloc-back-off
Revert "Use the remaining half bit in the refcount to bypass ObjC deallocation overhead"
2019-07-01 16:23:41 -07:00
Karoy Lorentey
f0291626e3 Merge pull request #25873 from lorentey/RawRepresentable-hashing
[stdlib] RawRepresentable: revert to default _rawHashValue(seed:)
2019-07-01 16:22:57 -07:00
David Smith
a84af6f68b Revert "Revert "Revert "Use the remaining half bit in the refcount to bypass ObjC deallocation overhead"""
This reverts commit c51294671b.
2019-07-01 14:29:40 -07:00
Scott Perry
f994fc3f80 Merge pull request #25808 from numist/numist/diffing-performance-master
Performance improvements and availability updates for Collection.difference(from:using:)
2019-07-01 14:20:07 -07:00
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
Saleem Abdulrasool
b8dbd9f667 Windows: replace @_fixed_layout with @frozen
Address warning that `@_fixed_layout` has been replaced with `@frozen`.
2019-06-30 15:04:11 -07:00
Karoy Lorentey
09bf1f72b1 [stdlib] RawRepresentable: revert to default _rawHashValue(seed:)
https://bugs.swift.org/browse/SR-10734
2019-06-29 11:49:51 -07:00
Saleem Abdulrasool
61d60a791a build: fix cross-compilation of android
The two modulemap construction were flipped. This showed up as a build
failure trying to cross-compile from Windows to android.
2019-06-29 10:26:05 -07:00
Steven Brunwasser
e7746b0eba Capitalize the w in with 2019-06-28 21:36:17 -07:00
Steven Brunwasser
2e22f57d79 Fix wording for manual string management header 2019-06-28 21:32:40 -07:00
Steven Brunwasser
c93b18d8b3 "Must" must not be used outside a precondition 2019-06-28 21:13:09 -07:00
Steven Brunwasser
23d40e7e6d Correct spelling mistakes and typos 2019-06-28 20:58:28 -07:00
Steven Brunwasser
707697c53f Fix verb tense disagreement 2019-06-28 20:54:20 -07:00
Saleem Abdulrasool
310f028d9e Merge pull request #25841 from compnerd/SDK-printing
SDK configuration
2019-06-28 10:56:13 -07:00
Saleem Abdulrasool
866da7fe1e Merge pull request #25823 from compnerd/standard-library-project
build: define a "top level" project for the stdlib
2019-06-27 20:47:13 -07:00
Saleem Abdulrasool
ee5e11ae0d build: allow configuration of the system header location
Rather than hardcoding the paths to /usr/include, allow the user to set
the path to their libc headers.  This is particularly important for
environments which may not use the traditional layout (e.g. exherbo) or
for builds which wish to build against an out-of-tree, non-system
installed libc for a Unix target which does not match the host system
(i.e. foreign cross-compilation).
2019-06-27 19:13:52 -07:00
Puyan Lotfi
dba135c8e2 Fixing SWIFT_COMPILE_FLAGS -parse-stdlib. 2019-06-27 16:02:25 -07:00
Scott Perry
3d741f7f2e Restore call to reserveCapacity 2019-06-27 16:01:17 -07:00
Karoy Lorentey
6aa313b8dd Merge pull request #25425 from lorentey/regenerate-deps
[SDK] Adjust dependency script & regenerate dependencies
2019-06-27 15:29:24 -07:00
Michael Ilseman
1de84fc531 Merge pull request #23834 from milseman/a_line_scaler
[String] Scalar-alignment bug fixes.
2019-06-27 14:28:09 -07:00
Karoy Lorentey
09c8997f94 [SDK] Regenerate overlay dependencies 2019-06-27 12:19:31 -07:00
Karoy Lorentey
22e0b4a2b8 [Foundation] Manually add CoreGraphics dependency
This isn’t hardcoded into the dependency detection script anymore.
2019-06-27 12:14:49 -07:00
Karoy Lorentey
1f2d044ee1 Merge pull request #25776 from lorentey/Accelerate-availability
[Accelerate] Declare availability where missing, remove where redundant
2019-06-27 12:06:54 -07:00
Scott Perry
3ddfff92a6 add CollectionDifference.inverse() and test coverage 2019-06-27 11:40:46 -07:00
Michael Ilseman
bd5a40ff1b [gardening] Add underscore to internal member 2019-06-27 11:11:44 -07:00
Saleem Abdulrasool
34aace6b43 build: define a "top level" project for the stdlib
CMake allows for projects to be added as a subdirectory.  Use this to
permit the construction of a top-level project for the standard library.
2019-06-27 10:30:04 -07:00
Joe Groff
85c44472e0 Merge pull request #25811 from jckarter/remote-mirror-opaque-types
Reflection: Look through opaque type descriptors.
2019-06-26 21:06:55 -07:00
Joe Groff
4e493b0051 Reflection: Look through opaque type descriptors.
Turn an opaque type reference in a mangled name into its underlying type, if we can.
rdar://problem/46140707
2019-06-26 17:58:52 -07:00
Scott Perry
0fc5d6ad31 Performance improvements and availability updates for Collection.difference(from:using:) 2019-06-26 16:55:29 -07:00
Michael Ilseman
4cd1e812b7 [String] Scalar-alignment bug fixes.
Fixes a general category (pun intended) of scalar-alignment bugs
surrounding exchanging non-scalar-aligned indices between views and
for slicing.

SE-0180 unifies the Index type of String and all its views and allows
non-scalar-aligned indices to be used across views. In order to
guarantee behavior, we often have to check and perform scalar
alignment. To speed up these checks, we allocate a bit denoting
known-to-be-aligned, so that the alignment check can skip the
load. The below shows what views need to check for alignment before
they can operate, and whether the indices they produce are aligned.

┌───────────────╥────────────────────┬──────────────────────────┐
│ View          ║ Requires Alignment │ Produces Aligned Indices │
╞═══════════════╬════════════════════╪══════════════════════════╡
│ Native UTF8   ║ no                 │ no                       │
├───────────────╫────────────────────┼──────────────────────────┤
│ Native UTF16  ║ yes                │ no                       │
╞═══════════════╬════════════════════╪══════════════════════════╡
│ Foreign UTF8  ║ yes                │ no                       │
├───────────────╫────────────────────┼──────────────────────────┤
│ Foreign UTF16 ║ no                 │ no                       │
╞═══════════════╬════════════════════╪══════════════════════════╡
│ UnicodeScalar ║ yes                │ yes                      │
├───────────────╫────────────────────┼──────────────────────────┤
│ Character     ║ yes                │ yes                      │
└───────────────╨────────────────────┴──────────────────────────┘

The "requires alignment" applies to any operation taking a
String.Index that's not defined entirely in terms of other operations
taking a String.Index. These include:

* index(after:)
* index(before:)
* subscript
* distance(from:to:) (since `to` is compared against directly)
* UTF16View._nativeGetOffset(for:)
2019-06-26 16:42:58 -07:00
Stephen Canon
166d0fa961 FloatingPoint.radix should be transparent. (#25789)
* FloatingPoint.radix should be inlinable.

* Switch transparent to inlinable+inline(__always).
2019-06-26 18:20:27 -04:00
Jordan Rose
57a0c9f5f8 [Runtime] Fix some type mismatch errors (#25790)
Harmless in practice, but still good hygiene.
2019-06-26 15:17:50 -07:00
David Smith
149080c526 Merge pull request #25771 from Catfish-Man/very-normal-hash
Remove a retain release pair in foreign string hashing
2019-06-26 14:21:45 -07:00
Michael Ilseman
93d65fc9c3 [gardening] Remove trailing whitespace 2019-06-26 09:22:17 -07:00
Michael Ilseman
f52a865570 [String] Slice contents before asking ICU
ICU will return different results if we call with an offset into a
code unit buffer vs if we slice the buffer first and provide an offset
of zero. Slicing more closely models the semantics of SE-0180, so use
that.

Test case coming in subsequent commit enforcing index
scalar-alignment.
2019-06-26 09:22:17 -07:00
t.ae
f96cbb8a36 Make AdditiveArithmetic.zero @_transparent (#25658) 2019-06-26 09:07:30 -04:00
Karoy Lorentey
2cc38fcace [Accelerate] Remove redundant @available attributes
Declarations lexically nested in a context with an @available declaration inherit the same.
2019-06-25 20:06:58 -07:00
Karoy Lorentey
992bed48e4 [Accelerate] Replace 9999 availability with actual OS versions 2019-06-25 20:03:28 -07:00
Karoy Lorentey
2fd8f54724 [Accelerate] vImage, vDSP, vForce: Describe availability 2019-06-25 19:59:27 -07:00
David Smith
75185aa556 Remove a retain release pair in foreign string hashing 2019-06-25 18:17:39 -07:00
Ross Bayer
230666b27f Merge pull request #25756 from Rostepher/lay-me-out-to-dry
[Build System: CMake] Move the legacy_layouts CMake target generation into stdlib/public/legacy_layouts/CMakeLists.txt.
2019-06-25 14:10:51 -07:00
Karoy Lorentey
0b97f27675 Merge pull request #25737 from lorentey/CoreMedia-shims
[Shims] Add CoreMedia overlay shims
2019-06-25 11:58:59 -07:00
Ross Bayer
66691ee3fa [Build System: CMake] Move the legacy_layouts CMake target generation into stdlib/public/legacy_layouts/CMakeLists.txt.
Any time users build and install the compiler they should also be installing the legacy_layouts for the same Darwin platforms.
2019-06-25 11:53:22 -07:00
Joe Groff
a868cfb237 Merge pull request #25329 from linux-on-ibm-z/s390x-keypathmultimodule-fix
Fix for KeyPathMultiModule test failure
2019-06-25 09:41:51 -07:00
Xiaodi Wu
4555b287e8 [gardening] Update copyright year 2019-06-25 09:49:58 -04:00