Skip to content

Commit e701a4c

Browse files
committed
---
yaml --- r: 349112 b: refs/heads/master c: f0b3003 h: refs/heads/master
1 parent 549117a commit e701a4c

File tree

401 files changed

+5093
-8632
lines changed

Some content is hidden

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

401 files changed

+5093
-8632
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2bd55f6755527d1038a966411082ea2b3187c904
2+
refs/heads/master: f0b3003b143c4d718c89955ee265473253d27e7f
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/.gitattributes

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

trunk/CHANGELOG.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,63 @@ Swift 5.2
5858
(foo as Magic)(5)
5959
```
6060

61+
* [SR-11298][]:
62+
63+
A class-constrained protocol extension, where the extended protocol does
64+
not impose a class constraint, will now infer the constraint implicitly.
65+
66+
```swift
67+
protocol Foo {}
68+
class Bar: Foo {
69+
var someProperty: Int = 0
70+
}
71+
72+
// Even though 'Foo' does not impose a class constraint, it is automatically
73+
// inferred due to the Self: Bar constraint.
74+
extension Foo where Self: Bar {
75+
var anotherProperty: Int {
76+
get { return someProperty }
77+
// As a result, the setter is now implicitly nonmutating, just like it would
78+
// be if 'Foo' had a class constraint.
79+
set { someProperty = newValue }
80+
}
81+
}
82+
```
83+
84+
As a result, this could lead to code that currently compiles today to throw an error.
85+
86+
```swift
87+
protocol Foo {
88+
var someProperty: Int { get set }
89+
}
90+
91+
class Bar: Foo {
92+
var someProperty = 0
93+
}
94+
95+
extension Foo where Self: Bar {
96+
var anotherProperty1: Int {
97+
get { return someProperty }
98+
// This will now error, because the protocol requirement
99+
// is implicitly mutating and the setter is implicitly
100+
// nonmutating.
101+
set { someProperty = newValue } // Error
102+
}
103+
}
104+
```
105+
106+
**Workaround**: Define a new mutable variable inside the setter that has a reference to `self`:
107+
108+
```swift
109+
var anotherProperty1: Int {
110+
get { return someProperty }
111+
set {
112+
var mutableSelf = self
113+
mutableSelf.someProperty = newValue // Okay
114+
}
115+
}
116+
```
117+
61118
* [SE-0253][]:
62119

63120
Values of types that declare `func callAsFunction` methods can be called
@@ -83,7 +140,7 @@ Swift 5.2
83140

84141
* [SR-4206][]:
85142

86-
A method override is no longer allowed to have a generic signature with
143+
A method override is no longer allowed to have a generic signature with
87144
requirements not imposed by the base method. For example:
88145

89146
```
@@ -7799,4 +7856,5 @@ Swift 1.0
77997856
[SR-8974]: <https://bugs.swift.org/browse/SR-8974>
78007857
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
78017858
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>
7859+
[SR-11298]: <https://bugs.swift.org/browse/SR-11298>
78027860
[SR-11429]: <https://bugs.swift.org/browse/SR-11429>

trunk/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ endif()
1111
list(APPEND CMAKE_MODULE_PATH
1212
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1313

14-
set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)
15-
1614
if(DEFINED CMAKE_JOB_POOLS)
1715
# CMake < 3.11 doesn't support CMAKE_JOB_POOLS. Manually set the property.
1816
set_property(GLOBAL PROPERTY JOB_POOLS "${CMAKE_JOB_POOLS}")
@@ -127,7 +125,7 @@ set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
127125
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
128126
# can be reused when a new version of Swift comes out (assuming the user hasn't
129127
# manually set it as part of their own CMake configuration).
130-
set(SWIFT_VERSION "5.1.1")
128+
set(SWIFT_VERSION "5.1")
131129

132130
set(SWIFT_VENDOR "" CACHE STRING
133131
"The vendor name of the Swift compiler")
@@ -377,10 +375,6 @@ option(SWIFT_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING
377375
"Build stdlibCore with exclusivity checking enabled"
378376
FALSE)
379377

380-
option(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING
381-
"Enable experimental Swift differentiable programming features"
382-
FALSE)
383-
384378
#
385379
# End of user-configurable options.
386380
#

trunk/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| | **Architecture** | **Master** | **Package** |
77
|---|:---:|:---:|:---:|
88
| **macOS** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-osx)|[![Build Status](https://ci.swift.org/job/oss-swift-package-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-osx)|
9+
| **Ubuntu 14.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04/lastCompletedBuild/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/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-14_04)|
910
| **Ubuntu 16.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04/lastCompletedBuild/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/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04)|
1011
| **Ubuntu 18.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-18_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04)|
1112

