Skip to content

Commit 3653e60

Browse files
authored
---
yaml --- r: 347109 b: refs/heads/master c: 0543071 h: refs/heads/master i: 347107: c9aca06
1 parent 9033362 commit 3653e60

File tree

200 files changed

+7476
-3320
lines changed

Some content is hidden

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

200 files changed

+7476
-3320
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: deb8b6691e4c2fd660b4ef4a4bd9c6f728f70266
2+
refs/heads/master: 0543071d0d2665b879239edcf03b693fb16985c7
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ set(SWIFT_BENCH_MODULES
7777
single-source/DictionaryRemove
7878
single-source/DictionarySubscriptDefault
7979
single-source/DictionarySwap
80-
single-source/DoubleWidthDivision
8180
single-source/DropFirst
8281
single-source/DropLast
8382
single-source/DropWhile

trunk/benchmark/single-source/DoubleWidthDivision.swift

Lines changed: 0 additions & 63 deletions
This file was deleted.

trunk/benchmark/utils/main.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ import DictionaryOfAnyHashableStrings
6565
import DictionaryRemove
6666
import DictionarySubscriptDefault
6767
import DictionarySwap
68-
import DoubleWidthDivision
6968
import DropFirst
7069
import DropLast
7170
import DropWhile
@@ -235,7 +234,6 @@ registerBenchmark(DictionaryOfAnyHashableStrings)
235234
registerBenchmark(DictionaryRemove)
236235
registerBenchmark(DictionarySubscriptDefault)
237236
registerBenchmark(DictionarySwap)
238-
registerBenchmark(DoubleWidthDivision)
239237
registerBenchmark(DropFirst)
240238
registerBenchmark(DropLast)
241239
registerBenchmark(DropWhile)

trunk/cmake/modules/SwiftSource.cmake

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

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

199200
_add_variant_swift_compile_flags(
200201
"${SWIFTFILE_SDK}"
@@ -283,17 +284,10 @@ function(_compile_swift_files
283284

284285
list(APPEND swift_flags ${SWIFTFILE_FLAGS})
285286

286-
set(obj_dirs)
287+
set(dirs_to_create)
287288
foreach(output ${SWIFTFILE_OUTPUT})
288289
get_filename_component(objdir "${output}" PATH)
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}")
290+
list(APPEND dirs_to_create "${objdir}")
297291
endforeach()
298292

299293
set(module_file)
@@ -316,6 +310,8 @@ function(_compile_swift_files
316310
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
317311
set(specific_module_dir "${module_base}.swiftmodule")
318312
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
313+
else()
314+
set(specific_module_dir)
319315
endif()
320316
set(module_file "${module_base}.swiftmodule")
321317
set(module_doc_file "${module_base}.swiftdoc")
@@ -328,16 +324,8 @@ function(_compile_swift_files
328324

329325
if(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES)
330326
set(interface_file "${module_base}.swiftinterface")
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}")
327+
list(APPEND swift_module_flags
328+
"-emit-parseable-module-interface-path" "${interface_file}")
341329
endif()
342330

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

400388
if (SWIFT_REPORT_STATISTICS)
401-
list(GET obj_dirs 0 first_obj_dir)
389+
list(GET dirs_to_create 0 first_obj_dir)
402390
list(APPEND swift_flags "-stats-output-dir" ${first_obj_dir})
403391
endif()
404392

@@ -433,12 +421,12 @@ function(_compile_swift_files
433421
endif()
434422

435423
# First generate the obj dirs
424+
list(REMOVE_DUPLICATES dirs_to_create)
436425
add_custom_command_target(
437-
obj_dirs_dependency_target
438-
${command_create_dirs}
439-
COMMAND ""
440-
OUTPUT ${obj_dirs}
441-
COMMENT "Generating obj dirs for ${first_output}")
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}")
442430

443431
# Then we can compile both the object files and the swiftmodule files
444432
# in parallel in this target for the object file, and ...
@@ -478,7 +466,7 @@ function(_compile_swift_files
478466
${swift_compiler_tool_dep}
479467
${file_path} ${source_files} ${SWIFTFILE_DEPENDS}
480468
${swift_ide_test_dependency}
481-
${obj_dirs_dependency_target}
469+
${create_dirs_dependency_target}
482470
${copy_legacy_layouts_dep}
483471
COMMENT "Compiling ${first_output}")
484472
set("${dependency_target_out_var_name}" "${dependency_target}" PARENT_SCOPE)
@@ -503,17 +491,20 @@ function(_compile_swift_files
503491
module_dependency_target
504492
COMMAND
505493
"${CMAKE_COMMAND}" "-E" "remove" "-f" ${module_outputs}
494+
COMMAND
495+
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
496+
${specific_module_dir}
506497
COMMAND
507498
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
508499
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
509-
${swift_flags} "@${file_path}"
500+
${swift_flags} ${swift_module_flags} "@${file_path}"
510501
${command_touch_module_outputs}
511502
OUTPUT ${module_outputs}
512503
DEPENDS
513504
${swift_compiler_tool_dep}
514505
${source_files} ${SWIFTFILE_DEPENDS}
515506
${swift_ide_test_dependency}
516-
${obj_dirs_dependency_target}
507+
${create_dirs_dependency_target}
517508
COMMENT "Generating ${module_file}")
518509
set("${dependency_module_target_out_var_name}" "${module_dependency_target}" PARENT_SCOPE)
519510

@@ -529,7 +520,7 @@ function(_compile_swift_files
529520
DEPENDS
530521
${swift_compiler_tool_dep}
531522
${source_files} ${SWIFTFILE_DEPENDS}
532-
${obj_dirs_dependency_target}
523+
${create_dirs_dependency_target}
533524
COMMENT "Generating ${sib_file}"
534525
EXCLUDE_FROM_ALL)
535526
set("${dependency_sib_target_out_var_name}" "${sib_dependency_target}" PARENT_SCOPE)
@@ -545,7 +536,7 @@ function(_compile_swift_files
545536
DEPENDS
546537
${swift_compiler_tool_dep}
547538
${source_files} ${SWIFTFILE_DEPENDS}
548-
${obj_dirs_dependency_target}
539+
${create_dirs_dependency_target}
549540
COMMENT "Generating ${sibopt_file}"
550541
EXCLUDE_FROM_ALL)
551542
set("${dependency_sibopt_target_out_var_name}" "${sibopt_dependency_target}" PARENT_SCOPE)
@@ -562,7 +553,7 @@ function(_compile_swift_files
562553
DEPENDS
563554
${swift_compiler_tool_dep}
564555
${source_files} ${SWIFTFILE_DEPENDS}
565-
${obj_dirs_dependency_target}
556+
${create_dirs_dependency_target}
566557
COMMENT "Generating ${sibgen_file}"
567558
EXCLUDE_FROM_ALL)
568559
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 $*P
4314+
// %1 will be of type $*@opened 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 $P
4337+
// %1 will be of type $@opened 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: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ 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`
4445
1. Clone `libxml2` into a folder named `libxml2`
4546

4647
- Currently, other repositories in the Swift project have not been tested and
@@ -64,6 +65,7 @@ git clone https://github.com/apple/swift-corelibs-libdispatch
6465
git clone https://github.com/apple/swift-corelibs-foundation
6566
git clone https://github.com/apple/swift-corelibs-xctest
6667
git clone https://github.com/apple/swift-lldb lldb
68+
git clone https://github.com/curl/curl.git curl
6769
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
6870
```
6971

@@ -248,7 +250,17 @@ cmake --build S:\b\libdispatch
248250
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
249251
```
250252

251-
### 11. Build libxml2
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
252264

253265
```cmd
254266
pushd "S:\libxml2\win32"
@@ -257,11 +269,7 @@ nmake /f Makefile.msvc
257269
popd
258270
```
259271

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`)
272+
### 13. Build swift-corelibs-foundation
265273

266274
```cmd
267275
mkdir "S:\b\foundation"
@@ -288,7 +296,7 @@ cmake -G Ninja^
288296
path S:\b\foundation;%PATH%
289297
```
290298

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

293301
```cmd
294302
mkdir "S:\b\xctest"
@@ -313,7 +321,7 @@ cmake --build S:\b\xctest
313321
path S:\b\xctest;%PATH%
314322
```
315323

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

318326
- Run ninja install:
319327

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,64 @@ 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+
235293
SWIFTPARSE_END_DECLS
236294

237295
#endif

trunk/include/swift/AST/Decl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4549,6 +4549,9 @@ 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+
45524555
// Implement isa/cast/dyncast/etc.
45534556
static bool classof(const Decl *D) {
45544557
return D->getKind() >= DeclKind::First_AbstractStorageDecl &&

0 commit comments

Comments
 (0)