Skip to content

Commit c370d24

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents 3f54bf8 + 6584406 commit c370d24

File tree

1,104 files changed

+138291
-19909
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,104 files changed

+138291
-19909
lines changed

.dir-locals.el

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,19 @@
1010
;
1111
;===----------------------------------------------------------------------===;
1212
;;; Directory Local Variables
13-
;;; See Info node `(emacs) Directory Variables' for more information.
13+
;;; For more information see (info "(emacs) Directory Variables")
1414

1515
((nil
1616
(tab-width . 2)
1717
(fill-column . 80)
18-
(eval .
19-
;; Load the Swift project's settings. To suppress this action
20-
;; you can put "(provide 'swift-project-settings)" in your
21-
;; .emacs
18+
(eval let* ((x (dir-locals-find-file default-directory))
19+
(this-directory (if (listp x) (car x)
20+
(file-name-directory x))))
2221
(unless (featurep 'swift-project-settings)
23-
;; Make sure the project's own utils directory is in the
24-
;; load path, but don't override any one the user might have
25-
;; set up.
26-
(add-to-list
27-
'load-path
28-
(concat
29-
(let ((dlff (dir-locals-find-file default-directory)))
30-
(if (listp dlff) (car dlff) (file-name-directory dlff)))
31-
"utils")
32-
:append)
33-
;; Load our project's settings -- indirectly brings in swift-mode
22+
(add-to-list 'load-path (concat this-directory "utils") :append)
23+
(let ((swift-project-directory this-directory))
3424
(require 'swift-project-settings)))
25+
(set (make-local-variable 'swift-project-directory) this-directory))
3526
(c-file-style . "swift")
3627
)
3728
(c++-mode
@@ -44,6 +35,8 @@
4435
(whitespace-style . (face lines indentation:space))
4536
(eval . (whitespace-mode)))
4637
(swift-mode
38+
(swift-find-executable-fn . swift-project-executable-find)
39+
(swift-syntax-check-fn . swift-project-swift-syntax-check)
4740
(whitespace-style . (face lines indentation:space))
4841
(eval . (whitespace-mode))
4942
(swift-basic-offset . 2)

.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
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-query-db,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: 524 additions & 375 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ if(POLICY CMP0054)
88
cmake_policy(SET CMP0054 NEW)
99
endif()
1010

11+
# Enable the IN_LIST operator, as in:
12+
# `if(<element_variable> IN_LIST <list_variable>)`
13+
if(POLICY CMP0057)
14+
cmake_policy(SET CMP0057 NEW)
15+
endif()
16+
1117
# Add path for custom CMake modules.
1218
list(APPEND CMAKE_MODULE_PATH
1319
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -269,6 +275,10 @@ option(SWIFT_STDLIB_ENABLE_RESILIENCE
269275
"Build the standard libraries and overlays with resilience enabled; see docs/LibraryEvolution.rst"
270276
FALSE)
271277

278+
option(SWIFT_STDLIB_ENABLE_SIL_OWNERSHIP
279+
"Build the standard libraries and overlays with sil ownership enabled."
280+
FALSE)
281+
272282
option(SWIFT_STDLIB_SIL_SERIALIZE_ALL
273283
"Build the standard libraries and overlays serializing all method bodies"
274284
TRUE)
@@ -413,6 +423,12 @@ include_directories(BEFORE
413423
# endif()
414424
set(SWIFT_DARWIN_VARIANTS "^(macosx|iphoneos|iphonesimulator|appletvos|appletvsimulator|watchos|watchsimulator)")
415425

426+
# A convenient list to match Darwin SDKs. Example:
427+
# if("${SWIFT_HOST_VARIANT_SDK}" IN_LIST SWIFT_APPLE_PLATFORMS)
428+
# ...
429+
# endif()
430+
set(SWIFT_APPLE_PLATFORMS "IOS" "IOS_SIMULATOR" "TVOS" "TVOS_SIMULATOR" "WATCHOS" "WATCHOS_SIMULATOR" "OSX")
431+
416432
# Configuration flags passed to all of our invocations of gyb. Try to
417433
# avoid making up new variable names here if you can find a CMake
418434
# variable that will do the job.
@@ -491,11 +507,10 @@ function(is_sdk_requested name result_var_name)
491507
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${name}")
492508
set("${result_var_name}" "TRUE" PARENT_SCOPE)
493509
else()
494-
list(FIND SWIFT_SDKS "${name}" sdk_index)
495-
if(${sdk_index} EQUAL -1)
496-
set("${result_var_name}" "FALSE" PARENT_SCOPE)
497-
else()
510+
if("${name}" IN_LIST SWIFT_SDKS)
498511
set("${result_var_name}" "TRUE" PARENT_SCOPE)
512+
else()
513+
set("${result_var_name}" "FALSE" PARENT_SCOPE)
499514
endif()
500515
endif()
501516
endfunction()

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
|**macOS** |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-osx/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-osx)|[![Build Status](https://ci.swift.org/job/oss-swift-package-osx/badge/icon)](https://ci.swift.org/job/oss-swift-package-osx)|
77
|**Ubuntu 14.04** |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-14_04/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-14_04)|
88
|**Ubuntu 15.10** |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-15_10/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-15_10)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-15_10/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-15_10)|
9+
|**Ubuntu 16.04** |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04)|
910

1011
**Welcome to Swift!**
1112

apinotes/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ set(SWIFT_API_NOTES_INPUTS
3535
ObjectiveC
3636
PassKit
3737
Photos
38-
QuartzCore
3938
QuickLook
4039
SafariServices
4140
SceneKit
@@ -67,8 +66,7 @@ endforeach()
6766
file(GLOB SWIFT_API_NOTES_INPUT_FILES "${SWIFT_API_NOTES_PATH}/*.apinotes")
6867
foreach(file ${SWIFT_API_NOTES_INPUT_FILES})
6968
get_filename_component(name "${file}" NAME_WE)
70-
list(FIND SWIFT_API_NOTES_INPUTS "${name}" name_index)
71-
if(name_index EQUAL -1)
69+
if(NOT "${name}" IN_LIST SWIFT_API_NOTES_INPUTS)
7270
message(SEND_ERROR "Found apinotes for ${name}; please add to CMakeLists.txt")
7371
endif()
7472
endforeach()

apinotes/Metal.apinotes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
Name: Metal
33
Tags:
44
- Name: MTLCommandBufferError
5-
SwiftName: MTLCommandBufferErrorDomain
5+
NSErrorDomain: MTLCommandBufferErrorDomain
66
- Name: MTLLibraryError
7-
SwiftName: MTLLibraryErrorDomain
7+
NSErrorDomain: MTLLibraryErrorDomain
88
- Name: MTLRenderPipelineError
9-
SwiftName: MTLRenderPipelineErrorDomain
9+
NSErrorDomain: MTLRenderPipelineErrorDomain
1010
Enumerators:
1111
- Name: MTLResourceStorageModeShared
1212
SwiftName: storageModeShared

apinotes/NetworkExtension.apinotes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Name: NetworkExtension
33
Tags:
44
- Name: NEAppProxyFlowError
5-
SwiftName: NEAppProxyErrorDomain
5+
NSErrorDomain: NEAppProxyErrorDomain
66
- Name: NEFilterError
7-
SwiftName: NEFilterErrorDomain
7+
NSErrorDomain: NEFilterErrorDomain
88
- Name: NETunnelProviderError
9-
SwiftName: NETunnelProviderErrorDomain
9+
NSErrorDomain: NETunnelProviderErrorDomain
1010
- Name: NEVPNError
11-
SwiftName: NEVPNErrorDomain
11+
NSErrorDomain: NEVPNErrorDomain

apinotes/ObjectiveC.apinotes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Protocols:
101101
- Selector: class
102102
MethodKind: Instance
103103
Availability: nonswift
104-
AvailabilityMsg: use 'dynamicType' instead
104+
AvailabilityMsg: use 'type(of:)' instead
105105
- Selector: 'conformsToProtocol:'
106106
MethodKind: Instance
107107
Nullability:

apinotes/QuartzCore.apinotes

Lines changed: 0 additions & 5 deletions
This file was deleted.

apinotes/SafariServices.apinotes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Name: SafariServices
33
Tags:
44
- Name: SFErrorCode
5-
SwiftName: SFErrorDomain
5+
NSErrorDomain: SFErrorDomain
66
- Name: SSReadingListErrorCode
7-
SwiftName: SSReadingListErrorDomain
7+
NSErrorDomain: SSReadingListErrorDomain

benchmark/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ set(SWIFT_BENCH_MODULES
3838
single-source/Chars
3939
single-source/ClassArrayGetter
4040
single-source/DeadArray
41+
single-source/DictTest
42+
single-source/DictTest2
43+
single-source/DictTest3
4144
single-source/DictionaryBridge
4245
single-source/DictionaryLiteral
4346
single-source/DictionaryRemove
4447
single-source/DictionarySwap
45-
single-source/DictTest
46-
single-source/DictTest2
47-
single-source/DictTest3
4848
single-source/ErrorHandling
4949
single-source/Fibonacci
5050
single-source/GlobalClass
@@ -59,10 +59,10 @@ set(SWIFT_BENCH_MODULES
5959
single-source/Memset
6060
single-source/MonteCarloE
6161
single-source/MonteCarloPi
62-
single-source/NopDeinit
6362
single-source/NSDictionaryCastToSwift
6463
single-source/NSError
6564
single-source/NSStringConversion
65+
single-source/NopDeinit
6666
single-source/ObjectAllocation
6767
single-source/OpenClose
6868
single-source/Phonebook
@@ -72,22 +72,22 @@ set(SWIFT_BENCH_MODULES
7272
single-source/Prims
7373
single-source/ProtocolDispatch
7474
single-source/ProtocolDispatch2
75-
single-source/RangeAssignment
7675
single-source/RC4
77-
single-source/RecursiveOwnedParameter
7876
single-source/RGBHistogram
77+
single-source/RangeAssignment
78+
single-source/RecursiveOwnedParameter
7979
single-source/SetTests
8080
single-source/SevenBoom
8181
single-source/Sim2DArray
8282
single-source/SortLettersInPlace
8383
single-source/SortStrings
8484
single-source/StaticArray
8585
single-source/StrComplexWalk
86+
single-source/StrToInt
8687
single-source/StringBuilder
8788
single-source/StringInterpolation
8889
single-source/StringTests
8990
single-source/StringWalk
90-
single-source/StrToInt
9191
single-source/SuperChars
9292
single-source/TwoSum
9393
single-source/TypeFlood
@@ -139,7 +139,8 @@ runcmd(COMMAND "xcrun" "-toolchain" "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}" "-f" "clan
139139
# You have to delete CMakeCache.txt in the swift build to force a
140140
# reconfiguration.
141141
set(SWIFT_EXTRA_BENCH_CONFIGS CACHE STRING
142-
"A semicolon separated list of benchmark configurations. Available configurations: <Optlevel>_SINGLEFILE, <Optlevel>_MULTITHREADED")
142+
"A semicolon separated list of benchmark configurations. \
143+
Available configurations: <Optlevel>_SINGLEFILE, <Optlevel>_MULTITHREADED")
143144

144145
# Syntax for an optset: <optimization-level>_<configuration>
145146
# where "_<configuration>" is optional.
@@ -148,6 +149,11 @@ if(NOT SWIFT_OPTIMIZATION_LEVELS)
148149
${SWIFT_EXTRA_BENCH_CONFIGS})
149150
endif()
150151

152+
set(SWIFT_BENCHMARK_NUM_O_ITERATIONS "" CACHE STRING
153+
"Number of iterations to perform when running -O benchmarks via cmake")
154+
set(SWIFT_BENCHMARK_NUM_ONONE_ITERATIONS "" CACHE STRING
155+
"Number of iterations to perform when running -Onone benchmarks via cmake")
156+
151157
# Options for the default (= empty) configuration
152158
set(BENCHOPTS "-whole-module-optimization")
153159

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,11 @@ function(swift_benchmark_compile)
382382
COMMAND "${swift-bin-dir}/Benchmark_Driver" "run"
383383
"-o" "O" "--output-dir" "${CMAKE_CURRENT_BINARY_DIR}/logs"
384384
"--swift-repo" "${SWIFT_SOURCE_DIR}"
385-
"--iterations" "3"
385+
"--iterations" "${SWIFT_BENCHMARK_NUM_O_ITERATIONS}"
386386
COMMAND "${swift-bin-dir}/Benchmark_Driver" "run"
387387
"-o" "Onone" "--output-dir" "${CMAKE_CURRENT_BINARY_DIR}/logs"
388388
"--swift-repo" "${SWIFT_SOURCE_DIR}"
389-
"--iterations" "3"
389+
"--iterations" "${SWIFT_BENCHMARK_NUM_ONONE_ITERATIONS}"
390390
COMMAND "${swift-bin-dir}/Benchmark_Driver" "compare"
391391
"--log-dir" "${CMAKE_CURRENT_BINARY_DIR}/logs"
392392
"--swift-repo" "${SWIFT_SOURCE_DIR}"

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/scripts/generate_harness/generate_harness.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
if __name__ == '__main__':
3939
# CMakeList single-source
40-
tests = [os.path.basename(x).split('.')[0]
41-
for x in glob.glob(os.path.join(single_source_dir, '*.swift'))]
40+
test_files = glob.glob(os.path.join(single_source_dir, '*.swift'))
41+
tests = sorted(os.path.basename(x).split('.')[0] for x in test_files)
4242

4343
# CMakeList multi-source
4444
class MultiSourceBench(object):

benchmark/single-source/DictTest2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public func run_Dictionary2(_ N: Int) {
1818
let ref_result = 199
1919
var res = 0
2020
for _ in 1...5*N {
21-
var x: [String:Int] = [:]
21+
var x: [String: Int] = [:]
2222
for i in 1...size {
2323
x[String(i, radix:16)] = i
2424
}

benchmark/single-source/DictTest3.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public func run_Dictionary3(_ N: Int) {
1717
let size1 = 100
1818
let reps = 20
1919
let ref_result = "1 99 20 1980"
20-
var hash1 = [String:Int]()
21-
var hash2 = [String:Int]()
20+
var hash1 = [String: Int]()
21+
var hash2 = [String: Int]()
2222
var res = ""
2323

2424
for _ in 1...N {

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)