Skip to content

Merge swift-DEVELOPMENT-SNAPSHOT-2019-10-13-a into tensorflow #27821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 184 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
9b6ff03
On Linux build LLVM and subprojects with -gsplit-dwarf which is more …
adrian-prantl Sep 27, 2019
33f3213
Fix for "private extension String { private extension String <eof>"
Oct 3, 2019
4e51684
Use .gitattributes to syntax-highlight GYB templates on GitHub
broadwaylamb Oct 4, 2019
922b71f
[Runtime] Refactor HeapObject override checks to use a macro.
mikeash Oct 4, 2019
60523e3
[SILGen] Add the IsThunk bit to vtable thunks
Oct 5, 2019
fd3a880
[AutoDiff upstream] [AST] Add 'AutoDiffIndexSubset' data structure.
rxwei Oct 5, 2019
3bbd176
[tests] Add mechanism to override lit environment
beccadax Oct 6, 2019
5908cfc
First cut at ASTScope expansion requestification
Sep 30, 2019
7b0d081
Remove IteratorRange in favor of llvm::iterator_range
jrose-apple Oct 8, 2019
fa8a56e
[build-script] Remove redundant test check in sourcekitlsp's build pr…
ahoppen Oct 8, 2019
86ec6a0
Remove include order dependency
Oct 8, 2019
a1ea211
Add llvm::iterator_range to LLVM.h
jrose-apple Oct 8, 2019
a6b5824
AST: Correctly set parent DeclContext of ParamDecls in EnumElementDecls
slavapestov Oct 8, 2019
03ae7a2
AST: Remove unused EnumDecl::getElement() method
slavapestov Oct 8, 2019
7e6b4e4
[Diagnostics] Extend single parameter tuple splat to support generic …
xedin Oct 8, 2019
c62c289
[Diagnostics] Fix fix-it location for labeled tuple splat
xedin Oct 9, 2019
f5dd971
Merge pull request #27583 from slavapestov/enum-declcontext
slavapestov Oct 9, 2019
43df5a2
[SyntaxParse] Parse SuperRefExpr syntax
rintaro Oct 3, 2019
0d4cf76
[SyntaxParse] Renew parseListSyntax()
rintaro Oct 4, 2019
242f9a7
[SyntaxParse] parseExpressionSyntax()
rintaro Oct 5, 2019
b0e1eb5
[ASTGen] Add getAdvancedLocEnd() function
rintaro Oct 5, 2019
1de6819
[SyntaxParse] Parse Array/Dictionary literal syntax
rintaro Oct 5, 2019
1f47fa2
[ASTGen] Don't leave AST node caches after generate()
rintaro Oct 9, 2019
c6b7ad7
[SyntaxParse] Eagarly cache deferred range for deferred layout node
rintaro Oct 9, 2019
fa991ba
[SyntaxParse] handle stringLiteralExpr in advanceLocEnd
rintaro Oct 9, 2019
a58a980
LoadableByAddress: Fix broken assert
aschwaighofer Oct 9, 2019
0587470
Merge pull request #27549 from harlanhaskins/whoda-thunk-it
Oct 9, 2019
5301fa0
Build everything but the stdlib with function body skipping
Oct 9, 2019
9e89d56
[ASTMangler] Do not crash when mangling a retroactive conformance
theblixguy Oct 7, 2019
51476cd
[Diagnostics] Clarify tuple splat message when single parameter is ge…
xedin Oct 9, 2019
8cb2449
Update SwiftSource.cmake
Oct 9, 2019
666a98c
[syntax-coloring] Add fallback handling for coloring object literals …
Oct 9, 2019
bc1a3ea
Merge pull request #27584 from xedin/extend-use-of-single-param-splat…
xedin Oct 9, 2019
1724f5b
Merge pull request #27565 from rintaro/syntaxparse-exprcollection
rintaro Oct 9, 2019
bb08667
[SyntaxParse] Parse tuple/paren expression syntax
rintaro Oct 5, 2019
ebbc9c8
[SyntaxParse] Don't update PreviousLoc when ignoring token.
rintaro Oct 9, 2019
e9dfdea
SerializeLoc: serialize basic decl source location information to .sw…
nkcsgexi Sep 30, 2019
125e6ef
test: add a test for serializing decl source locations under batch mode
nkcsgexi Oct 3, 2019
d6dc7c3
test: add a test for source location serialization for wmo mode
nkcsgexi Oct 3, 2019
212fe43
SerializeLoc: ensure we can load serialized source locations when we …
nkcsgexi Oct 4, 2019
adb9e1d
SerializeLoc: add some comments about record structures. NFC
nkcsgexi Oct 4, 2019
ba6891d
SerializeLoc: include source locations for double underscored symbols…
nkcsgexi Oct 4, 2019
8293bdc
SerilizeLoc: refactor table structures per Jordan's comments
nkcsgexi Oct 7, 2019
c9647bb
SerializeLoc: remove NameLoc entry in the serialized format
nkcsgexi Oct 7, 2019
5430ad5
Frontend: change return type of CompilerInstance::getInputBuffersIfPr…
nkcsgexi Oct 7, 2019
dd33540
AST: rename printDeclUSRForModuleDoc to printDeclUSR. NFC
nkcsgexi Oct 7, 2019
dec8783
Driver: rename Name.swiftmodule/Private directory to Name.swiftmodule…
nkcsgexi Oct 8, 2019
29ab49f
SerializeLoc: add an assertion to ensure we can use USR id as an inde…
nkcsgexi Oct 8, 2019
5c092e7
SerializeLoc: use decl_locs_block consistently. NFC
nkcsgexi Oct 8, 2019
adaf790
SerializeLoc: asserts USR id and basic decl location are always in sync
nkcsgexi Oct 8, 2019
014f863
SerializeLoc: address more comments from Jordan. NFC
nkcsgexi Oct 9, 2019
a877fe6
ASTMangler: EnumElementDecl could also be a DeclContext with a parame…
nkcsgexi Oct 9, 2019
16bb84f
Merge pull request #27574 from jrose-apple/we-could-have-called-them-…
jrose-apple Oct 9, 2019
33e561a
[Syntax] Include leading/trailing trivia size to the cache ID
rintaro Oct 9, 2019
ca8871e
Merge pull request #27536 from davidungar/Fix-rdar-55914036
Oct 10, 2019
932128e
Fix SE-0249 source compatibility break
beccadax Oct 10, 2019
483bd5d
SerializeLoc: implement SourceFile::getBasicLocsForDecl()
nkcsgexi Oct 10, 2019
987b2c9
Merge pull request #27593 from brentdax/dissolved-in-a-solution
beccadax Oct 10, 2019
a9ab4aa
Use SeparateCaching
Oct 9, 2019
8512387
[mandatory-combine] Make sure to bail early if we have an external de…
gottesmm Oct 10, 2019
9f3bb93
[mandatory-combine] Simplify block traversal used to initialize workl…
gottesmm Oct 10, 2019
e8492e9
Simplify code as per review
aschwaighofer Oct 10, 2019
813dfc4
Merge pull request #27540 from broadwaylamb/patch-2
gottesmm Oct 10, 2019
1b29d86
[ome] Just erase the destructure rather than trying to get rid of dea…
gottesmm Oct 10, 2019
c9f9350
[Compatibility50] Look up swift_getObjCClassMetadata at runtime.
mikeash Sep 13, 2019
48e4ddb
Merge pull request #27598 from gottesmm/pr-86500d6ad50210ce9319f02bd3…
gottesmm Oct 10, 2019
1c2cc29
Merge pull request #27578 from ahoppen/redundant-test-check-sourcekitlsp
benlangmuir Oct 10, 2019
29caee2
Sema: Accessors of static members are always static
slavapestov Oct 7, 2019
de8745b
Sema: Simplify error handling in typeCheckParameterList()
slavapestov Oct 8, 2019
19b55ed
Merge pull request #27599 from gottesmm/pr-b367ebec31812f3fe81f71280f…
gottesmm Oct 10, 2019
eb02f20
Merge pull request #27407 from adrian-prantl/split-dwarf
adrian-prantl Oct 10, 2019
e22d55d
omitNeedlessWords: Early exit instead of using a big if
jrose-apple Oct 5, 2019
981d1a9
omitNeedlessWords: Factor out matchTypeNameFromBackWithSpecialCases
jrose-apple Oct 5, 2019
3fdbd1b
omitNeedlessWords: split out BaseNameSelf omission
jrose-apple Oct 10, 2019
42f7a35
omitNeedlessWords: sink helper enum into .cpp file
jrose-apple Oct 10, 2019
e1e885e
omitNeedlessWords: delete accidentally dead code
jrose-apple Oct 10, 2019
758e727
omitNeedlessWords: Use existing helpers getPriorStr and getRestOfStr
jrose-apple Oct 10, 2019
86de8b8
omitNeedlessWords: Rename helper: omitTrailingTypeNameWithSpecialCases
jrose-apple Oct 10, 2019
d2c579d
Sema: Move some checks from validateType() down to resolveType()
slavapestov Oct 7, 2019
fc4627d
Sema: More refactoring of typeCheckParameterList()
slavapestov Oct 8, 2019
cdfd1ab
Merge pull request #27592 from rintaro/syntaxparse-exprtuple
rintaro Oct 10, 2019
4bafc77
Put More Faith In Raw Values From Synthesized Enums
CodaFi Oct 10, 2019
df62f36
AST: Rename ParamDecl::Specifier to ParamSpecifier
slavapestov Oct 8, 2019
ce7aa3c
Merge pull request #27588 from harlanhaskins/barrier-skip
Oct 10, 2019
5a3085b
Sema: Factor out getOriginalAccessorParam()
slavapestov Oct 9, 2019
0822ce5
Merge pull request #27587 from aschwaighofer/loadable_by_address_fix_…
aschwaighofer Oct 10, 2019
97339a6
[ASTMangler] Use llvm::SaveAndRestore to update the CurGenericSignature
theblixguy Oct 10, 2019
d8b61ff
Sema: Peel off typeCheckParameterList()'s specifier computation into …
slavapestov Oct 8, 2019
3dbdc09
Sema: Move ParamDecl interface type computation to validateDecl()
slavapestov Oct 9, 2019
6701a7e
AST: Remove unused method declaration
slavapestov Oct 9, 2019
efa3139
Merge pull request #27170 from mikeash/the-missing-link
mikeash Oct 10, 2019
1cb3d7c
Merge pull request #27542 from mikeash/retain-release-refactor
mikeash Oct 10, 2019
f50966f
[SyntaxParse] Parse ObjectLiteralExpr syntax
rintaro Oct 8, 2019
6a9b252
[SyntaxParse] Parse unresolved member expression syntax
rintaro Oct 9, 2019
f09b07b
[Diagnostics] Extend use of argument mismatch fix to `autoclosure` pa…
xedin Oct 10, 2019
54ec600
Merge pull request #27605 from CodaFi/penumbra
CodaFi Oct 10, 2019
c9f1900
Merge pull request #27464 from nkcsgexi/deserialize-source-info
nkcsgexi Oct 10, 2019
d930599
Merge pull request #27591 from nathawes/r55680999-fix-object-literals…
Oct 10, 2019
7725818
Revert "Merge pull request #27057 from theblixguy/unrevert/SR-11298"
jrose-apple Oct 10, 2019
0ea63be
Merge pull request #27611 from jrose-apple/re-revert-SR-11298
swift-ci Oct 10, 2019
fd1bb20
[Property wrappers] Don't infer "final" for the projected property.
DougGregor Oct 10, 2019
12231d2
Merge pull request #27571 from slavapestov/circular-validation-cleanu…
slavapestov Oct 10, 2019
c20e5db
AST: Re-implement getResultInterfaceType()/getElementInterfaceType()
slavapestov Oct 9, 2019
3062b8c
Sema: Move function result/subscript element type computation into a …
slavapestov Oct 9, 2019
a7b0a4c
Sema: Move @_cdecl attribute validation to typeCheckDecl()
slavapestov Oct 10, 2019
f543d24
Sema: Always create a type checker instance
slavapestov Oct 10, 2019
87cc09c
AST: Remove some unnecessary calls to setGenericSignature()
slavapestov Oct 10, 2019
ef57355
AST: Stop checking hasInterfaceType() in MangleLocalTypeDeclRequest
slavapestov Oct 10, 2019
440ffe1
IRGen: Remove unnecessary hasInterfaceType() check
slavapestov Oct 10, 2019
87dd47a
Sema: Fold AssociatedTypeDecl::computeType() into validateDecl()
slavapestov Oct 10, 2019
797a797
Sema: Fold NominalTypeDecl::computeType() into validateDecl()
slavapestov Oct 10, 2019
6974448
Sema: Fold TypeAliasDecl::computeType() into validateDecl()
slavapestov Oct 10, 2019
09034fd
Sema: Fold EnumElementDecl::computeType() into validateDecl()
slavapestov Oct 10, 2019
90fa96d
Sema: Fold SubscriptDecl::computeType() into validateDecl()
slavapestov Oct 10, 2019
773ac24
[ConstraintSystem] Detect and diagnose type mismatch failures of `ino…
xedin Oct 10, 2019
b521871
Merge pull request #27547 from theblixguy/fix/SR-11521
theblixguy Oct 11, 2019
4791af0
Merge pull request #27602 from jrose-apple/omit-needle-swords
jrose-apple Oct 11, 2019
171ff44
Remove swift::reversed in favor of llvm::reverse (#27610)
jrose-apple Oct 11, 2019
73df6cf
Merge pull request #27612 from DougGregor/property-wrapper-open-final
swift-ci Oct 11, 2019
571d815
Remove radar numbers.
Oct 11, 2019
28e4cd0
[Constant Evaluator] Add a flag for denoting top-level evaluation
ravikandhadai Oct 11, 2019
37afa7c
Merge pull request #27435 from davidungar/A-9-29-recursion-assert
Oct 11, 2019
684341e
Frontend: fix after #27464
compnerd Oct 11, 2019
09299de
Merge pull request #27617 from ravikandhadai/constexpr-toplevel-separ…
swift-ci Oct 11, 2019
f27a58c
Fix property wrapper crasher
beccadax Oct 11, 2019
db902a1
Merge pull request #27618 from compnerd/27464
swift-ci Oct 11, 2019
1846a59
Merge pull request #27608 from xedin/autoclosure-ctx-mismatch
xedin Oct 11, 2019
ce59d76
disallow in-tree builds
compnerd Oct 11, 2019
5e1f790
Merge pull request #27607 from rintaro/syntaxparse-exprunresolvedmember
rintaro Oct 11, 2019
eb61ae7
[Type checker] Factor out ConstraintSystem::addJoinConstraint().
DougGregor Oct 11, 2019
c128f6f
[Constraint system] Generalize ParamDecl type tracking to VarDecl.
DougGregor Oct 11, 2019
87b5df7
[Constraint system] Abstract the record of an applied function builder.
DougGregor Oct 11, 2019
95e7343
Only pass -DLLVM_USE_SPLIT_DWARF in DebugInfo-enable builds.
adrian-prantl Oct 11, 2019
060cbb2
[NFC] Downgrade The TypeLoc in VarDecl to a TypeRepr
CodaFi Oct 11, 2019
2516089
Clean up the pseudo-clone-constructor for ParamDecl
CodaFi Oct 11, 2019
1036d2a
[SyntaxParse] Parse ObjC keypath expression syntax
rintaro Oct 11, 2019
8e16aa4
[Diagnostics] Extend argument-to-parameter mismatch note to cover `in…
xedin Oct 11, 2019
9765858
Rename to 'IndexSubset' and move it to its own file.
rxwei Oct 11, 2019
c55962c
Fix indentation in tests and remove unrelated tests.
rxwei Oct 11, 2019
748b646
Merge pull request #27623 from adrian-prantl/split-fixup
swift-ci Oct 11, 2019
ad57896
Update include in ASTContext.cpp.
rxwei Oct 11, 2019
0e9425e
Fix indentation.
rxwei Oct 11, 2019
660f66d
Delete the IsTypeLocImplicit Bit
CodaFi Oct 11, 2019
6b9b764
Merge pull request #27614 from xedin/inout-type-mismatch
xedin Oct 11, 2019
94cafc0
Merge pull request #27625 from rintaro/syntaxparse-exprobjckeypath
rintaro Oct 11, 2019
05e24c0
[OSLogOptimization] Improve a comment in the OSLogOptimization pass
ravikandhadai Oct 11, 2019
ab31a0d
[PropertyWrappers] Allow constructors with default arguments to be fo…
theblixguy Sep 20, 2019
22bbaea
[PropertyWrappers] Check for a generic constructor and also remove th…
theblixguy Sep 20, 2019
e41d1ef
[PropertyWrappers] Try to find the best default value initializer if …
theblixguy Sep 20, 2019
7e31d7a
[Test] Add a test to verify which best init is chosen
theblixguy Sep 25, 2019
370f47c
[PropertyWrappers] Merge 'findDefaultInit' and 'findInitialValueInit'…
theblixguy Sep 25, 2019
e23b373
[PropertyWrappers] Add an 'hasExtraneousParam' parameter to simplify …
theblixguy Sep 25, 2019
cb54be2
[PropertyWrappers] Re-introduce valueVarType which got removed while …
theblixguy Oct 11, 2019
adfd8b3
Merge pull request #27555 from rxwei/ad-upstream-autodiff-index-subset
swift-ci Oct 11, 2019
7770564
Merge pull request #27624 from CodaFi/in-locale-parentis
CodaFi Oct 11, 2019
162f86f
[PropertyWrappers] We won't have a valueVar when looking for a defaul…
theblixguy Oct 11, 2019
7d437ec
Merge pull request #27629 from DougGregor/builder-refactoring-prelude
swift-ci Oct 11, 2019
eef8c11
This test case only fails with asserts on
slavapestov Oct 11, 2019
5acc417
Revert "[SkipFunctionBodies] Build everything but the stdlib with fun…
Oct 11, 2019
4a9cda9
Merge pull request #27630 from ravikandhadai/minor-comment-fixes
swift-ci Oct 11, 2019
ce61fe6
Update the llvm project to use llvm-project-v3
shahmishal Oct 11, 2019
5e8c4ad
Merge pull request #27632 from apple/revert-27588-barrier-skip
shahmishal Oct 11, 2019
f17bc67
Merge pull request #27631 from slavapestov/xfail-bad-test
Oct 12, 2019
f44077b
Merge pull request #27619 from brentdax/epic-wrap-battles-of-property
beccadax Oct 12, 2019
a9588b3
Merge pull request #27253 from theblixguy/fix/SR-11477
theblixguy Oct 12, 2019
f9f63bd
[DI] Don't allow assign_by_wrapper formation to break access control.
DougGregor Oct 12, 2019
d034d2d
Merge pull request #27560 from brentdax/not-an-environmentalist
beccadax Oct 12, 2019
deb32b2
Merge pull request #27642 from DougGregor/property-wrappers-di-access
swift-ci Oct 12, 2019
99d9c94
Add now-fixed test case for rdar://problem/45590743
DougGregor Oct 12, 2019
2e558f8
Merge pull request #27594 from slavapestov/circular-validation-cleanu…
slavapestov Oct 12, 2019
ff4f234
DebugInfo: loosen producer pattern
compnerd Oct 12, 2019
7b9f30b
Merge pull request #27643 from DougGregor/rdar45590743-test
swift-ci Oct 12, 2019
190d965
[Property wrappers] Fix source compatibility issue with attribute loo…
DougGregor Oct 12, 2019
96d4050
Merge pull request #27621 from compnerd/oh-no-you-dont
compnerd Oct 12, 2019
e7ab752
Merge pull request #27644 from compnerd/producer-consumer
compnerd Oct 12, 2019
72f8d70
Merge pull request #27645 from DougGregor/property-wrappers-lookup-so…
DougGregor Oct 12, 2019
d5b761c
Update WindowsBuild.md
compnerd Oct 13, 2019
033e31d
Merge pull request #27649 from apple/compnerd-time-estimates
compnerd Oct 13, 2019
2c5b430
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-10-13-a' into tensorflow-m…
saeta Oct 21, 2019
cfe04e9
Update update-checkout-config.json.
saeta Oct 21, 2019
558dcb8
Fix all merge conflicts.
saeta Oct 21, 2019
d93a9c0
Fix last merge conflict.
saeta Oct 21, 2019
398884c
Fixes to make the compiler build. (Note: tests are likely to fail.)
saeta Oct 21, 2019
7927f71
Make all-but-one tests pass. (The one failing test was failing before.)
saeta Oct 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.swift.gyb linguist-language=Swift
*.cpp.gyb linguist-language=C++
60 changes: 1 addition & 59 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,63 +58,6 @@ Swift 5.2
(foo as Magic)(5)
```

* [SR-11298][]:

A class-constrained protocol extension, where the extended protocol does
not impose a class constraint, will now infer the constraint implicitly.

```swift
protocol Foo {}
class Bar: Foo {
var someProperty: Int = 0
}

