Commit Graph

9910 Commits

Author SHA1 Message Date
swift-ci
430744b2f3 Merge remote-tracking branch 'origin/master' into master-next 2018-04-06 12:12:17 -07:00
Slava Pestov
178e676864 Merge pull request #15787 from slavapestov/se-0193-inlinable-is-usable-from-inline
SE-0193: @inlinable implies @usableFromInline
2018-04-06 12:03:29 -07:00
swift-ci
f495229285 Merge remote-tracking branch 'origin/master' into master-next 2018-04-06 11:29:54 -07:00
swift-ci
09e1e3c859 Merge pull request #15790 from compnerd/pedentary 2018-04-06 11:29:19 -07:00
Saleem Abdulrasool
b432249a17 stubs: silence pedantic warning (NFC)
C requires that there is at least one declaration in a translation unit.
Because this file is ObjC and not ObjC++, this restriction applies.  Add
a declaration to silence the warning in the case that ObjC interop is
disabled.
2018-04-06 09:29:05 -07:00
Slava Pestov
2e5aef9c8d stdlib: Remove redundant @usableFromInline attributes 2018-04-06 00:02:30 -07:00
swift-ci
58b2cad4ee Merge remote-tracking branch 'origin/master' into master-next 2018-04-05 19:11:48 -07:00
Joe Groff
161afd6be5 Merge pull request #15781 from jckarter/demangle-symbolic-reference-nested-type
Runtime: Properly handle demangling nested generic typerefs with symbolic manglings.
2018-04-05 18:58:47 -07:00
Joe Groff
b51d43377e Runtime: Properly handle demangling nested generic typerefs with symbolic manglings.
The demangling tree for a symbolic reference doesn't indicate the generic context depth of the referenced type, so we have to form the type metadata from whole cloth without incrementally building up nested types as we do for concrete mangled types. Notice when DecodedMetadataBuilder is passed a context descriptor ref without a parent and directly form the entire type in this case. Fixes rdar://problem/38891999.
2018-04-05 16:23:16 -07:00
swift-ci
880857452c Merge remote-tracking branch 'origin/master' into master-next 2018-04-05 15:59:28 -07:00
Slava Pestov
61280ef951 stdlib: @_versioned was renamed to @usableFromInline 2018-04-05 14:31:47 -07:00
swift-ci
3c18eed986 Merge remote-tracking branch 'origin/master' into master-next 2018-04-05 05:09:33 -07:00
Sho Ikeda
9efd347100 [gardening][Overlay] Use isEmpty in Data.swift 2018-04-05 17:50:20 +09:00
swift-ci
0ba399aaa1 Merge remote-tracking branch 'origin/master' into master-next 2018-04-04 18:33:35 -07:00
Jordan Rose
20ae19ef22 [CMake] Improve Xcode project generation with folders (#15738)
- Re-enable the use of folders with the USE_FOLDER setting. This got
  lost a while ago when we stopped including LLVM's top-level
  CMakeLists.txt.

- Put a bunch of new targets into folders.

Should not affect the built product and definitely shouldn't affect
anyone not building with Xcode (or MSVC, I guess).
2018-04-04 18:22:59 -07:00
swift-ci
7c6912c570 Merge remote-tracking branch 'origin/master' into master-next 2018-04-04 17:10:15 -07:00
swift-ci
2cbe98eb27 Merge pull request #15744 from compnerd/visualc-modulemap 2018-04-04 17:04:23 -07:00
Saleem Abdulrasool
f6dcc22598 platform: enhance the VisualC modulemap
Add the `vadefs` and `stdint` submodules.  These are required to get the
importing of the standard types (`intmax_t` and `uintptr_t`) correct
with the Visual C runtime.  This allows building the libdispatch Swift
overlay.
2018-04-04 14:27:54 -07:00
swift-ci
71503c41f6 Merge remote-tracking branch 'origin/master' into master-next 2018-04-04 11:34:02 -07:00
Mark Lacey
e137da5184 Merge pull request #15730 from rudkx/rdar33781464
stdlib: Collapse some multi-line closures to single-line closures.
2018-04-04 11:27:06 -07:00
swift-ci
f1b0745b08 Merge remote-tracking branch 'origin/master' into master-next 2018-04-04 07:49:22 -07:00
Sho Ikeda
68e76535bc [gardening][Calendar] No need to discard the retrun value of insert(_:) which is discardable 2018-04-04 19:29:42 +09:00
swift-ci
df70a77b65 Merge remote-tracking branch 'origin/master' into master-next 2018-04-04 00:29:13 -07:00
Mark Lacey
32d006de4a stdlib: Collapse some multi-line closures to single-line closures.
The change in CheckMutableCollectionType.swift.gyb previously resulted
in a runtime failure, and before that a compiler crash.

It appears that whatever type checker bug(s) were causing the issue
have been resolved in the last few months, so I'm returning this
closure to a single-expression form and cleaning up a couple other
places where we had an unneeded temporary as well.

Resolves rdar://problem/33781464.
2018-04-03 22:26:33 -07:00
Pavel Yaskevich
78822bc23e [IRGen] Adjust element size of offset vector to 32-bit for structs
Type of elements contained by field offsets vector can be adjusted
to 32-bit integers (from being pointer sized) to safe space in the
binary since segment size is limited to 4 GB.

Resolves: rdar://problem/36560486
2018-04-03 13:32:06 -07:00
swift-ci
e65bed999f Merge remote-tracking branch 'origin/master' into master-next 2018-04-03 11:43:13 -07:00
Jordan Rose
9be6519f5a [SILGen] Show a message when an unexpected enum value is switched on (#15614)
Builds on 36eae9d4f6 to emit a message instead of just trapping
when a switch over a non-frozen enum ends up not matching anything.
If the enum is known to be an @objc enum, the message is

  unexpected enum case 'MyEnum(rawValue: -42)'

and if it's anything else (a Swift enum, a tuple containing enums,
whatever), it's a more opaque

  unexpected enum case while switching on value of type 'MyEnum'

The reason for this is to avoid calling String(describing:) or
String(reflecting:) an arbitrary value when the enum might conform to
CustomStringConvertible and therefore /itself/ have a switch that's
going to fall off the end. By handling plain @objc enums (using a
bitcast), we've at least covered the 90% case.

rdar://problem/37728359
2018-04-03 11:21:36 -07:00
swift-ci
369007e47f Merge remote-tracking branch 'origin/master' into master-next 2018-04-02 13:35:05 -07:00
Michael Gottesman
9accf4a82f Merge pull request #15686 from gottesmm/pr-2aa38499b4210d8c66240446893c4f340fc62351
[+0-all-args] Remove autoreleasepool on non-x86_64 platforms from Str…
2018-04-02 13:29:57 -07:00
Michael Gottesman
bc48a66c77 [+0-all-args] Remove autoreleasepool on non-x86_64 platforms from String stubs.
This is only necessary on x86-64. On arm/arm64 we are already ok since the
assembly marker that we use there does not suffer from this issue.

For x86-64 we need to solve the problem upstream by not tailing calling
objc_retainAutoreleasedReturnValue.

rdar://38675842
2018-04-02 10:50:08 -07:00
swift-ci
519df29eb7 Merge remote-tracking branch 'origin/master' into master-next 2018-04-01 19:29:12 -07:00
John McCall
b18af4f4e1 Merge pull request #15671 from rjmccall/cyclic-metadata
Finish the first stage of incomplete type metadata support
2018-04-01 22:15:39 -04:00
swift-ci
eca55d95da Merge remote-tracking branch 'origin/master' into master-next 2018-04-01 17:09:25 -07:00
tbkka
97a934c412 SR-106: New floating-point description implementation (#15474)
* SR-106: New floating-point `description` implementation

This replaces the current implementation of `description` and
`debugDescription` for the standard floating-point types with a new
formatting routine based on a variation of Florian Loitsch' Grisu2
algorithm with changes suggested by Andrysco, Jhala, and Lerner's 2016
paper describing Errol3.

Unlike the earlier code based on `sprintf` with a fixed number of
digits, this version always chooses the optimal number of digits.  As
such, we can now use the exact same output for both `description` and
`debugDescription` (except of course that `debugDescription` provides
full detail for NaNs).

The implementation has been extensively commented; people familiar with
Grisu-style algorithms should find the code easy to understand.

This implementation is:

* Fast.  It uses only fixed-width integer arithmetic and has constant
  memory and time requirements.

* Simple. It is only a little more complex than Loitsch' original
  implementation of Grisu2.  The digit decomposition logic for double is
  less than 300 lines of standard C (half of which is common arithmetic
  support routines).

* Always Accurate. Converting the decimal form back to binary (using an
  accurate algorithm such as Clinger's) will always yield exactly the
  original binary value.  For the IEEE 754 formats, the round-trip will
  produce exactly the same bit pattern in memory.  This is an essential
  requirement for JSON serialization, debugging, and logging.

* Always Short.  This always selects an accurate result with the minimum
  number of decimal digits.  (So that `1.0 / 10.0` will always print
  `0.1`.)

* Always Close.  Among all accurate, short results, this always chooses
  the result that is closest to the exact floating-point value. (In case
  of an exact tie, it rounds the last digit even.)

This resolves SR-106 and related issues that have complained
about the floating-point `description` properties being inexact.

* Remove duplicate infinity handling

* Use defined(__SIZEOF_INT128__) to detect uint128_t support

* Separate `extracting` the integer part from `clearing` the integer part

The previous code was unnecessarily obfuscated by the attempt to combine
these two operations.

* Use `UINT32_MAX` to mask off 32 bits of a larger integer

* Correct the expected NaN results for 32-bit i386

* Make the C++ exceptions here consistent

Adding a C source file somehow exposed an issue in an unrelated C++ file.
Thanks to Joe Groff for the fix.

* Rename SwiftDtoa to ".cpp"

Having a C file in stdlib/public/runtime causes strange
build failures on Linux in unrelated C++ files.

As a workaround, rename SwiftDtoa.c to .cpp to see
if that avoids the problems.

* Revert "Make the C++ exceptions here consistent"

This reverts commit 6cd5c20566.
2018-04-01 16:52:48 -07:00
John McCall
6c31586128 Add cyclic-metadata support to tuples.
I was going to put this off for awhile, but it turns out that a lot of
my testcases are enums with multi-payload cases, which we currently
compile as tuples, so they were all still hanging until this patch.
2018-04-01 19:23:57 -04:00
John McCall
f22d02a67a Detect unbreakable metadata dependency cycles and abort with a diagnostic. 2018-04-01 19:23:57 -04:00
John McCall
ea7dd7eca3 Minor changes to how we track and lock around metadata dependencies
to enable the general cycle-dependency runtime error.
2018-04-01 19:23:57 -04:00
John McCall
4d461831b8 Optimize the layout of MetadataCacheEntryBase to pack fields more effectively. 2018-04-01 19:23:57 -04:00
swift-ci
9a6b0c4f53 Merge remote-tracking branch 'origin/master' into master-next 2018-04-01 08:49:30 -07:00
Xi Ge
d93e0dfa01 Merge pull request #15636 from Fidetro/master
Fixed JSONEncoder code style issues
2018-04-01 08:39:04 -07:00
swift-ci
07806de9bc Merge remote-tracking branch 'origin/master' into master-next 2018-03-31 10:49:00 -07:00
swift-ci
6c42bcccbd Merge pull request #15507 from devincoughlin/foundation-datecomponents-exclusivity-warnings 2018-03-31 10:47:38 -07:00
swift-ci
1a436bcb75 Merge remote-tracking branch 'origin/master' into master-next 2018-03-31 10:08:58 -07:00
Andrew Trick
e9d07d88fc Merge pull request #15501 from atrick/add-access-tracking-flag
[exclusivity] Add an access tracking flag.
2018-03-31 10:04:08 -07:00
swift-ci
41336a6a7e Merge remote-tracking branch 'origin/master' into master-next 2018-03-31 08:28:49 -07:00
swift-ci
ee57586822 Merge pull request #15652 from brennanMKE/semicolon 2018-03-31 08:19:28 -07:00
swift-ci
6c2f4dd034 Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 23:08:53 -07:00
brennanMKE
fb2f55f558 [stdlib] remove trailing semicolon in stdlib source 2018-03-30 22:44:05 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
swift-ci
485d502a0b Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 20:08:53 -07:00