Skip to content

Commit a72b451

Browse files
authored
Merge pull request #12 from apple/master
merge
2 parents a3fbb5f + f65000a commit a72b451

File tree

605 files changed

+19186
-5188
lines changed

Some content is hidden

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

605 files changed

+19186
-5188
lines changed

Diff for: CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ endforeach()
212212
#
213213
# User-configurable Darwin-specific options.
214214
#
215-
216215
option(SWIFT_EMBED_BITCODE_SECTION
217216
"If non-empty, embeds LLVM bitcode binary sections in the standard library and overlay binaries for supported platforms"
218217
FALSE)
219218

219+
option(SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS
220+
"If non-empty, when embedding the LLVM bitcode binary sections into the relevant binaries, pass in -bitcode_hide_symbols. Does nothing if SWIFT_EMBED_BITCODE_SECTION is set to false."
221+
FALSE)
222+
220223
option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
221224
"Whether to enable CrashReporter integration"
222225
FALSE)
@@ -893,6 +896,8 @@ if(HAVE_EL_WGETS)
893896
endif()
894897
cmake_pop_check_state()
895898

899+
check_symbol_exists(wait4 "sys/wait.h" HAVE_WAIT4)
900+
896901
if (LLVM_ENABLE_DOXYGEN)
897902
message(STATUS "Doxygen: enabled")
898903
endif()

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ supported host development operating systems.
6666

6767
#### macOS
6868

