Skip to content

Commit f96b655

Browse files
committed
Merge remote-tracking branch 'upstream/master' into SR-755-linux-fatal-stacktrace-symbolication
2 parents 74ff4da + 46b860b commit f96b655

File tree

396 files changed

+6606
-4149
lines changed

Some content is hidden

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

396 files changed

+6606
-4149
lines changed

.pep8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[flake8]
2-
filename = *.py,80+-check,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,check-incremental,gyb,line-directive,mock-distcc,ns-html2rst,recursive-lipo,rth,run-test,submit-benchmark-results,update-checkout,viewcfg,backtrace-check,coverage-build-db,coverage-generate-data,coverage-touch-tests,symbolicate-linux-fatal
2+
filename = *.py,80+-check,backtrace-check,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,check-incremental,clang++,coverage-build-db,coverage-generate-data,coverage-touch-tests,gyb,ld,line-directive,mock-distcc,ns-html2rst,PathSanitizingFileCheck,recursive-lipo,rth,run-test,submit-benchmark-results,update-checkout,viewcfg,symbolicate-linux-fatal

CHANGELOG.md

Lines changed: 35 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ Swift 3.1
2222

2323
* [SE-0045][]:
2424

25-
The `Sequence` protocol now includes two new members, `prefix(while:)` and
26-
`drop(while:)`. `prefix(while:)` is used to request the longest subsequence
27-
satisfying a predicate. `drop(while:)` is used to request the subsequence
28-
remaining after dropping the longest subsequence satisfying a predicate.
25+
The `Sequence` protocol adds new members `prefix(while:)` and
26+
`drop(while:)`. `prefix(while:)` requests the longest subsequence
27+
satisfying a predicate. `drop(while:)` requests the remaining subsequence
28+
after dropping the longest subsequence satisfying a predicate.
2929

3030
Swift 3.0
3131
---------
@@ -34,25 +34,24 @@ Swift 3.0
3434

3535
* [SE-0101][]:
3636

37-
The functions `sizeof()`, `strideof()`, and `alignof()` have been removed.
38-
Instead, these memory layout properties for a type `T` are now spelled
37+
The functions `sizeof()`, `strideof()`, and `alignof()` have been removed.
38+
Memory layout properties for a type `T` are now spelled
3939
`MemoryLayout<T>.size`, `MemoryLayout<T>.stride`, and
4040
`MemoryLayout<T>.alignment`, respectively.
4141

4242
* [SE-0136][]:
4343

44-
The functions `sizeofValue()`, `strideofValue()`, and `alignofValue()` have
45-
been renamed `MemoryLayout.size(ofValue:)`, `MemoryLayout.stride(ofValue:)`,
44+
The functions `sizeofValue()`, `strideofValue()`, and `alignofValue()` have been renamed to `MemoryLayout.size(ofValue:)`, `MemoryLayout.stride(ofValue:)`,
4645
and `MemoryLayout.alignment(ofValue:)`.
4746

4847
* [SE-0125][]:
4948

5049
The functions `isUniquelyReferenced()` and `isUniquelyReferencedNonObjC()`
51-
have been removed. The function `isKnownUniquelyReferenced()` should be called
52-
instead. The class `NonObjectiveCBase` which classes using
53-
`isUniquelyReferenced()` needed to inherit from was removed.
50+
have been removed. Call the function `isKnownUniquelyReferenced()` instead.
51+
52+
Classes using `isUniquelyReferenced()` needed to inherit from `NonObjectiveCBase`. The `NonObjectiveCBase` class has been removed.
5453

55-
The method `ManagedBufferPointer.holdsUniqueReference` was renamed to
54+
The method `ManagedBufferPointer.holdsUniqueReference` has been renamed to
5655
`ManagedBufferPointer.isUniqueReference`.
5756

