Skip to content

Commit 332b7a4

Browse files
committed
---
yaml --- r: 322527 b: refs/heads/tensorflow-next c: 26ae7f9 h: refs/heads/master i: 322525: 1440817 322523: 29e736e 322519: a0fb2b3 322511: 6e94199 322495: 313bccd
1 parent ecc605c commit 332b7a4

File tree

126 files changed

+2022
-2578
lines changed

Some content is hidden

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

126 files changed

+2022
-2578
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,4 +1461,4 @@ refs/heads/master-rebranch: 86e95c23aa0d37f24ec138b7853146c1cead2e40
14611461
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14621462
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14631463
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
1464-
refs/heads/tensorflow-next: c285e78d9e645497a1b7c6c6e5c0673cc0955d73
1464+
refs/heads/tensorflow-next: 26ae7f99b0da38747db49186872d7fca1b800817

branches/tensorflow-next/CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,30 @@ if(MSVC OR "${CMAKE_SIMULATE_ID}" STREQUAL MSVC)
409409
include(ClangClCompileRules)
410410
endif()
411411

412-
if(CMAKE_SYSTEM_NAME STREQUAL Darwin OR
413-
EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
412+
precondition(CMAKE_SYSTEM_NAME)
413+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
414414
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
415415
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
416+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
417+
if(EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
418+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
419+
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
420+
else()
421+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
422+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
423+
endif()
424+
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
425+
if(EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE} AND
426+
CMAKE_CXX_COMPILER_ID STREQUAL Clang)
427+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
428+
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
429+
else()
430+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
431+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
432+
endif()
416433
else()
417-
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
418-
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
434+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
435+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
419436
endif()
420437
option(SWIFT_BUILD_SYNTAXPARSERLIB
421438
"Build the Swift Syntax Parser library"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ function(_compile_swift_files
235235
list(APPEND swift_flags "-Xfrontend" "-assume-single-threaded")
236236
endif()
237237

238+
if(SWIFTFILE_IS_STDLIB)
239+
list(APPEND swift_flags "-Xfrontend" "-enable-mandatory-semantic-arc-opts")
240+
endif()
241+
238242
if(NOT SWIFT_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING AND SWIFTFILE_IS_STDLIB)
239243
list(APPEND swift_flags "-Xfrontend" "-enforce-exclusivity=unchecked")
240244
endif()

branches/tensorflow-next/cmake/modules/SwiftWindowsSupport.cmake

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,3 @@ function(swift_windows_cache_VCVARS)
8080
set(UCRTVersion $ENV{UCRTVersion} CACHE STRING "")
8181
endfunction()
8282

83-
# NOTE(compnerd) we use a macro here as this modifies global variables
84-
macro(swift_swap_compiler_if_needed target)
85-
if(NOT CMAKE_C_COMPILER_ID MATCHES Clang)
86-
if(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
87-
get_target_property(CLANG_LOCATION clang LOCATION)
88-
get_filename_component(CLANG_LOCATION ${CLANG_LOCATION} DIRECTORY)
89-
90-
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR
91-
"${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
92-
set(CMAKE_C_COMPILER
93-
${CLANG_LOCATION}/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
94-
set(CMAKE_CXX_COMPILER
95-
${CLANG_LOCATION}/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
96-
else()
97-
set(CMAKE_C_COMPILER
98-
${CLANG_LOCATION}/clang${CMAKE_EXECUTABLE_SUFFIX})
99-
set(CMAKE_CXX_COMPILER
100-
${CLANG_LOCATION}/clang++${CMAKE_EXECUTABLE_SUFFIX})
101-
endif()
102-
else()
103-
message(SEND_ERROR "${target} requires a clang based compiler")
104-
endif()
105-
endif()
106-
endmacro()
107-

branches/tensorflow-next/docs/Testing.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ out with ``lit.py -h``. We document some of the more useful ones below:
113113
* ``--param swift_test_mode=<MODE>`` drives the various suffix variations
114114
mentioned above. Again, it's best to get the invocation from the existing
115115
build system targets and modify it rather than constructing it yourself.
116-
* ``--param use_os_stdlib`` will run all tests with the standard libraries
117-
coming from the OS.
118116

119117
##### Remote testing options
120118

branches/tensorflow-next/docs/WindowsBuild.md

Lines changed: 23 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ 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 `apple/swift-llbuild` into a folder named `llbuild`
45-
1. Clone `apple/swift-package-manager` info a folder named `swift-package-manager`
4644
1. Clone `curl` into a folder named `curl`
4745
1. Clone `libxml2` into a folder named `libxml2`
4846

@@ -56,20 +54,19 @@ subst S: <path to sources>
5654
```
5755

5856
```cmd
57+
git config --global core.autocrlf input
5958
S:
6059
git clone https://github.com/apple/swift-cmark cmark
6160
git clone https://github.com/apple/swift-clang clang
6261
git clone https://github.com/apple/swift-llvm llvm
6362
git clone https://github.com/apple/swift-compiler-rt compiler-rt
64-
git clone -c core.autocrlf=input https://github.com/apple/swift
63+
git clone https://github.com/apple/swift
6564
git clone https://github.com/apple/swift-corelibs-libdispatch
6665
git clone https://github.com/apple/swift-corelibs-foundation
6766
git clone https://github.com/apple/swift-corelibs-xctest
6867
git clone https://github.com/apple/swift-lldb lldb
69-
git clone https://github.com/apple/swift-llbuild llbuild
70-
git clone -c core.autocrlf=input https://github.com/apple/swift-package-manager
71-
git clone https://github.com/curl/curl.git
72-
git clone https://gitlab.gnome.org/GNOME/libxml2.git
68+
git clone https://github.com/curl/curl.git curl
69+
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
7370
```
7471

7572
### 3. Acquire ICU
@@ -80,15 +77,7 @@ git clone https://gitlab.gnome.org/GNOME/libxml2.git
8077
PATH S:\icu\bin64;%PATH%
8178
```
8279

83-
### 4. Fetch SQLite3
84-
85-
```powershell
86-
(New-Object System.Net.WebClient).DownloadFile("https://www.sqlite.org/2019/sqlite-amalgamation-3270200.zip", "S:\sqlite-amalgamation-3270200.zip")
87-
Add-Type -A System.IO.Compression.FileSystem
88-
[IO.Compression.ZipFile]::ExtractToDirectory("S:\sqlite-amalgamation-3270200.zip", "S:\")
89-
```
90-
91-
### 5. Get ready
80+
### 4. Get ready
9281
- From within a **developer** command prompt (not PowerShell nor cmd, but the [Visual Studio Developer Command Prompt](https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx)), execute the following command if you have an x64 PC.
9382

9483
```cmd
@@ -119,7 +108,7 @@ mklink "%VCToolsInstallDir%\include\visualc.apinotes" S:\swift\stdlib\public\Pla
119108

120109
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.
121110

122-
### 6. Build LLVM/Clang
111+
### 5. Build LLVM/Clang
123112
- This must be done from within a developer command prompt. LLVM and Clang are
124113
large projects, so building might take a few hours. Make sure that the build
125114
type for LLVM/Clang is compatbile with the build type for Swift. That is,
@@ -148,7 +137,7 @@ cmake --build "S:\b\llvm"
148137
path S:\b\llvm\bin;%PATH%
149138
```
150139

151-
### 7. Build CMark
140+
### 6. Build CMark
152141
- This must be done from within a developer command prompt. CMark is a fairly
153142
small project and should only take a few minutes to build.
154143
```cmd
@@ -163,7 +152,7 @@ popd
163152
cmake --build "S:\b\cmark"
164153
```
165154

166-
### 8. Build Swift
155+
### 7. Build Swift
167156
- This must be done from within a developer command prompt
168157
- Note that Visual Studio vends a 32-bit python 2.7 installation in `C:\Python27` and a 64-bit python in `C:\Python27amd64`. You may use either one based on your installation.
169158

@@ -204,7 +193,7 @@ cmake --build "S:\b\swift"
204193
cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
205194
```
206195

207-
### 9. Build lldb
196+
### 8. Build lldb
208197
- This must be done from within a developer command prompt and could take hours
209198
depending on your system.
210199
```cmd
@@ -225,7 +214,7 @@ popd
225214
cmake --build S:\b\lldb
226215
```
227216

228-
### 10. Running tests on Windows
217+
### 9. Running tests on Windows
229218

230219
Running the testsuite on Windows has additional external dependencies. You must have a subset of the GNUWin32 programs installed and available in your path. The following packages are currently required:
231220

@@ -239,7 +228,7 @@ path S:\thirdparty\icu4c-63_1-Win64-MSVC2017\bin64;S:\b\swift\bin;S:\b\swift\lib
239228
ninja -C S:\b\swift check-swift
240229
```
241230

242-
### 11. Build swift-corelibs-libdispatch
231+
### 10. Build swift-corelibs-libdispatch
243232

244233
```cmd
245234
mkdir "S:\b\libdispatch"
@@ -261,7 +250,7 @@ cmake --build S:\b\libdispatch
261250
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
262251
```
263252

264-
### 12. Build curl
253+
### 11. Build curl
265254

266255
```cmd
267256
pushd "S:\curl"
@@ -271,7 +260,7 @@ nmake /f Makefile.vc mode=static VC=15 MACHINE=x64
271260
popd
272261
```
273262

274-
### 13. Build libxml2
263+
### 12. Build libxml2
275264

276265
```cmd
277266
pushd "S:\libxml2\win32"
@@ -280,7 +269,7 @@ nmake /f Makefile.msvc
280269
popd
281270
```
282271

283-
### 14. Build swift-corelibs-foundation
272+
### 13. Build swift-corelibs-foundation
284273

285274
```cmd
286275
mkdir "S:\b\foundation"
@@ -307,7 +296,7 @@ cmake -G Ninja^
307296
path S:\b\foundation;%PATH%
308297
```
309298

310-
### 15. Build swift-corelibs-xctest
299+
### 14. Build swift-corelibs-xctest
311300

312301
```cmd
313302
mkdir "S:\b\xctest"
@@ -332,13 +321,13 @@ cmake --build S:\b\xctest
332321
path S:\b\xctest;%PATH%
333322
```
334323

335-
### 16. Test XCTest
324+
### 15. Test XCTest
336325

337326
```cmd
338327
ninja -C S:\b\xctest check-xctest
339328
```
340329

341-
### 17. Rebuild Foundation
330+
### 16. Rebuild Foundation
342331

343332
```cmd
344333
mkdir "S:\b\foundation"
@@ -361,55 +350,14 @@ cmake -G Ninja^
361350
cmake --build S:\b\foundation
362351
```
363352

364-
### 18. Test Foundation
353+
### 17. Test Foundation
365354

366355
```cmd
367356
cmake --build S:\b\foundation
368357
ninja -C S:\b\foundation test
369358
```
370359

371-
### 19. Build SQLite3
372-
373-
```cmd
374-
md S:\b\sqlite
375-
cd S:\b\sqlite
376-
cl /MD /Ox /Zi /LD /DSQLITE_API=__declspec(dllexport) S:\sqlite-amalgamation-3270200\sqlite.c
377-
```
378-
379-
- Add SQLite3 to your path:
380-
```cmd
381-
path S:\b\sqlite;%PATH%
382-
```
383-
384-
### 20. Build llbuild
385-
386-
```cmd
387-
md S:\b\llbuild
388-
cd S:\b\llbuild
389-
cmake -G Ninja^
390-
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
391-
-DCMAKE_C_COMPILER=cl^
392-
-DCMAKE_CXX_COMPILER=cl^
393-
-DLLBUILD_PATH_TO_SQLITE_SOURCE=S:\sqlite-amalgamation-3270200^
394-
-DLLBUILD_PATH_TO_SQLITE_BUILD=S:\b\sqlite^
395-
S:\swift-llbuild
396-
ninja
397-
```
398-
399-
- Add llbuild to your path:
400-
```cmd
401-
path S:\b\llbuild;%PATH%
402-
```
403-
404-
### 21. Build swift-package-manager
405-
406-
```cmd
407-
md S:\b\spm
408-
cd S:\b\spm
409-
C:\Python27\python.exe S:\swift-package-manager\Utilities\bootstrap --foundation S:\b\foundation --libdispatch-build-dir S:\b\libdispatch --libdispatch-source-dir S:\swift-corelibs-libdispatch --llbuild-build-dir S:\b\llbuild --llbuild-source-dir S:\llbuild --sqlite-build-dir S:\b\sqlite --sqlite-source-dir S:\sqlite-amalgamation-3270200
410-
```
411-
412-
### 22. Install Swift on Windows
360+
### 18. Install Swift on Windows
413361

414362
- Run ninja install:
415363

@@ -418,3 +366,7 @@ ninja -C S:\b\swift install
418366
```
419367

420368
- Add the Swift on Windows binaries path (`C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin`) to the `PATH` environment variable.
369+
370+
## MSVC
371+
372+
To use `cl` instead, just replace the `-DCMAKE_C_COMPILER` and `-DCMAKE_CXX_COMPILER` parameters to the `cmake` invocations.

branches/tensorflow-next/include/swift/AST/DiagnosticsSema.def

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,13 @@ ERROR(precedence_group_redeclared,none,
815815
NOTE(previous_precedence_group_decl,none,
816816
"previous precedence group declaration here", ())
817817

818+
//------------------------------------------------------------------------------
819+
// MARK: Type Check Coercions
820+
//------------------------------------------------------------------------------
821+
822+
ERROR(tuple_conversion_not_expressible,none,
823+
"cannot express tuple conversion %0 to %1", (Type, Type))
824+
818825
//------------------------------------------------------------------------------
819826
// MARK: Expression Type Checking Errors
820827
//------------------------------------------------------------------------------

0 commit comments

Comments
 (0)