69-
To build for macOS, you need [Xcode 9.3](https://developer.apple.com/xcode/downloads/).
69+
To build for macOS, you need [Xcode 10 beta](https://developer.apple.com/xcode/downloads/).
7070
The required version of Xcode changes frequently, and is often a beta release.
7171
Check this document or the host information on <https://ci.swift.org> for the
7272
current required version.
@@ -208,7 +208,7 @@ then run the build product in Terminal.
208208
Make sure you are using the [correct release](#macos) of Xcode.
209209

210210
If you have changed Xcode versions but still encounter errors that appear to
211-
be related to the Xcode version, try passing `--rebuild` to `build-script`.
211+
be related to the Xcode version, try passing `--clean` to `build-script`.
212212

213213
When a new version of Xcode is released, you can update your build without
214214
recompiling the entire project by passing the `--reconfigure` option.

Diff for: apinotes/os.apinotes

+25
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Typedefs:
66
Availability: nonswift
77
- Name: os_log_t
88
Availability: nonswift
9+
- Name: os_signpost_type_t
10+
SwiftName: OSSignpostType
911
Classes:
1012
- Name: OS_os_log
1113
SwiftName: OSLog
@@ -20,10 +22,22 @@ Enumerators:
2022
SwiftPrivate: true
2123
- Name: OS_LOG_TYPE_FAULT
2224
SwiftPrivate: true
25+
- Name: OS_SIGNPOST_INTERVAL_BEGIN
26+
SwiftPrivate: true
27+
- Name: OS_SIGNPOST_INTERVAL_END
28+
SwiftPrivate: true
29+
- Name: OS_SIGNPOST_EVENT
30+
SwiftPrivate: true
2331
Functions:
2432
- Name: _os_log_impl
2533
Availability: nonswift
2634
AvailabilityMsg: 'Use os_log'
35+
- Name: _os_log_error_impl
36+
Availability: nonswift
37+
AvailabilityMsg: 'Use os_log'
38+
- Name: _os_log_fault_impl
39+
Availability: nonswift
40+
AvailabilityMsg: 'Use os_log'
2741
- Name: _os_log_sensitive_deprecated
2842
Availability: nonswift
2943
- Name: _os_trace_with_buffer
@@ -40,3 +54,14 @@ Functions:
4054
NullabilityOfRet: N
4155
- Name: os_log_is_debug_enabled
4256
Availability: nonswift
57+
- Name: os_signpost_enabled
58+
SwiftPrivate: true
59+
- Name: os_signpost_id_generate
60+
SwiftPrivate: true
61+
NullabilityOfRet: O
62+
- Name: os_signpost_id_make_with_pointer
63+
SwiftPrivate: true
64+
NullabilityOfRet: O
65+
- Name: _os_signpost_emit_with_name_impl
66+
Availability: nonswift
67+
AvailabilityMsg: 'Use os_signpost'

Diff for: benchmark/CMakeLists.txt

+27-66
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
# -*- mode: cmake -*-
2-
################################################################################
3-
# WARNING: This file is automatically generated from templates and should not
4-
# be directly modified. Instead, make changes to CMakeLists.text.gyb and run
5-
# scripts/generate_harness/generate_harness.py to regenerate this file.
6-
################################################################################
72

83
cmake_minimum_required(VERSION 2.8.12)
94

@@ -20,12 +15,16 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
2015
endif()
2116

2217
if(SWIFT_BENCHMARK_SUBCMAKE_BUILD)
23-
precondition(SWIFT_BENCHMARK_BUILD_STANDALONE
18+
precondition(SWIFT_BENCHMARK_BUILT_STANDALONE
2419
MESSAGE "If we are a subcmake build, we must be built standalone")
2520
endif()
2621

2722
include(AddSwiftBenchmarkSuite)
2823

24+
#===-----------------------------------------------------------------------===#
25+
# Declarative Description of Benchmarks
26+
#===-----------------------------------------------------------------------===#
27+
2928
set(SWIFT_BENCH_MODULES
3029
single-source/Ackermann
3130
single-source/AngryPhonebook
@@ -45,6 +44,7 @@ set(SWIFT_BENCH_MODULES
4544
single-source/BitCount
4645
single-source/ByteSwap
4746
single-source/COWTree
47+
single-source/COWArrayGuaranteedParameterOverhead
4848
single-source/CString
4949
single-source/CSVParsing
5050
single-source/Calculator
@@ -109,6 +109,7 @@ set(SWIFT_BENCH_MODULES
109109
single-source/ObserverForwarderStruct
110110
single-source/ObserverPartiallyAppliedMethod
111111
single-source/ObserverUnappliedMethod
112+
single-source/OpaqueConsumingUsers
112113
single-source/OpenClose
113114
single-source/PartialApplyDynamicType
114115
single-source/Phonebook
@@ -124,6 +125,7 @@ set(SWIFT_BENCH_MODULES
124125
single-source/Queue
125126
single-source/RC4
126127
single-source/RGBHistogram
128+
single-source/Radix2CooleyTukey
127129
single-source/RandomShuffle
128130
single-source/RandomValues
129131
single-source/RangeAssignment
@@ -171,7 +173,7 @@ set(SWIFT_MULTISOURCE_SWIFT3_BENCHES
171173

172174
set(PrimsSplit_sources
173175
multi-source/PrimsSplit/Prims.swift
174-
multi-source/PrimsSplit/main.swift)
176+
multi-source/PrimsSplit/Prims_main.swift)
175177

176178
set(SWIFT_MULTISOURCE_SWIFT4_BENCHES
177179
)
@@ -189,37 +191,9 @@ set(BENCH_DRIVER_LIBRARY_MODULES
189191
utils/DriverUtils
190192
)
191193

192-
add_definitions(-DSWIFT_EXEC -DSWIFT_LIBRARY_PATH -DONLY_PLATFORMS
193-
-DSWIFT_OPTIMIZATION_LEVELS -DSWIFT_BENCHMARK_EMIT_SIB)
194-
195-
if(NOT ONLY_PLATFORMS)
196-
set(ONLY_PLATFORMS "macosx" "iphoneos" "appletvos" "watchos")
197-
endif()
198-
199-
if(NOT SWIFT_EXEC)
200-
runcmd(COMMAND "xcrun" "-f" "swiftc"
201-
VARIABLE SWIFT_EXEC
202-
ERROR "Unable to find Swift driver")
203-
endif()
204-
205-
if(NOT SWIFT_LIBRARY_PATH)
206-
get_filename_component(tmp_dir "${SWIFT_EXEC}" DIRECTORY)
207-
get_filename_component(tmp_dir "${tmp_dir}" DIRECTORY)
208-
set(SWIFT_LIBRARY_PATH "${tmp_dir}/lib/swift")
209-
endif()
210-
211-
# If the CMAKE_C_COMPILER is already clang, don't find it again,
212-
# thus allowing the --host-cc build-script argument to work here.
213-
get_filename_component(c_compiler ${CMAKE_C_COMPILER} NAME)
214-
215-
if(${c_compiler} STREQUAL "clang")
216-
set(CLANG_EXEC ${CMAKE_C_COMPILER})
217-
else()
218-
runcmd(COMMAND "xcrun" "-toolchain" "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}" "-f" "clang"
219-
VARIABLE CLANG_EXEC
220-
ERROR "Unable to find Clang driver")
221-
endif()
222-
194+
#===-----------------------------------------------------------------------===#
195+
# Build Configuration
196+
#===-----------------------------------------------------------------------===#
223197

224198
# You have to delete CMakeCache.txt in the swift build to force a
225199
# reconfiguration.
@@ -276,34 +250,17 @@ set(BENCHOPTS_MULTITHREADED
276250
"-whole-module-optimization" "-num-threads" "4")
277251
set(BENCHOPTS_SINGLEFILE "")
278252

279-
set(macosx_arch "x86_64")
280-
set(iphoneos_arch "arm64" "armv7")
281-
set(appletvos_arch "arm64")
282-
set(watchos_arch "armv7k")
283-
284-
set(macosx_ver "10.9")
285-
set(iphoneos_ver "8.0")
286-
set(appletvos_ver "9.1")
287-
set(watchos_ver "2.0")
288-
289-
set(macosx_triple_platform "macosx")
290-
set(iphoneos_triple_platform "ios")
291-
set(appletvos_triple_platform "tvos")
292-
set(watchos_triple_platform "watchos")
293-
294-
set(sdks)
295-
set(platforms)
296-
foreach(platform ${ONLY_PLATFORMS})
297-
execute_process(
298-
COMMAND "xcrun" "--sdk" "${platform}" "--show-sdk-path"
299-
OUTPUT_VARIABLE ${platform}_sdk
300-
RESULT_VARIABLE result
301-
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
302-
if("${result}" MATCHES "0")
303-
list(APPEND sdks "${${platform}_sdk}")
304-
list(APPEND platforms ${platform})
305-
endif()
306-
endforeach()
253+
configure_build()
254+
255+
#===-----------------------------------------------------------------------===#
256+
# SDK Configuration
257+
#===-----------------------------------------------------------------------===#
258+
259+
configure_sdks()
260+
261+
#===---------------------------------------------------------------------===#
262+
# Statement of Configuration for Build Users
263+
#===---------------------------------------------------------------------===#
307264

308265
message("--")
309266
message("-- Swift Benchmark Suite:")
@@ -321,6 +278,10 @@ foreach(sdk ${sdks})
321278
message("-- ${sdk}")
322279
endforeach()
323280

281+
#===---------------------------------------------------------------------===#
282+
# Build Rule Generation
283+
#===---------------------------------------------------------------------===#
284+
324285
set(executable_targets)
325286

326287
set(srcdir "${CMAKE_CURRENT_SOURCE_DIR}")

Diff for: benchmark/Package.swift

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// swift-tools-version:4.0
2+
3+
import PackageDescription
4+
import Foundation
5+
6+
// This is a stop gap hack so we can edit benchmarks in Xcode.
7+
let singleSourceLibraries: [String] = {
8+
let f = FileManager.`default`
9+
let dirURL = URL(fileURLWithPath: "single-source").absoluteURL
10+
let fileURLs = try! f.contentsOfDirectory(at: dirURL,
11+
includingPropertiesForKeys: nil)
12+
return fileURLs.flatMap { (path: URL) -> String? in
13+
let c = path.lastPathComponent.split(separator: ".")
14+
// Too many components. Must be a gyb file.
15+
if c.count > 2 {
16+
return nil
17+
}
18+
if c[1] != "swift" {
19+
return nil
20+
}
21+
22+
// We do not support this test.
23+
if c[0] == "ObjectiveCNoBridgingStubs" {
24+
return nil
25+
}
26+
27+
assert(c[0] != "PrimsSplit")
28+
return String(c[0])
29+
}
30+
}()
31+
32+
let multiSourceLibraries: [String] = {
33+
let f = FileManager.`default`
34+
let dirURL = URL(fileURLWithPath: "multi-source").absoluteURL
35+
let fileURLs = try! f.contentsOfDirectory(at: dirURL,
36+
includingPropertiesForKeys: nil)
37+
return fileURLs.map { (path: URL) -> String in
38+
return path.lastPathComponent
39+
}
40+
}()
41+
42+
let p = Package(
43+
name: "swiftbench",
44+
products: [
45+
.library(name: "TestsUtils", type: .static, targets: ["TestsUtils"]),
46+
.library(name: "DriverUtils", type: .static, targets: ["DriverUtils"]),
47+
.library(name: "ObjectiveCTests", type: .static, targets: ["ObjectiveCTests"]),
48+
.executable(name: "SwiftBench", targets: ["SwiftBench"]),
49+
.library(name: "PrimsSplit", type: .static, targets: ["PrimsSplit"])
50+
] + singleSourceLibraries.map { .library(name: $0, type: .static, targets: [$0]) }
51+
+ multiSourceLibraries.map { .library(name: $0, type: .static, targets: [$0]) },
52+
targets: [
53+
.target(name: "TestsUtils",
54+
path: "utils",
55+
sources: ["TestsUtils.swift"]),
56+
.target(name: "DriverUtils",
57+
dependencies: [.target(name: "TestsUtils")],
58+
path: "utils",
59+
sources: ["DriverUtils.swift", "ArgParse.swift"]),
60+
.target(name: "SwiftBench",
61+
dependencies: [
62+
.target(name: "TestsUtils"),
63+
.target(name: "ObjectiveCTests"),
64+
.target(name: "DriverUtils"),
65+
] + singleSourceLibraries.map { .target(name: $0) }
66+
+ multiSourceLibraries.map { .target(name: $0) },
67+
path: "utils",
68+
sources: ["main.swift"]),
69+
.target(name: "ObjectiveCTests",
70+
path: "utils/ObjectiveCTests",
71+
publicHeadersPath: "."),
72+
] + singleSourceLibraries.map { x in
73+
return .target(name: x,
74+
dependencies: [
75+
.target(name: "TestsUtils"),
76+
.target(name: "ObjectiveCTests"),
77+
],
78+
path: "single-source",
79+
sources: ["\(x).swift"])
80+
} + multiSourceLibraries.map { x in
81+
return .target(name: x,
82+
dependencies: [
83+
.target(name: "TestsUtils")
84+
],
85+
path: "multi-source/\(x)")
86+
},
87+
swiftLanguageVersions: [4]
88+
)

0 commit comments

Comments
 (0)