Commit Graph

3089 Commits

Author SHA1 Message Date
Stephen Canon
0130407e21 Make FloatingPoint imply Hashable. SR-4132. 2017-03-01 20:39:11 -05:00
Nate Cook
fa0ec5d18f [docs] Update replaceRange to replaceSubrange 2017-03-02 09:00:58 +09:00
Nate Cook
888f504d50 [docs] Fix gybbo in UnsafeRawBufferPointer docs 2017-03-01 14:30:51 +09:00
Roman Levenstein
34815ff9ef [sil-generic-specializer] Do not create specializations for functions marked with @_semantics("optimize.sil.specialize.generic.never")
Those functions are not critical for performance, but their specializations result in a stdlib code bloat.
2017-02-24 14:59:44 -08:00
Slava Pestov
66bcf5b756 stdlib: Address a couple of ABI FIXMEs by deleting code
We have an implicit conversion to AnyHashable, so there's no
need to have the special subscript on Dictionary at all.
2017-02-21 20:28:49 -08:00
Jans Pavlovs
aa9efae562 Update map example code
Changes deprecated lowercaseString calls to lowercased()
This commit only affects example code provided in comments
2017-02-19 14:19:08 +02:00
Nate Cook
3ab1060e0a [stdlib] Doc comment revisions for (un)signed integers (#7541) 2017-02-16 15:34:19 -08:00
Nate Cook
15525c0d68 [stdlib] Correct documentation for ReversedIndex.base 2017-02-16 15:46:31 -06:00
Ben Cohen
863dfca3a2 Merge pull request #7510 from airspeedswift/zip-aliases
[stdlib] Deprecate aliases on Zip2Sequence
2017-02-16 08:14:03 -08:00
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
Ben Cohen
800248406e [stdlib] Deprecate aliases on Zip2Sequence 2017-02-15 16:09:18 -08:00
Chris Bieneman
e096d1c033 [CMake] Simplify add_swift_library
This patch splits add_swift_library into two functions one which handles
the simple case of adding a library that is part of the compiler being
built and the second handling the more complicated case of "target"
libraries, which may need to build for one or more targets.

The new add_swift_library is built using llvm_add_library, which re-uses
LLVM's CMake modules. In adapting to use LLVM's modules some of
add_swift_library's named parameters have been removed and
LINK_LIBRARIES has changed to LINK_LIBS, and LLVM_LINK_COMPONENTS
changed to LINK_COMPONENTS.

This patch also cleans up libswiftBasic's handling of UUID library and
headers, and how it interfaces with gyb sources.

add_swift_library also no longer has the FILE_DEPENDS parameter, which
doesn't matter because llvm_add_library's DEPENDS parameter has the same
behavior.
2017-02-14 14:28:10 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
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