// Even though 'Foo' does not impose a class constraint, it is automatically
// inferred due to the Self: Bar constraint.
extension Foo where Self: Bar {
var anotherProperty: Int {
get { return someProperty }
// As a result, the setter is now implicitly nonmutating, just like it would
// be if 'Foo' had a class constraint.
set { someProperty = newValue }
}
}
```

As a result, this could lead to code that currently compiles today to throw an error.

```swift
protocol Foo {
var someProperty: Int { get set }
}

class Bar: Foo {
var someProperty = 0
}

extension Foo where Self: Bar {
var anotherProperty1: Int {
get { return someProperty }
// This will now error, because the protocol requirement
// is implicitly mutating and the setter is implicitly
// nonmutating.
set { someProperty = newValue } // Error
}
}
```

**Workaround**: Define a new mutable variable inside the setter that has a reference to `self`:

```swift
var anotherProperty1: Int {
get { return someProperty }
set {
var mutableSelf = self
mutableSelf.someProperty = newValue // Okay
}
}
```

* [SE-0253][]:

Values of types that declare `func callAsFunction` methods can be called
Expand All @@ -140,7 +83,7 @@ Swift 5.2

* [SR-4206][]:

A method override is no longer allowed to have a generic signature with
A method override is no longer allowed to have a generic signature with
requirements not imposed by the base method. For example:

```
Expand Down Expand Up @@ -7856,5 +7799,4 @@ Swift 1.0
[SR-8974]: <https://bugs.swift.org/browse/SR-8974>
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>
[SR-11298]: <https://bugs.swift.org/browse/SR-11298>
[SR-11429]: <https://bugs.swift.org/browse/SR-11429>
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ endif()
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)

