Skip to content

Commit e949cd5

Browse files
authored
---
yaml --- r: 335855 b: refs/heads/rxwei-patch-1 c: 28251a7 h: refs/heads/master i: 335853: a89b402 335851: 9706182 335847: e2691ed 335839: 2fb75af
1 parent 16654d0 commit e949cd5

File tree

226 files changed

+4518
-1724
lines changed

Some content is hidden

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

226 files changed

+4518
-1724
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 7455fb748fa336195fc19b3f6572b8813e68cd84
1018+
refs/heads/rxwei-patch-1: 28251a7a3b743df43f0219604e00225e1af35f2f
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/CMakeLists.txt

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

412-
precondition(CMAKE_SYSTEM_NAME)
413-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
412+
if(CMAKE_SYSTEM_NAME STREQUAL Darwin OR
413+
EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
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()
433416
else()
434-
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
435-
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
417+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
418+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
436419
endif()
437420
option(SWIFT_BUILD_SYNTAXPARSERLIB
438421
"Build the Swift Syntax Parser library"

branches/rxwei-patch-1/cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,10 +1881,13 @@ function(add_swift_target_library name)
18811881
endforeach()
18821882

18831883
# Add PrivateFrameworks, rdar://28466433
1884+
set(swiftlib_c_compile_flags_all ${SWIFTLIB_C_COMPILE_FLAGS})
18841885
if(sdk IN_LIST SWIFT_APPLE_PLATFORMS AND SWIFTLIB_IS_SDK_OVERLAY)
18851886
set(swiftlib_swift_compile_private_frameworks_flag "-Fsystem" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/System/Library/PrivateFrameworks/")
18861887
endif()
18871888

1889+
list(APPEND swiftlib_c_compile_flags_all "-DSWIFT_TARGET_LIBRARY_NAME=${name}")
1890+
18881891
# Add this library variant.
18891892
_add_swift_library_single(
18901893
${VARIANT_NAME}
@@ -1902,7 +1905,7 @@ function(add_swift_target_library name)
19021905
FRAMEWORK_DEPENDS_WEAK ${SWIFTLIB_FRAMEWORK_DEPENDS_WEAK}
19031906
LLVM_COMPONENT_DEPENDS ${SWIFTLIB_LLVM_COMPONENT_DEPENDS}
19041907
FILE_DEPENDS ${SWIFTLIB_FILE_DEPENDS} ${swiftlib_module_dependency_targets}
1905-
C_COMPILE_FLAGS ${SWIFTLIB_C_COMPILE_FLAGS}
1908+
C_COMPILE_FLAGS ${swiftlib_c_compile_flags_all}
19061909
SWIFT_COMPILE_FLAGS ${swiftlib_swift_compile_flags_all} ${swiftlib_swift_compile_flags_arch} ${swiftlib_swift_compile_private_frameworks_flag}
19071910
LINK_FLAGS ${swiftlib_link_flags_all}
19081911
PRIVATE_LINK_LIBRARIES ${swiftlib_private_link_libraries_targets}

branches/rxwei-patch-1/cmake/modules/SwiftSource.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,6 @@ 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-
242238
if(NOT SWIFT_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING AND SWIFTFILE_IS_STDLIB)
243239
list(APPEND swift_flags "-Xfrontend" "-enforce-exclusivity=unchecked")
244240
endif()

branches/rxwei-patch-1/cmake/modules/SwiftWindowsSupport.cmake

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,28 @@ 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/rxwei-patch-1/docs/ABI/Mangling.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Globals
112112
global ::= nominal-type 'Mn' // nominal type descriptor
113113
global ::= nominal-type 'Mu' // class method lookup function
114114
global ::= nominal-type 'MU' // ObjC metadata update callback function
115+
global ::= nominal-type 'Ms' // ObjC resilient class stub
116+
global ::= nominal-type 'Mt' // Full ObjC resilient class stub (private)
115117
global ::= module 'MXM' // module descriptor
116118
global ::= context 'MXE' // extension descriptor
117119
global ::= context 'MXX' // anonymous context descriptor

branches/rxwei-patch-1/docs/Testing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ 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.
116118

117119
##### Remote testing options
118120

branches/rxwei-patch-1/docs/WindowsBuild.md

Lines changed: 73 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ 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`
4446
1. Clone `curl` into a folder named `curl`
4547
1. Clone `libxml2` into a folder named `libxml2`
4648

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

5658
```cmd
57-
git config --global core.autocrlf input
5859
S:
5960
git clone https://github.com/apple/swift-cmark cmark
6061
git clone https://github.com/apple/swift-clang clang
6162
git clone https://github.com/apple/swift-llvm llvm
6263
git clone https://github.com/apple/swift-compiler-rt compiler-rt
63-
git clone https://github.com/apple/swift
64+
git clone -c core.autocrlf=input https://github.com/apple/swift
6465
git clone https://github.com/apple/swift-corelibs-libdispatch
6566
git clone https://github.com/apple/swift-corelibs-foundation
6667
git clone https://github.com/apple/swift-corelibs-xctest
6768
git clone https://github.com/apple/swift-lldb lldb
68-
git clone https://github.com/curl/curl.git curl
69-
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
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
7073
```
7174

7275
### 3. Acquire ICU
@@ -77,7 +80,15 @@ git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
7780
PATH S:\icu\bin64;%PATH%
7881
```
7982

80-
### 4. Get ready
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
8192
- 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.
8293

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

109120
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.
110121

111-
### 5. Build LLVM/Clang
122+
### 6. Build LLVM/Clang
112123
- This must be done from within a developer command prompt. LLVM and Clang are
113124
large projects, so building might take a few hours. Make sure that the build
114125
type for LLVM/Clang is compatbile with the build type for Swift. That is,
@@ -125,7 +136,7 @@ cmake -G Ninja^
125136
-DLLVM_ENABLE_ASSERTIONS=ON^
126137
-DLLVM_ENABLE_PDB=YES^
127138
-DLLVM_ENABLE_PROJECTS=clang^
128-
-DLLVM_TARGETS_TO_BUILD=X86^
139+
-DLLVM_TARGETS_TO_BUILD="AArch64;ARM;X86"^
129140
S:/llvm
130141
popd
131142
cmake --build "S:\b\llvm"
@@ -137,7 +148,7 @@ cmake --build "S:\b\llvm"
137148
path S:\b\llvm\bin;%PATH%
138149
```
139150

140-
### 6. Build CMark
151+
### 7. Build CMark
141152
- This must be done from within a developer command prompt. CMark is a fairly
142153
small project and should only take a few minutes to build.
143154
```cmd
@@ -152,7 +163,7 @@ popd
152163
cmake --build "S:\b\cmark"
153164
```
154165

155-
### 7. Build Swift
166+
### 8. Build Swift
156167
- This must be done from within a developer command prompt
157168
- 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.
158169

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

196-
### 8. Build lldb
207+
### 9. Build lldb
197208
- This must be done from within a developer command prompt and could take hours
198209
depending on your system.
199210
```cmd
@@ -208,13 +219,13 @@ cmake -G Ninja^
208219
-DLLDB_PATH_TO_LLVM_BUILD="S:\b\llvm"^
209220
-DLLDB_PATH_TO_SWIFT_BUILD="S:\b\swift"^
210221
-DLLVM_ENABLE_ASSERTIONS=ON^
211-
-DPYTHON_HOME=%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64^
222+
-DPYTHON_HOME="%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64"^
212223
S:\lldb
213224
popd
214225
cmake --build S:\b\lldb
215226
```
216227

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

219230
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:
220231

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

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

233244
```cmd
234245
mkdir "S:\b\libdispatch"
@@ -250,7 +261,7 @@ cmake --build S:\b\libdispatch
250261
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
251262
```
252263

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

255266
```cmd
256267
pushd "S:\curl"
@@ -260,7 +271,7 @@ nmake /f Makefile.vc mode=static VC=15 MACHINE=x64
260271
popd
261272
```
262273

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

265276
```cmd
266277
pushd "S:\libxml2\win32"
@@ -269,7 +280,7 @@ nmake /f Makefile.msvc
269280
popd
270281
```
271282

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

274285
```cmd
275286
mkdir "S:\b\foundation"
@@ -296,7 +307,7 @@ cmake -G Ninja^
296307
path S:\b\foundation;%PATH%
297308
```
298309

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

301312
```cmd
302313
mkdir "S:\b\xctest"
@@ -321,13 +332,13 @@ cmake --build S:\b\xctest
321332
path S:\b\xctest;%PATH%
322333
```
323334

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

326337
```cmd
327338
ninja -C S:\b\xctest check-xctest
328339
```
329340

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

332343
```cmd
333344
mkdir "S:\b\foundation"
@@ -350,14 +361,55 @@ cmake -G Ninja^
350361
cmake --build S:\b\foundation
351362
```
352363

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

355366
```cmd
356367
cmake --build S:\b\foundation
357368
ninja -C S:\b\foundation test
358369
```
359370

360-
### 18. Install Swift on Windows
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
361413

362414
- Run ninja install:
363415

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

368420
- 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.

0 commit comments

Comments
 (0)