Skip to content

Commit 9033362

Browse files
committed
---
yaml --- r: 347108 b: refs/heads/master c: deb8b66 h: refs/heads/master
1 parent c9aca06 commit 9033362

File tree

201 files changed

+3323
-7479
lines changed

Some content is hidden

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

201 files changed

+3323
-7479
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7faf2ece2b5ac434cf21a1a2d6e620cc947b2d8a
2+
refs/heads/master: deb8b6691e4c2fd660b4ef4a4bd9c6f728f70266
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/benchmark/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ set(SWIFT_BENCH_MODULES
7777
single-source/DictionaryRemove
7878
single-source/DictionarySubscriptDefault
7979
single-source/DictionarySwap
80+
single-source/DoubleWidthDivision
8081
single-source/DropFirst
8182
single-source/DropLast
8283
single-source/DropWhile
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//===--- DoubleWidthDivision.swift ----------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
// This test checks performance of division using DoubleWidth.
14+
15+
// FIXME: This needs to be disabled with an #if because it runs into pathological
16+
// compile time and code size problems.
17+
// [SR-6947] DoubleWidth compile time.
18+
// import Foundation
19+
import TestsUtils
20+
21+
public let DoubleWidthDivision = BenchmarkInfo(
22+
name: "DoubleWidthDivision",
23+
runFunction: disabled,
24+
tags: [.validation, .algorithm]
25+
)
26+
public func disabled(_ N: Int) {}
27+
28+
#if false
29+
30+
private typealias Int128 = DoubleWidth<Int64>
31+
private typealias Int256 = DoubleWidth<Int128>
32+
private typealias Int512 = DoubleWidth<Int256>
33+
private typealias Int1024 = DoubleWidth<Int512>
34+
35+
@inline(never)
36+
public func run_DoubleWidthDivision(_ N: Int) {
37+
var sum = 0
38+
for _ in 1...5*N {
39+
let (q, r) =
40+
(Int128(Int64.max) * 16)
41+
.quotientAndRemainder(dividingBy: numericCast(getInt(16)))
42+
sum += Int(q * r)
43+
44+
let (q1, r1) =
45+
(40 as Int128).dividingFullWidth(
46+
(high: numericCast(getInt(0)), low: numericCast(getInt(240))))
47+
sum += Int(q1 * r1)
48+
49+
let x =
50+
DoubleWidth<DoubleWidth<DoubleWidth<Int8>>>(
51+
Int64.max / numericCast(getInt(4)))
52+
let y = DoubleWidth<DoubleWidth<Int8>>(Int32.max)
53+
let (q2, r2) = y.dividingFullWidth((x.high, x.low))
54+
sum += Int(q2 - r2)
55+
56+
let xx = Int1024(x)
57+
let yy = Int512(y)
58+
let (q3, r3) = yy.dividingFullWidth((xx.high, xx.low))
59+
sum -= Int(q3 - r3)
60+
}
61+
CheckResults(sum == 0)
62+
}
63+
#endif

trunk/benchmark/utils/main.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import DictionaryOfAnyHashableStrings
6565
import DictionaryRemove
6666
import DictionarySubscriptDefault
6767
import DictionarySwap
68+
import DoubleWidthDivision
6869
import DropFirst
6970
import DropLast
7071
import DropWhile
@@ -234,6 +235,7 @@ registerBenchmark(DictionaryOfAnyHashableStrings)
234235
registerBenchmark(DictionaryRemove)
235236
registerBenchmark(DictionarySubscriptDefault)
236237
registerBenchmark(DictionarySwap)
238+
registerBenchmark(DoubleWidthDivision)
237239
registerBenchmark(DropFirst)
238240
registerBenchmark(DropLast)
239241
registerBenchmark(DropWhile)

trunk/cmake/modules/SwiftSource.cmake

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ function(_compile_swift_files
195195

196196
# Compute flags for the Swift compiler.
197197
set(swift_flags)
198-
set(swift_module_flags)
199198

200199
_add_variant_swift_compile_flags(
201200
"${SWIFTFILE_SDK}"
@@ -284,10 +283,17 @@ function(_compile_swift_files
284283

285284
list(APPEND swift_flags ${SWIFTFILE_FLAGS})
286285

287-
set(dirs_to_create)
286+
set(obj_dirs)
288287
foreach(output ${SWIFTFILE_OUTPUT})
289288
get_filename_component(objdir "${output}" PATH)
290-
list(APPEND dirs_to_create "${objdir}")
289+
list(APPEND obj_dirs "${objdir}")
290+
endforeach()
291+
list(REMOVE_DUPLICATES obj_dirs)
292+
293+
set(command_create_dirs)
294+
foreach(objdir ${obj_dirs})
295+
list(APPEND command_create_dirs
296+
COMMAND "${CMAKE_COMMAND}" -E make_directory "${objdir}")
291297
endforeach()
292298

293299
set(module_file)
@@ -310,8 +316,6 @@ function(_compile_swift_files
310316
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
311317
set(specific_module_dir "${module_base}.swiftmodule")
312318
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
313-
else()
314-
set(specific_module_dir)
315319
endif()
316320
set(module_file "${module_base}.swiftmodule")
317321
set(module_doc_file "${module_base}.swiftdoc")
@@ -324,8 +328,16 @@ function(_compile_swift_files
324328

325329
if(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES)
326330
set(interface_file "${module_base}.swiftinterface")
327-
list(APPEND swift_module_flags
328-
"-emit-parseable-module-interface-path" "${interface_file}")
331+
list(APPEND swift_flags
332+
"-emit-parseable-module-interface-path" "${interface_file}")
333+
endif()
334+
335+
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
336+
list(APPEND command_create_dirs
337+
COMMAND "${CMAKE_COMMAND}" -E make_directory "${specific_module_dir}")
338+
else()
339+
list(APPEND command_create_dirs
340+
COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
329341
endif()
330342

331343
# If we have extra regexp flags, check if we match any of the regexps. If so
@@ -386,7 +398,7 @@ function(_compile_swift_files
386398
endif()
387399

388400
if (SWIFT_REPORT_STATISTICS)
389-
list(GET dirs_to_create 0 first_obj_dir)
401+
list(GET obj_dirs 0 first_obj_dir)
390402
list(APPEND swift_flags "-stats-output-dir" ${first_obj_dir})
391403
endif()
392404

@@ -421,12 +433,12 @@ function(_compile_swift_files
421433
endif()
422434

423435
# First generate the obj dirs
424-
list(REMOVE_DUPLICATES dirs_to_create)
425436
add_custom_command_target(
426-
create_dirs_dependency_target
427-
COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
428-
OUTPUT ${dirs_to_create}
429-
COMMENT "Generating dirs for ${first_output}")
437+
obj_dirs_dependency_target
438+
${command_create_dirs}
439+
COMMAND ""
440+
OUTPUT ${obj_dirs}
441+
COMMENT "Generating obj dirs for ${first_output}")
430442

431443
# Then we can compile both the object files and the swiftmodule files
432444
# in parallel in this target for the object file, and ...
@@ -466,7 +478,7 @@ function(_compile_swift_files
466478
${swift_compiler_tool_dep}
467479
${file_path} ${source_files} ${SWIFTFILE_DEPENDS}
468480
${swift_ide_test_dependency}
469-
${create_dirs_dependency_target}
481+
${obj_dirs_dependency_target}
470482
${copy_legacy_layouts_dep}
471483
COMMENT "Compiling ${first_output}")
472484
set("${dependency_target_out_var_name}" "${dependency_target}" PARENT_SCOPE)
@@ -491,20 +503,17 @@ function(_compile_swift_files
491503
module_dependency_target
492504
COMMAND
493505
"${CMAKE_COMMAND}" "-E" "remove" "-f" ${module_outputs}
494-
COMMAND
495-
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
496-
${specific_module_dir}
497506
COMMAND
498507
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
499508
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
500-
${swift_flags} ${swift_module_flags} "@${file_path}"
509+
${swift_flags} "@${file_path}"
501510
${command_touch_module_outputs}
502511
OUTPUT ${module_outputs}
503512
DEPENDS
504513
${swift_compiler_tool_dep}
505514
${source_files} ${SWIFTFILE_DEPENDS}
506515
${swift_ide_test_dependency}
507-
${create_dirs_dependency_target}
516+
${obj_dirs_dependency_target}
508517
COMMENT "Generating ${module_file}")
509518
set("${dependency_module_target_out_var_name}" "${module_dependency_target}" PARENT_SCOPE)
510519

@@ -520,7 +529,7 @@ function(_compile_swift_files
520529
DEPENDS
521530
${swift_compiler_tool_dep}
522531
${source_files} ${SWIFTFILE_DEPENDS}
523-
${create_dirs_dependency_target}
532+
${obj_dirs_dependency_target}
524533
COMMENT "Generating ${sib_file}"
525534
EXCLUDE_FROM_ALL)
526535
set("${dependency_sib_target_out_var_name}" "${sib_dependency_target}" PARENT_SCOPE)
@@ -536,7 +545,7 @@ function(_compile_swift_files
536545
DEPENDS
537546
${swift_compiler_tool_dep}
538547
${source_files} ${SWIFTFILE_DEPENDS}
539-
${create_dirs_dependency_target}
548+
${obj_dirs_dependency_target}
540549
COMMENT "Generating ${sibopt_file}"
541550
EXCLUDE_FROM_ALL)
542551
set("${dependency_sibopt_target_out_var_name}" "${sibopt_dependency_target}" PARENT_SCOPE)
@@ -553,7 +562,7 @@ function(_compile_swift_files
553562
DEPENDS
554563
${swift_compiler_tool_dep}
555564
${source_files} ${SWIFTFILE_DEPENDS}
556-
${create_dirs_dependency_target}
565+
${obj_dirs_dependency_target}
557566
COMMENT "Generating ${sibgen_file}"
558567
EXCLUDE_FROM_ALL)
559568
set("${dependency_sibgen_target_out_var_name}" "${sibgen_dependency_target}" PARENT_SCOPE)

trunk/docs/SIL.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,7 +4311,7 @@ open_existential_addr
43114311
// type P
43124312
// $*@opened P must be a unique archetype that refers to an opened
43134313
// existential type P.
4314-
// %1 will be of type $*@opened P
4314+
// %1 will be of type $*P
43154315

43164316
Obtains the address of the concrete value inside the existential
43174317
container referenced by ``%0``. The protocol conformances associated
@@ -4334,7 +4334,7 @@ open_existential_value
43344334
// type P
43354335
// $@opened P must be a unique archetype that refers to an opened
43364336
// existential type P.
4337-
// %1 will be of type $@opened P
4337+
// %1 will be of type $P
43384338

43394339
Loadable version of the above: Opens-up the existential
43404340
container associated with ``%0``. The protocol conformances associated

trunk/docs/WindowsBuild.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +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 `curl` into a folder named `curl`
4544
1. Clone `libxml2` into a folder named `libxml2`
4645

4746
- Currently, other repositories in the Swift project have not been tested and
@@ -65,7 +64,6 @@ git clone https://github.com/apple/swift-corelibs-libdispatch
6564
git clone https://github.com/apple/swift-corelibs-foundation
6665
git clone https://github.com/apple/swift-corelibs-xctest
6766
git clone https://github.com/apple/swift-lldb lldb
68-
git clone https://github.com/curl/curl.git curl
6967
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
7068
```
7169

@@ -250,17 +248,7 @@ cmake --build S:\b\libdispatch
250248
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
251249
```
252250

253-
### 11. Build curl
254-
255-
```cmd
256-
pushd "S:\curl"
257-
.\buildconf.bat
258-
cd winbuild
259-
nmake /f Makefile.vc mode=static VC=15 MACHINE=x64
260-
popd
261-
```
262-
263-
### 12. Build libxml2
251+
### 11. Build libxml2
264252

265253
```cmd
266254
pushd "S:\libxml2\win32"
@@ -269,7 +257,11 @@ nmake /f Makefile.msvc
269257
popd
270258
```
271259

272-
### 13. Build swift-corelibs-foundation
260+
### 12. Build swift-corelibs-foundation
261+
262+
To build Foundation you will need builds of:
263+
264+
- `libcurl` (https://curl.haxx.se, download the source, `cd` into `winbuild`, and run `nmake /f Makefile.vc mode=static VC=15 MACHINE=x64`)
273265

274266
```cmd
275267
mkdir "S:\b\foundation"
@@ -296,7 +288,7 @@ cmake -G Ninja^
296288
path S:\b\foundation;%PATH%
297289
```
298290

299-
### 14. Build swift-corelibs-xctest
291+
### 13. Build swift-corelibs-xctest
300292

301293
```cmd
302294
mkdir "S:\b\xctest"
@@ -321,7 +313,7 @@ cmake --build S:\b\xctest
321313
path S:\b\xctest;%PATH%
322314
```
323315

324-
### 15. Install Swift on Windows
316+
### 14. Install Swift on Windows
325317

326318
- Run ninja install:
327319

trunk/include/swift-c/SyntaxParser/SwiftSyntaxParser.h

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -232,64 +232,6 @@ swiftparse_parse_string(swiftparse_parser_t, const char *source);
232232
/// declarations, etc.
233233
SWIFTPARSE_PUBLIC const char* swiftparse_syntax_structure_versioning_identifier(void);
234234

235-
typedef struct {
236-
/// Represents the range for the fixit.
237-
swiftparse_range_t range;
238-
/// Represent the text for replacement.
239-
const char* text;
240-
} swiftparse_diagnostic_fixit_t;
241-
242-
typedef enum {
243-
SWIFTPARSER_DIAGNOSTIC_SEVERITY_ERROR = 0,
244-
SWIFTPARSER_DIAGNOSTIC_SEVERITY_WARNING = 1,
245-
SWIFTPARSER_DIAGNOSTIC_SEVERITY_NOTE = 2,
246-
} swiftparser_diagnostic_severity_t;
247-
248-
/// This is for the client to ask further information about a diagnostic that is
249-
/// associated with the pointer.
250-
/// This pointer is only valid to access from within the
251-
/// swiftparse_diagnostic_handler_t block
252-
typedef const void* swiftparser_diagnostic_t;
253-
254-
/// Invoked by the parser when a diagnostic is emitted.
255-
typedef void(^swiftparse_diagnostic_handler_t)(swiftparser_diagnostic_t);
256-
257-
/// Set the \c swiftparse_diagnostic_handler_t block to be used by the parser.
258-
///
259-
/// It isn't required to set a \c swiftparse_diagnostic_handler_t block.
260-
SWIFTPARSE_PUBLIC void
261-
swiftparse_parser_set_diagnostic_handler(swiftparse_parser_t,
262-
swiftparse_diagnostic_handler_t);
263-
264-
/// Get the message of a swiftparser_diagnostic_t
265-
SWIFTPARSE_PUBLIC const char*
266-
swiftparse_diagnostic_get_message(swiftparser_diagnostic_t);
267-
268-
/// Get the source location in byte offset to where the diagnostic is issued
269-
/// in the source buffer.
270-
SWIFTPARSE_PUBLIC
271-
unsigned swiftparse_diagnostic_get_source_loc(swiftparser_diagnostic_t diag);
272-
273-
/// Get the number of fixits of a swiftparser_diagnostic_t
274-
SWIFTPARSE_PUBLIC unsigned
275-
swiftparse_diagnostic_get_fixit_count(swiftparser_diagnostic_t);
276-
277-
/// Get the fixit at the specified index of a swiftparser_diagnostic_t
278-
SWIFTPARSE_PUBLIC swiftparse_diagnostic_fixit_t
279-
swiftparse_diagnostic_get_fixit(swiftparser_diagnostic_t, unsigned);
280-
281-
/// Get the number of highlight ranges of a swiftparser_diagnostic_t
282-
SWIFTPARSE_PUBLIC unsigned
283-
swiftparse_diagnostic_get_range_count(swiftparser_diagnostic_t);
284-
285-
/// Get the highlight range at the specified index of a swiftparser_diagnostic_t
286-
SWIFTPARSE_PUBLIC swiftparse_range_t
287-
swiftparse_diagnostic_get_range(swiftparser_diagnostic_t, unsigned);
288-
289-
/// Get the severity of a swiftparser_diagnostic_t
290-
SWIFTPARSE_PUBLIC swiftparser_diagnostic_severity_t
291-
swiftparse_diagnostic_get_severity(swiftparser_diagnostic_t diag);
292-
293235
SWIFTPARSE_END_DECLS
294236

295237
#endif

trunk/include/swift/AST/Decl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4549,9 +4549,6 @@ class AbstractStorageDecl : public ValueDecl {
45494549
/// other modules.
45504550
bool exportsPropertyDescriptor() const;
45514551

4552-
/// True if any of the accessors to the storage is private or fileprivate.
4553-
bool hasPrivateAccessor() const;
4554-
45554552
// Implement isa/cast/dyncast/etc.
45564553
static bool classof(const Decl *D) {
45574554
return D->getKind() >= DeclKind::First_AbstractStorageDecl &&

0 commit comments

Comments
 (0)