if(DEFINED CMAKE_JOB_POOLS)
# CMake < 3.11 doesn't support CMAKE_JOB_POOLS. Manually set the property.
set_property(GLOBAL PROPERTY JOB_POOLS "${CMAKE_JOB_POOLS}")
Expand Down
10 changes: 5 additions & 5 deletions cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ function(_compile_swift_files
set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
set(specific_module_dir "${module_base}.swiftmodule")
set(specific_module_private_dir "${specific_module_dir}/Private")
set(source_info_file "${specific_module_private_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
set(specific_module_project_dir "${specific_module_dir}/Project")
set(source_info_file "${specific_module_project_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
else()
set(specific_module_dir)
set(specific_module_private_dir)
set(specific_module_project_dir)
set(source_info_file "${module_base}.swiftsourceinfo")
endif()
set(module_file "${module_base}.swiftmodule")
Expand Down Expand Up @@ -367,7 +367,7 @@ function(_compile_swift_files
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT}"
OPTIONAL
PATTERN "Private" EXCLUDE)
PATTERN "Project" EXCLUDE)
else()
swift_install_in_component(FILES ${module_outputs}
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
Expand Down Expand Up @@ -508,7 +508,7 @@ function(_compile_swift_files
COMMAND
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
${specific_module_dir}
${specific_module_private_dir}
${specific_module_project_dir}
COMMAND
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
Expand Down
11 changes: 5 additions & 6 deletions docs/WindowsBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ mklink "%VCToolsInstallDir%\include\visualc.apinotes" S:\swift\stdlib\public\Pla
Warning: Creating the above links usually requires administrator privileges. The quick and easy way to do this is to open a second developer prompt by right clicking whatever shortcut you used to open the first one, choosing Run As Administrator, and pasting the above commands into the resulting window. You can then close the privileged prompt; this is the only step which requires elevation.

## 6. Build LLVM/Clang
- This must be done from within a developer command prompt. LLVM and Clang are
large projects, so building might take a few hours. Make sure that the build
- This must be done from within a developer command prompt. Make sure that the build
type for LLVM/Clang is compatible with the build type for Swift. That is,
either build everything `Debug` or some variant of `Release` (e.g. `Release`,
`RelWithDebInfo`).
Expand All @@ -126,8 +125,8 @@ ninja
path S:\b\llvm\bin;%PATH%
```
## 7. Build CMark
- This must be done from within a developer command prompt. CMark is a fairly
small project and should only take a few minutes to build.
- This must be done from within a developer command prompt.

```cmd
md "S:\b\cmark"
cd "S:\b\cmark"
Expand Down Expand Up @@ -180,8 +179,8 @@ cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
```

## 9. Build lldb
- This must be done from within a developer command prompt and could take hours
depending on your system.
- This must be done from within a developer command prompt.

```cmd
md "S:\b\lldb"
cd "S:\b\lldb"
Expand Down
42 changes: 27 additions & 15 deletions include/swift/AST/ASTScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include "swift/AST/ASTNode.h"
#include "swift/AST/NameLookup.h" // for DeclVisibilityKind
#include "swift/AST/SimpleRequest.h"
#include "swift/Basic/Compiler.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/NullablePtr.h"
Expand Down Expand Up @@ -88,6 +89,14 @@ struct AnnotatedInsertionPoint {
ASTScopeImpl *insertionPoint;
const char *explanation;
};
} // namespace ast_scope

namespace ast_scope {

void simple_display(llvm::raw_ostream &out, const ASTScopeImpl *);
void simple_display(llvm::raw_ostream &out, const ScopeCreator *);

SourceLoc extractNearestSourceLoc(std::tuple<ASTScopeImpl *, ScopeCreator *>);

#pragma mark the root ASTScopeImpl class

Expand Down Expand Up @@ -333,6 +342,11 @@ class ASTScopeImpl {
public:
/// expandScope me, sending deferred nodes to my descendants.
/// Return the scope into which to place subsequent decls
ASTScopeImpl *expandAndBeCurrentDetectingRecursion(ScopeCreator &);

/// Expand or reexpand the scope if unexpanded or if not current.
/// There are several places in the compiler that mutate the AST after the
/// fact, above and beyond adding Decls to the SourceFile.
ASTScopeImpl *expandAndBeCurrent(ScopeCreator &);

unsigned getASTAncestorScopeCount() const { return astAncestorScopeCount; }
Expand All @@ -344,6 +358,12 @@ class ASTScopeImpl {
void setWasExpanded() { wasExpanded = true; }
virtual ASTScopeImpl *expandSpecifically(ScopeCreator &) = 0;
virtual void beCurrent();
virtual bool doesExpansionOnlyAddNewDeclsAtEnd() const;

public:
bool isExpansionNeeded(const ScopeCreator &) const;

protected:
bool isCurrent() const;
virtual bool isCurrentIfWasExpanded() const;

Expand Down Expand Up @@ -374,16 +394,7 @@ class ASTScopeImpl {

bool isATypeDeclScope() const;

/// There are several places in the compiler that mutate the AST after the
/// fact, above and beyond adding Decls to the SourceFile. These are
/// documented in: rdar://53018839, rdar://53027266, rdar://53027733,
/// rdar://53028050
/// Return true if did reexpand
bool reexpandIfObsolete(ScopeCreator &);

private:
void reexpand(ScopeCreator &);

virtual ScopeCreator &getScopeCreator();

#pragma mark - - creation queries
Expand Down Expand Up @@ -533,8 +544,8 @@ class ASTSourceFileScope final : public ASTScopeImpl {
/// The number of \c Decls in the \c SourceFile that were already seen.
/// Since parsing can be interleaved with type-checking, on every
/// lookup, look at creating scopes for any \c Decls beyond this number.
/// rdar://55562483 Unify with numberOfChildrenWhenLastExpanded
int numberOfDeclsAlreadySeen = 0;
/// TODO: Unify with numberOfChildrenWhenLastExpanded
size_t numberOfDeclsAlreadySeen = 0;

ASTSourceFileScope(SourceFile *SF, ScopeCreator *scopeCreator);

Expand All @@ -548,7 +559,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
public:
NullablePtr<DeclContext> getDeclContext() const override;

void addNewDeclsToScopeTree();
void buildFullyExpandedTree();
void
buildEnoughOfTreeForTopLevelExpressionsButDontRequestGenericsOrExtendedNominals();
Expand All @@ -559,11 +569,15 @@ class ASTSourceFileScope final : public ASTScopeImpl {

protected:
ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override;
bool isCurrentIfWasExpanded() const override;
void beCurrent() override;
bool doesExpansionOnlyAddNewDeclsAtEnd() const override;

ScopeCreator &getScopeCreator() override;

private:
void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &);
AnnotatedInsertionPoint
expandAScopeThatCreatesANewInsertionPoint(ScopeCreator &);
};

class Portion {
Expand Down Expand Up @@ -1148,7 +1162,6 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
/// false positives, that that doesn't hurt anything. However, the result of
/// the conservative source range computation doesn't seem to be stable. So
/// keep the original here, and use it for source range queries.
/// rdar://55263708

const SourceRange sourceRangeWhenCreated;

Expand Down Expand Up @@ -1251,7 +1264,6 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
};

class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
// Should be able to remove this when rdar://53921703 is accomplished.
Expr *initAsWrittenWhenCreated;

public:
Expand Down
1 change: 1 addition & 0 deletions include/swift/AST/ASTTypeIDZone.def
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SWIFT_TYPEID(AncestryFlags)
SWIFT_TYPEID(CtorInitializerKind)
SWIFT_TYPEID(GenericSignature)
SWIFT_TYPEID(ParamSpecifier)
SWIFT_TYPEID(PropertyWrapperBackingPropertyInfo)
SWIFT_TYPEID(PropertyWrapperTypeInfo)
SWIFT_TYPEID(Requirement)
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/ASTTypeIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class ModuleDecl;
class NominalTypeDecl;
class OperatorDecl;
class OpaqueTypeDecl;
class ParamDecl;
enum class ParamSpecifier : uint8_t;
class PrecedenceGroupDecl;
struct PropertyWrapperBackingPropertyInfo;
struct PropertyWrapperTypeInfo;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ class DeclAttributes {
public:
template <typename ATTR, bool AllowInvalid>
using AttributeKindRange =
OptionalTransformRange<llvm::iterator_range<const_iterator>,
OptionalTransformRange<iterator_range<const_iterator>,
ToAttributeKind<ATTR, AllowInvalid>,
const_iterator>;

Expand Down
Loading