Skip to content

Commit 810fc35

Browse files
author
Greg Parker
authored
Merge branch 'master' into new-refcount-representation
2 parents 24d1fc2 + e4f23a3 commit 810fc35

File tree

811 files changed

+18048
-6905
lines changed

Some content is hidden

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

811 files changed

+18048
-6905
lines changed

CMakeLists.txt

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,17 @@ if(SWIFT_BUILT_STANDALONE)
358358
project(Swift C CXX ASM)
359359
endif()
360360

361-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "")
362-
message(FATAL_ERROR "CMAKE_SYSTEM_NAME is empty!")
363-
endif()
361+
precondition(CMAKE_SYSTEM_NAME)
364362
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
365363
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
364+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
365+
if(EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
366+
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
367+
else()
368+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
369+
endif()
366370
else()
367-
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
371+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
368372
endif()
369373
option(SWIFT_BUILD_SOURCEKIT
370374
"Build SourceKit"
@@ -405,12 +409,6 @@ include(SwiftList)
405409
# Configure swift include, install, build components.
406410
swift_configure_components()
407411

408-
if("${CMAKE_VERSION}" VERSION_LESS "3.0")
409-
set(SWIFT_CMAKE_HAS_GENERATOR_EXPRESSIONS FALSE)
410-
else()
411-
set(SWIFT_CMAKE_HAS_GENERATOR_EXPRESSIONS TRUE)
412-
endif()
413-
414412
# lipo is used to create universal binaries.
415413
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
416414
include(SwiftDarwin)
@@ -453,6 +451,9 @@ endif()
453451

454452
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
455453
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
454+
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
455+
set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")
456+
set(SWIFT_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
456457

457458
set(SWIFT_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin")
458459
set(SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib")
@@ -473,8 +474,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
473474

474475
# We'll need this once we have generated headers
475476
include_directories(BEFORE
476-
${CMAKE_CURRENT_BINARY_DIR}/include
477-
${CMAKE_CURRENT_SOURCE_DIR}/include
477+
${SWIFT_MAIN_INCLUDE_DIR}
478+
${SWIFT_INCLUDE_DIR}
478479
)
479480

480481
# A convenience pattern to match Darwin platforms. Example:
@@ -665,6 +666,10 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "CYGWIN")
665666
set(SWIFT_PRIMARY_VARIANT_ARCH_default "x86_64")
666667

667668
elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
669+
670+
set(SWIFT_HOST_VARIANT "windows" CACHE STRING
671+
"Deployment OS for Swift host tools (the compiler) [windows].")
672+
668673
configure_sdk_windows(WINDOWS "Windows" "msvc" "${SWIFT_HOST_VARIANT_ARCH}")
669674
set(SWIFT_PRIMARY_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
670675
set(SWIFT_PRIMARY_VARIANT_ARCH_default "${SWIFT_HOST_VARIANT_ARCH}")
@@ -822,21 +827,10 @@ endif()
822827

823828
list_subtract("${SWIFT_SDKS}" "${SWIFT_CONFIGURED_SDKS}" unknown_sdks)
824829

825-
if(NOT "${unknown_sdks}" STREQUAL "")
826-
message(FATAL_ERROR "Unknown SDKs: ${unknown_sdks}")
827-
endif()
828-
829-
if("${SWIFT_CONFIGURED_SDKS}" STREQUAL "")
830-
message(FATAL_ERROR "No SDKs selected.")
831-
endif()
832-
833-
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "")
834-
message(FATAL_ERROR "No SDK for host tools.")
835-
endif()
836-
837-
if("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "")
838-
message(FATAL_ERROR "No arch for host tools.")
839-
endif()
830+
precondition(unknown_sdks NEGATE MESSAGE "Unknown SDKs: ${unknown_sdks}")
831+
precondition(SWIFT_CONFIGURED_SDKS MESSAGE "No SDKs selected.")
832+
precondition(SWIFT_HOST_VARIANT_SDK MESSAGE "No SDK for host tools.")
833+
precondition(SWIFT_HOST_VARIANT_ARCH MESSAGE "No arch for host tools")
840834

841835
set(SWIFT_PRIMARY_VARIANT_SUFFIX
842836
"-${SWIFT_SDK_${SWIFT_PRIMARY_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_PRIMARY_VARIANT_ARCH}")
@@ -847,8 +841,8 @@ foreach(sdk ${SWIFT_SDKS})
847841
endforeach()
848842

849843
if(SWIFT_PARALLEL_LINK_JOBS)
850-
if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
851-
message(WARNING "Job pooling is only available with Ninja generators and CMake 3.0 and later.")
844+
if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
845+
message(WARNING "Job pooling is only available with Ninja generators.")
852846
else()
853847
set_property(GLOBAL APPEND PROPERTY JOB_POOLS swift_link_job_pool=${SWIFT_PARALLEL_LINK_JOBS})
854848
set(CMAKE_JOB_POOL_LINK swift_link_job_pool)
@@ -884,16 +878,18 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND "${SWIFT_PATH_TO_LIBICU_BUILD}" S
884878
find_package(ICU REQUIRED COMPONENTS uc i18n)
885879
endif()
886880

881+
find_package(PythonInterp REQUIRED)
882+
887883
#
888884
# Find optional dependencies.
889885
#
890886

891887
# Find libxml.
892888
# FIXME: unify with CLANG_HAVE_LIBXML, which is set in LLVM anyway.
893889
find_package(LibXml2)
894-
if(LIBXML2_FOUND)
895-
set(SWIFT_HAVE_LIBXML 1)
896-
endif()
890+
option(SWIFT_HAVE_LIBXML
891+
"Whether to build with libxml"
892+
${LIBXML2_FOUND})
897893

898894
# You need libedit linked in order to check if you have el_wgets.
899895
cmake_push_check_state()
@@ -946,6 +942,8 @@ if(SWIFT_INCLUDE_DOCS)
946942
add_subdirectory(docs)
947943
endif()
948944

945+
add_subdirectory(cmake/modules)
946+
949947
swift_install_in_component(license
950948
FILES "LICENSE.txt"
951949
DESTINATION "share/swift")

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 [the latest Xcode](https://developer.apple.com/xcode/downloads/).
56+
For macOS, you need [Xcode 8.3 Beta 2](https://developer.apple.com/xcode/downloads/).
5757

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

benchmark/scripts/perf_test_driver/perf_test_driver.py

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

15+
import functools
1516
import multiprocessing
1617
import os
1718
import re
@@ -54,6 +55,7 @@ def print_data(self, max_test_len):
5455
def _unwrap_self(args):
5556
return type(args[0]).process_input(*args)
5657

58+
5759
BenchmarkDriver_OptLevels = ['Onone', 'O', 'Ounchecked']
5860

5961

@@ -106,7 +108,7 @@ def reduce_results(acc, r):
106108
acc['extra_data'] = r.merge_in_extra_data(acc['extra_data'])
107109
return acc
108110

109-
return reduce(reduce_results, results, {
111+
return functools.reduce(reduce_results, results, {
110112
'result': [],
111113
'has_failure': False,
112114
'max_test_len': 0,
@@ -124,7 +126,9 @@ def run(self, test_filter=None):
124126
self.data = [
125127
self.run_for_opt_level(binary, opt_level, test_filter)
126128
for binary, opt_level in self.targets]
127-
max_test_len = reduce(max, [d['max_test_len']for d in self.data])
128-
has_failure = reduce(max, [d['has_failure']for d in self.data])
129+
max_test_len = functools.reduce(max,
130+
[d['max_test_len'] for d in self.data])
131+
has_failure = functools.reduce(max,
132+
[d['has_failure'] for d in self.data])
129133
self.print_data(self.data, max_test_len)
130134
return not has_failure

0 commit comments

Comments
 (0)