Commit Graph

5263 Commits

Author SHA1 Message Date
Dave Abrahams
966b6f435b Merge pull request #1025 from glessard/details2
80-column compliance
2016-01-20 08:19:32 -08:00
Guillaume Lessard
5d4fb3f210 80-column compliance 2016-01-20 07:53:44 -07:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Dmitri Gribenko
74ce1ca79c Add unavailable declarations for Swift 2.2 -> 3 migration 2016-01-19 14:32:59 -08:00
Chris Lattner
671eb1f4dd Merge pull request #976 from gregomni/associatedtype-in-stdlib
[stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
2016-01-17 14:09:06 -08:00
practicalswift
043d4ebc1f Fix recently introduced typos 2016-01-16 10:56:11 +01:00
Dmitri Gribenko
5a1f8b25a5 Merge pull request #979 from antonblanchard/powerpc64_merge
Add powerpc64le Linux support
2016-01-15 18:14:45 -08:00
Luke Howard
70c5755adb [SR-381]: runtime resolution of type metadata from a name
replace ProtocolConformanceTypeKind with TypeMetadataRecordKind

metadata reference does not need to be indirectable

more efficient check for protocol conformances

remove swift_getMangledTypeName(), not needed yet

kill off Remangle.cpp for non-ObjC builds

cleanup

cleanup

cleanup comments
2016-01-15 17:48:42 +11:00
Anton Blanchard
b1827d8a8f Add powerpc64le Linux support
This patch adds powerpc64le Linux support. While the patch also adds
the matching powerpc64 bits, there are endian issues that need to be
sorted out.

The PowerPC LLVM changes for the swift ABI (eg returning three element
non-homogeneous aggregates) are still in the works, but a simple LLVM
fix to allow those aggregates results in swift passing all but 8
test cases.
2016-01-15 06:48:31 +00:00
gregomni
e2dee6b9dd [stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
Fixes deprecation warnings arising from addition of new
‘associatedtype’ keyword in sr-511.
2016-01-14 09:39:15 -08:00
Maxim Moiseev
77628e9747 Merge pull request #951 from tanadeau/sr-409
[SR-409][stdlib] Removed unused _CollectionWrapperType protocol
2016-01-13 17:29:56 -08:00
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
JohnLui
451ce376e3 [stdlib] Change C-style for loop to Swift-style for-in loop 2016-01-09 12:57:55 +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
21c3d93bea Remove unused imports. 2016-01-09 01:39:22 +01: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
Doug Gregor
1a38e0ad3b Merge branch 'master' into swift-3-api-guidelines 2016-01-06 15:32:55 -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
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
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01: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
Ling Wang
bb7119f4ae Add O(1) contains() implementation for Range with Comparable Element 2016-01-01 19:43:01 -06:00
Chris Lattner
a30ae2bf55 Merge pull request #836 from zachpanz88/new-year
Update copyright date
2015-12-31 19:36:14 -08:00
Dave Abrahams
e210532690 Merge pull request #825 from kballard/collectiontype-lazy-first
[Stdlib] Optimize CollectionType.first
2015-12-31 16:41:05 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Kevin Ballard
dee1c7a05c [Stdlib] Add notes to lazy collection doc comments about complexity
Many lazy collections don't offer O(1) performance for `startIndex`,
`first`, or any method that depends on `startIndex`.
`LazyFilterCollection` already had a note to this effect (which I
tweaked a bit), but `FlattenCollection` didn't.

Related to SR-425.
2015-12-31 13:35:52 -08:00
Kevin Ballard
6ae85cea26 [Stdlib] Optimize CollectionType.first
For lazy collections, `isEmpty` and `startIndex` may be O(N) operations.
The old implementation ended up being potentially O(2N) instead of O(1).
In particular, accessing `col.lazy.filter(pred).first` would evaluate
the predicate on elements twice, once to determine the result of
`isEmpty` and once to determine `startIndex`.
2015-12-31 13:30:11 -08:00
Joe Groff
8f55d99173 stdlib: Reduce code size of tuple comparators.
We can define the operations for N+1-tuples in terms of the ones for N-tuples, which reduces an x86-64 stdlib by about 4KB:

-rwxr-xr-x  1 jgroff  staff  5172856 Dec 30 10:54 lib/swift/macosx/libswiftCore.before.dylib
-rwxr-xr-x  1 jgroff  staff  5168752 Dec 30 11:59 lib/swift/macosx/libswiftCore.after.dylib

The optimizer should still be able to inline all the calls together in release builds.
2015-12-30 13:42:33 -08:00
Ray Lillywhite
4f90ba129e [stdlib] Add documentation for === 2015-12-29 10:45:46 -08:00
practicalswift
d89b4d45e1 Fix typos in code (non-comment typos). 2015-12-27 13:05:01 +01:00
practicalswift
ce760cff66 Fix typos. 2015-12-26 12:43:52 +01:00
Patrick Pijnappel
f181a6eca3 [stdlib] Remove return comments 2015-12-26 11:18:22 +11:00
Patrick Pijnappel
4c894b97a0 [stdlib] Fix comment
Amendment to my own commit.
2015-12-26 11:13:54 +11:00