trunk/benchmark/scripts/run_smoke_bench

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ def main():
9393
argparser.add_argument(
9494
'-num-samples', type=int,
9595
help='The (minimum) number of samples to run', default=3)
96-
argparser.add_argument(
97-
'-num-reruns', type=int,
98-
help="The number of re-runs until it's assumed to be a real change",
99-
default=8)
10096
argparser.add_argument(
10197
'-platform', type=str,
10298
help='The benchmark build platform', default='macosx')
@@ -124,7 +120,7 @@ def test_opt_levels(args):
124120
if test_performance(opt_level, args.oldbuilddir[0],
125121
args.newbuilddir[0],
126122
float(args.threshold) / 100, args.num_samples,
127-
args.num_reruns, output_file):
123+
output_file):
128124
changes = True
129125

130126
# There is no point in reporting code size for Onone.
@@ -175,7 +171,7 @@ def merge(results, other_results):
175171

176172

177173
def test_performance(opt_level, old_dir, new_dir, threshold, num_samples,
178-
num_reruns, output_file):
174+
output_file):
179175
"""Detect performance changes in benchmarks.
180176
181177
Start fast with few samples per benchmark and gradually spend more time
@@ -189,7 +185,7 @@ def test_performance(opt_level, old_dir, new_dir, threshold, num_samples,
189185
tests = TestComparator(results[0], results[1], threshold)
190186
changed = tests.decreased + tests.increased
191187

192-
while len(changed) > 0 and unchanged_length_count < num_reruns:
188+
while len(changed) > 0 and unchanged_length_count < 10:
193189
i += 1
194190
if VERBOSE:
195191
log(' test again: ' + str([test.name for test in changed]))

trunk/benchmark/single-source/UTF8Decode.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ public let UTF8Decode = [
4242
name: "UTF8Decode_InitFromBytes_ascii",
4343
runFunction: run_UTF8Decode_InitFromBytes_ascii,
4444
tags: [.validation, .api, .String]),
45+
BenchmarkInfo(
46+
name: "UTF8Decode_InitFromData_ascii_as_ascii",
47+
runFunction: run_UTF8Decode_InitFromData_ascii_as_ascii,
48+
tags: [.validation, .api, .String]),
49+
BenchmarkInfo(
50+
name: "UTF8Decode_InitDecoding_ascii_as_ascii",
51+
runFunction: run_UTF8Decode_InitDecoding_ascii_as_ascii,
52+
tags: [.validation, .api, .String]),
53+
BenchmarkInfo(
54+
name: "UTF8Decode_InitFromBytes_ascii_as_ascii",
55+
runFunction: run_UTF8Decode_InitFromBytes_ascii_as_ascii,
56+
tags: [.validation, .api, .String]),
4557
]
4658

4759
// 1-byte sequences
@@ -129,4 +141,26 @@ public func run_UTF8Decode_InitFromBytes_ascii(_ N: Int) {
129141
}
130142
}
131143

144+
@inline(never)
145+
public func run_UTF8Decode_InitFromData_ascii_as_ascii(_ N: Int) {
146+
let input = asciiData
147+
for _ in 0..<1_000*N {
148+
blackHole(String(data: input, encoding: .ascii))
149+
}
150+
}
151+
@inline(never)
152+
public func run_UTF8Decode_InitDecoding_ascii_as_ascii(_ N: Int) {
153+
let input = asciiBytes
154+
for _ in 0..<1_000*N {
155+
blackHole(String(decoding: input, as: Unicode.ASCII.self))
156+
}
157+
}
158+
@inline(never)
159+
public func run_UTF8Decode_InitFromBytes_ascii_as_ascii(_ N: Int) {
160+
let input = asciiBytes
161+
for _ in 0..<1_000*N {
162+
blackHole(String(bytes: input, encoding: .ascii))
163+
}
164+
}
165+
132166

trunk/cmake/modules/AddSwift.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,6 @@ function(_add_variant_swift_compile_flags
422422
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
423423
endif()
424424

425-
if(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
426-
list(APPEND result "-D" "SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING")
427-
endif()
428-
429425
set("${result_var_name}" "${result}" PARENT_SCOPE)
430426
endfunction()
431427

trunk/cmake/modules/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ set(SWIFT_LIBRARY_DIRS ${SWIFT_LIBRARY_OUTPUT_INTDIR})
1616
configure_file(
1717
SwiftConfig.cmake.in
1818
${swift_cmake_builddir}/SwiftConfig.cmake
19-
@ONLY)
19+
@ONLY)

trunk/cmake/modules/SwiftConfig.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set(SWIFT_VERSION @SWIFT_VERSION@)
66
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)
77

88
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
9-
set(SWIFT_LIBRARY_DIRS "@SWIFT_LIBRARY_DIRS@")
9+
set(SWIFT_LIBRARY_DIRS "@SWIFT_CONFIG_LIBRARY_DIRS@")
1010

1111
# These variables are duplicated, but they must match the LLVM variables of the
1212
# same name. The variables ending in "S" could some day become lists, and are
1313
# preserved for convention and compatibility.
1414
set(SWIFT_INCLUDE_DIR "@SWIFT_INCLUDE_DIRS@")
15-
set(SWIFT_LIBRARY_DIR "@SWIFT_LIBRARY_DIRS@")
15+
set(SWIFT_LIBRARY_DIR "@SWIFT_CONFIG_LIBRARY_DIRS@")
1616

1717
set(SWIFT_CMAKE_DIR "@SWIFT_CMAKE_DIR@")
1818
set(SWIFT_BINARY_DIR "@SWIFT_BINARY_DIR@")

trunk/cmake/modules/SwiftSource.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@ function(_compile_swift_files
310310
set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
311311
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
312312
set(specific_module_dir "${module_base}.swiftmodule")
313-
set(specific_module_project_dir "${specific_module_dir}/Project")
314-
set(source_info_file "${specific_module_project_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
313+
set(specific_module_private_dir "${specific_module_dir}/Private")
314+
set(source_info_file "${specific_module_private_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
315315
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
316316
else()
317317
set(specific_module_dir)
318-
set(specific_module_project_dir)
318+
set(specific_module_private_dir)
319319
set(source_info_file "${module_base}.swiftsourceinfo")
320320
endif()
321321
set(module_file "${module_base}.swiftmodule")
@@ -354,7 +354,7 @@ function(_compile_swift_files
354354
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
355355
COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT}"
356356
OPTIONAL
357-
PATTERN "Project" EXCLUDE)
357+
PATTERN "Private" EXCLUDE)
358358
else()
359359
swift_install_in_component(FILES ${module_outputs}
360360
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
@@ -495,7 +495,7 @@ function(_compile_swift_files
495495
COMMAND
496496
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
497497
${specific_module_dir}
498-
${specific_module_project_dir}
498+
${specific_module_private_dir}
499499
COMMAND
500500
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
501501
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"

trunk/docs/WindowsBuild.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ mklink "%VCToolsInstallDir%\include\visualc.apinotes" S:\swift\stdlib\public\Pla
9999
Warning: Creating the above links usually requires administrator privileges. The quick and easy way to do this is to open a second developer prompt by right clicking whatever shortcut you used to open the first one, choosing Run As Administrator, and pasting the above commands into the resulting window. You can then close the privileged prompt; this is the only step which requires elevation.
100100

101101
## 6. Build LLVM/Clang
102-
- This must be done from within a developer command prompt. Make sure that the build
102+
- This must be done from within a developer command prompt. LLVM and Clang are
103+
large projects, so building might take a few hours. Make sure that the build
103104
type for LLVM/Clang is compatible with the build type for Swift. That is,
104105
either build everything `Debug` or some variant of `Release` (e.g. `Release`,
105106
`RelWithDebInfo`).
@@ -125,8 +126,8 @@ ninja
125126
path S:\b\llvm\bin;%PATH%
126127
```
127128
## 7. Build CMark
128-
- This must be done from within a developer command prompt.
129-
129+
- This must be done from within a developer command prompt. CMark is a fairly
130+
small project and should only take a few minutes to build.
130131
```cmd
131132
md "S:\b\cmark"
132133
cd "S:\b\cmark"
@@ -179,8 +180,8 @@ cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
179180
```
180181

181182
## 9. Build lldb
182-
- This must be done from within a developer command prompt.
183-
183+
- This must be done from within a developer command prompt and could take hours
184+
depending on your system.
184185
```cmd
185186
md "S:\b\lldb"
186187
cd "S:\b\lldb"

trunk/include/swift/AST/ASTContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ namespace swift {
109109
class TypeAliasDecl;
110110
class VarDecl;
111111
class UnifiedStatsReporter;
112-
class IndexSubset;
113112

114113
enum class KnownProtocolKind : uint8_t;
115114

trunk/include/swift/AST/ASTDemangler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class ASTBuilder {
5858
using BuiltTypeDecl = swift::GenericTypeDecl *; // nominal or type alias
5959
using BuiltProtocolDecl = swift::ProtocolDecl *;
6060
explicit ASTBuilder(ASTContext &ctx) : Ctx(ctx) {}
61+
62+
/// The resolver to use for type checking, if necessary.
63+
LazyResolver *Resolver = nullptr;
6164

6265
ASTContext &getASTContext() { return Ctx; }
6366
DeclContext *getNotionalDC();

0 commit comments

Comments
 (0)