Skip to content

Commit 7880bae

Browse files
author
Greg Parker
committed
Merge branch 'master' of github.com:apple/swift into new-refcount-representation
2 parents 20d8d0f + 2f9a332 commit 7880bae

File tree

544 files changed

+24175
-5339
lines changed

Some content is hidden

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

544 files changed

+24175
-5339
lines changed

CODE_OWNERS.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ D: Swift standard library
1313

1414
N: David Farler
1515
16-
D: Markup, Swift Linux port
16+
D: Markup, lib/Syntax, Swift Linux port
1717

1818
N: Doug Gregor
1919

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ discussed below.
5353
macOS, Ubuntu Linux LTS, and the latest Ubuntu Linux release are the current
5454
supported host development operating systems.
5555

56-
For macOS, you need [Xcode 8.3 Beta 2](https://developer.apple.com/xcode/downloads/).
56+
For macOS, you need [Xcode 8.3 Beta 3](https://developer.apple.com/xcode/downloads/).
5757

5858
For Ubuntu, you'll need the following development dependencies:
5959

benchmark/scripts/compare_perf_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#
1414
# ===---------------------------------------------------------------------===//
1515

16+
from __future__ import print_function
17+
1618
import argparse
1719
import csv
1820
import sys

benchmark/scripts/generate_harness/generate_harness.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
# Generate CMakeLists.txt and utils/main.swift from templates.
1616

17+
from __future__ import print_function
18+
1719
import glob
1820
import os
1921
import re

benchmark/scripts/perf_test_driver/perf_test_driver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#
1313
# ===---------------------------------------------------------------------===//
1414

15+
from __future__ import print_function
16+
1517
import functools
1618
import multiprocessing
1719
import os

benchmark/utils/convertToJSON.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
# ]
5858
# }
5959

60+
from __future__ import print_function
61+
6062
import json
6163
import re
6264
import sys

cmake/modules/AddSwift.cmake

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -181,47 +181,65 @@ function(_add_variant_c_compile_flags)
181181
if(optimized OR CFLAGS_FORCE_BUILD_OPTIMIZED)
182182
list(APPEND result "-O2")
183183

184-
# Add -momit-leaf-frame-pointer on x86.
185-
if("${CFLAGS_ARCH}" STREQUAL "i386" OR "${CFLAGS_ARCH}" STREQUAL "x86_64")
186-
list(APPEND result "-momit-leaf-frame-pointer")
184+
# Omit leaf frame pointers on x86.
185+
if("${CFLAGS_ARCH}" STREQUAL "i386" OR "${CFLAGS_ARCH}" STREQUAL "i686")
186+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
187+
list(APPEND result "-momit-leaf-frame-pointer")
188+
else()
189+
list(APPEND result "/Oy")
190+
endif()
187191
endif()
188192
else()
189-
list(APPEND result "-O0")
190-
endif()
191-
is_build_type_with_debuginfo("${CFLAGS_BUILD_TYPE}" debuginfo)
192-
if(debuginfo)
193-
_compute_lto_flag("${CFLAGS_ENABLE_LTO}" _lto_flag_out)
194-
if(_lto_flag_out)
195-
list(APPEND result "-gline-tables-only")
193+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
194+
list(APPEND result "-O0")
196195
else()
197-
list(APPEND result "-g")
196+
list(APPEND result "/Od")
198197
endif()
199-
else()
200-
list(APPEND result "-g0")
201198
endif()
202199

203-
if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
204-
list(APPEND result -Xclang;--dependent-lib=oldnames)
205-
# TODO(compnerd) handle /MT, /MTd, /MD, /MDd
206-
if("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
207-
list(APPEND result "-D_MD")
208-
list(APPEND result -Xclang;--dependent-lib=msvcrt)
200+
# CMake automatically adds the flags for debug info if we use MSVC/clang-cl.
201+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
202+
is_build_type_with_debuginfo("${CFLAGS_BUILD_TYPE}" debuginfo)
203+
if(debuginfo)
204+
_compute_lto_flag("${CFLAGS_ENABLE_LTO}" _lto_flag_out)
205+
if(_lto_flag_out)
206+
list(APPEND result "-gline-tables-only")
207+
else()
208+
list(APPEND result "-g")
209+
endif()
209210
else()
210-
list(APPEND result "-D_MDd")
211-
list(APPEND result -Xclang;--dependent-lib=msvcrtd)
211+
list(APPEND result "-g0")
212212
endif()
213-
list(APPEND result -fno-pic)
214213
endif()
215214

216215
if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
216+
# MSVC doesn't support -Xclang. We don't need to manually specify
217+
# -D_MD or D_MDd either, as CMake does this automatically.
218+
if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
219+
list(APPEND result -Xclang;--dependent-lib=oldnames)
220+
# TODO(compnerd) handle /MT, /MTd, /MD, /MDd
221+
if("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
222+
list(APPEND result "-D_MD")
223+
list(APPEND result -Xclang;--dependent-lib=msvcrt)
224+
else()
225+
list(APPEND result "-D_MDd")
226+
list(APPEND result -Xclang;--dependent-lib=msvcrtd)
227+
endif()
228+
endif()
229+
230+
# MSVC/clang-cl don't support -fno-pic or -fms-compatability-version.
231+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
232+
list(APPEND result -fno-pic)
233+
list(APPEND result "-fms-compatibility-version=1900")
234+
endif()
235+
217236
list(APPEND result "-DLLVM_ON_WIN32")
218237
list(APPEND result "-D_CRT_SECURE_NO_WARNINGS")
219238
list(APPEND result "-D_CRT_NONSTDC_NO_WARNINGS")
220239
# TODO(compnerd) permit building for different families
221240
list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
222241
# TODO(compnerd) handle /MT
223242
list(APPEND result "-D_DLL")
224-
list(APPEND result "-fms-compatibility-version=1900")
225243
endif()
226244

227245
if(CFLAGS_ENABLE_ASSERTIONS)
@@ -321,9 +339,12 @@ function(_add_variant_link_flags)
321339
elseif("${LFLAGS_SDK}" STREQUAL "CYGWIN")
322340
# No extra libraries required.
323341
elseif("${LFLAGS_SDK}" STREQUAL "WINDOWS")
324-
# NOTE: we do not use "/MD" or "/MDd" and select the runtime via linker
325-
# options. This causes conflicts.
326-
list(APPEND result "-nostdlib")
342+
# We don't need to add -nostdlib using MSVC or clang-cl, as MSVC and clang-cl rely on auto-linking entirely.
343+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
344+
# NOTE: we do not use "/MD" or "/MDd" and select the runtime via linker
345+
# options. This causes conflicts.
346+
list(APPEND result "-nostdlib")
347+
endif()
327348
elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
328349
list(APPEND result
329350
"-ldl"
@@ -351,15 +372,17 @@ function(_add_variant_link_flags)
351372
if(NOT "${SWIFT_${LFLAGS_SDK}_ICU_I18N}" STREQUAL "")
352373
list(APPEND library_search_directories "${SWIFT_${sdk}_ICU_I18N}")
353374
endif()
354-
355-
if(SWIFT_ENABLE_GOLD_LINKER AND
356-
"${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
357-
list(APPEND result "-fuse-ld=gold")
358-
endif()
359-
if(SWIFT_ENABLE_LLD_LINKER OR
360-
("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND
361-
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
362-
list(APPEND result "-fuse-ld=lld")
375+
376+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
377+
if(SWIFT_ENABLE_GOLD_LINKER AND
378+
"${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
379+
list(APPEND result "-fuse-ld=gold")
380+
endif()
381+
if(SWIFT_ENABLE_LLD_LINKER OR
382+
("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND
383+
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
384+
list(APPEND result "-fuse-ld=lld")
385+
endif()
363386
endif()
364387

365388
set("${LFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function(add_swift_unittest test_dirname)
2828

2929
set(new_libnames)
3030
foreach(dep ${libnames})
31-
if("${dep}" MATCHES "^(LLVM|Clang|gtest)")
31+
if("${dep}" MATCHES "^(LLVM|Clang|gtest)" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
3232
list(APPEND new_libnames "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
3333
else()
3434
list(APPEND new_libnames "${dep}")

cmake/modules/SwiftSource.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ function(_compile_swift_files
477477
if (NOT SWIFTFILE_IS_MAIN)
478478
add_custom_command_target(
479479
module_dependency_target
480+
COMMAND
481+
"${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_file}"
480482
COMMAND
481483
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
482484
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}" ${swift_flags}

docs/ContinuousIntegration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Smoke Testing](#smoke-testing)
1010
- [Validation Testing](#validation-testing)
1111
- [Lint Testing](#lint-testing)
12+
- [Specific Preset Testing](#specific-preset-testing)
1213
- [Cross Repository Testing](#cross-repository-testing)
1314
- [ci.swift.org bots](#ciswiftorg-bots)
1415

@@ -28,6 +29,7 @@ swift-ci pull request testing is triggered by writing a comment on this PR addre
2829
2. Validation Testing
2930
3. Benchmarking.
3031
4. Lint Testing
32+
5. Specific Preset Testing
3133

3234
We describe each in detail below:
3335

@@ -79,6 +81,7 @@ A smoke test on Linux does the following:
7981
OS X platform | @swift-ci Please benchmark | Swift Benchmark on OS X Platform
8082
Linux platform | @swift-ci Please test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
8183
Linux platform | @swift-ci Please clean test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
84+
OS X platform | @swift-ci Please ASAN test | Swift ASAN Test OS X Platform
8285

8386
The core principles of validation testing is that:
8487

@@ -121,6 +124,20 @@ A validation test on Linux does the following:
121124
------------ | ------- | ------------
122125
Python | @swift-ci Please Python lint | Python lint
123126

127+
### Specific Preset Testing
128+
129+
Platform | Comment | Check Status
130+
------------ | ------- | ------------
131+
OS X platform | preset=<preset> <br> @swift-ci Please test macOS with preset | Swift Test macOS Platform with preset
132+
133+
For example:
134+
135+
```
136+
preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread
137+
@swift-ci Please test macOS with preset
138+
139+
```
140+
124141
## Cross Repository Testing
125142

126143
Simply provide the URL from corresponding pull requests in the same comment as "@swift-ci Please test" phrase. List all of the pull requests and then provide the specific test phrase you would like to trigger. Currently, it will only merge the main pull request you requested testing from as opposed to all of the PR's.

0 commit comments

Comments
 (0)