Skip to content

Merge main 2022-06-06 #4628

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 224 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
63c88b9
Add `-index-ignore-clang-modules` flag
DavidGoldman May 13, 2022
65062c9
Capture the proper module name even if the module indexing is disabled
DavidGoldman May 16, 2022
88f7260
start work on operators
Huddie Feb 28, 2022
178b012
Add operators as class members
Huddie Mar 9, 2022
b9f2196
Add changes
Huddie Mar 14, 2022
e14e2fb
Add changes
Huddie Mar 17, 2022
4267958
Mapping decl base name to imported name
Huddie Apr 6, 2022
11730e8
Remap class operator function names (-/+/*....) to imported operator …
Huddie May 13, 2022
bd4db51
Added synth member to result
Huddie May 18, 2022
c36eeed
Update Identifier.h
Huddie May 13, 2022
540e52a
Update Identifier.h
Huddie May 13, 2022
9154a12
[android][test] Don't set lit's config.target_env_prefix when running…
finagolfin May 20, 2022
e7fe6f0
Fix tests and re-enable support for CXX operators
Huddie May 22, 2022
3196ea9
Refactor and format
Huddie May 22, 2022
e73bb6f
[cxx-interop] Import attributes on inherited C++ methods
skrtks May 23, 2022
dadcb04
[Build][Runtime] Replace SWIFT_STDLIB_SINGLE_THREADED_RUNTIME.
al45tair Mar 25, 2022
34af337
[Runtime] Remove all use of read/write locks.
al45tair Mar 29, 2022
63a0900
[Threading] Create new threading library and use it.
al45tair Apr 15, 2022
ddea8b1
[Unittests] Make the Threading unit tests work.
al45tair Apr 20, 2022
4280222
[Unittests] Add more threading library tests.
al45tair Apr 20, 2022
c37c146
[Threading] Fix case sensitivity bug.
al45tair Apr 20, 2022
1243d15
[Threading] Auto-detect threading in the preprocessor.
al45tair Apr 20, 2022
2398fe7
[Threading] A couple of header file fixes.
al45tair Apr 20, 2022
fc90280
[Threading] Fix the Linux build.
al45tair Apr 21, 2022
448f81f
[Build] Move initialization of SWIFT_HOST_VARIANT_SDK further up.
al45tair Apr 21, 2022
982aa29
[Build] Fix static linking.
al45tair Apr 22, 2022
90be2e3
[Build] Fix the name of the threading package setting.
al45tair Apr 22, 2022
f04b658
[Threading][Windows] Fix missing close brace.
al45tair Apr 22, 2022
6f4d9cc
[Threading][Windows] Fix another Windows niggle.
al45tair Apr 22, 2022
4527c08
[Threading][Windows] More header file fixes.
al45tair Apr 22, 2022
709d06f
[Threading][Windows] Undefine Yield and ERROR.
al45tair Apr 26, 2022
848b6b5
[Runtime][Windows] Need to link with Synchronization.lib.
al45tair Apr 26, 2022
b718432
[Threading][Windows] Don't include <windows.h>
al45tair Apr 27, 2022
79e2d0d
[Runtime][Windows] A couple of files need to include <windows.h>
al45tair Apr 27, 2022
c034d6c
[Concurrency][Threading] Remove use of platform thread functions.
al45tair Apr 27, 2022
d090bb0
[Threading][Windows] Try to avoid declaring _RTL_SRWLOCK
al45tair Apr 28, 2022
1fc36cf
[Concurrency][Windows] Add a couple of includes for Windows.
al45tair Apr 28, 2022
da42d72
[Concurrency][Windows] Remove unnecessary includes.
al45tair Apr 28, 2022
d5c022f
[Threading][Windows] Link the unit test against Synchronization.lib
al45tair Apr 28, 2022
dadd23e
[UnitTests][Windows] Link with Synchronization.lib
al45tair Apr 28, 2022
6e875da
[Threading] Remove thread_get_main().
al45tair Apr 28, 2022
b5bd267
[Threading] Put everything through git clang-format.
al45tair Apr 28, 2022
2884ddb
[Threading] Fix some problems with the C11 threading code.
al45tair Apr 29, 2022
69f0b03
[Threading] Don't use TLS keys as template arguments.
al45tair May 4, 2022
fc4f941
[Threading] Move stack bounds fetching into the threading library.
al45tair May 6, 2022
a987cb9
[Concurrency] Remove redundant include.
al45tair May 6, 2022
1c6618e
[Threading] A few include tweaks.
al45tair May 6, 2022
901ceae
[Threading] Add the ability to use any C++ callable in swift::once().
al45tair May 24, 2022
3a5f103
[Threading] Fix a few things following rebase.
al45tair May 24, 2022
43cc1f9
[Threading] Use llvm::Optional<> rather than making a zero lower boun…
al45tair May 24, 2022
65473f5
Use Identifier instead of StringRef to avoid dangling pointer
Huddie May 24, 2022
8fd8408
[CSSimplify] If function types mismatch on labels record a contextual…
xedin May 24, 2022
16c1e1d
Format
Huddie May 27, 2022
238eec4
PR comment
Huddie May 27, 2022
c1994b4
[build-script] Cross-compile sourcekit-lsp for arm64
ahoppen May 25, 2022
597668f
Test diff mangled name for windows
Huddie May 27, 2022
2422c0c
Keep the XFAIL on windows for now
Huddie May 27, 2022
bb3a721
Manually fix some formatting
Huddie May 27, 2022
a596863
SILGen: Use ObjC types to lower async completion handler arguments.
jckarter May 28, 2022
3b8db19
[Gardening] fix typo "supercede" -> "supersede"
Jager-yoo May 28, 2022
bbe4608
Patch Out a Source of Iterator Invalidation
CodaFi May 28, 2022
ba2dcfb
[cxx-interop] support inout params as cxx references
WANGJIEKE May 30, 2022
2c54427
CI: alter the ninja reporting for analytics
compnerd May 30, 2022
a19a986
Update build-windows-toolchain.bat
compnerd May 30, 2022
127e29f
[cxx-interop] Do not warn about missing libstdc++ on Android
egorzhdan May 30, 2022
2b0b389
[Distributed] onReturn ad-hoc req must not be mutating
ktoso May 31, 2022
2598aa5
Add experimental feature for bound generic extensions
DougGregor May 31, 2022
ad65a64
Delete superseded language option `EnableConcisePoundFile`
DougGregor May 31, 2022
22ccb3f
Introduce experimental features for autodiff options
DougGregor May 31, 2022
6267513
Add experimental feature for AdditiveArithmetic derived conformances
DougGregor May 31, 2022
03941bd
Merge branch 'apple:main' into cxx-interop-inout-param
WANGJIEKE May 31, 2022
402501d
[Distributed] Also prevent mutating remoteCall impls
ktoso May 31, 2022
22daa86
[ConstraintSystem] Make `for-in` solution application target standalone
xedin May 16, 2022
3327559
[TypeChecker] IDE: Adjust `typeCheckForCodeCompletion` to support all…
xedin May 16, 2022
bb7beda
[CSClosure] Handle for-in statement preamble via solution target
xedin May 17, 2022
96f2c88
[TypeChecker] NFC: Use `typeCheckTarget` from `typeCheckExpression`
xedin May 17, 2022
9fa39e9
[MiscDiagnostics] Unhandled throw check should use recorded conformance
xedin May 18, 2022
1be0eaf
[CSSimplify] Ignore missing `makeIterator` member
xedin May 19, 2022
8616529
[TypeChecker] Change the way for-in statement in type-checked
xedin May 19, 2022
0989cd9
[CSSimplify] Ignore missing `next` member on `$generator`
xedin May 19, 2022
d461eab
[TypeChecker] Effects: Don't diagnose implicit AST nodes
xedin May 19, 2022
e9b0647
[CSSimplify] Don't record requirement failure if one of the sides is…
xedin May 19, 2022
2c8bfee
[SILGen] Unify handling of for-in and async for-in statements
xedin May 20, 2022
5f0dcb5
[ConstraintSystem] Implicitly open existential type of for-in sequence
xedin May 20, 2022
b7860ea
[TypeChecker] Split for-in sequence into parsed and type-checked vers…
xedin May 20, 2022
ef0523f
[ConstraintSystem] NFC: Remove obsolete `ValueWitness` constraint
xedin May 20, 2022
cffa588
[CSFix] Skip constrained erasure check (SE-0352) for sequence express…
xedin May 27, 2022
df1e38f
[TypeChecker] NFC: Add test-case for rdar://93061432
xedin May 27, 2022
9889586
Merge pull request #59162 from ktoso/wip-adhoc-mutating-onreturn
ktoso May 31, 2022
aeabf7d
Merge pull request #59156 from apple/egorzhdan/cxx-android-warning
egorzhdan May 31, 2022
c470c54
Fix the analyze_code_size script after python3 upgrade
eeckstein May 31, 2022
efe5997
[Tools] Fix swift-reflection-fuzzer.
al45tair May 31, 2022
5ffcaad
[Demangler] Fix a NULL Node pointer assertion.
al45tair May 31, 2022
b9d14cc
Merge pull request #59168 from eeckstein/fix-analysize_code_size
swift-ci May 31, 2022
11752f8
Merge pull request #59163 from DougGregor/more-experimental-features
DougGregor May 31, 2022
68dfde2
[Build] Fix some issues with the standalone library build.
al45tair May 31, 2022
46a746b
Merge pull request #59169 from al45tair/eng/PR-94143566
al45tair May 31, 2022
d20b9a8
Merge pull request #59170 from al45tair/eng/PR-94143700
al45tair May 31, 2022
b739394
cmake: add android runtime build caches
compnerd May 31, 2022
07aec92
[cxx-interop] Pass sysroot to the Clang driver when detecting libstdc…
egorzhdan May 24, 2022
7b1d4df
ModuleInterface: Fix decl attribute corruption in private swiftinterf…
tshortli May 27, 2022
1cb1546
Merge pull request #59137 from jckarter/objc-async-defined-in-swift-t…
jckarter May 31, 2022
619ce79
Merge pull request #59144 from CodaFi/sunkissed-you-are-not
CodaFi May 31, 2022
d775ec8
Merge pull request #59158 from compnerd/ninja-logging
compnerd May 31, 2022
cdc3c88
AST: Remove unused field from OpenedArchetypeType
slavapestov May 25, 2022
075e594
Sema: Allow protocol compositions containing parameterized protocol t…
slavapestov May 31, 2022
866975a
Sema: Better diagnostic when parameterized protocol is used in an uns…
slavapestov May 31, 2022
1f88fa8
Sema: Allow parameterized protocol types without 'any' as the underly…
slavapestov May 31, 2022
b79797e
Merge pull request #59128 from tshortli/inconsistent-attributes-in-pr…
tshortli May 31, 2022
ae1f707
[test] New test mode to execute all tests with C++ interop enabled.
drodriguez May 27, 2022
ab25f6f
Increase expectation slop for clock tests
phausler May 31, 2022
defafa7
ClosureLifetimeFixup : Fix bug in lifetime extension of non escaping …
meg-gupta May 27, 2022
bf00a71
AST: An opaque generic parameter is not 'simple' for purposes of type…
slavapestov May 31, 2022
c70d8fd
Merge pull request #59050 from apple/egorzhdan/libstdcxx-sysroot
egorzhdan May 31, 2022
b45e0d1
IRGen: Add -enable/disable-round-trip-debug-types flag, on by default…
slavapestov May 24, 2022
bc53d1c
Merge pull request #59001 from buttaface/native-droid
swift-ci May 31, 2022
7521101
Merge pull request #59120 from drodriguez/test-with-cxx-interop
swift-ci May 31, 2022
c0d30ec
Merge pull request #59178 from slavapestov/unused-field-archetype-type
slavapestov May 31, 2022
0cda214
[CSGen] Don't use one-way constraints for $generator initializer
xedin May 31, 2022
49b489b
Merge pull request #59160 from meg-gupta/closurefixupbug
meg-gupta May 31, 2022
d113ca6
CSApply: Fix several issues with non-failable to failable/throwing in…
AnthonyLatsis May 13, 2022
a9fb330
Fix a crash in the ASTDumper
AnthonyLatsis May 17, 2022
b9e8e2c
Merge pull request #59179 from slavapestov/parameterized-protocol-imp…
slavapestov May 31, 2022
7a4c36e
Merge pull request #59074 from slavapestov/type-reconstruction-round-…
slavapestov May 31, 2022
1113842
[docs] clarify docs for load, loadUnaligned and storeBytes
glessard May 31, 2022
e904e24
ModuleInterface: Fix use-after-free when cloning SPI attributes.
tshortli May 31, 2022
bc79518
[Static Mirror] Handle anonymous contexts when re-constructing fully-…
artemcm Apr 5, 2022
d55c496
Merge pull request #59186 from tshortli/inconsistent-attributes-in-pr…
tshortli Jun 1, 2022
f1ed622
Merge pull request #59187 from glessard/se-unaligned-loads-docs
swift-ci Jun 1, 2022
c6ef5d2
[Sema] Check `@_typeEraser` SPI visibility
rxwei Jun 1, 2022
e4d8fa4
Merge pull request #59161 from AnthonyLatsis/init-delegation-diags
AnthonyLatsis Jun 1, 2022
b9c492a
print as pointer type in C layer
WANGJIEKE Jun 1, 2022
8a1ce59
AddressLowering: Don't generate an end_borrow for store_borrow
meg-gupta May 6, 2022
f0e52db
AddressLowering: Handle opaque use in ValueMetatypeInst
meg-gupta May 12, 2022
25186ff
Use AddressMaterialization::materializeAddress instead of directly us…
meg-gupta May 13, 2022
fb0be6a
Run AddressLowering after DI and RawSILInstLowering
meg-gupta May 31, 2022
ed21300
Merge pull request #59046 from ahoppen/pr/fat-sourcekit-lsp
ahoppen Jun 1, 2022
c368d73
[stdlib] Delete unused gyb variable (#59197)
dduan Jun 1, 2022
e1bc4f1
[Build][Concurrency] Fix Concurrency build to work for Linux.
al45tair Jun 1, 2022
0895934
[docs] fix a parameter description for storeBytes
glessard Jun 1, 2022
d48c5fb
Merge pull request #59022 from skrtks/cxx_inherited_attributes
zoecarver Jun 1, 2022
c59f473
Add Script and Script Extension tests (#59194)
Azoy Jun 1, 2022
d618e50
Merge pull request #59164 from meg-gupta/addressloweringminorfixes
meg-gupta Jun 1, 2022
fb92680
add test for generated C declaration
WANGJIEKE Jun 1, 2022
962c3aa
[IRGen] Import ASTDemangler.h in both debug and non-debug
xymus Jun 1, 2022
1d1df27
Fix switch error + format
Huddie Jun 1, 2022
54ed81c
Format
Huddie Jun 1, 2022
9aea433
Add in newline
Huddie Jun 1, 2022
e7f8a99
Fix spacing
Huddie Jun 1, 2022
c4dd271
Merge pull request #59202 from xymus/fix-ndebug-getTypeForMangling
xymus Jun 1, 2022
8bcb711
Merge pull request #42447 from al45tair/eng/PR-90776105
al45tair Jun 1, 2022
9a0978a
Merge pull request #59200 from glessard/se-unaligned-loads-docs
swift-ci Jun 1, 2022
42c6ff6
[interop][SwiftToCxx] Gather initial struct layout information and em…
hyp May 27, 2022
db5119f
fix testcase to avoid -emit-ir
hyp Jun 1, 2022
53e8e7b
SILGen: Don't reference external property descriptors for @_alwaysEmi…
jckarter Jun 1, 2022
4967cd5
Merge pull request #58910 from Huddie/update-cxx-operator-impl
zoecarver Jun 2, 2022
c4ca064
Creating new test to check that a function don't throws when it shoul…
Robertorosmaninho Jun 2, 2022
27fd1bd
SILGen: Emit calls to default argument generators at the right abstra…
slavapestov Jun 2, 2022
ead6e3d
[Threading] Use raw gettid syscall for older glibc compatibility
kateinoigakukun Jun 2, 2022
d3d7f4a
[Concurrency] Fix back deploy concurrency threading.
al45tair Jun 2, 2022
b939128
Also fetch proper module name for system modules
DavidGoldman Jun 2, 2022
94c9ce6
Merge pull request #59223 from al45tair/pr/fix-bdp-threading
ahoppen Jun 2, 2022
58081c8
Merge pull request #59220 from kateinoigakukun/katei/dont-use-gettid-…
ahoppen Jun 2, 2022
b7fd963
Merge pull request #59213 from jckarter/keypath-aeic
jckarter Jun 2, 2022
35acc21
[Concurrency] Fix back deploying concurrency threading (take 2).
al45tair Jun 2, 2022
729f912
Merge pull request #59227 from al45tair/pr/fix-bd-concurrency-2
ahoppen Jun 2, 2022
6c0636b
Revert "Merge pull request #59227 from al45tair/pr/fix-bd-concurrency-2"
ahoppen Jun 2, 2022
6ad7713
Revert "Merge pull request #59220 from kateinoigakukun/katei/dont-use…
ahoppen Jun 2, 2022
935e0dd
Revert "Merge pull request #59223 from al45tair/pr/fix-bdp-threading"
ahoppen Jun 2, 2022
4aa2bbb
Revert "Merge pull request #42447 from al45tair/eng/PR-90776105"
ahoppen Jun 2, 2022
62f39fe
Merge pull request #59221 from ahoppen/pr/revert-threading-library
ahoppen Jun 2, 2022
c0b91c9
Tests: XFAIL test/stdlib/StringCreate.swift on the back deployment bo…
tshortli Jun 2, 2022
6a40690
Merge pull request #59218 from slavapestov/fix-concrete-default-argum…
slavapestov Jun 2, 2022
7282c64
Turn off templated operators aside from subscript
Huddie Jun 1, 2022
402ef5b
Moved to importFunction
Huddie Jun 1, 2022
0d7a041
Removed extra string include
Huddie Jun 1, 2022
2741944
Merge pull request #59064 from xedin/issue-59058
xedin Jun 2, 2022
198e967
Merge pull request #59207 from Huddie/update-cxx-operator-impl-templa…
zoecarver Jun 2, 2022
0ba655e
[ASTPrinter] Simplify archetype printing by visiting the interface type.
hborla Jun 2, 2022
904a2ff
Allow unavailable conformances to non-Sendaable protocols during cont…
DougGregor Jun 2, 2022
0b09d6b
Merge pull request #59228 from tshortli/xfail-string-create
tshortli Jun 2, 2022
ee312bc
Merge pull request #42190 from artemcm/AnonymousContextFullyQualified…
artemcm Jun 2, 2022
644a720
Merge pull request #59003 from xedin/rdar-92177656
xedin Jun 2, 2022
beec309
AST: Fix debug info mangling of opaque result types with @_originally…
slavapestov Jun 2, 2022
3b39af3
[capture-promotion] Add support for GEPs from captures that are load_…
gottesmm Jun 2, 2022
7c4b32f
Merge pull request #59192 from apple/rdar94175237
rxwei Jun 2, 2022
1997438
Merge pull request #59233 from hborla/archetype-printing
hborla Jun 2, 2022
3d9c72c
Merge pull request #59234 from slavapestov/opaque-result-type-debug-i…
slavapestov Jun 3, 2022
8ae4ea1
Merge pull request #59149 from WANGJIEKE/cxx-interop-inout-param
hyp Jun 3, 2022
0591246
Merge pull request #59217 from Robertorosmaninho/interop/SwiftToCXXEr…
hyp Jun 3, 2022
99116c9
Change error diagnosed for when `self` isn't available in scope (#59140)
NSAntoine Jun 3, 2022
c7eaeb0
Merge pull request #59119 from hyp/eng/swift-struct-layout-in-cxx
hyp Jun 3, 2022
344fdf8
Merge pull request #59235 from DougGregor/unavailable-non-sendable-co…
DougGregor Jun 3, 2022
ed636ba
Merge pull request #59180 from phausler/pr/addtional_clock_test_slop
ahoppen Jun 3, 2022
9c72d09
Merge pull request #59142 from Jager-yoo/fix-typo-supersede
CodaFi Jun 3, 2022
15c0ce3
Merge pull request #58932 from DavidGoldman/ignoreclangmoduleindexing
bnbarham Jun 3, 2022
7960b03
Update IRABIDetailsProvider.h
compnerd Jun 3, 2022
6a394c5
Update changelog entry for SE-0353
slavapestov Jun 3, 2022
47efc38
[lit] Support executable and non-executable tests with C++ Interop (#…
drodriguez Jun 3, 2022
464d7ec
[ast] Add a @moveOnly type attribute only available at the SIL level.
gottesmm Oct 17, 2021
c66061a
[moveOnly] Add a new SIL specific AST type called SILMoveOnly.
gottesmm Oct 18, 2021
02759d1
[move-only] Add methods to AbstractionPattern to add/remove the move …
gottesmm Jan 19, 2022
92a5dba
[move-only] Add support to SILType for unwrapping move only types and…
gottesmm Jan 21, 2022
0e2526d
[move-only] Add move only type lowering variants.
gottesmm Jan 9, 2022
a01e1b8
Merge pull request #59240 from gottesmm/pr-c0e7967be8755ca788fec8ed6c…
gottesmm Jun 3, 2022
c581497
[CSClosure] NFC: Add a test-case for rdar://92757114
xedin Jun 3, 2022
1344df3
Merge pull request #59253 from slavapestov/update-changelog-se-0353
swift-ci Jun 3, 2022
26952f7
ABI checker: include a field to indicate whether a decl is from exten…
nkcsgexi Jun 3, 2022
7bab30c
ABIChecker: diagnose moving a non-final member from a class to an ext…
nkcsgexi Jun 3, 2022
b488e07
Merge pull request #59252 from apple/compnerd/memory
compnerd Jun 3, 2022
399d5f3
Merge pull request #59258 from nkcsgexi/abi-checker-fix-extension
nkcsgexi Jun 3, 2022
ad4e2b3
Merge pull request #59208 from gottesmm/sil-move-only-type-typesystem…
gottesmm Jun 3, 2022
1099cca
Merge pull request #59238 from xedin/rdar-92757114-test
xedin Jun 3, 2022
e46b5f5
ABIChecker: for decls with @_originallyDefinedIn, use original module…
nkcsgexi Jun 4, 2022
0f0e721
Merge pull request #59269 from nkcsgexi/93615410
nkcsgexi Jun 4, 2022
570878c
Change message of `invalid_ibinspectable`, remove hardcoded `invalid_…
NSAntoine Jun 1, 2022
4cf51af
[Gardening] Fix formatting when diagnosing with attr_must_be_used_on_…
NSAntoine Jun 4, 2022
c2b7d82
Merge pull request #59198 from SerenaKit/serena/update-IBInspectable-…
swift-ci Jun 4, 2022
3b849e0
Merge pull request #59173 from compnerd/android
compnerd Jun 4, 2022
e05f68c
Change diagnostic error thrown for when string interpolations aren't …
NSAntoine Jun 4, 2022
0567a9b
ABI checker: include SPI group names in ABI descriptor files
nkcsgexi Jun 5, 2022
dfb5321
ABIChecker: add an option to avoid diagnosing about certain given SPI…
nkcsgexi Jun 5, 2022
5b77b32
Merge pull request #59273 from nkcsgexi/92032848
nkcsgexi Jun 5, 2022
0753ee4
Merge remote-tracking branch 'apple/main' into katei/merge-main-2022-…
kateinoigakukun Jun 6, 2022
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
25 changes: 12 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ _**Note:** This is in reverse chronological order, so newer entries are added to

* [SE-0346][]:

Protocols can now declare a list of one or more primary associated types:
Protocols can now declare a list of one or more _primary associated types_, which enable writing same-type requirements on those associated types using angle bracket syntax:

```swift
protocol Graph<Vertex, Edge> {
Expand All @@ -121,31 +121,30 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
}
```

A protocol-constrained type like `Graph<Int>` can now be written anywhere that
expects the right-hand side of a protocol conformance requirement:
You can now write a protocol name followed by type arguments in angle brackets, like
`Graph<Int, String>`, anywhere that a protocol conformance requirement may appear:

```swift
func shortestPath<V, E>(_: some Graph<V>, from: V, to: V) -> [E]
func shortestPath<V, E>(_: some Graph<V, E>, from: V, to: V) -> [E]

extension Graph<Int> {...}
extension Graph<Int, String> {...}

func build() -> some Graph<String> {}
func build() -> some Graph<Int, String> {}
```

A protocol-constrained type is equivalent to a conformance requirement to the protocol
itself together with a same-type requirement constraining the primary associated type.
A protocol name followed by angle brackets is shorthand for a conformance requirement,
together with a same-type requirement for the protocol's primary associated types.
The first two examples above are equivalent to the following:

```swift
func shortestPath<V, E, G>(_: G, from: V, to: V) -> [E]
where G: Graph, G.Vertex == V, G.Edge == V
where G: Graph, G.Vertex == V, G.Edge == E

extension Graph where Vertex == Int {...}
extension Graph where Vertex == Int, Edge == String {...}
```

The `build()` function returning `some Graph<String>` cannot be written using a `where`
clause; this is an example of a constrained opaque result type, which could not be written
before.
The `build()` function returning `some Graph<Int, String>` can't be written using a
`where` clause; this is an example of a constrained opaque result type, which is new expressivity in Swift 5.7.

* [SE-0353][]:

Expand Down
27 changes: 27 additions & 0 deletions cmake/caches/Runtime-Android-aarch64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "")
set(SWIFT_HOST_VARIANT_ARCH aarch64 CACHE STRING "")

# NOTE(compnerd) disable the tools, we are trying to build just the standard
# library.
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")

# NOTE(compnerd) cannot build tests since the tests require the toolchain
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")

# NOTE(compnerd) cannot build docs since that requires perl
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")

set(SWIFT_SDK_ANDROID_ARCHITECTURES aarch64 CACHE STRING "")

# NOTE(compnerd) this is lollipop, which seems to still have decent usage.
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "")
# NOTE(compnerd) this matches the value from the NDK r24.
set(SWIFT_ANDROID_NDK_CLANG_VERSION 14.0.1 CACHE STRING "" FORCE)
28 changes: 28 additions & 0 deletions cmake/caches/Runtime-Android-armv7.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "")
set(SWIFT_HOST_VARIANT_ARCH armv7 CACHE STRING "")

# NOTE(compnerd) disable the tools, we are trying to build just the standard
# library.
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")

# NOTE(compnerd) cannot build tests since the tests require the toolchain
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")

# NOTE(compnerd) cannot build docs since that requires perl
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")

set(SWIFT_SDK_ANDROID_ARCHITECTURES armv7 CACHE STRING "")

# NOTE(compnerd) this is lollipop, which seems to still have decent usage.
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "")
# NOTE(compnerd) this matches the value from the NDK r24.
set(SWIFT_ANDROID_NDK_CLANG_VERSION 14.0.1 CACHE STRING "" FORCE)

3 changes: 3 additions & 0 deletions include/swift/ABI/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -2839,6 +2839,9 @@ struct TargetAnonymousContextDescriptor final
};
using AnonymousContextDescriptor = TargetAnonymousContextDescriptor<InProcess>;

template<template <typename Runtime> class ObjCInteropKind, unsigned PointerSize>
using ExternalAnonymousContextDescriptor = TargetAnonymousContextDescriptor<External<ObjCInteropKind<RuntimeTarget<PointerSize>>>>;

/// A protocol descriptor.
///
/// Protocol descriptors contain information about the contents of a protocol:
Expand Down
16 changes: 15 additions & 1 deletion include/swift/APIDigester/ModuleAnalyzerNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace api {
///
/// When the json format changes in a way that requires version-specific handling, this number should be incremented.
/// This ensures we could have backward compatibility so that version changes in the format won't stop the checker from working.
const uint8_t DIGESTER_JSON_VERSION = 7; // push SDKNodeRoot to lower-level
const uint8_t DIGESTER_JSON_VERSION = 8; // add isFromExtension
const uint8_t DIGESTER_JSON_DEFAULT_VERSION = 0; // Use this version number for files before we have a version number in json.
const StringRef ABIRootKey = "ABIRoot";
const StringRef ConstValuesKey = "ConstValues";
Expand Down Expand Up @@ -161,6 +161,7 @@ struct CheckerOptions {
bool Migrator;
StringRef LocationFilter;
std::vector<std::string> ToolArgs;
llvm::StringSet<> SPIGroupNamesToIgnore;
};

class SDKContext {
Expand Down Expand Up @@ -346,6 +347,7 @@ class SDKNodeDecl: public SDKNode {
StringRef Location;
StringRef ModuleName;
std::vector<DeclAttrKind> DeclAttributes;
std::vector<StringRef> SPIGroups;
bool IsImplicit;
bool IsStatic;
bool IsDeprecated;
Expand All @@ -354,6 +356,7 @@ class SDKNodeDecl: public SDKNode {
bool IsOpen;
bool IsInternal;
bool IsABIPlaceholder;
bool IsFromExtension;
uint8_t ReferenceOwnership;
StringRef GenericSig;
// In ABI mode, this field is populated as a user-friendly version of GenericSig.
Expand All @@ -372,6 +375,7 @@ class SDKNodeDecl: public SDKNode {
StringRef getModuleName() const {return ModuleName;}
StringRef getHeaderName() const;
ArrayRef<DeclAttrKind> getDeclAttributes() const;
ArrayRef<StringRef> getSPIGroups() const { return SPIGroups; }
bool hasAttributeChange(const SDKNodeDecl &Another) const;
swift::ReferenceOwnership getReferenceOwnership() const {
return swift::ReferenceOwnership(ReferenceOwnership);
Expand All @@ -392,6 +396,7 @@ class SDKNodeDecl: public SDKNode {
bool isOpen() const { return IsOpen; }
bool isInternal() const { return IsInternal; }
bool isABIPlaceholder() const { return IsABIPlaceholder; }
bool isFromExtension() const { return IsFromExtension; }
StringRef getGenericSignature() const { return GenericSig; }
StringRef getSugaredGenericSignature() const { return SugaredGenericSig; }
StringRef getScreenInfo() const;
Expand All @@ -413,6 +418,12 @@ class SDKNodeDecl: public SDKNode {
if (isObjc())
return;
}
// Don't emit SPIs if the group name is out-out.
for (auto spi: getSPIGroups()) {
if (Ctx.getOpts().SPIGroupNamesToIgnore.contains(spi)) {
return;
}
}
Ctx.getDiags(Loc).diagnose(Loc, ID, getScreenInfo(), std::move(Args)...);
}
};
Expand Down Expand Up @@ -710,6 +721,7 @@ class SDKNodeDeclConstructor: public SDKNodeDeclAbstractFunc {
void jsonize(json::Output &Out) override;
};

// Note: Accessor doesn't have Parent pointer.
class SDKNodeDeclAccessor: public SDKNodeDeclAbstractFunc {
SDKNodeDecl *Owner;
AccessorKind AccKind;
Expand Down Expand Up @@ -828,6 +840,8 @@ int findDeclUsr(StringRef dumpPath, CheckerOptions Opts);

void nodeSetDifference(ArrayRef<SDKNode*> Left, ArrayRef<SDKNode*> Right,
NodeVector &LeftMinusRight, NodeVector &RightMinusLeft);

bool hasValidParentPtr(SDKNodeKind kind);
} // end of abi namespace
} // end of ide namespace
} // end of Swift namespace
Expand Down
20 changes: 16 additions & 4 deletions include/swift/AST/ASTMangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ASTMangler : public Mangler {

/// If enabled, non-canonical types are allowed and type alias types get a
/// special mangling.
bool DWARFMangling;
bool DWARFMangling = false;

/// If enabled, entities that ought to have names but don't get a placeholder.
///
Expand Down Expand Up @@ -72,6 +72,12 @@ class ASTMangler : public Mangler {
/// function types.
bool Preconcurrency = false;

/// If enabled, declarations annotated with @_originallyDefinedIn are mangled
/// as if they're part of their original module. Disabled for debug mangling,
/// because lldb wants to find declarations in the modules they're currently
/// defined in.
bool RespectOriginallyDefinedIn = true;

public:
using SymbolicReferent = llvm::PointerUnion<const NominalTypeDecl *,
const OpaqueTypeDecl *>;
Expand Down Expand Up @@ -110,8 +116,13 @@ class ASTMangler : public Mangler {
BackDeploymentFallback,
};

ASTMangler(bool DWARFMangling = false)
: DWARFMangling(DWARFMangling) {}
/// lldb overrides the defaulted argument to 'true'.
ASTMangler(bool DWARFMangling = false) {
if (DWARFMangling) {
DWARFMangling = true;
RespectOriginallyDefinedIn = false;
}
}

void addTypeSubstitution(Type type, GenericSignature sig) {
type = dropProtocolsFromAssociatedTypes(type, sig);
Expand Down Expand Up @@ -286,7 +297,8 @@ class ASTMangler : public Mangler {

std::string mangleTypeAsContextUSR(const NominalTypeDecl *type);

std::string mangleAnyDecl(const ValueDecl *Decl, bool prefix);
std::string mangleAnyDecl(const ValueDecl *Decl, bool prefix,
bool respectOriginallyDefinedIn = false);
std::string mangleDeclAsUSR(const ValueDecl *Decl, StringRef USRPrefix);

std::string mangleAccessorEntityAsUSR(AccessorKind kind,
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/Attr.def
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ TYPE_ATTR(yields)
TYPE_ATTR(yield_once)
TYPE_ATTR(yield_many)
TYPE_ATTR(captures_generics)
// Used at the SIL level to mark a type as moveOnly.
TYPE_ATTR(moveOnly)

// SIL metatype attributes.
TYPE_ATTR(thin)
Expand Down
25 changes: 23 additions & 2 deletions include/swift/AST/Attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,8 @@ class SPIAccessControlAttr final : public DeclAttribute,
SourceRange range,
ArrayRef<Identifier> spiGroups);

SPIAccessControlAttr *clone(ASTContext &C, bool implicit) const;

/// Name of SPIs declared by the attribute.
///
/// Note: A single SPI name per attribute is currently supported but this
Expand Down Expand Up @@ -1269,6 +1271,13 @@ class EffectsAttr : public DeclAttribute {
static bool classof(const DeclAttribute *DA) {
return DA->getKind() == DAK_Effects;
}

EffectsAttr *clone(ASTContext &ctx) const {
if (getKind() == EffectsKind::Custom) {
return new (ctx) EffectsAttr(customString);
}
return new (ctx) EffectsAttr(getKind());
}
};


Expand Down Expand Up @@ -1712,12 +1721,15 @@ class ProjectedValuePropertyAttr : public DeclAttribute {
}
};

/// Describe a symbol was originally defined in another module. For example, given
/// Describes a symbol that was originally defined in another module. For
/// example, given the following declaration:
///
/// \code
/// @_originallyDefinedIn(module: "Original", OSX 10.15) var foo: Int
/// \endcode
///
/// Where variable Foo has originally defined in another module called Original prior to OSX 10.15
/// The variable \p foo was originally defined in another module called
/// \p Original prior to OSX 10.15
class OriginallyDefinedInAttr: public DeclAttribute {
public:
OriginallyDefinedInAttr(SourceLoc AtLoc, SourceRange Range,
Expand All @@ -1730,6 +1742,8 @@ class OriginallyDefinedInAttr: public DeclAttribute {
Platform(Platform),
MovedVersion(MovedVersion) {}

OriginallyDefinedInAttr *clone(ASTContext &C, bool implicit) const;

// The original module name.
const StringRef OriginalModuleName;

Expand Down Expand Up @@ -2303,6 +2317,13 @@ class DeclAttributes {
DeclAttrs = Attr;
}

/// Add multiple constructed DeclAttributes to this list.
void add(DeclAttributes &Attrs) {
for (auto attr : Attrs) {
add(attr);
}
}

// Iterator interface over DeclAttribute objects.
class iterator : public iterator_base<DeclAttribute, iterator> {
public:
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/DiagnosticsModuleDiffer.def
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ ERROR(type_witness_change,APIDigesterBreakage,"%0 has type witness type for %1 c

ERROR(decl_new_witness_table_entry,APIDigesterBreakage,"%0 now requires%select{| no}1 new witness table entry", (StringRef, bool))

ERROR(class_member_moved_to_extension,APIDigesterBreakage,"Non-final class member %0 is moved to extension", (StringRef))

WARNING(new_decl_without_intro,APIDigesterBreakage,"%0 is a new API without @available attribute", (StringRef))

ERROR(objc_name_change,APIDigesterBreakage,"%0 has ObjC name change from %1 to %2", (StringRef, StringRef, StringRef))
Expand Down
5 changes: 5 additions & 0 deletions include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,11 @@ ERROR(expected_type_after_as,none,
ERROR(string_interpolation_extra,none,
"extra tokens after interpolated string expression", ())

// String interpolation isnt closed by a )
// ie: `let west = "ye \("`
ERROR(string_interpolation_unclosed, none,
"cannot find ')' to match opening '(' in string interpolation", ())

// Interpolations with parameter labels or multiple values
WARNING(string_interpolation_list_changing,none,
"interpolating multiple values will not form a tuple in Swift 5", ())
Expand Down
13 changes: 7 additions & 6 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ ERROR(cannot_find_in_scope,none,
ERROR(cannot_find_in_scope_corrected,none,
"cannot %select{find|find operator}1 %0 in scope; did you mean '%2'?",
(DeclNameRef, bool, StringRef))
ERROR(cannot_find_self_in_scope,none,
"cannot find 'self' in scope; did you mean to use it in a type or extension context?", ())
NOTE(confusable_character,none,
"%select{identifier|operator}0 '%1' contains possibly confused characters; "
"did you mean to use '%2'?",
Expand Down Expand Up @@ -1406,8 +1408,6 @@ ERROR(transparent_in_protocols_not_supported,none,
ERROR(transparent_in_classes_not_supported,none,
"'@_transparent' attribute is not supported on declarations within classes", ())

ERROR(invalid_iboutlet,none,
"only instance properties can be declared @IBOutlet", ())
ERROR(iboutlet_nonobjc_class,none,
"@IBOutlet property cannot %select{have|be an array of}0 "
"non-'@objc' class type %1", (bool, Type))
Expand All @@ -1429,8 +1429,8 @@ NOTE(note_make_implicitly_unwrapped_optional,none,
ERROR(invalid_ibdesignable_extension,none,
"@IBDesignable can only be applied to classes and extensions "
"of classes", ())
ERROR(invalid_ibinspectable,none,
"only instance properties can be declared @%0", (StringRef))
ERROR(attr_must_be_used_on_class_instance,none,
"only class instance properties can be declared @%0", (StringRef))
ERROR(invalid_ibaction_decl,none,
"only instance methods can be declared @%0", (StringRef))
ERROR(invalid_ibaction_result,none,
Expand Down Expand Up @@ -3748,8 +3748,6 @@ ERROR(protocol_declares_unknown_primary_assoc_type,none,
(Identifier, Type))
ERROR(protocol_declares_duplicate_primary_assoc_type,none,
"duplicate primary associated type name %0", (Identifier))
ERROR(parameterized_protocol_not_supported,none,
"protocol type with type arguments can only be used as a generic constraint", ())
ERROR(protocol_does_not_have_primary_assoc_type,none,
"cannot specialize protocol type %0", (Type))
ERROR(parameterized_protocol_type_argument_count_mismatch,none,
Expand Down Expand Up @@ -5490,6 +5488,9 @@ NOTE(type_eraser_init_not_accessible,none,
"cannot have more restrictive access than protocol %1 "
"(which is %select{private|fileprivate|internal|public|open}2)",
(AccessLevel, Type, AccessLevel))
NOTE(type_eraser_init_spi,none,
"'init(erasing:)' is SPI, but protocol %0 is not"
"%select{| in the same SPI groups as 'init(erasing:)'}1", (Type, bool))

//------------------------------------------------------------------------------
// MARK: @available
Expand Down
Loading