Commit Graph

4650 Commits

Author SHA1 Message Date
Arnold Schwaighofer
5c0568dd6e Remove @inline(never) hacks that were added for the lack of ARC across loops
After the recent improvements to the ARC optimizer these should not longer be
necessary and I did not measure negative performance impact from removing them.

rdar://24011261
2016-01-13 11:52:49 -08:00
Trent Nadeau
174221c230 Removed unused _CollectionWrapperType protocol 2016-01-13 04:30:50 +00:00
Maxim Moiseev
f82389a70f Merge pull request #923 from johnlui/master
[stdlib] Change C-style for loop to Swift-style for-in loop
2016-01-12 09:29:50 -08:00
Maxim Moiseev
e8886a4ffa Merge pull request #920 from practicalswift/gyb-fixes
[gardening] Clean up .gyb-files: Remove unused imports. Non-controversial PEP8 fixes.
2016-01-12 09:27:48 -08:00
Dmitri Gribenko
f0d294b714 Merge pull request #884 from practicalswift/apostrophes
[gardening] Replace left/right quotation marks
2016-01-11 20:41:24 -08:00
Tomohiro Kumagai
e4bf75fb29 [stdlib] [docs] Re-wrap some paragraphs to fit within 80 characters. #936 2016-01-12 11:09:15 +09:00
Max Moiseev
08e1e4a043 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-11 16:51:11 -08:00
Tomohiro Kumagai
01155076fa [stdlib] [docs] Modify Array's type parameter name and rename Slice to ArraySlice in comments.
In swift 1.2, `Slice` has been renamed  `ArraySlice`.
In swift 2.0, type parameter name of `Array` is changed from `T` to `Element`.
Therefore, modified the names which appear in code comments and a document.
2016-01-11 17:04:45 +09:00
Dmitri Gribenko
b5d5d82576 Merge pull request #935 from EZ-NET/correct_document_set-type-parameter-name
[stdlib] [docs] Modify Set's type parameter name in comments.
2016-01-10 23:19:50 -08:00
Tomohiro Kumagai
cf8a733a4d [stdlib] [docs] Modify Set's type parameter name in comments.
In swift 2.0, type parameter name of `Set` is changed from `T` to `Element`.
Therefore, modified the names which appear in code comments and a document.
2016-01-11 16:02:05 +09:00
Dmitri Gribenko
f1be251514 Merge pull request #930 from dcci/define
[stdlib] Add missing defines for FreeBSD.
2016-01-09 16:08:37 -08:00
Davide Italiano
4fa7505b8b [stdlib] Add missing defines for FreeBSD.
This makes RaceTest and StdlibCoreExtras working there.
2016-01-10 00:07:47 +00:00
Greg Parker
35448a1179 Merge pull request #861 from jder/fix-fail-cast-overrelease
[SR-392][Runtime] Avoid overrelease when failing cast to protocol
2016-01-09 08:40:45 -08:00
Greg Parker
c9f4dc0044 [test] Fail if a test file uses StdlibUnittest but runs no tests.
This catches accidental omission of runAllTests(). Previously
such test files would silently test nothing and succeed.
2016-01-09 03:27:56 -08:00
Greg Parker
7acc6eae6e [stdlib] Fix a backwards NDEBUG check.
This was inadvertently broken in d15c24e2.
2016-01-09 01:00:31 -08:00
Greg Parker
8ee8adb36e [stdlib] Move protocol conformance checking and caching into its own file. 2016-01-09 01:00:31 -08:00
JohnLui
451ce376e3 [stdlib] Change C-style for loop to Swift-style for-in loop 2016-01-09 12:57:55 +08:00
Slava Pestov
b45cec0dff Runtime: Fix a warning 2016-01-08 19:21:23 -08:00
Maxim Moiseev
bf969a385f Merge pull request #894 from nonsensery/fix-inc-if-signed-logic
[stdlib] Remove confusing `incIfSigned` control flow
2016-01-08 17:27:13 -08:00
practicalswift
73b63c894b Conform to standard spacing around operators, etc. 2016-01-09 01:39:22 +01:00
practicalswift
57d4f2d4da Remove redundant backslashes. 2016-01-09 01:39:22 +01:00
practicalswift
bf90a10adc Avoid multiple imports on same line. 2016-01-09 01:39:22 +01:00
practicalswift
21c3d93bea Remove unused imports. 2016-01-09 01:39:22 +01:00
Jesse Rusak
30224016c5 [SR-392][Runtime] Avoid overrelease when failing cast to protocol
Fixes a regression introduced in e09027ca which causes us to release
the wrong value when a cast fails.
2016-01-08 19:02:37 -05:00
nonsensery
e76dbd5798 Remove confusing incIfSigned control flow
This function was named exactly backwards (it incremented only when
*not* signed). Investigating this naming error revealed that the call
site was also unclear: `incIfSigned` was called from a block where
`signed` was known to be False). So, I inlined the logic in the one
place where it was actually used, and removed the function.
2016-01-08 15:35:15 -08:00
Dmitri Gribenko
8991424d96 Merge pull request #909 from dcci/environfbsd
[Glibc] Define 'extern char **environment' correctly on FreeBSD.
2016-01-09 00:36:34 +02:00
Davide Italiano
51736f16b4 [Glibc] Define 'extern char **environment' correctly on FreeBSD. 2016-01-08 21:52:14 +00:00
Andrew Trick
9cf84c24ca Fix a leak when interpolating optional references.
The runtime support for casting optionals introduced in 35cb1afa
resulted in a redundant retain.

