Skip to content

Commit c9331c5

Browse files
authored
---
yaml --- r: 275445 b: refs/heads/master-next c: 74d1322 h: refs/heads/master i: 275443: e901b04
1 parent 0a87bb3 commit c9331c5

File tree

253 files changed

+8729
-3935
lines changed

Some content is hidden

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

253 files changed

+8729
-3935
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 65b3164726f2e62dff31e90a5cb5e3fb67cc82bf
3-
refs/heads/master-next: 6c662f7a6c5dc53d548d52accbca646bab4a30c9
3+
refs/heads/master-next: 74d1322a727ac903bf518fa79fdab5221bb3274c
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
| Contents |
88
| :--------------------- |
9+
| [Swift 5.1](#swift-51) |
910
| [Swift 5.0](#swift-50) |
1011
| [Swift 4.2](#swift-42) |
1112
| [Swift 4.1](#swift-41) |
@@ -26,6 +27,17 @@ Swift 5.1
2627

2728
* Key path expressions can now include references to tuple elements.
2829

30+
* Single-parameter functions accepting values of type `Any` are no
31+
longer preferred over other functions.
32+
33+
```swift
34+
func foo(_: Any) { print("Any") }
35+
func foo<T>(_: T) { print("T") }
36+
foo(0) // prints "Any" in Swift < 5.1, "T" in Swift 5.1
37+
```
38+
39+
**Add new entries to the top of this section, not here!**
40+
2941
Swift 5.0
3042
---------
3143

branches/master-next/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
235235
FALSE)
236236

237237
option(SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
238-
"Enable the Swift stable ABI's class marker bit"
239-
FALSE)
238+
"Enable the Swift stable ABI's class marker bit for new deployment targets"
239+
TRUE)
240240

241241
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
242242
"The name of the toolchain to pass to 'xcrun'")

branches/master-next/benchmark/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ set(SWIFT_BENCH_MODULES
7777
single-source/DictionaryRemove
7878
single-source/DictionarySubscriptDefault
7979
single-source/DictionarySwap
80-
single-source/DoubleWidthDivision
8180
single-source/DropFirst
8281
single-source/DropLast
8382
single-source/DropWhile

branches/master-next/benchmark/single-source/DoubleWidthDivision.swift

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

branches/master-next/benchmark/utils/main.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ import DictionaryOfAnyHashableStrings
6565
import DictionaryRemove
6666
import DictionarySubscriptDefault
6767
import DictionarySwap
68-
import DoubleWidthDivision
6968
import DropFirst
7069
import DropLast
7170
import DropWhile
@@ -235,7 +234,6 @@ registerBenchmark(DictionaryOfAnyHashableStrings)
235234
registerBenchmark(DictionaryRemove)
236235
registerBenchmark(DictionarySubscriptDefault)
237236
registerBenchmark(DictionarySwap)
238-
registerBenchmark(DoubleWidthDivision)
239237
registerBenchmark(DropFirst)
240238
registerBenchmark(DropLast)
241239
registerBenchmark(DropWhile)

branches/master-next/cmake/modules/SwiftSource.cmake

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ function(_compile_swift_files
195195

196196
# Compute flags for the Swift compiler.
197197
set(swift_flags)
198+
set(swift_module_flags)
198199

199200
_add_variant_swift_compile_flags(
200201
"${SWIFTFILE_SDK}"
@@ -261,7 +262,7 @@ function(_compile_swift_files
261262
if (SWIFTFILE_IS_STDLIB)
262263
list(APPEND swift_flags "-swift-version" "5")
263264
endif()
264-
265+
265266
# Force swift 4 compatibility mode for overlays.
266267
if (SWIFTFILE_IS_SDK_OVERLAY)
267268
list(APPEND swift_flags "-swift-version" "4")
@@ -283,17 +284,10 @@ function(_compile_swift_files
283284

284285
list(APPEND swift_flags ${SWIFTFILE_FLAGS})
285286

286-
set(obj_dirs)
287+
set(dirs_to_create)
287288
foreach(output ${SWIFTFILE_OUTPUT})
288289
get_filename_component(objdir "${output}" PATH)
289-
list(APPEND obj_dirs "${objdir}")
290-
endforeach()
291-
list(REMOVE_DUPLICATES obj_dirs)
292-
293-
set(command_create_dirs)
294-
foreach(objdir ${obj_dirs})
295-
list(APPEND command_create_dirs
296-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${objdir}")
290+
list(APPEND dirs_to_create "${objdir}")
297291
endforeach()
298292

299293
set(module_file)
@@ -316,6 +310,8 @@ function(_compile_swift_files
316310
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
317311
set(specific_module_dir "${module_base}.swiftmodule")
318312
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
313+
else()
314+
set(specific_module_dir)
319315
endif()
320316
set(module_file "${module_base}.swiftmodule")
321317
set(module_doc_file "${module_base}.swiftdoc")
@@ -328,16 +324,8 @@ function(_compile_swift_files
328324

329325
if(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES)
330326
set(interface_file "${module_base}.swiftinterface")
331-
list(APPEND swift_flags
332-
"-emit-parseable-module-interface-path" "${interface_file}")
333-
endif()
334-
335-
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
336-
list(APPEND command_create_dirs
337-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${specific_module_dir}")
338-
else()
339-
list(APPEND command_create_dirs
340-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
327+
list(APPEND swift_module_flags
328+
"-emit-parseable-module-interface-path" "${interface_file}")
341329
endif()
342330

343331
# If we have extra regexp flags, check if we match any of the regexps. If so
@@ -356,16 +344,11 @@ function(_compile_swift_files
356344
list(APPEND module_outputs "${interface_file}")
357345
endif()
358346

359-
set(optional_arg)
360-
if(sdk IN_LIST SWIFT_APPLE_PLATFORMS)
361-
# Allow installation of stdlib without building all variants on Darwin.
362-
set(optional_arg "OPTIONAL")
363-
endif()
364-
365347
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
366348
swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
367349
DIRECTORY "${specific_module_dir}"
368-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}")
350+
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
351+
OPTIONAL)
369352
else()
370353
swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
371354
FILES ${module_outputs}
@@ -398,7 +381,7 @@ function(_compile_swift_files
398381
endif()
399382

400383
if (SWIFT_REPORT_STATISTICS)
401-
list(GET obj_dirs 0 first_obj_dir)
384+
list(GET dirs_to_create 0 first_obj_dir)
402385
list(APPEND swift_flags "-stats-output-dir" ${first_obj_dir})
403386
endif()
404387

@@ -433,12 +416,12 @@ function(_compile_swift_files
433416
endif()
434417

435418
# First generate the obj dirs
419+
list(REMOVE_DUPLICATES dirs_to_create)
436420
add_custom_command_target(
437-
obj_dirs_dependency_target
438-
${command_create_dirs}
439-
COMMAND ""
440-
OUTPUT ${obj_dirs}
441-
COMMENT "Generating obj dirs for ${first_output}")
421+
create_dirs_dependency_target
422+
COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
423+
OUTPUT ${dirs_to_create}
424+
COMMENT "Generating dirs for ${first_output}")
442425

443426
# Then we can compile both the object files and the swiftmodule files
444427
# in parallel in this target for the object file, and ...
@@ -451,7 +434,7 @@ function(_compile_swift_files
451434
set(file_path "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.txt")
452435
string(REPLACE ";" "'\n'" source_files_quoted "${source_files}")
453436
file(WRITE "${file_path}" "'${source_files_quoted}'")
454-
437+
455438
# If this platform/architecture combo supports backward deployment to old
456439
# Objective-C runtimes, we need to copy a YAML file with legacy type layout
457440
# information to the build directory so that the compiler can find it.
@@ -478,7 +461,7 @@ function(_compile_swift_files
478461
${swift_compiler_tool_dep}
479462
${file_path} ${source_files} ${SWIFTFILE_DEPENDS}
480463
${swift_ide_test_dependency}
481-
${obj_dirs_dependency_target}
464+
${create_dirs_dependency_target}
482465
${copy_legacy_layouts_dep}
483466
COMMENT "Compiling ${first_output}")
484467
set("${dependency_target_out_var_name}" "${dependency_target}" PARENT_SCOPE)
@@ -503,17 +486,20 @@ function(_compile_swift_files
503486
module_dependency_target
504487
COMMAND
505488
"${CMAKE_COMMAND}" "-E" "remove" "-f" ${module_outputs}
489+
COMMAND
490+
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
491+
${specific_module_dir}
506492
COMMAND
507493
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
508494
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
509-
${swift_flags} "@${file_path}"
495+
${swift_flags} ${swift_module_flags} "@${file_path}"
510496
${command_touch_module_outputs}
511497
OUTPUT ${module_outputs}
512498
DEPENDS
513499
${swift_compiler_tool_dep}
514500
${source_files} ${SWIFTFILE_DEPENDS}
515501
${swift_ide_test_dependency}
516-
${obj_dirs_dependency_target}
502+
${create_dirs_dependency_target}
517503
COMMENT "Generating ${module_file}")
518504
set("${dependency_module_target_out_var_name}" "${module_dependency_target}" PARENT_SCOPE)
519505

@@ -529,7 +515,7 @@ function(_compile_swift_files
529515
DEPENDS
530516
${swift_compiler_tool_dep}
531517
${source_files} ${SWIFTFILE_DEPENDS}
532-
${obj_dirs_dependency_target}
518+
${create_dirs_dependency_target}
533519
COMMENT "Generating ${sib_file}"
534520
EXCLUDE_FROM_ALL)
535521
set("${dependency_sib_target_out_var_name}" "${sib_dependency_target}" PARENT_SCOPE)
@@ -545,7 +531,7 @@ function(_compile_swift_files
545531
DEPENDS
546532
${swift_compiler_tool_dep}
547533
${source_files} ${SWIFTFILE_DEPENDS}
548-
${obj_dirs_dependency_target}
534+
${create_dirs_dependency_target}
549535
COMMENT "Generating ${sibopt_file}"
550536
EXCLUDE_FROM_ALL)
551537
set("${dependency_sibopt_target_out_var_name}" "${sibopt_dependency_target}" PARENT_SCOPE)
@@ -562,7 +548,7 @@ function(_compile_swift_files
562548
DEPENDS
563549
${swift_compiler_tool_dep}
564550
${source_files} ${SWIFTFILE_DEPENDS}
565-
${obj_dirs_dependency_target}
551+
${create_dirs_dependency_target}
566552
COMMENT "Generating ${sibgen_file}"
567553
EXCLUDE_FROM_ALL)
568554
set("${dependency_sibgen_target_out_var_name}" "${sibgen_dependency_target}" PARENT_SCOPE)

branches/master-next/docs/SIL.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,7 +4311,7 @@ open_existential_addr
43114311
// type P
43124312
// $*@opened P must be a unique archetype that refers to an opened
43134313
// existential type P.
4314-
// %1 will be of type $*P
4314+
// %1 will be of type $*@opened P
43154315

43164316
Obtains the address of the concrete value inside the existential
43174317
container referenced by ``%0``. The protocol conformances associated
@@ -4334,7 +4334,7 @@ open_existential_value
43344334
// type P
43354335
// $@opened P must be a unique archetype that refers to an opened
43364336
// existential type P.
4337-
// %1 will be of type $P
4337+
// %1 will be of type $@opened P
43384338

43394339
Loadable version of the above: Opens-up the existential
43404340
container associated with ``%0``. The protocol conformances associated

branches/master-next/docs/WindowsBuild.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ it provides some of the needed headers and libraries.
4141
1. Clone `apple/swift-corelibs-foundation` into a folder named `swift-corelibs-foundation`
4242
1. Clone `apple/swift-corelibs-xctest` into a folder name `swift-corelibs-xctest`
4343
1. Clone `apple/swift-lldb` into a folder named `lldb`
44+
1. Clone `curl` into a folder named `curl`
4445
1. Clone `libxml2` into a folder named `libxml2`
4546

4647
- Currently, other repositories in the Swift project have not been tested and
@@ -64,6 +65,7 @@ git clone https://github.com/apple/swift-corelibs-libdispatch
6465
git clone https://github.com/apple/swift-corelibs-foundation
6566
git clone https://github.com/apple/swift-corelibs-xctest
6667
git clone https://github.com/apple/swift-lldb lldb
68+
git clone https://github.com/curl/curl.git curl
6769
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
6870
```
6971

@@ -248,7 +250,17 @@ cmake --build S:\b\libdispatch
248250
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
249251
```
250252

251-
### 11. Build libxml2
253+
### 11. Build curl
254+
255+
```cmd
256+
pushd "S:\curl"
257+
.\buildconf.bat
258+
cd winbuild
259+
nmake /f Makefile.vc mode=static VC=15 MACHINE=x64
260+
popd
261+
```
262+
263+
### 12. Build libxml2
252264

253265
```cmd
254266
pushd "S:\libxml2\win32"
@@ -257,11 +269,7 @@ nmake /f Makefile.msvc
257269
popd
258270
```
259271

260-
### 12. Build swift-corelibs-foundation
261-
262-
To build Foundation you will need builds of:
263-
264-
- `libcurl` (https://curl.haxx.se, download the source, `cd` into `winbuild`, and run `nmake /f Makefile.vc mode=static VC=15 MACHINE=x64`)
272+
### 13. Build swift-corelibs-foundation
265273

266274
```cmd
267275
mkdir "S:\b\foundation"
@@ -288,7 +296,7 @@ cmake -G Ninja^
288296
path S:\b\foundation;%PATH%
289297
```
290298

291-
### 13. Build swift-corelibs-xctest
299+
### 14. Build swift-corelibs-xctest
292300

293301
```cmd
294302
mkdir "S:\b\xctest"
@@ -313,7 +321,7 @@ cmake --build S:\b\xctest
313321
path S:\b\xctest;%PATH%
314322
```
315323

316-
### 14. Install Swift on Windows
324+
### 15. Install Swift on Windows
317325

318326
- Run ninja install:
319327

0 commit comments

Comments
 (0)