Commit Graph

7767 Commits

Author SHA1 Message Date
practicalswift
7e48c04277 [gardening] Fix inconsistent headers. 2017-01-21 10:59:10 +01:00
practicalswift
95e47eceb7 [gardening] Fix a vs an typos. 2017-01-21 10:47:25 +01:00
practicalswift
2b4a6a573a [gardening] Use nullptr instead of NULL 2017-01-21 10:31:29 +01:00
Maxim Moiseev
89840c738a [dispatch] Fix + and - operations on DispatchTime and DispatchWallTime (#6961)
... for the cases where `seconds` parameter is NaN or infinite.
Fixes <rdar://problem/29764171>
2017-01-20 21:44:47 -08:00
Slava Pestov
230b50263e Merge pull request #6940 from hughbe/crash-client-hidden
Remove CRASH_REPORTER_CLIENT_HIDDEN in favour of equivilent LLVM macro
2017-01-20 20:28:44 -08:00
Slava Pestov
6d94756a5e Merge pull request #6958 from NachoSoto/asynchronously-fixit
Fix the fixits for dispatch_async and dispatch_group_async
2017-01-20 17:56:15 -08:00
Stephen Canon
e6c84d7a63 Mark libc math shims with always_inline attribute (#6956)
* Mark libc math shims with always_inline attribute

We want these to always be inlined, so mark them with ... always_inline.
The compiler happened to do the right thing with them previously, but we
shouldn't depend on that.

<rdar://problem/30043258> master-next: IRGen/builtin_math.swift failing because sqrt(4) is not constant folded
2017-01-20 18:09:30 -05:00
NachoSoto
a12e739fb8 Fix the fixits for dispatch_async and dispatch_group_async
They erroneously suggested `DispatchQueue.asynchronously`, but it's actually `DispatchQueue.async`.
2017-01-20 15:05:15 -08:00
Hugh Bellamy
4e55214c18 Remove CRASH_REPORTER_CLIENT_HIDDEN in favour of equivilent LLVM macro 2017-01-20 13:48:56 +00:00
Hugh Bellamy
0b9685cbd7 Fix warnings on all platforms for cygwin specific code. 2017-01-20 12:58:47 +00:00
Slava Pestov
d6c857259d Sema: Diagnose @_fixed_layout when applied to internal types
This attribute is only meaningful for versioned and public types;
private and internal types are always fixed-layout.
2017-01-20 01:22:50 -08:00
Max Moiseev
871d1a2805 Removing arithemtic operator default implementations from BinaryInteger and FloatingPoint 2017-01-19 14:34:23 -08:00
Max Moiseev
d128ed42b0 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-19 14:16:32 -08:00
Max Moiseev
e600da4e25 Moving arithmetic operators back onto concrete types level temporarily 2017-01-19 12:04:52 -08:00
Max Moiseev
d82ddea20c Using chain() instead of a 2-level list comprehension in gyb 2017-01-19 12:03:56 -08:00
Max Moiseev
a8d7fc56d1 Annotating init() as transparent 2017-01-19 12:03:03 -08:00
Slava Pestov
5accebf556 Merge pull request #5344 from karwa/clearspecific
[Overlay/Dispatch]: Change DispatchQueue.setSpecific to take an optional
2017-01-18 15:59:45 -08:00
Ben Cohen
0bafc86e5e remove redundant _arrayReserve method 2017-01-18 09:17:26 -08:00
Slava Pestov
6a8e579601 Reflection: Fix layout of Set, Dictionary and other fixed-size multi-payload enums
For generic multi-payload enums, we would proceed down the
dynamic layout path without checking for a builtin descriptor.

As a result Set and Dictionary were always reported as being
9 bytes in size and not 8. Oops...

Fixes <rdar://problem/30066015>.
2017-01-17 21:38:06 -08:00
Tony Allevato
7741fb5d49 Minor cleanup; add some documentation. 2017-01-17 20:04:11 -08:00
Joe Groff
e9efff1021 Merge pull request #6399 from spevans/pr_elf_static_binary_dladdr
[runtime] Implement lookupSymbol() for ELF static executables
2017-01-17 17:03:00 -08:00
Simon Evans
223a607639 [runtime] StaticBinaryELF review fixes
- Use llvm::Optional to avoid heap allocations and
  eliminate redundant ivars.
2017-01-17 22:45:22 +00:00
Joe Groff
808d4d7e51 Merge pull request #4788 from amraboelela/glibc.modulemap.gyb
Added module ifaddrs
2017-01-17 14:36:24 -08:00
Slava Pestov
928a3193eb Merge pull request #3886 from tinysun212/pr-stdlib-cygwin-3
[stdlib] Fixed for Cygwin
2017-01-17 12:26:25 -08:00
swift-ci
1b75481ab8 Merge pull request #6802 from moiseev/no-pi-warning 2017-01-17 12:23:48 -08:00
Ben Cohen
bc3d97e2f5 Merge pull request #6851 from airspeedswift/sequence-append
[stdlib] refactor array sequence append growth logic
2017-01-17 12:19:58 -08:00
Ben Cohen
5a83bef7b3 tweak outer loop comment 2017-01-17 11:36:41 -08:00
Max Moiseev
b2efca54d6 Removing unnecessary CGFloat->Double->CGFloat conversions 2017-01-17 11:29:50 -08:00
ben-cohen
3dfd0f74f0 refactor sequence append growth logic 2017-01-16 20:42:00 -08:00
Tony Allevato
65ebcc8a1c Speed up Character.init for small characters.
This optimization checks to see if a Character can fit in the 63-bit
small representation instead of unconditionally constructing a String
and paying the cost of that allocation. If it does, the small
representation is computed directly from its UTF-8 code units.

In optimized builds, this turns Character literals <= 8 UTF-8 code units
long into single 64-bit integer loads -- a huge improvement.
2017-01-16 19:01:08 -08:00
Kevin Ballard
aa0cfa33af Better default domain for CustomNSError
We were creating domains that looked like `"main.SomeError.Type"`
instead of the expected `"main.SomeError"`. Fix this and add some basic
tests.
2017-01-16 15:50:35 -08:00
Han Sangjin
a8dec7fa43 [stdlib] Fixed for Cygwin
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
  and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
2017-01-17 02:31:16 +09:00
Simon Evans
0ef3f65e34 [runtime] StaticBinaryELF safety fixes 2017-01-16 14:07:18 +00:00
dfrib
72d86903d9 [stdlib] Fixes to doc. for formIndex of Indexable
Added documentation description for third parameter of

    formIndex(_:offsetBy:limitedBy:)

which was previously omitted.

Description copied from the 'index(_:offsetBy:limitedBy:)' method.
2017-01-15 15:57:23 +01:00
Stephen Canon
6ff95dad03 Mark several C macros imported from <float.h> as deprecated. (#6796)
* Mark several C macros imported from <float.h> as deprecated.

These macros all have straightforward replacements in terms of static properties on FloatingPoint or BinaryFloatingPoint. It is necessary to add 1 in a few places because of differences between how C and Swift count significand bits and normalize the significand, but this is expected to have minimal impact on code in practice (and when it does have impact, using the Swift definition is generally simpler).

* Address review notes from @moiseev.

This fixes <rdar://problem/27871465>
2017-01-13 21:33:43 -05:00
Max Moiseev
764fc0aa13 Replacing M_PI with .pi 2017-01-13 18:25:04 -08:00
Max Moiseev
de5b03ddc4 Getting rid of Arithmetic.init() in favor of 0 2017-01-13 17:59:35 -08:00
Max Moiseev
a1c5a0b528 Deprecating M_SQRT2 and M_SQRT1_2
Now that square root is being propoerly inlined and optimized away, it
is safe to deprecate these two constants in favor of a Swiftier API.

Fixes: <rdar://problem/30003973>
2017-01-13 10:40:28 -08:00
Stephen Canon
d89f8f423e Go back to using static inline stubs for sqrt and remainder (#6769)
* Go back to using static inline implementations of sqrt and remainder now that SR-2089 is resolved.

* Fix typo: sqrt -> squareRoot.

* Added test for constant-folding sqrt with -O.

* Added test case requested by jrose.
2017-01-13 13:26:46 -05:00
Robert Widmann
cef4e66233 Merge pull request #6776 from ArtSabintsev/feature/XCTAssertNoThrow
Implementation for XCTAssertNoThrow
2017-01-13 01:39:26 -07:00
Arthur Ariel Sabintsev
5008ed8421 Changed constant to _XCTAssertionType.noThrow 2017-01-13 02:43:11 -05:00
Arthur Ariel Sabintsev
741056578f Revert "All declarations in XCTest in SDK and XCTest in validations-tests have 2 spaces instead of 4"
This reverts commit 43a7b31490.
2017-01-13 01:38:27 -05:00
Arthur Ariel Sabintsev
43a7b31490 All declarations in XCTest in SDK and XCTest in validations-tests have 2 spaces instead of 4 2017-01-13 01:36:37 -05:00
Arthur Ariel Sabintsev
ec8e6c5a38 Changed success condition 2017-01-13 01:31:29 -05:00
Arthur Ariel Sabintsev
5f9352c8d2 Fixed indentation. 2017-01-13 01:28:53 -05:00
Arthur Ariel Sabintsev
b6d36fa86e Simplified throwable function evaluation and success case requirements. 2017-01-13 01:24:53 -05:00
Arthur Ariel Sabintsev
13094af307 Fixed indentation 2017-01-13 01:18:21 -05:00
Slava Pestov
d99834ec33 Merge pull request #6775 from ArtSabintsev/bugfix/XCTAssertThrowsError-error-mistake
Fixed copy-paste error in error case in XCTAssertThrowsError function
2017-01-12 21:42:12 -08:00
Arthur Ariel Sabintsev
31b96ad3cd Adjusted _XCTRegisterFailure conditions. Added validation test for XCTAssertNoThrow 2017-01-13 00:41:47 -05:00
Arthur Ariel Sabintsev
7d726f2f32 Fixed smal bug with how expression was called 2017-01-13 00:20:54 -05:00