Fixes SR-459: Weakened optionals don't zero...
rdar://24057977.
2016-01-08 13:51:02 -08:00
Pavel Mazurin
e0c6ac167c Add @autoclosure to message parameter, so it's constructed only if it's needed. 2016-01-08 20:49:48 +01:00
Greg Parker
f91dd6fa60 Merge pull request #857 from jder/fix-existential-cast-leak
[SR-426][Runtime] Use _fail to ensure src is deallocated in cast
2016-01-08 01:44:35 -08:00
Davide Italiano
0001c9e227 [CMake] Spell freebsd correctly.
Case sensitiveness matters in this case.
2016-01-08 02:00:25 +00:00
Mike Ferris
d30df98c52 Merge pull request #888 from briancroom/use_StaticString
Use StaticString for `file` parameters in the XCTest overlay
2016-01-07 16:03:10 -08:00
Davide Italiano
f1b3965586 [stdlib] Port StdlibUnittest to FreeBSD. 2016-01-07 21:05:32 +00:00
Doug Gregor
1a38e0ad3b Merge branch 'master' into swift-3-api-guidelines 2016-01-06 15:32:55 -08:00
Joe Groff
7775b9c261 Runtime: Remove swift_retainCount entry points.
These are no longer needed by the corelibs.
2016-01-06 14:12:03 -08:00
Max Moiseev
31f17e212c [stdlib] using static method dispatch instead of failable casts
Overriding `AnySequence.dropFirst` and `AnySequence.prefix` to delegate
these operations to an underlying sequence, thus simplifying default
implementations in `Sequence`.
2016-01-06 13:22:24 -08:00
Max Moiseev
1600c52822 [stdlib] Constraining AnySequence.init
... to only allow sequences where SubSequence.SubSequence ==
SubSequence. See swift-evolution proposal
https://github.com/apple/swift-evolution/blob/master/proposals/0014-constrained-AnySequence.md
for more details.
2016-01-06 12:25:09 -08:00
practicalswift
4689a22f1b Replace left/right quotation marks with apostrophes in non-quote contexts
* LEFT SINGLE QUOTATION MARK (U+2018) → APOSTROPHE (U+0027)
* RIGHT SINGLE QUOTATION MARK (U+2019) → APOSTROPHE (U+0027)
2016-01-06 12:29:40 +01:00
nonsensery
a23e16199f [stdlib] Fix conversion from (signed) int to float in default init
The default initializer for a float types initializes the value to `0`
by calling a “builtin” function to convert an integer with value `0`
into an “FPIEEE” float with value `0`. The integer value is signed, but
the code was calling a function that expected an unsigned integer.
2016-01-05 16:08:02 -08:00
Brian Croom
a5ae9ddabe Use StaticString for file parameters in the XCTest overlay
Instead of just `String`. This makes it consistent with `fatalError`,
`assert`, etc., as well as `swift-corelibs-xctest`
2016-01-05 16:24:50 -05:00
Greg Parker
3f6356110b Remove a stale comment.
This comment should have been removed by d0be84e.
2016-01-04 23:12:52 -08:00
practicalswift
ca92efc8e6 Use consistent formatting of header comments.
Correct format:
```
//===--- Name of file - Description ----------------------------*- Lang -*-===//
```

Notes:
* Comment line should be exactly 80 chars.
* Padding: Pad with dashes after "Description" to reach 80 chars.
* "Name of file", "Description" and "Lang" are all optional.
* In case of missing "Lang": drop the "-*-" markers.
* In case of missing space: drop one, two or three dashes before "Name of file".
2016-01-04 23:00:53 +01:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
practicalswift
fd608f3d85 Fix incorrect file names in file headers. 2016-01-04 10:02:46 +01:00
practicalswift
f91525a10f Consistent placement of "-*- [language] -*-===//" in header. 2016-01-04 09:46:20 +01:00
practicalswift
199c4eae2e Consistent use of programming language indicator in top of file comment. 2016-01-04 09:20:19 +01:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Jesse Rusak
2aaa4846e8 [SR-426][Runtime] Use _fail to ensure src is deallocated in cast
This case was previously ignoring the DestroyOnFailure flag, so
we had a leak if a cast to an existential metatype failed for
certain types (tuples, structs, etc).
2016-01-03 15:07:34 -05:00
Michael Gottesman
3d8433b7f6 [arc] Add in a new semantics attribute called "arc.programtermination_point" and document it.
If this semantic tag is applied to a function, then we know that:

- The function does not touch any reference counted objects.
- After the function is executed, all reference counted objects are leaked
  (most likely in preparation for program termination).

This allows one, when performing ARC code motion, to ignore blocks that contain
an apply to this function as long as the block does not have any other side
effect having instructions.

I have wanted to do this for a while but was stymied by lacking the ability to
apply multiple @_semantics attributes. This is now committed to trunk so I added
this attribute instead of pattern matching against fatalError (since there could
be other functions with this property).

rdar://19592537
2016-01-02 16:22:06 -06:00