5857
```swift
@@ -77,8 +76,7 @@ Swift 3.0
7776

7877
* [SE-0124][]:
7978

80-
The initializers on `Int` and `UInt` accepting an `ObjectIdentifier` now need
81-
to be spelled with an explicit `bitPattern` label.
79+
Initializers on `Int` and `UInt` that accept an `ObjectIdentifier` must now use an explicit `bitPattern` label.
8280

8381
```swift
8482
let x: ObjectIdentifier = ...
@@ -94,9 +92,7 @@ Swift 3.0
9492

9593
* [SE-0120][]:
9694

97-
The collection methods `partition()` and `partition(isOrderedBefore:)` have
98-
been removed from Swift. They were replaced by the method `partition(by:)`
99-
which takes a unary predicate.
95+
The collection methods `partition()` and `partition(isOrderedBefore:)` have been removed from Swift. They are replaced by the method `partition(by:)` which takes a unary predicate.
10096

10197
Calls to the `partition()` method can be replaced by the following code.
10298

@@ -112,16 +108,11 @@ Swift 3.0
112108

113109
* [SE-0103][]:
114110

115-
Closure parameters are non-escaping by default, rather than explicitly being
116-
annotated `@noescape`. Use `@escaping` to say that a closure parameter may
117-
escape. `@autoclosure(escaping)` is now spelled `@autoclosure @escaping`.
118-
`@noescape` and `@autoclosure(escaping)` are deprecated.
111+
Closure parameters are now non-escaping by default and do not require `@noescape` annotation. Use `@escaping` to indicate that a closure parameter can escape. `@autoclosure(escaping)` is now spelled `@autoclosure @escaping`. `@noescape` and `@autoclosure(escaping)` are deprecated.
119112

120113
* [SE-0115][]:
121114

122-
To clarify the role of `*LiteralConvertible` protocols, they have
123-
been renamed to `ExpressibleBy*Literal`. No requirements of these
124-
protocols have changed.
115+
To clarify their roles, `*LiteralConvertible` protocols have been renamed to `ExpressibleBy*Literal`. The protocol requirements are unchanged.
125116

126117
* [SE-0107][]:
127118

