Commit Graph

2617 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Robert Widmann
883ca16ab9 Merge pull request #4314 from ultramiraculous/failable-int-to-float
SE-0080 (4/4) - Failable initializers for Float->Int
2017-01-12 21:57:05 -07:00
Michael Gottesman
2b98e46718 Merge pull request #6711 from moiseev/unsafebitcast
[stdlib] Eliminating some 'unsafeBitcast' related warnings
2017-01-11 22:41:39 -08:00
Slava Pestov
75b4be61fb Merge pull request #6461 from hughbe/icu-windows
Simplify ICU package resolution not to require PkgConfig and to be more user configurable.
2017-01-11 15:41:09 -08:00
Matthew Carroll
0e09bbbb83 [DiagnosticsQoI] SR-3359: Add a fix-it to remove @discardableResult on functions that return Void or Never (#6681)
This commit adds a fix-it to remove @discardableResult on functions that return Void or Never. The fix-it is at the warning level. A test was added to verify that the fix-it removes the @discardableResult. This issue was reported in SR-3359:
https://bugs.swift.org/browse/SR-3359

Changes:
TypeCheckAttr.cpp: implemented AttributeChecker::visitDiscardableResultAttr to add a fix-it to remove @discardableResult on functions returning Void or Never.

DiagnosticsSema.def: Added a warning with a diagnostic message.

LoggingWrappers.swift.gyb, HashedCollections.swift.gyb: Removed @discardableResult on functions returning Void.

fixits-apply-all.swift, fixits-apply-all.swift.result: Added tests to verify that @discardableResult is removed from functions returning Void or Never.
2017-01-11 15:12:36 -08:00
Maxim Moiseev
f462ce7852 Deprecating + and - for SignedInteger and its Stride (#6603)
* Removing uses of mixed-type + and - in benchmarks

Using type cast or explicit type annotations.

* Deprecating use of + and - on SignedInteger

As it leads to mixed type arithmetics that is not supposed to work.
It was needed before the new collection indexing model to make moving
indexes simple.

* Test deprecation warning
2017-01-11 14:42:27 -08:00
Max Moiseev
b7d5ef90b8 Addressing PR comments 2017-01-10 14:30:44 -08:00
Vivian Kong
e2c9e246d7 Add @versioned declarations to fix s390x build (#6708) 2017-01-10 13:52:58 -08:00
Max Moiseev
195691523f [stdlib] Eliminating some 'unsafeBitcast' related warnings 2017-01-10 12:36:22 -08:00
Hugh Bellamy
c66b72c5fa Simplify ICU package resolution not to require PkgConfig and to be more user configurable.
If you don't have PkgConfig, you'll need to pass the following to CMake:
```
 -DICU_UC_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
 -DICU_UC_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
 -DICU_I18N_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
 -DICU_I18N_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
 -DICU_UC_LIB_NAME="icuuc"^
 -DICU_I18N_LIB_NAME="icuin"
```

icu
2017-01-10 09:01:40 +00:00
Slava Pestov
d65d1d25f9 Sema: Diagnostics for @_inlineable, @_versioned and Swift 4 default arguments model
Piggybacks some resilience diagnostics onto the availability
checking code.

Public and versioned functions with inlineable bodies can only
reference other public and internal entities, since the SIL code
for the function body is serialized and stored as part of the
module.

This includes @_transparent functions, @_inlineable functions,
accessors for @_inlineable storage, @inline(__always) functions,
and in Swift 4 mode, default argument expressions.

The new checks are a source-breaking change, however we don't
guarantee source compatibility for underscored attributes.

The new ABI and tests for the default argument model will come in
subsequent commits.
2017-01-09 16:59:13 -08:00