Skip to content

Commit d42446b

Browse files
committed
---
yaml --- r: 346063 b: refs/heads/master c: fa5ee3d h: refs/heads/master i: 346061: 687b7dc 346059: 0854669 346055: f339b4b 346047: 5e38dee
1 parent e32b959 commit d42446b

File tree

9 files changed

+49
-67
lines changed

9 files changed

+49
-67
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: 9929c5b31530d34adc9f5469d16ef570221810bd
2+
refs/heads/master: fa5ee3d717ef1fff0abc03506b5c6aa6e28bc0ac
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/benchmark/single-source/DictTest4Legacy.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ struct LargeKey: Hashable {
5656
return hash
5757
}
5858

59-
func hash(into hasher: inout Hasher) {
60-
hasher.combine(self.hashValue)
61-
}
62-
6359
init(_ value: Int) {
6460
self.i = value
6561
self.j = 2 * value

trunk/docs/WindowsBuild.md

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,29 @@ the other hand, `clang-cl` is able to build the runtime, which makes it
1717
possible to build and run all the components required for Swift natively on
1818
Windows.
1919

20-
clang should be 7.0 or newer. Visual Studio 2017 is needed in all cases as
21-
it provides some of the needed headers and libraries.
22-
2320
## `clang-cl`
21+
- Windows doesn't currently have a build script. You'll need to run commands
22+
manually to build Swift on Windows.
23+
- Windows support for Swift is a work in progress and may not work on your
24+
system, but it has been tested.
25+
- Using the latest Visual Studio version is recommended (tested with Visual
26+
Studio 2017 - Version 15.5.5). Swift may fail to build with older C++
27+
compilers.
28+
- Note that the release version of Swift on Windows may crash when you try to compile a
29+
Swift program. See bug report [SR-7867](https://bugs.swift.org/browse/SR-7867).
2430

2531
### 1. Install dependencies
26-
1. Latest version of [Visual Studio](https://www.visualstudio.com/downloads/)
32+
1. Latest version (2.7.12 tested) of [Python
33+
2](https://www.python.org/downloads/)
34+
1. Latest version (3.7.0-rc3 tested) of [CMake](https://cmake.org/download/)
35+
1. Latest version (1.7.1 tested) of
36+
[Ninja](https://github.com/ninja-build/ninja/releases/latest)
37+
1. Latest version (2015 Update 3 tested) of [Visual
38+
Studio](https://www.visualstudio.com/downloads/)
2739
- Make sure to include "Programming Languages|Visual C++" and "Windows and Web
2840
Development|Universal Windows App Development|Windows SDK" in your
2941
installation.
42+
- Make sure to add Python, CMake and Ninja to your `Path` environment variable
3043

3144
### 2. Clone the repositories
3245
1. Create a folder to contain all the Swift repositories
@@ -35,7 +48,6 @@ it provides some of the needed headers and libraries.
3548
1. Clone `apple/swift-llvm` into a folder named `llvm`
3649
1. Clone `apple/swift-compiler-rt` into a folder named `compiler-rt`
3750
1. Clone `apple/swift` into a folder named `swift`
38-
1. Clone `apple/swift-corelibs-libdispatch` into a folder named `swift-corelibs-libdispatch`
3951
- Currently, other repositories in the Swift project have not been tested and
4052
may not be supported.
4153

@@ -77,9 +89,11 @@ set swift_source_dir=path-to-directory-containing-all-cloned-repositories
7789
(`Debug`, `RelWithDebInfoAssert` or `Release`) to avoid conflicts between the debug and
7890
non-debug version of the MSCRT library.
7991

80-
- Set up the `ucrt`, `visualc`, and `WinSDK` modules by copying `ucrt.modulemap` located at
92+
- Set up the `visualc` and `ucrt` modules by copying `ucrt.modulemap` located at
8193
`swift/stdlib/public/Platform/ucrt.modulemap` into
82-
`${UniversalCRTSdkDir}/Include/${UCRTVersion}/ucrt` as `module.modulemap`, copying `visualc.modulemap` located at `swift/stdlib/public/Platform/visualc.modulemap` into `${VCToolsInstallDir}/include` as `module.modulemap`, and copying `winsdk.modulemap` located at `swift/stdlib/public/Platform/winsdk.modulemap` into `${UniversalCRTSdkDir}/Include/10.0.107663/um`
94+
`${UniversalCRTSdkDir}/Include/${UCRTVersion}/ucrt` as `module.modulemap` and copying `visualc.modulemap` located at `swift/stdlib/public/Platform/visualc.modulemap` into `${VCToolsInstallDir}/include` as `module.modulemap`
95+
96+
8397

8498
### 5. Build CMark
8599
- This must be done from within a developer command prompt. CMark is a fairly
@@ -129,7 +143,7 @@ set llvm_bin_dir="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64/
129143
```cmd
130144
mkdir "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
131145
pushd "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
132-
cmake -G "Ninja"^
146+
cmake -G "Ninja" "%swift_source_dir%/swift"^
133147
-DCMAKE_BUILD_TYPE=Debug^
134148
-DSWIFT_PATH_TO_CMARK_SOURCE="%swift_source_dir%/cmark"^
135149
-DSWIFT_PATH_TO_CMARK_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/cmark-windows-amd64"^
@@ -138,22 +152,24 @@ cmake -G "Ninja"^
138152
-DSWIFT_PATH_TO_LLVM_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"^
139153
-DSWIFT_PATH_TO_CLANG_SOURCE="%swift_source_dir%/llvm/tools/clang"^
140154
-DSWIFT_PATH_TO_CLANG_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"^
141-
-DICU_WINDOWS_x86_64_UC_INCLUDE="%swift_source_dir%/icu/include"^
142-
-DICU_WINDOWS_x86_64_UC_LIBRARY="%swift_source_dir%/icu/lib64/icuuc.lib"^
143-
-DICU_WINDOWS_x86_64_I18N_INCLUDE="%swift_source_dir%/icu/include"^
144-
-DICU_WINDOWS_x86_64_I18N_LIBRARY="%swift_source_dir%/icu/lib64/icuin.lib"^
155+
-DICU_UC_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
156+
-DICU_UC_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
157+
-DICU_I18N_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
158+
-DICU_I18N_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
159+
-DICU_UC_LIB_NAME="icuuc"^
160+
-DICU_I18N_LIB_NAME="icuin"^
145161
-DSWIFT_INCLUDE_DOCS=FALSE^
146162
-DSWIFT_INCLUDE_TESTS=FALSE^
147163
-DCMAKE_C_COMPILER="%llvm_bin_dir%/clang-cl.exe"^
148164
-DCMAKE_CXX_COMPILER="%llvm_bin_dir%/clang-cl.exe"^
149-
-DCMAKE_C_FLAGS="/Z7"^
150-
-DCMAKE_CXX_FLAGS="/Z7 -Wno-c++98-compat -Wno-c++98-compat-pedantic"^
165+
-DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 /Z7"^
166+
-DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 -Z7"^
151167
-DCMAKE_EXE_LINKER_FLAGS:STRING="/INCREMENTAL:NO"^
152168
-DCMAKE_MODULE_LINKER_FLAGS="/INCREMENTAL:NO"^
153169
-DCMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO"^
154170
-DCMAKE_STATIC_LINKER_FLAGS="/INCREMENTAL:NO"^
155171
-DCMAKE_INSTALL_PREFIX="C:/Program Files (x86)/Swift"^
156-
"%swift_source_dir%/swift"
172+
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE
157173
popd
158174
cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
159175
```
@@ -166,7 +182,7 @@ cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
166182
a file.
167183

168184
```cmd
169-
cmake -G "Visual Studio 2017" "%swift_source_dir%/swift"^
185+
cmake -G "Visual Studio 15" "%swift_source_dir%/swift"^
170186
-DCMAKE_GENERATOR_PLATFORM="x64"^
171187
...
172188
```
@@ -189,8 +205,8 @@ cmake -G "Ninja" "%swift_source_dir%/lldb"^
189205
-DLLDB_PATH_TO_SWIFT_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"^
190206
-DCMAKE_C_COMPILER="%llvm_bin_dir%/clang-cl.exe"^
191207
-DCMAKE_CXX_COMPILER="%llvm_bin_dir%/clang-cl.exe"^
192-
-DCMAKE_C_FLAGS="/Z7"^
193-
-DCMAKE_CXX_FLAGS="/Z7 -Wno-c++98-compat"^
208+
-DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 /Z7"^
209+
-DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 -Z7 -Wno-c++98-compat"^
194210
-DLLVM_ENABLE_ASSERTIONS=YES
195211
popd
196212
cmake --build "%swift_source_dir%/build/Ninja-RelWithDebInfoAssert/lldb-windows-amd64"
@@ -216,7 +232,7 @@ Follow instructions 1-6 for `clang-cl`, but run the following instead to build S
216232
```cmd
217233
mkdir "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
218234
pushd "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
219-
cmake -G "Ninja"^
235+
cmake -G "Ninja" "%swift_source_dir%/swift"^
220236
-DCMAKE_BUILD_TYPE=Debug^
221237
-DSWIFT_PATH_TO_CMARK_SOURCE="%swift_source_dir%/cmark"^
222238
-DSWIFT_PATH_TO_CMARK_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/cmark-windows-amd64"^
@@ -225,15 +241,16 @@ cmake -G "Ninja"^
225241
-DSWIFT_PATH_TO_LLVM_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"^
226242
-DSWIFT_PATH_TO_CLANG_SOURCE="%swift_source_dir%/llvm/tools/clang"^
227243
-DSWIFT_PATH_TO_CLANG_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"^
228-
-DICU_WINDOWS_x86_64_UC_INCLUDE="%swift_source_dir%/icu/include"^
229-
-DICU_WINDOWS_x86_64_UC_LIBRARY="%swift_source_dir%/icu/lib64/icuuc.lib"^
230-
-DICU_WINDOWS_x86_64_I18N_INCLUDE="%swift_source_dir%/icu/include"^
231-
-DICU_WINDOWS_x86_64_I18N_LIBRARY="%swift_source_dir%/icu/lib64/icuin.lib"^
244+
-DICU_UC_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
245+
-DICU_UC_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
246+
-DICU_I18N_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
247+
-DICU_I18N_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
248+
-DICU_UC_LIB_NAME="icuuc"^
249+
-DICU_I18N_LIB_NAME="icuin"^
232250
-DSWIFT_INCLUDE_DOCS=FALSE^
233251
-DSWIFT_INCLUDE_TESTS=FALSE^
234252
-DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE^
235-
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE^
236-
"%swift_source_dir%/swift"
253+
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE
237254
popd
238255
cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
239256
```

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,11 +2944,8 @@ ERROR(closure_implicit_capture_without_noescape,none,
29442944
"escaping closures can only capture inout parameters explicitly by value",
29452945
())
29462946
ERROR(closure_implicit_capture_mutating_self,none,
2947-
"escaping closure cannot capture a mutating self parameter",
2947+
"closure cannot implicitly capture a mutating self parameter",
29482948
())
2949-
NOTE(create_mutating_copy_or_capture_self,none,
2950-
"create a mutating copy of self, or explicitly capture self for immutability",
2951-
())
29522949
ERROR(nested_function_with_implicit_capture_argument,none,
29532950
"nested function with %select{an |}0implicitly captured inout "
29542951
"parameter%select{|s}0 can only be used as a non-escaping argument", (bool))

trunk/lib/Basic/Platform.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
139139
case llvm::Triple::Contiki:
140140
case llvm::Triple::AMDPAL:
141141
case llvm::Triple::HermitCore:
142+
case llvm::Triple::Hurd:
142143
return "";
143144
case llvm::Triple::Darwin:
144145
case llvm::Triple::MacOSX:

trunk/lib/Sema/TypeCheckCaptures.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ class FindCapturedVars : public ASTWalker {
402402
if (isInOut && !AFR.isKnownNoEscape() && !isNested) {
403403
if (D->getBaseName() == D->getASTContext().Id_self) {
404404
TC.diagnose(DRE->getLoc(),
405-
diag::closure_implicit_capture_mutating_self);
406-
TC.diagnose(DRE->getLoc(),
407-
diag::create_mutating_copy_or_capture_self);
405+
diag::closure_implicit_capture_mutating_self);
408406
} else {
409407
TC.diagnose(DRE->getLoc(),
410408
diag::closure_implicit_capture_without_noescape);

trunk/stdlib/public/stubs/SwiftNativeNSXXXBase.mm.gyb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ SWIFT_RUNTIME_STDLIB_API
9393
return swift_tryRetain(reinterpret_cast<HeapObject*>(self)) != nullptr;
9494
}
9595

96-
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
97-
return NO;
98-
}
99-
10096
#pragma clang diagnostic push
10197
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
10298
- (void)dealloc {

trunk/test/Sema/diag_invalid_inout_captures.swift

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ func do_escape(_ not_a_price_you_are_willing_to_pay: @escaping () -> ()) {}
66
struct you_cry_in_your_tea {
77
mutating func which_you_hurl_in_the_sea_when_you_see_me_go_by() {
88
no_escape { _ = self } // OK
9-
do_escape { _ = self } // expected-error {{escaping closure cannot capture a mutating self parameter}}
10-
// expected-note@-1 {{create a mutating copy of self, or explicitly capture self for immutability}}
9+
do_escape { _ = self } // expected-error {{closure cannot implicitly capture a mutating self parameter}}
1110
do_escape {
1211
[self] in
1312
_ = self // OK
@@ -41,23 +40,3 @@ func remember(line: inout String) -> () -> Void {
4140
func its_complicated(condition: inout Int) {
4241
no_escape(condition == 0 ? { condition = 1 } : { condition = 2}) // expected-error 2 {{escaping closures can only capture inout parameters explicitly by value}}
4342
}
44-
45-
// rdar://problem/46322943 - Improve error message about mutating self capture in escaping closures
46-
func rdar46322943() {
47-
struct S {
48-
var bar = 1
49-
50-
func foo(_ fn: () -> Void) {
51-
fn()
52-
}
53-
54-
mutating func main() {
55-
let fn = {
56-
self.bar += 1
57-
// expected-error@-1 {{escaping closure cannot capture a mutating self parameter}}
58-
// expected-note@-2 {{create a mutating copy of self, or explicitly capture self for immutability}}
59-
}
60-
self.foo(fn)
61-
}
62-
}
63-
}

trunk/test/stdlib/Metal.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,10 @@ if #available(OSX 10.14, iOS 12.0, tvOS 12.0, *){
259259
let encoder = cmdBuf.makeRenderCommandEncoder(descriptor: rpDesc)!
260260
encoder.useResources([buf], usage: MTLResourceUsage.read)
261261
encoder.useHeaps([heap])
262-
#if os(macOS) || os(iOS)
263-
if #available(iOS 12.0, macOS 10.13, *) {
262+
#if os(macOS)
264263
encoder.setViewports([MTLViewport()])
265264
encoder.setScissorRects([MTLScissorRect(x:0, y:0, width:1, height:1)])
266-
}
267-
#endif
265+
#endif
268266
encoder.setVertexBuffers([buf], offsets: [0], range: 0..<1)
269267
encoder.setVertexTextures([tex], range: 0..<1)
270268
encoder.setVertexSamplerStates([smplr], range: 0..<1)

0 commit comments

Comments
 (0)