Skip to content

Commit f51e708

Browse files
author
Max Moiseev
committed
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2 parents 9391b0a + d56b8ba commit f51e708

File tree

1,513 files changed

+30819
-11883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,513 files changed

+30819
-11883
lines changed

.dir-locals.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;
33
; This source file is part of the Swift.org open source project
44
;
5-
; Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
5+
; Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
; Licensed under Apache License v2.0 with Runtime Library Exception
77
;
88
; See http://swift.org/LICENSE.txt for license information

CHANGELOG.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Latest
99
for operators that start with a dot ("."). The new rule is that an operator
1010
that starts with a dot may contain other dots in it, but operators that start
1111
with some other character may not contain dots. For example:
12-
12+
1313
```
1414
x....foo --> "x" "...." "foo"
1515
x&%^.foo --> "x" "&%^" ".foo"
@@ -91,6 +91,14 @@ Latest
9191
back-ticks. For more information, see
9292
[SE-0001](https://github.com/apple/swift-evolution/blob/master/proposals/0001-keywords-as-argument-labels.md).
9393
94+
* Tuples (up to arity 6) whose elements are all `Comparable` or `Equatable` now
95+
implement the full set of comparison/equality operators. The comparison
96+
operators are defined in terms of [lexicographical order][]. See [SE-0015][]
97+
for more information.
98+
99+
[lexicographical order]: https://en.wikipedia.org/wiki/Lexicographical_order
100+
[SE-0015]: https://github.com/apple/swift-evolution/blob/master/proposals/0015-tuple-comparison-operators.md
101+
94102
2015-09-17 [Xcode 7.1, Swift 2.1]
95103
----------
96104
@@ -3897,9 +3905,9 @@ Latest
38973905
themselves.
38983906

38993907
Overall, a property now may either be "stored" (the default), "computed"
3900-
(have a `get:` and optionally a `set:` specifier), or a observed
3908+
(have a `get:` and optionally a `set:` specifier), or an observed
39013909
(`willSet`/`didSet`) property. It is not possible to have a custom getter
3902-
or setter on a observed property, since they have storage.
3910+
or setter on an observed property, since they have storage.
39033911

39043912
Two known-missing bits are:
39053913
- **(rdar://problem/15920332) didSet/willSet variables need to allow initializers**

CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ set(SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS "" CACHE STRING
183183
"A list of [module_regexp1;flags1;module_regexp2;flags2,...] which can be used to apply specific flags to modules that match a cmake regexp. It always applies the first regexp that matches.")
184184

185185
set(SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS "" CACHE STRING
186-
"A list of [module_regexp1;flags1;module_regexp2;flags2,...] which can be used to apply specific flags to modules that do not match a cmake regexp. It always applies the first regexp that does not matche. The reason this is necessary is that cmake does not provide negative matches in the regex. Instead you have to use NOT in the if statement requiring a separate variable.")
187-
188-
option(SWIFT_RUNTIME_ENABLE_DTRACE
189-
"Should the runtime be built with dtrace instrumentation enabled"
190-
FALSE)
186+
"A list of [module_regexp1;flags1;module_regexp2;flags2,...] which can be used to apply specific flags to modules that do not match a cmake regexp. It always applies the first regexp that does not match. The reason this is necessary is that cmake does not provide negative matches in the regex. Instead you have to use NOT in the if statement requiring a separate variable.")
191187

192188
option(SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
193189
"Should the runtime be built with support for non-thread-safe leak detecting entrypoints"

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ with version 2 shipped with Ubuntu.
5656
If you are building on Ubuntu 14.04 LTS, you'll need to upgrade your clang
5757
compiler for C++14 support and create a symlink:
5858

59-
sudo apt-get install clang-3.6
60-
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
61-
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100
59+
sudo apt-get install clang-3.6
60+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
61+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100
6262

6363
### Getting Sources for Swift and Related Projects
6464

docs/ARCOptimization.rst

+19
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,22 @@ These builtins perform an implicit cast to NativeObject before
228228
checking uniqueness. There’s no way at SIL level to cast the address
229229
of a reference, so we need to encapsulate this operation as part of
230230
the builtin.
231+
232+
Semantic Tags
233+
=============
234+
235+
ARC takes advantage of certain semantic tags. This section documents these
236+
semantics and their meanings.
237+
238+
arc.programtermination_point
239+
----------------------------
240+
241+
If this semantic tag is applied to a function, then we know that:
242+
243+
- The function does not touch any reference counted objects.
244+
- After the function is executed, all reference counted objects are leaked
245+
(most likely in preparation for program termination).
246+
247+
This allows one, when performing ARC code motion, to ignore blocks that contain
248+
an apply to this function as long as the block does not have any other side
249+
effect having instructions.

docs/DebuggingTheCompiler.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ and check for the function name in the breakpoint condition::
136136

137137
(lldb) br set -c 'hasName("_TFC3nix1Xd")' -f SILFunction.cpp -l 91
138138

139-
Sometimes you want to know which optimization does insert, remove or move a
139+
Sometimes you may want to know which optimization inserts, removes or moves a
140140
certain instruction. To find out, set a breakpoint in
141141
``ilist_traits<SILInstruction>::addNodeToList`` or
142142
``ilist_traits<SILInstruction>::removeNodeFromList``, which are defined in

docs/ErrorHandlingRationale.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ options as a programmer:
389389
function called by your function.
390390
391391
- You can carefully arrange your function so that there are no
392-
critical sections where an universal error can leave things in an
392+
critical sections where a universal error can leave things in an
393393
unwanted state.
394394
395395
There are techniques for making the second more palatable. Chiefly,
@@ -741,8 +741,8 @@ This approach is therefore relatively even-handed about the error
741741
vs. the non-error path, although it requires some care in order to
742742
minimize code-size penalties for parallel error paths.
743743
744-
``setjmp`` / ``longmp``
745-
~~~~~~~~~~~~~~~~~~~~~~~
744+
``setjmp`` / ``longjmp``
745+
~~~~~~~~~~~~~~~~~~~~~~~~
746746
747747
Another strategy to is to dynamically maintain a thread-local stack of
748748
interesting frames. A function with an interesting frame must save

docs/Generics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ OrderedCollection>) are just sugar for a where clause. For example, the
579579
above find() signature is equivalent to::
580580

581581
func find<C where C : OrderedCollection, C.Element : Comparable>(
582-
collection : C, value : C.Element)-> Int
582+
collection : C, value : C.Element) -> Int
583583

584584
Note that find<C> is shorthand for (and equivalent to) find<C : Any>, since
585585
every type conforms to the Any protocol composition.

docs/GitWorkflows.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ By default when updating, Git will attempt to merge the remote changes and your
114114
local changes. Ignoring what that sentence means, this is not an SVN-esque
115115
model. Instead we want any local changes that we have to be applied on top of
116116
any new remote changes. The 'branch.autosetuprebase' flag causes this to be done
117-
automatically when ever one updates the local repository.
117+
automatically whenever one updates the local repository.
118118

119119
Update
120120
------
@@ -261,7 +261,7 @@ command::
261261

262262
$ git log <REVISION>
263263

264-
To see a oneline summary that includes just the title of the commit and its
264+
To see an oneline summary that includes just the title of the commit and its
265265
hash, pass the '--oneline' command::
266266

267267
$ git log --oneline

docs/HighLevelSILOptimizations.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Array
132132
The following semantic tags describe Array operations. The operations
133133
are first described in terms of the Array "state". Relations between the
134134
operations are formally defined below. 'Array' refers to the standard library
135-
Array<T>, ContigousArray<T>, and ArraySlice<T> data-structures.
135+
Array<T>, ContiguousArray<T>, and ArraySlice<T> data-structures.
136136

137137
We consider the array state to consist of a set of disjoint elements
138138
and a storage descriptor that encapsulates nonelement data such as the
@@ -262,7 +262,7 @@ check_subscript guards get_element, get_element_address
262262
make_mutable interferes-with props.isCocoa/needsElementTypeCheck
263263
get_elt_addr interferes-with get_element, get_element_address,
264264
props.isCocoa/needsElementTypeCheck
265-
mutate_unknown itereferes-with get_element, check_subscript, get_length,
265+
mutate_unknown interferes-with get_element, check_subscript, get_length,
266266
get_capacity, get_element_address,
267267
props.isCocoa/needsElementTypeCheck
268268
================ =============== ==========================================

docs/Runtime.md

+15-18
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ process start and the function returns.
242242
## Debugging
243243

244244
```
245-
0000000000024040 T __swift_debug_verifyTypeLayoutAttribute
246245
0000000000027140 T _swift_willThrow
247246
```
248247

@@ -307,6 +306,9 @@ detail used to implement resilient per-type metadata accessor functions.
307306
0000000000028bc0 T _swift_getInitializedObjCClass
308307
```
309308

