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
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.
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.
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.
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
Added documentation description for third parameter of
formIndex(_:offsetBy:limitedBy:)
which was previously omitted.
Description copied from the 'index(_:offsetBy:limitedBy:)' method.
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.
* 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
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
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.