@@ -130,17 +121,14 @@ Swift 3.0
130121
to `UnsafePointer<U>` has been disallowed. `Unsafe[Mutable]RawPointer`
131122
provides an API for untyped memory access, and an API for binding memory
132123
to a type. Binding memory allows for safe conversion between pointer types.
133-
See `bindMemory(to:capacity:)`, `assumingMemoryBound(to:)`, and
134-
`withMemoryRebound(to:capacity:)`.
124+
125+
For detailed instructions on how to migrate your code to the new API refer to the [UnsafeRawPointer migration guide](https://swift.org/migration-guide/se-0107-migrate.html). See also: See `bindMemory(to:capacity:)`, `assumingMemoryBound(to:)`, and
126+
`withMemoryRebound(to:capacity:)`.
135127

136128
* [SE-0096][]:
137129

138-
The `dynamicType` keyword has been removed from Swift. In its place a new
139-
primitive function `type(of:)` has been added to the language. Existing code
140-
that uses the `.dynamicType` member to retrieve the type of an expression
141-
should migrate to this new primitive. Code that is using `.dynamicType` in
142-
conjunction with `sizeof` should migrate to the `MemoryLayout` structure
143-
provided by [SE-0101][].
130+
The `dynamicType` keyword has been removed from Swift. It's replaced by a new primitive function `type(of:)`. Existing code
131+
using the `.dynamicType` member to retrieve the type of an expression should migrate to this new primitive. Code using `.dynamicType` in conjunction with `sizeof` should migrate to the `MemoryLayout` structure introduced by [SE-0101][].
144132

145133
* [SE-0113][]:
146134

@@ -151,32 +139,26 @@ Swift 3.0
151139
mutating func round( _ rule: FloatingPointRoundingRule)
152140
```
153141

154-
These bind the IEEE 754 roundToIntegral operations. They provide the
155-
functionality of the C / C++ `round()`, `ceil()`, `floor()`, and `trunc()`
156-
functions and other rounding operations as well.
142+
These methods bind the IEEE 754 roundToIntegral operations. They provide the functionality of the C / C++ `round()`, `ceil()`, `floor()`, and `trunc()` functions along with other rounding operations.
157143

158-
As a follow-on to the work of [SE-0113][] and [SE-0067][], the following
159-
mathematical operations in the `Darwin.C` and `glibc` modules now operate
160-
on any type conforming to `FloatingPoint`: `fabs`, `sqrt`, `fma`,
144+
Following onto [SE-0113][] and [SE-0067][], the following `Darwin.C` and `glibc` module mathematical operations now operate on any type conforming to `FloatingPoint`: `fabs`, `sqrt`, `fma`,
161145
`remainder`, `fmod`, `ceil`, `floor`, `round`, and `trunc`.
162146

163-
See also the changes associated with [SE-0067][].
147+
See also: the changes associated with [SE-0067][].
164148

165149
* [SE-0067][]:
166150

167151
The `FloatingPoint` protocol has been expanded to include most IEEE 754
168152
required operations. A number of useful properties have been added to the
169-
protocol as well, representing quantities like the largest finite value or
153+
protocol, representing quantities like the largest finite value or
170154
the smallest positive normal value (these correspond to the macros such as
171155
FLT_MAX defined in C).
172156

173-
While almost all of the changes are additive, there are four changes that
174-
will impact existing code:
157+
While almost all of the changes are additive, four changes impact existing code:
175158

176159
- The `%` operator is no longer available for `FloatingPoint` types. It
177-
was difficult to use correctly, and its semantics did not actually match
178-
those of the corresponding integer operation, making it something of an
179-
attractive nuisance. The new method `formTruncatingRemainder(dividingBy:)`
160+
was difficult to use correctly and its semantics did not match
161+
those of the corresponding integer operation. This made it something of an attractive nuisance. The new method `formTruncatingRemainder(dividingBy:)`
180162
provides the old semantics if they are needed.
181163

182164
- The static property `.NaN` has been renamed `.nan`.
@@ -186,30 +168,25 @@ Swift 3.0
186168

187169
- The predicate `isSignaling` has been renamed `isSignalingNaN`.
188170

189-
See also the changes associated with [SE-0113][].
171+
See also: the changes associated with [SE-0113][].
190172

191173
* [SE-0111][]:
192174

193-
Argument labels have been removed from Swift function types. Instead, they are
194-
part of the name of a function, subscript, or initializer. Calls to a function
195-
or initializer, or uses of a subscript, still require argument labels, as they
196-
always have:
175+
Argument labels have been removed from Swift function types. They are now
176+
part of the name of a function, subscript, or initializer. Calls to a function or initializer, and subscript uses, still require argument labels as they always have:
197177

198178
```swift
199179
func doSomething(x: Int, y: Int) { }
200180
doSomething(x: 0, y: 0) // argument labels are required
201181
```
202182

203-
However, unapplied references to functions or initializers no longer carry
204-
argument labels. For example:
183+
Unapplied references to functions or initializers no longer carry argument labels. For example:
205184

206185
```swift
207186
let f = doSomething(x:y:) // inferred type is now (Int, Int) -> Void
208187
```
209188

210-
Additionally, explicitly-written function types can no longer carry argument
211-
labels, although one can still provide parameter name for documentation
212-
purposes using the '_' in the argument label position:
189+
Explicitly-written function types can no longer carry argument labels. You can still provide parameter names for documentation purposes using the '_' in the argument label position:
213190

214191
```swift
215192
typealias CompletionHandler =
@@ -229,7 +206,7 @@ Swift 3.0
229206

230207
* [SE-0131][]:
231208

232-
The standard library provides a new type `AnyHashable` for use in heterogenous
209+
The standard library provides a new type `AnyHashable` for use in heterogeneous
233210
hashed collections. Untyped `NSDictionary` and `NSSet` APIs from Objective-C
234211
now import as `[AnyHashable: Any]` and `Set<AnyHashable>`.
235212

@@ -584,7 +561,7 @@ Swift 3.0
584561

585562
* [SE-0046][]:
586563

587-
Function parameters now have consistent labelling across all function
564+
Function parameters now have consistent labeling across all function
588565
parameters. With this update the first parameter declarations will
589566
now match the existing behavior of the second and later parameters.
590567
This change makes the language simpler.
@@ -3686,7 +3663,7 @@ Swift 1.0
36863663
accepts inouts or `nil`:
36873664

36883665
```swift
3689-
var error: NSError? = nil
3666+
var error: NSError?
36903667
let words = NSString.stringWithContentsOfFile("/usr/share/dict/words",
36913668
encoding: .UTF8StringEncoding,
36923669
error: &error)

benchmark/scripts/compare_perf_tests.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
PAIN_DETAIL = """
7272
{0}: {1}"""
7373

74+
RATIO_MIN = None
75+
RATIO_MAX = None
76+
7477

7578
def main():
7679
global RATIO_MIN
@@ -146,11 +149,11 @@ def main():
146149

147150
ratio_total = 0
148151
for key in new_results.keys():
149-
ratio = (old_results[key]+0.001)/(new_results[key]+0.001)
152+
ratio = (old_results[key] + 0.001) / (new_results[key] + 0.001)
150153
ratio_list[key] = round(ratio, 2)
151154
ratio_total *= ratio
152-
delta = (((float(new_results[key]+0.001) /
153-
(old_results[key]+0.001)) - 1) * 100)
155+
delta = (((float(new_results[key] + 0.001) /
156+
(old_results[key] + 0.001)) - 1) * 100)
154157
delta_list[key] = round(delta, 2)
155158
if ((old_results[key] < new_results[key] and
156159
new_results[key] < old_max_results[key]) or
@@ -174,17 +177,17 @@ def main():
174177
delta_width = max_width(delta_list, title='DELTA (%)')
175178

176179
markdown_table_header = "\n" + MARKDOWN_ROW.format(
177-
"TEST".ljust(test_name_width),
178-
old_branch.ljust(old_time_width),
179-
new_branch.ljust(new_time_width),
180-
"DELTA (%)".ljust(delta_width),
181-
"SPEEDUP".ljust(2))
180+
"TEST".ljust(test_name_width),
181+
old_branch.ljust(old_time_width),
182+
new_branch.ljust(new_time_width),
183+
"DELTA (%)".ljust(delta_width),
184+
"SPEEDUP".ljust(2))
182185
markdown_table_header += MARKDOWN_ROW.format(
183-
HEADER_SPLIT.ljust(test_name_width),
184-
HEADER_SPLIT.ljust(old_time_width),
185-
HEADER_SPLIT.ljust(new_time_width),
186-
HEADER_SPLIT.ljust(delta_width),
187-
HEADER_SPLIT.ljust(2))
186+
HEADER_SPLIT.ljust(test_name_width),
187+
HEADER_SPLIT.ljust(old_time_width),
188+
HEADER_SPLIT.ljust(new_time_width),
189+
HEADER_SPLIT.ljust(delta_width),
190+
HEADER_SPLIT.ljust(2))
188191
markdown_regression = ""
189192
for i, key in enumerate(decreased_perf_list):
190193
ratio = "{0:.2f}x".format(ratio_list[key])

benchmark/single-source/NSDictionaryCastToSwift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// rdar://problem/18539730
1515
//
1616
// Description:
17-
// Create a NSDictionary instance and cast it to [String: NSObject].
17+
// Create an NSDictionary instance and cast it to [String: NSObject].
1818
import Foundation
1919
import TestsUtils
2020

benchmark/utils/DriverUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct TestConfig {
9696

9797
/// After we run the tests, should the harness sleep to allow for utilities
9898
/// like leaks that require a PID to run on the test harness.
99-
var afterRunSleep: Int? = nil
99+
var afterRunSleep: Int?
100100

101101
/// The list of tests to run.
102102
var tests = [Test]()

0 commit comments

Comments
 (0)