309+
**ABI TODO**: Fast entry points for `getExistential*TypeMetadata1-3`. Static
310+
metadata for `Any` and `AnyObject` is probably worth considering too.
311+
310312
## Type metadata initialization
311313

312314
Calls to these entry points are emitted when instantiating type metadata at
@@ -325,26 +327,19 @@ runtime.
325327
0000000000028b60 T _swift_instantiateObjCClass
326328
```
327329

328-
## Objective-C Runtime Interop
329-
330-
```
331-
0000000000023e60 T _swift_demangleSimpleClass
332-
0000000000028770 T _swift_objcRespondsToSelector
333-
```
334-
335330
## Metatypes
336331

337332
```
338333
0000000000000b60 T _swift_getDynamicType
339334
0000000000022fb0 T _swift_getObjectType
340335
00000000000006f0 T _swift_getTypeName
341336
00000000000040c0 T _swift_isClassType
342-
0000000000003f50 T _swift_isClassOrObjCExistential
337+
0000000000003f50 T _swift_isClassOrObjCExistentialType
343338
0000000000004130 T _swift_isOptionalType
344-
00000000000279f0 T __swift_usesNativeSwiftReferenceCounting_class
345-
000000000002b340 T __swift_class_getInstancePositiveExtentSize
346-
000000000002b350 T __swift_class_getInstancePositiveExtentSize_native
347-
0000000000004080 T __swift_getSuperclass_nonNull
339+
00000000000279f0 T _swift_objc_class_usesNativeSwiftReferenceCounting
340+
000000000002b340 T _swift_objc_class_unknownGetInstanceExtents
341+
000000000002b350 T _swift_class_getInstanceExtents
342+
0000000000004080 T _swift_class_getSuperclass
348343
```
349344

350345
**ABI TODO**: getTypeByName entry point.
@@ -354,9 +349,6 @@ constants to supersede `swift_is*Type`.
354349

355350
**ABI TODO**: Rename class metadata queries with a consistent naming scheme.
356351

357-
**ABI TODO**: `swift_isClassOrObjCExistential` should end in `-Type` for
358-
consistency.
359-
360352
## Protocol conformance lookup
361353

362354
```
@@ -375,7 +367,10 @@ consistency.
375367

