Commit Graph

10736 Commits

Author SHA1 Message Date
Joe Groff
8620bc619b Merge pull request #18578 from jckarter/dont-verify-roundtripping-private-types
Runtime: Don't attempt to round-trip mangled names for private types.
2018-08-08 19:19:24 -07:00
Stephen Canon
2f015ce574 Conform Float80 to CustomReflectable. (#18577)
Fixes SR-8492.
2018-08-08 19:34:17 -04:00
Joe Groff
fb05ede036 Runtime: Don't attempt to round-trip mangled names for private types.
By design, we don't want private or function-nested types to be accessible by mangled name, since they don't have stable identities, and they could inadvertently become ABI if someone serialized a mangled string and expected to deserialize it into a type. Fixes rdar://problem/39826794 .
2018-08-08 13:52:59 -07:00
Joe Groff
0f6f3493fe Demangler: Use a non-numeric introducer for anonymous context tokens.
The token contents doesn't really matter, but it can't start with a digit if it's going to show up in mangled names using identifier grammar. `s/0x/$/` for some 80s flair.
2018-08-08 13:48:24 -07:00
Mox Soini
c66e136c18 Improve documentation for compactMapValues() of Dictionary (#18547) 2018-08-08 00:25:49 -05:00
Nate Cook
efb0415a61 [stdlib] More documentation revisions (#18263)
- Fix error in `last(where:)` example
- Improve MemoryLayout, UnsafePointer, and integer operator discussions
- Clean up ranges and random APIs
- Revisions to overflow operators and the SignedNumeric requirements
- Standardize on 'nonoptional' in remaining uses
2018-08-08 00:25:09 -05:00
Xiaodi Wu
0dcaff99eb Merge pull request #18511 from xwu/simplify-fp-int-conversion
[stdlib] Simplify concrete floating-point-to-integer conversion
2018-08-07 23:02:59 -04:00
Xiaodi Wu
c2ed788dad [stdlib] Restore rounding-based test of numeric conversion exactness 2018-08-07 21:29:51 -04:00
eeckstein
1ccad42482 Merge pull request #18520 from eeckstein/utf8iterator
stdlib: mark the UTF8View iterator's next function as inline-always.
2018-08-06 13:38:16 -07:00
swift-ci
71f0248b0a Merge remote-tracking branch 'origin/master' into master-next 2018-08-06 11:07:55 -07:00
Erik Eckstein
93e7786161 stdlib: mark the UTF8View iterator's next function as inline-always.
This speeds up C-String handling

rdar://problem/42247427
2018-08-06 10:28:32 -07:00
Maxim Moiseev
b7661c5991 [overlay] The AssetsLibrary APIs have been deprecated since iOS 9
Addresses: <rdar://problem/39029315>
2018-08-06 13:10:05 +08:00
Xiaodi Wu
44f02a2fd1 [stdlib] Simplify fp-to-int and int-to-fp conversion 2018-08-04 15:36:38 -04:00
Michael Ilseman
8294c0003a [string] Drop _StringGuts subscript; NFC
_StringGuts shouldn't expose a subscript, implying efficient
access. Switch to the explicit code unit fetch method. Update tests
accordingly, and switch off of deprecated typealiases.
2018-08-02 16:34:22 -07:00
Michael Ilseman
ced2e63d95 [test] Make string internal testing a little more robust; NFC
Add an isSmall query to Character so testing doesn't have to bake in
internal format. Clarify the purpose of the invalid UTF-16 backdoor
creation method.
2018-08-02 16:34:19 -07:00
swift-ci
84909c68db Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 13:29:01 -07:00
Michael Ilseman
b06c636cfa Merge pull request #18456 from milseman/internalable
[string] Internalize many faux-testable declarations
2018-08-02 13:16:08 -07:00
swift-ci
5854058037 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 11:49:40 -07:00
swift-ci
c1029b6fe3 Merge pull request #18443 from phausler/data_init_availability 2018-08-02 11:47:56 -07:00
Michael Ilseman
336ae86bc5 [string] Un-break Linux build 2018-08-02 10:17:03 -07:00
swift-ci
c522b6e487 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 19:09:02 -07:00
John McCall
05c9671902 Change the ABI for the type descriptors of imported declarations.
- Instead of keeping multiple flags in the type descriptor flags,
  just keep a single flag indicating the presence of additional
  import information after the name.

- That import information consists of a sequence of null-terminated
  C strings, terminated by an empty string (i.e. by a double null
  terminator), each prefixed with a character describing its purpose.

- In addition to the symbol namespace and related entity name,
  include the ABI name if it differs from the user-facing name of the
  type, and make the name the user-facing Swift name.

There's a remaining issue here that isn't great: we don't correctly
represent the parent relationship between error types and their codes,
and instead we just use the Clang module as the parent.  But I'll
leave that for a later commit.
2018-08-01 18:37:08 -04:00
Michael Ilseman
ba6158d74e [test] Internalize _StringGuts; Add shared testing struct; NFC
Create a _StringRepresentation struct to standardize internal testing
on. Internalize much of _StringGuts, except for some SPI hacks, and
update tests to use _StringRepresentation.
2018-08-01 14:23:56 -07:00
Michael Ilseman
1859ae404a [test] Internalize SmallString; NFC 2018-08-01 14:23:56 -07:00
Philippe Hausler
ae9f5e3cde [Foundation] handle ambiguity in swift 4 mode for Data.init with byte sequences 2018-08-01 09:43:55 -07:00
swift-ci
6fac261954 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 07:49:11 -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
swift-ci
bf137ae65b Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 18:59:26 -07:00
Michael Ilseman
d3f7a1615b [stdlib] Eviscerate MigrationSupport String impl
Remove many of the implementations of obsoleted String functionality
by replacing it with unreachable. A few remain temporarily until the
Foundation overlay can be updated.

Also, update TestJSONEncoder.swift off of deprecated functionality.
2018-07-31 15:42:22 -07:00
swift-ci
30b9005d83 Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 15:09:59 -07:00
Mishal Shah
0ef312ff78 Merge pull request #18409 from apple/swift-master-xcode-10-beta-5
Update master to build with Xcode 10 beta 5, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs
2018-07-31 15:04:02 -07:00
swift-ci
1e4ad6ea0d Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 14:49:51 -07:00
Jordan Rose
53ff023c6c [Runtime] Print fatal errors' messages before pausing in the debugger (#18374)
The message is available in the debugger (or in Xcode), but it
increases the chances that the user will see it if it's also been
logged at the time the debugger takes over.
2018-07-31 14:40:10 -07:00
Mishal Shah
13f5118a92 Update master to build with Xcode 10 beta 5, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs 2018-07-31 13:05:42 -07:00
swift-ci
30b40e50ca Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 10:09:50 -07:00
Doug Gregor
4dc0cc54c1 Merge pull request #18396 from SusanDoggie/master
[stdlib]getrandom introduced in Android API 28
2018-07-31 09:54:17 -07:00
swift-ci
c076416f04 Merge remote-tracking branch 'origin/master' into master-next 2018-07-30 21:29:25 -07:00
Susan Cheng
9b61888046 getrandom introduced in Android API 28 2018-07-31 10:42:10 +08:00
John McCall
873c02e317 Remove the need to set CTag on all imported tag declarations.
NFC; I'll change the schema to remove CTag in a separate patch.
2018-07-30 22:29:07 -04:00
swift-ci
8247c2ba15 Merge remote-tracking branch 'origin/master' into master-next 2018-07-30 13:09:54 -07:00
Joe Groff
f8e5ebe873 Merge pull request #18299 from jckarter/enable-key-path-resilience
Enable key path resilience.
2018-07-30 13:00:43 -07:00
swift-ci
be19f650fd Merge remote-tracking branch 'origin/master' into master-next 2018-07-30 10:08:59 -07:00
swift-ci
37faf21f51 Merge pull request #18289 from Dante-Broggi/patch-6 2018-07-30 10:04:35 -07:00
swift-ci
7bedcc1212 Merge remote-tracking branch 'origin/master' into master-next 2018-07-29 18:48:57 -07:00
John McCall
1f80d21e1e Merge pull request #18340 from Azoy/remove-_interface
[Visibility] Remove _INTERFACE
2018-07-29 21:37:37 -04:00
John McCall
436a8b273d Add runtime functions to compute tuple layouts from element layouts.
Previously, when a tuple type had non-fixed layout, we would compute
a layout by building the metadata for that tuple type and then
extracting the layout from the VWT.  This can be quite expensive
because it involves constructing the exact metadata for types like
arrays and functions despite those types being fixed-layout across
all instantiations.  It also tends to cause unnecessary recursive-type
issues, especially with enums where tuples are currently used to model
cases with mutliple payloads.  Since we just need a layout, computing
it directly from element layouts instead of constructing metadata for
the formal type lets us take advantage of all the other fast paths for
layout construction, e.g. for fixed types and single-field aggregates.

This is a good improvement overall, but it also serves to alleviate
some of the problems of rdar://40810002 / SR-7876 in a way that
might be suitable for integration to 4.2.
2018-07-29 18:27:27 -04:00
swift-ci
7f536bef9a Merge remote-tracking branch 'origin/master' into master-next 2018-07-29 10:49:08 -07:00
Azoy
b8fc8b333c Remove _interface 2018-07-29 10:41:22 -04:00
John McCall
db8f23df74 Update the ABI for uniquing foreign type metadata.
- `swift_getForeignTypeMetadata` is now a request/response function.

- The initialization function is now a completion function, and the
  pointer to it has moved into the type descriptor.

- The cache variable is no longer part of the ABI; it's an
  implementation detail of the access function.

- The two points above mean that there is no special header on foreign
  type metadata and therefore that they can be marked constant when
  there isn't something about them that needs to be initialized.

The only foreign-metadata initialization we actually do right now is
of the superclass field of a foreign class, and since that relationship
is a proper DAG, it's not actually possible to have recursive
initialization problems.  But this is the right long-term thing to do,
and it removes one of the last two clients of once-based initialization.
2018-07-29 03:16:35 -04:00
swift-ci
e356364293 Merge remote-tracking branch 'origin/master' into master-next 2018-07-28 14:29:21 -07:00