Commit Graph

2952 Commits

Author SHA1 Message Date
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
Max Moiseev
de5b03ddc4 Getting rid of Arithmetic.init() in favor of 0 2017-01-13 17:59:35 -08: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
Max Moiseev
e1a8e28ad7 Making non-masking shift helper function public (compiler requires it now) 2017-01-11 15:43:18 -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
fa7368ad7d Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-11 14:37:01 -08:00
Max Moiseev
a872adad8f Fixing and XFAILing tests 2017-01-10 15:38:17 -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
Max Moiseev
aecccc7e48 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-09 17:38:04 -08: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
practicalswift
3918d9d251 [gardening] Replace likely word processor artefacts with ASCII equivalents (— → --, … → ...) 2017-01-08 15:23:06 +01:00
Ben Cohen
578a52627a Merge branch 'master' into se-147 2017-01-07 13:19:15 -08:00
practicalswift
8c2b87bce0 [gardening] Add correct copyright notices 2017-01-07 20:32:18 +01:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
Max Moiseev
d356e1416b Using trailingZeros and leadingZeros provided by integers in floating point types 2017-01-06 14:47:17 -08:00
practicalswift
292282e035 Merge pull request #6620 from practicalswift/gardening-20160106b
[gardening] Fix typos
2017-01-06 22:03:27 +01:00
Nate Cook
6368857344 Merge pull request #6382 from natecook1000/nc-sort-median
[stdlib] Modify sort to pivot on median of 3
2017-01-06 14:27:53 -06:00
practicalswift
30a88d38e6 [gardening] Fix recently introduced typos 2017-01-06 21:16:02 +01:00
Max Moiseev
99689955c5 Adding init(bitPattern: FLOATING_POINT) to Int32 and Int64 2017-01-06 11:59:59 -08:00