376368
The Swift runtime exports standard metadata objects for `Builtin` types
377369
as well as standard value witness tables that can be freely adopted by
378-
types with common layout attributes.
370+
types with common layout attributes. Note that, unlike public-facing types,
371+
the runtime does not guarantee a 1:1 mapping of Builtin types to metadata
372+
objects, and will reuse metadata objects to represent builtins with the same
373+
layout characteristics.
379374

380375
```
381376
000000000004faa8 S __TMBB
@@ -419,4 +414,6 @@ types with common layout attributes.
419414

420415
- Unsynchronized retain/release
421416

422-
- Decouple dynamic casting and reflection from the standard library
417+
- Nonnull retain/release
418+
419+
- Decouple dynamic casting, bridging, and reflection from the standard library

docs/SIL.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ gets lowered to SIL as::
13891389

13901390
sil @inout : $(@inout Int) -> () {
13911391
entry(%x : $*Int):
1392-
%1 = integer_literal 1 : $Int
1392+
%1 = integer_literal $Int, 1
13931393
store %1 to %x
13941394
return
13951395
}
@@ -4049,7 +4049,7 @@ select_value
40494049
sil-instruction ::= 'select_value' sil-operand sil-select-value-case*
40504050
(',' 'default' sil-value)?
40514051
':' sil-type
4052-
sil-selct-value-case ::= 'case' sil-value ':' sil-value
4052+
sil-select-value-case ::= 'case' sil-value ':' sil-value
40534053

40544054

40554055
%n = select_value %0 : $U, \
@@ -4130,7 +4130,7 @@ original enum value. For example::
41304130
case #Foo.TwoInts!enumelt.1: two_ints
41314131

41324132
nothing:
4133-
%zero = integer_literal 0 : $Int
4133+
%zero = integer_literal $Int, 0
41344134
return %zero : $Int
41354135

41364136
one_int(%y : $Int):

docs/StdlibAPIGuidelines.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Acceptable Short or Non-Descriptive Names
200200

201201
func map<U>(transformation: T->U) -> [U] // not this one
202202

203-
func forEach<S: SequenceType>(body: (S.Iterator.Element)->())
203+
func forEach<S: SequenceType>(body: (S.Iterator.Element) -> ())
204204

205205
Prefixes and Suffixes
206206
---------------------

docs/StringDesign.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ Searching
940940

941941
:Swift:
942942
.. parsed-literal::
943-
func **find**\ (match: (Character)->Bool) -> Range<String.IndexType>
943+
func **find**\ (match: (Character) -> Bool) -> Range<String.IndexType>
944944
945945
.. Admonition:: Usage Example
946946

@@ -1100,7 +1100,7 @@ Capitalization
11001100
11011101
:Swift:
11021102
.. parsed-literal::
1103-
trim **trim**\ (match: (Character)->Bool) -> String
1103+
trim **trim**\ (match: (Character) -> Bool) -> String
11041104
11051105
.. Admonition:: Usage Example
11061106

docs/Testing.rst

+2
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ Other substitutions:
313313
* ``%platform-sdk-overlay-dir``: absolute path of the directory where the SDK
314314
overlay module files for the target platform are stored.
315315

316+
* ``%{python}``: run the same Python interpreter that's being used to run the
317+
current ``lit`` test.
316318

317319
When writing a test where output (or IR, SIL) depends on the bitness of the
318320
target CPU, use this pattern::

docs/archive/LangRefNew.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1537,8 +1537,8 @@ Short Circuiting Logical Operators
15371537

15381538
::
15391539

1540-
func && (lhs: Bool, rhs: ()->Bool) -> Bool
1541-
func || (lhs: Bool, rhs: ()->Bool) -> Bool
1540+
func && (lhs: Bool, rhs: () -> Bool) -> Bool
1541+
func || (lhs: Bool, rhs: () -> Bool) -> Bool
15421542

15431543
Swift has a simplified precedence levels when compared with C. From highest to
15441544
lowest:

docs/doxygen.cfg.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ SEARCHENGINE = @enable_searchengine@
12391239
# using Javascript. Doxygen will generate the search PHP script and index
12401240
# file to put on the web server. The advantage of the server
12411241
# based approach is that it scales better to large projects and allows
1242-
# full text search. The disadvances is that it is more difficult to setup
1242+
# full text search. The disadvantage is that it is more difficult to setup
12431243
# and does not have live searching capabilities.
12441244

12451245
SERVER_BASED_SEARCH = @enable_server_based_search@

docs/proposals/ArrayBridge.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
..
55
.. This source file is part of the Swift.org open source project
66
..
7-
.. Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
7+
.. Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
88
.. Licensed under Apache License v2.0 with Runtime Library Exception
99
..
1010
.. See http://swift.org/LICENSE.txt for license information

0 commit comments

Comments
 (0)