Skip to content

Finish merge from swift-DEVELOPMENT-SNAPSHOT-2019-10-08-a #27693

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 182 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
000294f
[Diagnostics][NFC] Optionally add notes as explicit children of an er…
owenv Aug 25, 2019
6e1e768
Add diagnoseWithNotes helper so CompoundDiagnosticTransation doesn't …
owenv Sep 17, 2019
b2c1540
[SIL Optimization][OSLogOptimization] Improve the logic for
ravikandhadai Sep 28, 2019
dee631b
[NFC] Explicitly control alignment of Identifiers
beccadax Sep 18, 2019
c3c9e3a
Update table of contents in CHANGELOG.md
benrimmington Oct 1, 2019
b0e947b
[ownership] Emit a PrettyStackTrace msg telling to re-run with -sil-v…
gottesmm Oct 1, 2019
5d3ee68
swift-reflection-dump: Base ObjectMemoryReader address space on image…
jckarter Sep 30, 2019
263bbbb
RemoteMirror: Work around flaw in C interface
jckarter Oct 1, 2019
8add25a
Misc spot fixes
jckarter Oct 1, 2019
bce1636
swift-reflection-dump: Mach-O binding list support
jckarter Oct 1, 2019
c39a2ae
IRGen: Always use symbolic references in mangled names (on Mach-O pla…
jckarter Oct 1, 2019
9e414da
[IRGen] Use llvm.used for __objc_protorefs and __objc_protolist and a…
jinlin-bayarea Sep 24, 2019
dfe0085
[docs] CToSwift: Finish swift_name section
jrose-apple Oct 1, 2019
1bb666a
[docs] CToSwiftName: Add the section on ObjC properties
jrose-apple Oct 1, 2019
c5c7422
Update table of contents in CHANGELOG.md
benrimmington Oct 2, 2019
6a23ed5
Revert "IRGen: Leave frame pointers off SIL functions marked [thunk]."
aschwaighofer Oct 2, 2019
483d835
[AST/ASTMangler] Fix linker error for `SWIFT_BUILD_ONLY_SYNTAXPARSERL…
akyrtzi Oct 2, 2019
c108dae
[CSDiagnostics] Find argument lists for key path subscripts
hamishknight Sep 15, 2019
9220feb
Merge pull request #27489 from akyrtzi/parser-lib-link-error
swift-ci Oct 2, 2019
2b790a9
Merge pull request #27488 from aschwaighofer/revert_no_frame_pointer_…
aschwaighofer Oct 2, 2019
a59f438
Merge pull request #27465 from jrose-apple/properties-of-properties
jrose-apple Oct 2, 2019
8b8c88e
Improve swift::TransformRange enough to delete TransformArrayRef
jrose-apple Oct 2, 2019
262f686
Remove unused swift::FilterIterator and swift::FilterRange
jrose-apple Oct 2, 2019
0c8dd88
[utils/build-parser-lib] Add capability for cross-compiling the parse…
akyrtzi Oct 2, 2019
c712938
Merge pull request #27414 from brentdax/identify-yourself
beccadax Oct 2, 2019
85b6a05
AST: remove `dump` for GSB
compnerd Oct 2, 2019
e2e114f
Merge pull request #27463 from gottesmm/pr-cab8832ce5d2768bd6581460dc…
gottesmm Oct 2, 2019
5883345
[ClangImporter] Include -Xcc options in the PCH hash (#27482)
jrose-apple Oct 2, 2019
1e0d927
Update WindowsBuild.md
compnerd Oct 2, 2019
bddc69c
Organize SILOptimizer/Utils headers. Remove Local.h.
atrick Sep 28, 2019
22500e7
Update the coding style for all code moved in the previous commit.
atrick Oct 1, 2019
c090816
[ModuleInterfaces] Combine the normalized target triple into the cach…
Oct 1, 2019
7f24c99
[gardening] Eliminate unneeded include of <string>.
gottesmm Oct 2, 2019
d535e3e
[ownership] Allow for the ownership verifier to be run in non-asserts…
gottesmm Oct 2, 2019
3ec5e76
Update FloatingPointTypes.swift.gyb (#27461)
own2pwn Oct 2, 2019
8821c6c
swift-reflection-dump: Create ReflectionContext with correct target p…
jckarter Oct 2, 2019
da385bd
[csvcolumn_to_scurve] Avoid division by zero.
nate-chandler Oct 2, 2019
fc635cf
[CSDiagnostics] Find argument lists for key path subscripts (#27492)
hamishknight Oct 2, 2019
da10020
Merge pull request #27495 from apple/compnerd-lldb-windows
compnerd Oct 2, 2019
3db3525
Merge pull request #27498 from gottesmm/pr-2874f8dc3187fa660c8b043dc8…
swift-ci Oct 2, 2019
62ccf81
Merge pull request #27417 from atrick/cleanup-cfg-utils
swift-ci Oct 2, 2019
b93096c
swift-reflection-dump: Use a 32-bit friendly multi-image VM mapping.
jckarter Oct 2, 2019
351c4cc
[XFAIL] Disable Sanitizers/tsan-norace-deinit-run-time.swift (55880585)
shahmishal Oct 2, 2019
28189a7
Merge pull request #27470 from edymtt/reenable-runtime-tests
edymtt Oct 2, 2019
ef64b13
Merge pull request #27500 from nate-chandler/scurve-avoid-zero-division
swift-ci Oct 2, 2019
4f07dcb
[lib/IDE] Improve error message outputted from `getPlistEntry` functi…
akyrtzi Oct 2, 2019
5914325
[SyntaxParse] Parse typealias declaration
rintaro Oct 1, 2019
967be8b
[ClangImporter] Remove unused variable
jrose-apple Oct 2, 2019
5f26958
Merge pull request #26830 from owenv/diag_child_notes_refactor
jrose-apple Oct 2, 2019
03edea3
Merge pull request #27502 from akyrtzi/improve-getPlistEntry-err
swift-ci Oct 2, 2019
7c1c58e
[windows] Adapt Windows build script to latest changes.
drodriguez Oct 1, 2019
6d789e3
Merge pull request #27499 from gottesmm/pr-dc6371871f1797246355f4fc67…
gottesmm Oct 2, 2019
13deb3b
Merge pull request #27503 from jrose-apple/fielding-questions
swift-ci Oct 2, 2019
3d321c1
Fix the new Swift NSMutableArray subclass to match edge case behavior…
Catfish-Man Oct 2, 2019
414a4e2
Merge pull request #27467 from jckarter/symbolic-reference-all-the-th…
jckarter Oct 2, 2019
0746d1e
Merge pull request #27493 from jrose-apple/this-isnt-even-my-final-form
jrose-apple Oct 2, 2019
2fe3ce8
Requestify the Raw Value Accessor
CodaFi Sep 27, 2019
6f3d610
Switch up @objc enum printing
CodaFi Oct 2, 2019
af5eda5
Merge pull request #27419 from ravikandhadai/oslog-backward-dependenc…
ravikandhadai Oct 2, 2019
597538c
[SyntaxParse] Parse IdentifierExpr syntax
rintaro Sep 28, 2019
8c5dcc0
Merge pull request #27485 from rintaro/syntaxparse-decltypealias
rintaro Oct 3, 2019
9b7ab6b
Merge pull request #27403 from CodaFi/thursday-night-raw
CodaFi Oct 3, 2019
dd45f56
Merge pull request #27458 from benrimmington/changelog-toc-5.2
swift-ci Oct 3, 2019
934d4d1
Requestify whether a decl is an ABI compatible override
hamishknight Oct 2, 2019
ce531be
Merge pull request #27469 from harlanhaskins/target-acquired
Oct 3, 2019
e0ce37e
SILGen: Fix setting variables with property wrappers marked objc dynamic
aschwaighofer Oct 2, 2019
2f3ec72
Merge pull request #27494 from compnerd/dump-gsb
compnerd Oct 3, 2019
bb4f46f
Merge pull request #27475 from drodriguez/batch-script-lldb-fixes
compnerd Oct 3, 2019
0854397
SILOptimizer: rename `cdecl` to `ctor` (NFC)
compnerd Oct 3, 2019
c7d80f2
build: stage libdispatch exports target usage
compnerd Oct 3, 2019
333f0db
Merge pull request #27346 from jinlin-bayarea/llvm_used
rajbarik Oct 3, 2019
67ff818
Remove unused imaginary 'friend' declaration
jckarter Oct 3, 2019
4b646bf
Merge pull request #27517 from compnerd/decltype
swift-ci Oct 3, 2019
357b742
[update-checkout] remove master-rebranch
cyndyishida Oct 3, 2019
dad8366
Merge pull request #27522 from cyndyishida/master
shahmishal Oct 3, 2019
70b1d91
[windows] Allow EXE and exe capitalizations in tests.
drodriguez Oct 3, 2019
e621be0
[update-checkout] Update master-20190619
JDevlieghere Oct 3, 2019
dac7467
Merge pull request #27525 from JDevlieghere/update-checkout-master-20…
shahmishal Oct 3, 2019
5574372
Merge pull request #27504 from Catfish-Man/hifi-masquerade
Catfish-Man Oct 3, 2019
0996da0
[build-script-impl] Fix cross-compilation of swift.
Oct 3, 2019
f58f68d
Merge pull request #27438 from compnerd/libdispatch-export-targets
compnerd Oct 3, 2019
a2e0d08
Merge pull request #27519 from apple/no-imaginary-friends
jckarter Oct 3, 2019
edbf24c
[SyntaxParse] Fix attribute generation in ASTGen
rintaro Oct 3, 2019
4932755
[ownership] Fix no-asserts build.
gottesmm Oct 3, 2019
c022ff2
[SyntaxParse] Adjust parseMatchingToken()
rintaro Oct 3, 2019
d7e977b
adding space engine changes
AndrewLitteken Aug 21, 2019
33770fa
Merge pull request #27526 from dcci/openupyoureyes
dcci Oct 3, 2019
55a6693
Frontend: -emit-silgen exits with non-zero status code if a diagnosti…
slavapestov Oct 2, 2019
044204a
Sema: Don't synthesize null bodies for invalid accessors
slavapestov Oct 2, 2019
6828a12
Sema: Remove unnecessary circularity breaks
slavapestov Oct 3, 2019
6702d38
Sema: Remove most calls to Decl::setValidationToChecked()
slavapestov Sep 26, 2019
ce6de7e
swift-reflection-dump: ELF ObjectMemoryReader support for relocations
jckarter Oct 3, 2019
fff1a39
[Version] Bump the Swift version to 5.1.1
shahmishal Oct 3, 2019
2ddba9c
Merge pull request #27528 from rintaro/syntaxparse-rdar55952739
rintaro Oct 3, 2019
9f26b56
[SyntaxParse] Remove unused overload of parseMatchingTokenSyntax()
rintaro Oct 3, 2019
12c1db9
NFC: Move ArgumentMismatchFailure down a bit
hamishknight Oct 3, 2019
b5a0d58
Have ArgumentMismatchFailure store FunctionArgApplyInfo
hamishknight Oct 1, 2019
ec45b24
Use hasAppliedSelf in getFunctionArgApplyInfo
hamishknight Oct 1, 2019
f03d210
Make getFunctionArgApplyInfo more lenient with CSDiag
hamishknight Oct 1, 2019
e2096ae
[CSDiagnostics] Tweak candidate note text for arg mismatch
hamishknight Oct 3, 2019
6e3671d
Move FunctionArgApplyInfo up the header
hamishknight Oct 3, 2019
d2c668b
Merge pull request #27527 from gottesmm/pr-1abc9e6927939511bbfbed96d9…
gottesmm Oct 4, 2019
951c626
Merge pull request #27533 from apple/master-bump-swift-version-5-1-1
shahmishal Oct 4, 2019
a511622
Merge pull request #27379 from slavapestov/circular-validation-cleanu…
slavapestov Oct 4, 2019
078ef80
Remove Ubuntu 14.04 bot link from README.md
shahmishal Oct 4, 2019
013c4f1
Requestify whether a decl is an ABI compatible override (#27524)
hamishknight Oct 4, 2019
c1a1ddd
Requestify needsNewVTableEntry
hamishknight Oct 3, 2019
3f66608
Check for stubs in NeedsNewVTableEntryRequest
hamishknight Oct 3, 2019
df07883
NFC: silence a few warnings
davezarzycki Oct 4, 2019
a0f04ad
Merge pull request #27532 from jckarter/elf-object-reader-relocations
jckarter Oct 4, 2019
cb3f9e6
Merge pull request #26754 from AndrewLitteken/SR-11159-SpaceEngine
CodaFi Oct 4, 2019
8fbe089
IRGen: Strip a bitcast that might be there because a runtime function…
aschwaighofer Oct 4, 2019
d2971fa
[SyntaxParse] Fix crasher for generic parameter with attributes
rintaro Oct 4, 2019
b32e82c
More idiomatic use of llvm::hash_combine in many places (#27497)
jrose-apple Oct 4, 2019
76aeffc
Remove special case for swift-ci in update-checkout.
varungandhi-apple Oct 4, 2019
ca7e809
[NFC] Add a short note on what USRs are and what they're used for.
varungandhi-apple Oct 5, 2019
e334e5d
AST: Convert ValueDecl::getOpaqueResultTypeDecl() into a request
slavapestov Sep 27, 2019
cdcb8e4
AST: Lazier opaque type validation
slavapestov Sep 28, 2019
204276c
Sema: Remove unused TypeResolution::Resolver variable
slavapestov Oct 5, 2019
d173559
Parse: Fudge a test case to work around non-deterministic behavior (r…
slavapestov Oct 5, 2019
7063ecd
IDE: Eliminate typeCheckCompletionDecl()
slavapestov Oct 4, 2019
d4bafdf
Add minimal test case for rdar://problem/55519276.
varungandhi-apple Oct 6, 2019
3b9dbd5
[AST] Get the ObjC accessor name, not the one parsed from Swift.
varungandhi-apple Oct 6, 2019
91c9501
[build-script-impl] Handle multiple version directories in TOOLCHAIN/…
mikeash Oct 5, 2019
afb904f
[build-script-impl] Echo commands that are executed when in verbose m…
mikeash Oct 7, 2019
5b5d316
test: make multithread_module pass on Windows
compnerd Oct 7, 2019
a57e6cc
Remove now unnecessary const_cast
hamishknight Oct 7, 2019
45545c6
tests: make Driver.driver-compile pass on Windows again
compnerd Oct 7, 2019
dbddb0d
Merge pull request #27516 from aschwaighofer/silgen_fix_assignment_pr…
aschwaighofer Oct 7, 2019
aff6d6e
[SILProfiler] Skip exprs with invalid locations
vedantk Oct 7, 2019
c4814cb
[build-script] Pass updated arguments to SwiftSyntax's build script
ahoppen Oct 7, 2019
071a713
Merge pull request #27544 from rintaro/syntaxparse-attrincomplete
rintaro Oct 8, 2019
e8afc44
Merge pull request #27568 from vedantk/master
swift-ci Oct 8, 2019
18f2b97
Update alias for LLVM Project to support swift/master
shahmishal Oct 8, 2019
2035658
Merge pull request #27531 from rintaro/syntaxparse-matchingtoken
rintaro Oct 8, 2019
0d727d0
[NFC] Replace new getAccessor calls with getOpaqueAccessor calls.
varungandhi-apple Oct 8, 2019
c07d02e
[CMake] Correctly export SWIFT_LIBRARY_DIRS
bulbazord Oct 8, 2019
f6226d9
[AutoDiff upstream] Add `-enable-experimental-differentiable-programm…
dan-zheng Oct 8, 2019
6bfe518
AST: Compute FuncDecl::isStatic() using a request
slavapestov Oct 4, 2019
7baf6a2
Sema: Move a few more things from validateDecl() to typeCheckDecl()
slavapestov Oct 4, 2019
1d80980
AST: Add ValueDecl::isRecursiveValidation()
slavapestov Oct 4, 2019
52cf365
Sema: Simplify validateDecl()
slavapestov Oct 4, 2019
e903595
Merge pull request #27510 from drodriguez/windows-exe-capitalization
compnerd Oct 8, 2019
f42f60f
[Syntax] Consolidate 'TupleElement' and 'FunctionCallArgument' kinds
rintaro Oct 7, 2019
e7c0172
Merge pull request #27546 from slavapestov/circular-validation-cleanu…
slavapestov Oct 8, 2019
2b04447
[CSDiagnostics] Store FunctionArgApplyInfo on ArgumentMismatch… (#27537)
hamishknight Oct 8, 2019
91a792b
Merge branch 'master' into id-like-to-request-a-table
hamishknight Oct 8, 2019
a260d0a
AST: getInterfaceType() returns ErrorType instead of Type() on circul…
slavapestov Oct 5, 2019
5669b9e
Sema: checkRedeclaration() doesn't need a type checker instance
slavapestov Oct 7, 2019
fac36f9
Sema: Always use interface types in typeCheckParameterList()
slavapestov Oct 7, 2019
6e70b39
IDE: Remove workaround for rdar://problem/54310026
slavapestov Oct 7, 2019
5b878ac
Merge pull request #27539 from davezarzycki/pr27539
davezarzycki Oct 8, 2019
a947f34
Requestify needsNewVTableEntry (#27541)
hamishknight Oct 8, 2019
d20418e
Merge pull request #27543 from aschwaighofer/irgen_remove_runtime_fn_…
aschwaighofer Oct 8, 2019
64224ca
Merge pull request #27553 from slavapestov/circular-validation-cleanu…
slavapestov Oct 8, 2019
45d3b25
Merge pull request #27564 from rintaro/tupleelement-functioncallargument
rintaro Oct 8, 2019
5251736
Merge pull request #27562 from compnerd/driver-tests
compnerd Oct 8, 2019
bc6ba22
Merge pull request #27561 from compnerd/multithread_module
compnerd Oct 8, 2019
98d358c
Merge pull request #27570 from xiaobai/donde-esta-la-biblioteca
compnerd Oct 8, 2019
907a8c3
[SILProfiler] Add debug output for {push,pop}Region operations
vedantk Oct 8, 2019
0cef7b0
[SILProfiler] Do not visit closure bodies twice
vedantk Oct 8, 2019
14985a8
Merge pull request #27550 from mikeash/compiler-retweet
mikeash Oct 8, 2019
04ce7bf
Merge pull request #27557 from varungandhi-apple/vg-fix-selector-names
varungandhi-apple Oct 8, 2019
dfe962f
Merge pull request #27508 from rintaro/syntaxparse-expridentifier
rintaro Oct 8, 2019
5ce10d1
Merge pull request #27548 from varungandhi-apple/vg-document-USR
varungandhi-apple Oct 8, 2019
8f55e42
Merge pull request #27538 from varungandhi-apple/vg-update-update-che…
varungandhi-apple Oct 8, 2019
5d817d9
[ClangImporter] Save a bit of malloc traffic with BumpPtrAllocator (#…
jrose-apple Oct 8, 2019
4055530
Update assert on SymbolicValue size (#27515)
uraimo Oct 8, 2019
91669ce
Merge pull request #27573 from vedantk/master
swift-ci Oct 8, 2019
b2a1e1c
[build-script] Introduce an option to skip local build.
Oct 8, 2019
f2229c4
Merge pull request #27566 from ahoppen/install-swiftsyntax-module
ahoppen Oct 8, 2019
e40a6fd
[Build System: build-script-impl] Fix the copy logic in build-script-…
Aug 21, 2019
36a7e93
[build-script] Fix issue with installing SwiftSyntax if target dir do…
ahoppen Oct 8, 2019
f2b43e4
Merge pull request #27575 from mikeash/compiler-retweet-nonexistent-ls
swift-ci Oct 8, 2019
f692420
Merge pull request #27567 from dcci/skip-local-build
swift-ci Oct 8, 2019
1d7d58a
Merge pull request #27576 from ahoppen/install-swiftsyntax-module
ahoppen Oct 8, 2019
14ba7c0
Merge branch 'master_5' into tensorflow-merge
asuhan Oct 15, 2019
c8c7c1f
Fix more merge damage
asuhan Oct 15, 2019
3236d2d
Merge branch 'master_6' into tensorflow-merge
asuhan Oct 15, 2019
d49bcb9
Merge branch 'master_final' into tensorflow-merge
asuhan Oct 15, 2019
aac5aef
Fix more merge damage
asuhan Oct 15, 2019
0474bbf
Update lldb dependency
asuhan Oct 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 18 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ CHANGELOG
<details>
<summary>Note: This is in reverse chronological order, so newer entries are added to the top.</summary>

| Contents |
| :--------------------- |
| [Swift Next](#swift-next) |
| [Swift 5.1](#swift-51) |
| [Swift 5.0](#swift-50) |
| [Swift 4.2](#swift-42) |
| [Swift 4.1](#swift-41) |
| [Swift 4.0](#swift-40) |
| [Swift 3.1](#swift-31) |
| [Swift 3.0](#swift-30) |
| [Swift 2.2](#swift-22) |
| [Swift 2.1](#swift-21) |
| [Swift 2.0](#swift-20) |
| [Swift 1.2](#swift-12) |
| [Swift 1.1](#swift-11) |
| [Swift 1.0](#swift-10) |
| Version | Released | Toolchain |
| :--------------------- | :--------- | :---------- |
| [Swift 5.2](#swift-52) | | |
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |

</details>

Swift Next
----------
Swift 5.2
---------

* [SR-11429][]:

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
# can be reused when a new version of Swift comes out (assuming the user hasn't
# manually set it as part of their own CMake configuration).
set(SWIFT_VERSION "5.1")
set(SWIFT_VERSION "5.1.1")

set(SWIFT_VENDOR "" CACHE STRING
"The vendor name of the Swift compiler")
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ set(SWIFT_LIBRARY_DIRS ${SWIFT_LIBRARY_OUTPUT_INTDIR})
configure_file(
SwiftConfig.cmake.in
${swift_cmake_builddir}/SwiftConfig.cmake
@ONLY)
@ONLY)
4 changes: 2 additions & 2 deletions cmake/modules/SwiftConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ set(SWIFT_VERSION @SWIFT_VERSION@)
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)

set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
set(SWIFT_LIBRARY_DIRS "@SWIFT_CONFIG_LIBRARY_DIRS@")
set(SWIFT_LIBRARY_DIRS "@SWIFT_LIBRARY_DIRS@")

# These variables are duplicated, but they must match the LLVM variables of the
# same name. The variables ending in "S" could some day become lists, and are
# preserved for convention and compatibility.
set(SWIFT_INCLUDE_DIR "@SWIFT_INCLUDE_DIRS@")
set(SWIFT_LIBRARY_DIR "@SWIFT_CONFIG_LIBRARY_DIRS@")
set(SWIFT_LIBRARY_DIR "@SWIFT_LIBRARY_DIRS@")

set(SWIFT_CMAKE_DIR "@SWIFT_CMAKE_DIR@")
set(SWIFT_BINARY_DIR "@SWIFT_BINARY_DIR@")
Expand Down
111 changes: 108 additions & 3 deletions docs/CToSwiftNameTranslation.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,29 @@ Additionally, typedefs for `void *` or `const void *` that are themselves annota
If a typedef's underlying type is itself a "CF pointer" typedef, the "alias" typedef will be imported as a regular typealias, with the suffix "Ref" still dropped from its name (if present) unless doing so would conflict with another declaration in the same module as the typedef.


## Objective-C Properties

By default, most property names are not transformed at all. However, if the getter of a property overrides a superclass or adopted protocol method that is also a property accessor, the Swift name of the overridden accessor's property will be used for consistency. If there's more than one such name, one is chosen arbitrarily.

Properties with the type `BOOL` or `Boolean` use the name of the getter as the name of the Swift property by default, rather than the name of the property in Objective-C. This accounts for a difference in Swift and Objective-C naming conventions for boolean properties that use "is".

```objc
@property(getter=isContrivedExample) BOOL contrivedExample;
@property BOOL hasAnotherForm;
```

```swift
var isContrivedExample: Bool { get set }
var hasAnotherForm: Bool { get set }
```

_This rule should probably have applied to C's native `bool` as well._

A property declaration with the `SwiftImportPropertyAsAccessors` API note will not be imported at all, and its accessors will be imported as methods. Additionally, properties whose names start with "accessibility" in the NSAccessibility protocol are always imported as methods, as are properties whose names start with "accessibility" in an `@interface` declaration (class or category) that provides the adoption of NSAccessibility.

_Objective-C code has historically not been consistent about whether the NSAccessibility declarations should be considered properties and therefore the Swift compiler chooses to import them as methods, as a sort of lowest common denominator._


## `swift_private`

The `swift_private` Clang attribute prepends `__` onto the base name of any declaration being imported except initializers. For initializers with no arguments, a dummy `Void` argument with the name `__` is inserted; otherwise, the label for the first argument has `__` prepended. This transformation takes place after any other name manipulation, unless the declaration has a custom name. It will not occur if the declaration is an override; in that case the name needs to match the overridden declaration.
Expand Down Expand Up @@ -252,6 +275,8 @@ __attribute__((swift_name("SpacecraftCoordinates")))
struct SPKSpacecraftCoordinates {
double x, y, z, t; // space and time, of course
};

// Usually seen as NS_SWIFT_NAME.
```

```swift
Expand Down Expand Up @@ -287,12 +312,10 @@ The `swift_name` attribute can be used to give a C function a custom name. The v
```objc
__attribute__((swift_name("doSomething(to:bar:)")))
void doSomethingToFoo(Foo *foo, int bar);

// Usually seen as NS_SWIFT_NAME.
```

```swift
func doSomething(foo: UnsafeMutablePointer<Foo>, bar: Int32)
func doSomething(to foo: UnsafeMutablePointer<Foo>, bar: Int32)
```

An underscore can be used in place of an empty parameter label, as in Swift.
Expand Down Expand Up @@ -430,4 +453,86 @@ Although enumerators always have global scope in C, they are often imported as m

_Currently, `swift_name` does not even allow importing an enum case as a member of the enum type itself, even if the enum is not recognized as an `@objc` enum, error code enum, or option set (i.e. the situation where a case is imported as a global constant)._


### Fields of structs and unions; Objective-C properties

The `swift_name` attribute can be applied to rename a struct or union field or an Objective-C property (whether on a class or a protocol). The value of the attribute must be a valid Swift identifier.

```objc
struct SPKSpaceflightBooking {
const SPKLocation * _Nullable destination;
bool roundTrip __attribute__((swift_name("isRoundTrip")));
};
```

```swift
struct SPKSpaceflightBooking {
var destination: UnsafePointer<SPKLocation>?
var isRoundTrip: Bool
}
```


### Objective-C methods

The `swift_name` attribute can be used to give an Objective-C method a custom name. The value of the attribute must be a full Swift function name, including parameter labels.

```objc
- (void)doSomethingToFoo:(Foo *)foo bar:(int)bar
__attribute__((swift_name("doSomethingImportant(to:bar:)")));
```

```swift
func doSomethingImportant(to foo: UnsafeMutablePointer<Foo>, bar: Int32)
```

As with functions, an underscore can be used to represent an empty parameter label.

Methods that follow the NSError out-parameter convention may provide one fewer parameter label than the number of parameters in the original method to indicate that a parameter should be dropped, but they do not have to. The `swift_error` attribute is still respected even when using a custom name for purposes of transforming an NSError out-parameter and the method return type.

```objc
- (BOOL)doSomethingRiskyAndReturnError:(NSError **)error
__attribute__((swift_name("doSomethingRisky()")));
- (BOOL)doSomethingContrived:(NSString *)action error:(NSError **)outError
__attribute__((swift_name("doSomethingContrived(_:error:)")));
```

```swift
func doSomethingRisky() throws
func doSomethingContrived(_ action: String, error: ()) throws
```

A base name of "init" can be used on a *class* method that returns `instancetype` or the containing static type in order to import that method as an initializer. Any other custom name *prevents* a class method from being imported as an initializer even if it would normally be inferred as one.

```objc
+ (Action *)makeActionWithHandler:(void(^)(void))handler
__attribute__((swift_name("init(handler:)")));
+ (instancetype)makeActionWithName:(NSString *)name
__attribute__((swift_name("init(name:)")));
```

```swift
/* non-inherited */ init(handler: () -> Void)
init(name: String)
```

A no-argument method imported as an initializer can be given a dummy argument label to disambiguate it from the no-argument `init()`, whether the method is an init-family instance method or a factory class method in Objective-C.

```objc
- (instancetype)initSafely
__attribute__((swift_name("init(safe:)")));
+ (instancetype)makeDefaultAction
__attribute__((swift_name("init(default:)")));
```

```swift
init(safe: ())
init(default: ())
```

A custom name on an instance method with one of Objective-C's subscript selectors (`objectAtIndexedSubscript:`, `objectForKeyedSubscript:`, `setObject:atIndexedSubscript:`, or `setObject:forKeyedSubscript:`) prevents that method from being imported as a subscript or used as the accessor for another subscript.

_Currently, this only works if *both* methods in a read/write subscript are given custom names; if just one is, a read/write subscript will still be formed. A read-only subscript only has one method to rename._


## More to come...
8 changes: 3 additions & 5 deletions docs/WindowsBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,11 @@ cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
md "S:\b\lldb"
cd "S:\b\lldb"
cmake -G Ninja^
-DLLVM_DIR="S:/b/llvm/lib/cmake/llvm"^
-DClang_DIR="S:/b/llvm/lib/cmake/clang"^
-DSwift_DIR="S:/b/swift/lib/cmake/swift"^
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
-DLLDB_ALLOW_STATIC_BINDINGS=YES^
-DLLDB_PATH_TO_CLANG_SOURCE="S:\clang"^
-DLLDB_PATH_TO_SWIFT_SOURCE="S:\swift"^
-DLLDB_PATH_TO_CLANG_BUILD="S:\b\llvm"^
-DLLDB_PATH_TO_LLVM_BUILD="S:\b\llvm"^
-DLLDB_PATH_TO_SWIFT_BUILD="S:\b\swift"^
-DLLVM_ENABLE_ASSERTIONS=ON^
-DPYTHON_HOME="%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64"^
S:\lldb
Expand Down
2 changes: 0 additions & 2 deletions include/swift/ABI/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,6 @@ struct TargetClassMetadata : public TargetAnyClassMetadata<Runtime> {
using StoredPointer = typename Runtime::StoredPointer;
using StoredSize = typename Runtime::StoredSize;

friend class ReflectionContext;

TargetClassMetadata() = default;
constexpr TargetClassMetadata(const TargetAnyClassMetadata<Runtime> &base,
ClassFlags flags,
Expand Down
3 changes: 0 additions & 3 deletions include/swift/AST/ASTDemangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ class ASTBuilder {
using BuiltTypeDecl = swift::GenericTypeDecl *; // nominal or type alias
using BuiltProtocolDecl = swift::ProtocolDecl *;
explicit ASTBuilder(ASTContext &ctx) : Ctx(ctx) {}

/// The resolver to use for type checking, if necessary.
LazyResolver *Resolver = nullptr;

ASTContext &getASTContext() { return Ctx; }
DeclContext *getNotionalDC();
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/ASTTypeIDZone.def
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ SWIFT_TYPEID(Type)
SWIFT_TYPEID(TypePair)
SWIFT_TYPEID_NAMED(CustomAttr *, CustomAttr)
SWIFT_TYPEID_NAMED(Decl *, Decl)
SWIFT_TYPEID_NAMED(EnumDecl *, EnumDecl)
SWIFT_TYPEID_NAMED(GenericParamList *, GenericParamList)
SWIFT_TYPEID_NAMED(GenericTypeParamType *, GenericTypeParamType)
SWIFT_TYPEID_NAMED(InfixOperatorDecl *, InfixOperatorDecl)
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)
SWIFT_TYPEID_NAMED(ModuleDecl *, ModuleDecl)
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
SWIFT_TYPEID_NAMED(OpaqueTypeDecl *, OpaqueTypeDecl)
SWIFT_TYPEID_NAMED(OperatorDecl *, OperatorDecl)
SWIFT_TYPEID_NAMED(Optional<PropertyWrapperMutability>,
PropertyWrapperMutability)
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 @@ -25,6 +25,7 @@ class AbstractFunctionDecl;
class BraceStmt;
class CustomAttr;
class Decl;
class EnumDecl;
class GenericParamList;
class GenericSignature;
class GenericTypeParamType;
Expand All @@ -33,6 +34,7 @@ class IterableDeclContext;
class ModuleDecl;
class NominalTypeDecl;
class OperatorDecl;
class OpaqueTypeDecl;
class PrecedenceGroupDecl;
struct PropertyWrapperBackingPropertyInfo;
struct PropertyWrapperTypeInfo;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/AnyRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AnyRequest {
friend llvm::DenseMapInfo<swift::AnyRequest>;

static hash_code hashForHolder(uint64_t typeID, hash_code requestHash) {
return hash_combine(hash_value(typeID), requestHash);
return hash_combine(typeID, requestHash);
}

/// Abstract base class used to hold the specific request kind.
Expand Down
Loading