Commit Graph

2976 Commits

Author SHA1 Message Date
practicalswift
3e40296cfa [gardening] Fix inconsistent headers 2017-02-13 15:21:52 +01:00
Avjinder
12de833a55 42 * 42 is 1764, not 1746. 2017-02-09 21:18:23 +05:30
Doug Gregor
12fc2d22bf [Standard library] de-GYB string interpolation. NFC 2017-02-08 21:01:18 -08:00
Doug Gregor
fbb7dcf971 Replace concrete init(stringInterpolationSegment:)'s with generic ones
Remove 16 concrete init(stringInterpolationSegment:) overloads and
replace them with 3 generic overloads, significantly reducing the
exponential blow-up from larger string interpolations.

Fixes rdar://problem/29389887.
2017-02-08 21:01:09 -08:00
Doug Gregor
e387361194 Revert "Replace concrete init(stringInterpolationSegment:)'s with generic ones"
This reverts commit f6cac54606.
2017-02-08 13:38:11 -08:00
Doug Gregor
bb365b4657 Revert "[Standard library] de-GYB string interpolation. NFC"
This reverts commit 658f244188.
2017-02-08 13:38:10 -08:00
Doug Gregor
0b4261cae1 Revert "[Standard library] Remove some gyb-related cruft from string interpolation."
This reverts commit d0811cc318.
2017-02-08 13:38:08 -08:00
Nate Cook
c25bf40c26 [stdlib] Various documentation improvements
* Revise type(of:)
* Revise withoutActuallyEscaping(_:do:)
* Add slicing / index sharing to Collection
* Other cleanups
2017-02-07 23:02:41 -06:00
Erik Eckstein
fd62be59a1 stdlib: Use the re-mangler for _typeByName
The old method of constructing a mangled class name does not work anymore with the new mangling scheme.
Also, by using the re-mangler, _typeByName now works with class names containing non-ascii characters.
2017-02-07 08:36:21 -08:00
Andrew Trick
22f166437e Revert "Revert "[stdlib] Resolve unsafeBitCast warnings in Runtime.swift.gyb."" 2017-02-03 13:31:10 -08:00
swift-ci
2fd07f22a3 Merge pull request #7227 from apple/revert-7116-unsafeBitCast-Runtime.swift.gyb 2017-02-03 10:04:49 -08:00
Doug Gregor
0f99d18343 Merge pull request #7024 from rintaro/stdlib-newtype-comparable
[stdlib] Workaround type checker ambiguity in Comparable SwiftNewtypeWrapper
2017-02-03 09:55:42 -08:00
Andrew Trick
e62a57f243 Revert "[stdlib] Resolve unsafeBitCast warnings in Runtime.swift.gyb." 2017-02-03 09:46:04 -08:00
Jordan Rose
139699432b [stdlib] Resolve unsafeBitCast warnings in Runtime.swift.gyb. (#7116)
No intended functionality change.
2017-02-03 08:25:51 -08:00
Doug Gregor
d0811cc318 [Standard library] Remove some gyb-related cruft from string interpolation.
NFC
2017-02-01 10:51:02 -08:00
Rintaro Ishizaki
f11b74176b [stdlib] Workaround type checker ambiguity in Comparable SwiftNewtypeWrapper 2017-01-31 21:29:10 +09:00
Max Moiseev
c342166f10 Renaming leadingZeros to leadingZeroBits. Same for trailingZeros 2017-01-30 17:16:16 -08:00
Max Moiseev
125efc1fcc Moving / down to the BinaryInteger protocol 2017-01-30 17:16:16 -08:00
Max Moiseev
0e7863129c Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-30 16:51:16 -08:00
Joe Groff
fd91396b30 Merge pull request #7136 from jckarter/missing-slice-default-implementations
Fix source compatibility problems with conforming to multiple Collection axes at once.
2017-01-30 14:34:47 -08:00
Doug Gregor
658f244188 [Standard library] de-GYB string interpolation. NFC 2017-01-30 10:16:24 -08:00
Joe Groff
34ec424898 stdlib: Adding missing default implementations of subscript(Range<Index>) for combinations of [Mutable][RangeReplaceable][Bidirectional|RandomAccess]Collection.
These were overlooked, and somehow code that attempted to make a minimal collection conform to RangeReplaceableCollection and RandomAccessCollection managed to compile successfully in Swift 3.0, but in Swift 3.1…*something* changed to reject a type that conforms to both due to the lack of a suitable default slicing subscript implementation in the stdlib that provided all the requirements. Fill in these missing implementations, fixing rdar://problem/30228957.
2017-01-30 09:54:58 -08:00
Doug Gregor
f6cac54606 Replace concrete init(stringInterpolationSegment:)'s with generic ones
Remove 16 concrete init(stringInterpolationSegment:) overloads and
replace them with 3 generic overloads, significantly reducing the
exponential blow-up from larger string interpolations.

Fixes rdar://problem/29389887.
2017-01-27 21:54:59 -08:00
Max Moiseev
06a45cb8fd Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-27 16:36:41 -08:00
Max Moiseev
5601f5fd51 Adding back a transparrent attribute in an initializer 2017-01-27 16:35:49 -08:00
Erik Eckstein
ef3a611ddb stdlib: make sure that Array._copyBuffer is not inlined.
Although it’s called via _slowPath the compiler sometimes inlines it, because it considers it to be a trivial function.
This change gives small code size improvements for benchmarks which deal with arrays.

rdar://problem/30210047
2017-01-26 15:59:55 -08:00
Max Moiseev
90ef26824f Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-26 15:28:42 -08:00
Ben Cohen
d3728ac5a8 Merge pull request #6850 from allevato/character-performance
[stdlib] Speed up Character.init significantly for small characters.
2017-01-25 16:51:41 -08:00
Max Moiseev
083a2054cb [stdlib] Commenting out a few transparent annotations
To make standard library compile with resiliency on.
2017-01-24 15:59:50 -08:00
swift-ci
de771d3819 Merge pull request #7002 from moiseev/fix-integers-for-resiliency 2017-01-24 12:24:35 -08:00
Max Moiseev
c81c3ebcdd This fixes the build with resiliency
The compiler changes introduced in
0c294314d0 now prohibit the transparent
initializer assigning to self. One such initializer was in the new
integer protocols, that made it to the master before Swift 3. Luckily it
is not used and can be safely removed for now.
2017-01-24 11:17:02 -08:00
Keita Ito
4318d9d688 [stdlib] Fix an error in max() method documentation
In max() method’s documentation comment, The explanation says “This
example finds the smallest value in an array of height measurements.”
But, it should be “the largest value”. This commit fixes this
documentation error.
2017-01-23 22:25:51 -08:00
Max Moiseev
6d380d9638 Correcting the logic in the reasoning for the heterogeneous comparison implementation 2017-01-23 16:45:09 -08:00
Max Moiseev
d382ac97ea Using >= instead of > to catch overshifts correctly 2017-01-23 16:01:32 -08:00
Max Moiseev
b5ab7263c1 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-23 11:00:33 -08:00
Max Moiseev
1265f0792a Implementing arithmetic operators on NSDecimal, CGFloat, and concrete FP types 2017-01-23 10:59:24 -08: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
Ben Cohen
0bafc86e5e remove redundant _arrayReserve method 2017-01-18 09:17:26 -08:00
Tony Allevato
7741fb5d49 Minor cleanup; add some documentation. 2017-01-17 20:04:11 -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
Ben Cohen
5a83bef7b3 tweak outer loop comment 2017-01-17 11:36:41 -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
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
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