Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
260 commits
Select commit Hold shift + click to select a range
e3fbad5
[SILGen] Forward addr self to borrow accessors.
nate-chandler Jun 8, 2024
128a8bc
[Concurrency] Don't ignore mismatching isolation for overrides of
hborla Jun 8, 2024
382a8e7
Merge pull request #74237 from hborla/override-isolation
hborla Jun 9, 2024
d1ae73f
Handle flow-sensitive `#isolation` in distributed actor initializers.
DougGregor Jun 10, 2024
cd0b3f0
[docs] Remove line in Task docs that is an error in Swift 6 mode
ktoso Jun 10, 2024
d8cba03
[docs] remove swift style code highlighting on non-swift snippet
ktoso Jun 10, 2024
0135623
[docs] fix typo in type name in code snippet
ktoso Jun 10, 2024
25830d6
Merge pull request #74225 from DougGregor/flow-sensitive-actor-init-i…
DougGregor Jun 10, 2024
ab34a6d
[Completion] Check for callback rather than result of ResolveMacroReq…
hamishknight Jun 10, 2024
98ba978
[Completion] Handle inherited protocols in `isExtensionWithSelfBound`
hamishknight Jun 10, 2024
f245ecf
[TaskGroup] Fix typo in code snippet
ktoso Jun 10, 2024
53861a4
[cxx-interop] Avoid emitting methods that cause name clash
Jun 10, 2024
064a7dd
Address review comments.
Jun 10, 2024
005b45c
[Sema] Diagnose deprecated default implementations in the witness che…
hborla Jun 10, 2024
5da7ac6
[NFC] Use `DeclAttributes::isDeprecated` in a few more places.
hborla Jun 10, 2024
2200632
SILGen: ignore unreachable var decls
eeckstein Jun 10, 2024
a3e3079
[docs] Suggest `--skip-xros` in the Getting Started guide
egorzhdan Jun 10, 2024
20f0353
Merge pull request #74223 from jckarter/borrowing-switch-language-fea…
jckarter Jun 10, 2024
e3a53ab
Don't use aarch64 hint for arm targets
Azoy Jun 10, 2024
717880e
PerformanceDiagnostics: avoid false meta-data alarms for non-loadable…
eeckstein Jun 10, 2024
0f420fe
[cxx-interop] Only run tests for reference types against a recent Swi…
egorzhdan Jun 10, 2024
1bb335d
Merge pull request #74212 from hjyamauchi/crosscompile
hjyamauchi Jun 10, 2024
a2b2087
Merge pull request #74198 from nate-chandler/rdar128900124
nate-chandler Jun 10, 2024
0351ecd
Merge pull request #74196 from nate-chandler/lifetime-completion/2024…
nate-chandler Jun 10, 2024
4a49e65
[Sema] NFC: Replace a couple of closure parameters with ASTContext
hamishknight Jun 10, 2024
fe272e6
[Sema] Restore 5.10 implicit self behavior prior to Swift 6 mode
hamishknight Jun 10, 2024
9769418
Better message diagnostics for inout `@escaping` closure
iMostfa Jun 9, 2024
1ba18a0
Merge pull request #74250 from apple/gaborh/enum-element-method-name-…
Xazax-hun Jun 10, 2024
d430573
Merge pull request #74256 from eeckstein/fix-unreachable-vardecl
eeckstein Jun 10, 2024
cab0eee
[embedded] Expand ABI docs on C/C++ interop
kubamracek Jun 10, 2024
9a4bc35
Merge pull request #74257 from apple/egorzhdan/docs-skip-xros
egorzhdan Jun 10, 2024
772e066
[embedded] Add 'sorting strings' to the list of ops that need Unicode…
kubamracek Jun 10, 2024
5e1721d
[embedded] Make Mirror present but unavailable
kubamracek May 24, 2024
09d025b
Merge pull request #74258 from Azoy/synchronization-arm-hints
Azoy Jun 10, 2024
7743741
Merge pull request #74235 from nate-chandler/rdar127115078
nate-chandler Jun 10, 2024
03e0cfd
Run moveonly checker + TSAN tests in a separate file.
jckarter Jun 10, 2024
1407980
Don't pass foundation build path to swift-driver/swift-package-manage…
jmschonfeld Jun 10, 2024
bc147ae
Merge pull request #73944 from kubamracek/embedded-docs5
kubamracek Jun 10, 2024
7047809
Merge pull request #73961 from kubamracek/embedded-docs6
kubamracek Jun 11, 2024
8ead724
Merge pull request #74244 from hborla/deprecated-default-implementation
hborla Jun 11, 2024
bfbceb8
Merge pull request #74246 from ktoso/wip-docs
ktoso Jun 11, 2024
6a11171
[ModuleInterface] Save `-public-autolink-library` module option
kateinoigakukun Jun 11, 2024
8848a52
[Concurrency] CaseIterable synthesized allCases must be nonisolated
ktoso Jun 10, 2024
8dec8f6
Merge pull request #74259 from eeckstein/fix-fixed-abi-runtime-effects
eeckstein Jun 11, 2024
6329eef
Merge pull request #74254 from ktoso/wip-caseiterable-isolation
ktoso Jun 11, 2024
51d817c
Merge pull request #74242 from iMostfa/feature/SR-9615-escaping-and-i…
xedin Jun 11, 2024
12f402f
Revert "[AutoDiff] Fix custom derivative thunk for Optional (#71721)"…
MaxDesiatov Jun 11, 2024
04db12f
Merge pull request #74248 from hamishknight/macrotype
hamishknight Jun 11, 2024
592462b
Merge pull request #74260 from hamishknight/another-implicit-self-fix
hamishknight Jun 11, 2024
353f060
[cxx-interop] Fix unavailable generics triggering compilation error
Jun 11, 2024
876c056
Merge pull request #74261 from apple/egorzhdan/old-runtime-test
egorzhdan Jun 11, 2024
0211fd7
AST: Make absence of discriminator into a fatal error
slavapestov Jun 5, 2024
02e3b5a
Sema: Remove unused variable
slavapestov Jun 10, 2024
322ce5a
SIL: Consistently drop substitution map when forming apply instructions
slavapestov Jun 10, 2024
210ded1
Merge pull request #74270 from jckarter/move-only-tsan-test-require
jckarter Jun 11, 2024
dc131ee
Frontend: share the module cache path with clang
compnerd Jun 11, 2024
c2d6039
Merge pull request #74287 from apple/gaborh/unavailable-generics
Xazax-hun Jun 11, 2024
b86fe88
[Runtime] Fix key argument indexing when checking invertible protocols.
mikeash Jun 10, 2024
5dbf31a
Merge pull request #74266 from slavapestov/fix-rdar129298104
slavapestov Jun 11, 2024
c145591
Add dependsOn(immortal)
meg-gupta Jun 6, 2024
7ccd2ad
Revert "Update to ensure downgradeToWarning doesn't get reset"
nkcsgexi Jun 11, 2024
6f5b405
Revert "Handle package exportability."
nkcsgexi Jun 11, 2024
89b6f91
IRGen: Use static alloca for builtin stackAlloc when possible
aschwaighofer Jun 11, 2024
71ec06e
Cache visible Clang modules for interface printing in 'ModuleDecl'
artemcm Jun 11, 2024
d98cb9e
[Mangler] Mangle function type for invalid enum element
hamishknight Jun 11, 2024
34d9b6c
Revert "Sema: Report references to missing imports from package exten…
nkcsgexi Jun 11, 2024
c09dbce
Merge pull request #74297 from compnerd/cache-path
compnerd Jun 11, 2024
f97134c
Merge pull request #73873 from kubamracek/embedded-mirror-unavailable
kubamracek Jun 11, 2024
1a06ddc
Bump the DWARF version number to 5 on Darwin.
adrian-prantl Jun 11, 2024
2d70de8
[IRGen] Assert on retaining noncopyable.
nate-chandler Jun 11, 2024
38db63c
[NFC] ClosureSpecializer: Use llvm::enumerate.
nate-chandler Jun 11, 2024
55eb29a
[Gardening] Detypo'd.
nate-chandler Jun 11, 2024
ac5ae3c
[ClosureSpecializer] Bail on noncopyable argument.
nate-chandler Jun 11, 2024
d895c34
[Test] Add regression test.
nate-chandler Jun 11, 2024
f1a8875
Merge pull request #74195 from meg-gupta/immortal
meg-gupta Jun 11, 2024
414295d
[AST] `@preconcurrency` conformance applies to implied conformances a…
xedin Jun 11, 2024
8428b36
Merge pull request #74277 from kateinoigakukun/katei/save-public-auto…
kateinoigakukun Jun 11, 2024
b5b637c
[NFC] SIL: Renamed helper.
nate-chandler Jun 11, 2024
78c1837
[NFC] SIL: Extracted has "any" move-only wrapping.
nate-chandler Jun 11, 2024
f39b70a
[NFC] SIL: Extracted remove "any" m-o wrapping.
nate-chandler Jun 11, 2024
fed3cb8
[NFC] SIL: Expose undef values.
nate-chandler Jun 11, 2024
a69a1a2
[update-checkout] Also update swift-collections on release/6.0
lorentey Jun 11, 2024
8883e88
[NFC] MOWTE: Deduplicated code.
nate-chandler Jun 11, 2024
d0341dd
[NFC] MOWTE: Deleted dead array.
nate-chandler Jun 11, 2024
69fa1ae
[MOWTE] Start madeChange at false.
nate-chandler Jun 11, 2024
5d63fcf
[MOWTE] Visit undef values.
nate-chandler Jun 11, 2024
bcdcdf1
Merge pull request #74302 from nkcsgexi/revert-pkg-export
nkcsgexi Jun 12, 2024
562e724
[Test] Add regression test.
nate-chandler Jun 12, 2024
155773c
Fix renaming enum case parameters with unnamed associated arguments
ahoppen Jun 9, 2024
fe66c47
[docs] Provide more documentation on custom executors with global actors
ktoso Jun 12, 2024
43ce060
Merge pull request #74309 from nate-chandler/rdar129622373
nate-chandler Jun 12, 2024
4bae14a
[Distributed] Improve erroring out when distributed types not found
ktoso Jun 11, 2024
f035590
[region-isolation] Dont crash when processing global actor isolated i…
gottesmm Jun 12, 2024
8b00478
[SwiftCompilerSources] Remove unnecessary default case from Serialize…
elsh Jun 12, 2024
689e889
Merge pull request #74318 from nate-chandler/gh72615
nate-chandler Jun 12, 2024
b5dc349
[Distributed] Typed throws for whenLocal: func must be @_AEIC
ktoso Jun 12, 2024
3b95855
[Distributed] Reword docs since we no longer have ad-hoc requirements
ktoso Jun 12, 2024
8a88569
[Distributed] remoteCallVoid is a new requirement in Swift 6.0
ktoso Jun 12, 2024
28af977
Merge pull request #74284 from ktoso/wip-minor-improved-erroringout
ktoso Jun 12, 2024
88d420f
Merge pull request #74321 from gottesmm/pr-5b09ff36784666ef5fde4abfcf…
gottesmm Jun 12, 2024
85c0555
Merge pull request #74288 from hamishknight/invalid-enum-mangle
hamishknight Jun 12, 2024
d80813e
SIL: update borrowed-from instructions when cloning a basic block
eeckstein Jun 12, 2024
3aca85b
Merge pull request #74298 from nate-chandler/rdar129593468
nate-chandler Jun 12, 2024
3dfeb5f
Merge pull request #74307 from artemcm/CacheVisibleClangModulesInModules
artemcm Jun 12, 2024
3dd4198
[Windows] Prepare for swift-foundation in the toolchain (#74127)
jmschonfeld Jun 12, 2024
ae1f804
[cxx-interop] Fix extra indirection when exporting CFData arguments/r…
Jun 12, 2024
c270597
SIL: Fix false positive in FlowIsolation with DynamicSelfType usage
slavapestov Jun 12, 2024
c9e2e8e
[Test] Add regression test.
nate-chandler Jun 12, 2024
2039b8d
[cxx-interop] import static operator call from C++23 as member callAs…
hyp Jun 11, 2024
13ecb51
embedded: add swift_dynamicCastClass runtime function
eeckstein Jun 12, 2024
98b74d8
[android] do not import stdatomic from android's libc++
hyp Jun 12, 2024
f53be71
ModuleInterface: Print imports shadowed by a cross-import overlay
xymus Jun 11, 2024
bba8b92
Finalize Swift debug info before running Clang codegen, because it ma…
adrian-prantl Jun 12, 2024
045c214
[docs] Add a little section about Disabling PCH Verification.
gottesmm Jun 12, 2024
17b8e86
Sema: Support newer import restrictions with cross-import overlays
xymus Jun 11, 2024
e871cea
[embedded] Respect float arg lowering convention under -mfloat-abi=hard
kubamracek Jun 12, 2024
09a1f0b
[CS] NFC: Factor out `includingParentApply`
hamishknight Jun 12, 2024
7c7e914
[Completion] Skip `tryOptimizeGenericDisjunction` if there's a comple…
hamishknight Jun 12, 2024
b7b93a1
Merge pull request #74329 from eeckstein/fix-block-cloning
eeckstein Jun 12, 2024
1eed24a
Merge pull request #74267 from mikeash/invertible-protocol-checking-k…
mikeash Jun 12, 2024
29ee0ed
[Gardening] Clarified documentation.
nate-chandler Jun 12, 2024
cc40e29
[ConsumeAddrChecker] Diagnose consumes of borrows.
nate-chandler Jun 12, 2024
3889ede
Merge pull request #74342 from slavapestov/flow-analysis-self-metatyp…
slavapestov Jun 12, 2024
b1c7999
[Test] Add regression test.
nate-chandler Jun 12, 2024
910d717
Merge pull request #73656 from lorentey/update-swift-system
lorentey Jun 12, 2024
1ef8d5c
Merge pull request #74350 from gottesmm/pr-14492224ffefe9f5bf2798bb31…
gottesmm Jun 12, 2024
ec4a125
NCGenerics: ext's might not infer invertible req's
kavon Jun 6, 2024
2893e3d
Sema: reword inverse-on-extension message
kavon Jun 11, 2024
a1e14ae
Sema: ext's must add solo invertible conformances
kavon Jun 12, 2024
f5d15f4
Merge pull request #74241 from ahoppen/enum-case-rename
ahoppen Jun 12, 2024
67694c2
Sema: Report public conformances to non-publicly imported protocols
xymus May 31, 2024
9c868f8
Merge pull request #74351 from xymus/cross-import-hidden-imports
xymus Jun 12, 2024
c652647
Treat references to enum cases with associated values as `@Sendable` …
DougGregor Jun 12, 2024
bd472b1
[region-isolation] Make store_borrow a store operation that does not …
gottesmm Jun 4, 2024
89c3804
Merge pull request #73654 from lorentey/update-swift-collections
lorentey Jun 12, 2024
f9b3a62
[Test] Narrow the 'ScanDependencies/module_deps_link_libs.swift' test…
artemcm Jun 12, 2024
5e18474
Merge pull request #74279 from hyp/eng/oh-no-msvc-how-can-you-adopt-c…
hyp Jun 12, 2024
e431216
Merge pull request #74343 from nate-chandler/gh73525
nate-chandler Jun 12, 2024
c5a77fc
Add a proper `TaskGroup.Iterator.next(isolation:)`
DougGregor Jun 12, 2024
1c9b178
[sending] Do not let protocol function reqs with a sending result be …
gottesmm Jun 4, 2024
3c166b5
[sending] Implement non-protocol function subtyping rules.
gottesmm Jun 4, 2024
83bcf23
[sending] Check for a nullptr in AssociatedTypeInference when calling…
gottesmm Jun 5, 2024
ba6c8af
Simplify test to only use target-typecheck-verify-swift since we are …
gottesmm Jun 6, 2024
2ac874e
[sending] Fix a few bugs around closure inference of sending paramete…
gottesmm Jun 6, 2024
4d99192
Remove new whenLocal func from ABI test - it is always emit into client
ktoso Jun 12, 2024
5a1c268
Add test for ThrowingTaskGroup version
DougGregor Jun 12, 2024
81100ad
[sending] Fix type inference for sending results of closures.
gottesmm Jun 12, 2024
2735492
AST: fix `isWrittenWithConstraints`
kavon Jun 13, 2024
bb4c0d3
MoveOnlyAddressChecker: Turn assertion into early exit.
jckarter Jun 13, 2024
6d15e41
Merge pull request #74123 from gottesmm/pr-9e8378fdeee3204a34f48ea8d2…
gottesmm Jun 13, 2024
3837bb3
Merge pull request #74365 from artemcm/NarrowerLinkLibsScanDepsTest
artemcm Jun 13, 2024
6694bba
Merge pull request #74360 from nate-chandler/rdar127518559
nate-chandler Jun 13, 2024
a83269e
Merge pull request #74361 from nate-chandler/gh69252
nate-chandler Jun 13, 2024
9eba052
Merge pull request #74322 from kavon/se427-noimplicit-for-invertible
kavon Jun 13, 2024
b803cb1
Merge pull request #74325 from apple/elsh/remove-default-case
elsh Jun 13, 2024
6debc33
Merge pull request #74332 from eeckstein/swift_dynamiccastclass
eeckstein Jun 13, 2024
a451fe6
Fix a test
gottesmm Jun 13, 2024
49e8a73
Adjust Synchronization module dependencies for macCatalyst
Azoy Jun 13, 2024
de9aefc
Merge pull request #74330 from apple/gaborh/core-foundation-types
Xazax-hun Jun 13, 2024
71eb55a
Properly handle `@objc` thunks for generic classes and actors
rjmccall Jun 13, 2024
4517333
Merge pull request #74372 from kavon/rdar125659789
kavon Jun 13, 2024
dbdd983
[cxx-interop] Fix generated declaration order
Jun 13, 2024
a49eb8e
Merge pull request #74348 from hyp/eng/android-stdatomiccxx23
hyp Jun 13, 2024
79f111a
Merge pull request #74381 from Azoy/synchronization-build-stuff
Azoy Jun 13, 2024
fb307ff
Merge pull request #74349 from adrian-prantl/128309024
adrian-prantl Jun 13, 2024
f564732
Merge pull request #74374 from jckarter/dead-before-live-def-block-as…
jckarter Jun 13, 2024
c20ef6d
Remove RemoteInspection code to fetch no-longer-used reflection metadata
tbkka Jun 13, 2024
dd0831f
Merge pull request #74375 from rjmccall/generic-objc-thunks
rjmccall Jun 13, 2024
0f4dacd
[AutoDiff] Fix custom derivative thunk for Optional (#74378)
asl Jun 13, 2024
e221532
Sema: track use in API of declaring and bystanders for cross-import o…
xymus Jun 13, 2024
b99b6af
Merge pull request #74310 from adrian-prantl/darwin-dwarf5
adrian-prantl Jun 13, 2024
9b04241
utils: support VS Build Tools for building the SDKs
compnerd Jun 13, 2024
c0c28c4
Merge pull request #74384 from apple/gaborh/print-decl-order
Xazax-hun Jun 13, 2024
95e12ca
Don't apply `@Sendable` to enum cases in pattern matching
DougGregor Jun 13, 2024
e4ed330
NFC: simplify test and add assertion
kavon Jun 13, 2024
8a18179
[Parseable Output] Make Emit-Module tasks indicate their name accordi…
artemcm Jun 13, 2024
53b7b4a
Update API test for new addition
DougGregor Jun 13, 2024
470bdc6
Provide property source locations for `@_documentation`.
DougGregor Jun 13, 2024
41ee82a
[SwiftCompilerSources] Remove warning: add unknown default case for b…
elsh Jun 13, 2024
9793f77
AST: New mangling for expansion locations to avoid request cycles
slavapestov Jun 6, 2024
75bd5a5
Merge pull request #74398 from xymus/cross-import-public-api-use
xymus Jun 13, 2024
3a7b993
Merge pull request #74362 from DougGregor/enum-case-sendable-fn
DougGregor Jun 13, 2024
915b1e3
Sema: Update more tests with more precise message about exported conf…
xymus Jun 5, 2024
e5bc35b
Tests: Temporarly disable checks from reverted exportability checking
xymus Jun 12, 2024
8be6286
Merge pull request #74368 from DougGregor/task-group-iterator-next-is…
DougGregor Jun 13, 2024
b593062
Merge pull request #74315 from xedin/rdar-129599097
xedin Jun 13, 2024
d4564e4
[stdlib] Define availability for SwiftStdlib 6.0
lorentey Jun 12, 2024
a1708ef
Merge pull request #74394 from tbkka/tbkka-remotemirror-no-more-mpe-m…
tbkka Jun 13, 2024
6ca531c
Merge pull request #74404 from DougGregor/documentation-macro-attr-loc
DougGregor Jun 14, 2024
810a98c
Teach "find imports" to equate overlay modules with their underlying …
DougGregor Jun 14, 2024
ad3d3ad
[benchmark] Update/fix availability checks
lorentey Jun 12, 2024
30f121d
[AST] Define runtime version 6.0
lorentey Jun 12, 2024
d5b79be
[stdlib] Define placeholder availability for SwiftStdlib 6.1
lorentey Jun 12, 2024
2840441
[AST] Define placeholder availability for the 6.1 runtime
lorentey Jun 12, 2024
5e95c6e
[stdlib] Define _StdlibVersion.v6_1_0 and set it as the current version
lorentey Jun 12, 2024
e563f66
[AST] Update availability of features targeting 6.0
lorentey Jun 13, 2024
5b9e498
[test] Update availability tests
lorentey Jun 14, 2024
4b374cd
Merge pull request #74400 from kavon/rdar125659789-nfcs
kavon Jun 14, 2024
4dc0603
Merge pull request #74142 from xymus/access-level-conformances
xymus Jun 14, 2024
eed48dc
Merge pull request #74412 from DougGregor/preconcurrency-import-under…
DougGregor Jun 14, 2024
16d0194
[sending] Improve the sending mismatch errors and make them warnings …
gottesmm Jun 13, 2024
b14563f
Merge pull request #74201 from slavapestov/macro-expansion-mangling
slavapestov Jun 14, 2024
0cf67e4
Merge pull request #74319 from ktoso/wip-global-custom-exec-docs
ktoso Jun 14, 2024
2f27865
Merge pull request #74366 from lorentey/define-availability-for-6.0
lorentey Jun 14, 2024
a9d3df0
Merge pull request #74352 from hamishknight/complete-disjunction
hamishknight Jun 14, 2024
0a734c2
[PackageCMO] Global var and accessor linkage should be kept private/h…
elsh Jun 14, 2024
9659601
Merge pull request #74324 from ktoso/wip-whenLocal-inlinable
ktoso Jun 14, 2024
3104e3f
[AST] Fix CaseStmt's `getStartLoc`
hamishknight Jun 14, 2024
a8c7261
[ASTDumper] Avoid parsing decl members
hamishknight Jun 14, 2024
532535f
SIL: enable some SIL linkage related asserts in release builds
eeckstein Jun 14, 2024
35017db
ArrayPropertyOpt: update borrowed-from instructions
eeckstein Jun 14, 2024
19557cd
Merge pull request #74304 from aschwaighofer/use_static_alloca_for_st…
aschwaighofer Jun 14, 2024
2ec717b
[Concurrency] TaskExecutor ownership fixes (#74000)
ktoso Jun 14, 2024
c42ecb0
[Distributed] Remove "Stdlib" in macro as it is not understood in use…
ktoso Jun 14, 2024
17eef27
Merge pull request #74354 from kubamracek/embedded-float-abi-hard
kubamracek Jun 14, 2024
64962dc
Merge pull request #74419 from eeckstein/release-asserts
eeckstein Jun 14, 2024
8528951
Merge pull request #74401 from artemcm/EmitModuleParsableOutput
artemcm Jun 14, 2024
5b9e5a2
Merge pull request #74397 from compnerd/buildtools
compnerd Jun 14, 2024
c8d9e18
[sending] Make the protocol errors only occur in swift 6.
gottesmm Jun 14, 2024
22e75e0
Merge pull request #74421 from apple/fix-array-property-opt
eeckstein Jun 14, 2024
32a24f9
Merge pull request #74416 from apple/elsh/pcmo-global
elsh Jun 14, 2024
6dc8686
Add CXX compiler to SCL-F Windows build (#74427)
jmschonfeld Jun 14, 2024
71d02ef
[cxx-interop] Fix a test for move-only types
egorzhdan Jun 14, 2024
b604488
Demangler: edge case in existential demangling
kavon Jun 14, 2024
f995418
Merge pull request #74129 from gottesmm/pr-d17a3faab1ceab8b831d7649c1…
gottesmm Jun 14, 2024
80e8608
Fix an ABI break
tbkka Jun 14, 2024
51205ad
Merge pull request #74409 from hamishknight/no-member-parsing-in-dump
hamishknight Jun 14, 2024
788ee61
Merge pull request #74410 from apple/elsh/add-default
elsh Jun 14, 2024
877547f
utils: copy static libraries for Android SDK
compnerd Jun 14, 2024
05c74e0
Revert "Merge pull request #74394 from tbkka/tbkka-remotemirror-no-mo…
tbkka Jun 14, 2024
0ecf982
Demangler: fix demangling `any ~Copyable`
kavon Jun 15, 2024
d79c876
Merge pull request #74435 from apple/egorzhdan/inherited-move-only-test
egorzhdan Jun 15, 2024
e50a6c4
Few typos in docs/EmbeddedSwift/UserManual.md (#74311)
b5i Jun 15, 2024
9121b26
Merge pull request #74436 from kavon/demangling-rdar128695929
kavon Jun 15, 2024
32aba12
[Features] `FullTypedThrows` should only be enable-able in asserts bu…
hborla Jun 15, 2024
219b4a6
Merge pull request #74439 from tbkka/tbkka-remotemirror-mpe-removal-fix
tbkka Jun 15, 2024
aa90b43
Drop a very, very dated comment that we don't need. The FIXME suffices
DougGregor Jun 15, 2024
7798926
Merge pull request #74447 from DougGregor/drop-old-comment
DougGregor Jun 15, 2024
d4ee050
[Parse] Fix nested ifConfig compiler checks (#74415)
kabiroberai Jun 15, 2024
4a98a53
Merge pull request #74446 from hborla/dont-enable-full-typed-throws
hborla Jun 15, 2024
013cee4
Merge pull request #74440 from compnerd/interop-android
compnerd Jun 15, 2024
843ce58
Set fix impact for non-settable overload choices higher, so we get di…
Jun 9, 2024
bf49f27
Tests: Fixup report public conformances to non-publicly imported prot…
xymus Jun 15, 2024
fb2d667
Merge pull request #74243 from gregomni/rvalue-ambiguous
gregomni Jun 15, 2024
9300c16
Merge pull request #74450 from xymus/fixup-access-level-conformances
xymus Jun 16, 2024
56f0958
Add validation test for issue #46000
Jun 16, 2024
fd6197f
Merge pull request #74453 from gregomni/issue-46000
gregomni Jun 16, 2024
9e3e2aa
ignore ExistentialConstraint from resolveImplicitlyUnwrappedOptionalType
iMostfa Jun 16, 2024
8c746c9
Add shouldDiagnoseImplicitlyUnwrappedOptionalType to match prevent mo…
iMostfa Jul 8, 2024
1c3f4fd
rename Diagnostic variable to incorrect_iuo_any instead of incorrect_…
iMostfa Jul 8, 2024
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
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions SwiftCompilerSources/Sources/SIL/Function.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash
case .IsNotSerialized: return .notSerialized
case .IsSerialized: return .serialized
case .IsSerializedForPackage: return .serializedForPackage
default: fatalError()
@unknown default: fatalError()
}
}

Expand All @@ -156,7 +156,6 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash
case .notSerialized: return .IsNotSerialized
case .serialized: return .IsSerialized
case .serializedForPackage: return .IsSerializedForPackage
default: fatalError()
}
}

Expand Down
4 changes: 2 additions & 2 deletions benchmark/single-source/CharacterRecognizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import TestsUtils

public var benchmarks: [BenchmarkInfo] {
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else {
guard #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) else {
return []
}
return [
Expand Down Expand Up @@ -82,7 +82,7 @@ let _asciiString = #"""
"""#
let asciiString = String(repeating: _asciiString, count: 10)

@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
func run(string: String, n: Int) {
var state = Unicode._CharacterRecognizer()
var c = 0
Expand Down
73 changes: 39 additions & 34 deletions benchmark/single-source/StringTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,43 @@ import TestsUtils
@_spi(_Unicode)
import Swift

public let benchmarks = [
BenchmarkInfo(
name: "StringEqualPointerComparison",
runFunction: run_StringEqualPointerComparison,
tags: [.validation, .api, .String]),
BenchmarkInfo(
name: "StringHasPrefixAscii",
runFunction: run_StringHasPrefixAscii,
tags: [.validation, .api, .String],
legacyFactor: 10),
BenchmarkInfo(
name: "StringHasPrefixUnicode",
runFunction: run_StringHasPrefixUnicode,
tags: [.validation, .api, .String],
legacyFactor: 1000),
BenchmarkInfo(
name: "StringHasSuffixAscii",
runFunction: run_StringHasSuffixAscii,
tags: [.validation, .api, .String],
legacyFactor: 10),
BenchmarkInfo(
name: "StringHasSuffixUnicode",
runFunction: run_StringHasSuffixUnicode,
tags: [.validation, .api, .String],
legacyFactor: 1000),
BenchmarkInfo(
name: "StringIterateWords",
runFunction: run_iterateWords,
tags: [.validation, .String]),
]
public var benchmarks: [BenchmarkInfo] {
var result = [
BenchmarkInfo(
name: "StringEqualPointerComparison",
runFunction: run_StringEqualPointerComparison,
tags: [.validation, .api, .String]),
BenchmarkInfo(
name: "StringHasPrefixAscii",
runFunction: run_StringHasPrefixAscii,
tags: [.validation, .api, .String],
legacyFactor: 10),
BenchmarkInfo(
name: "StringHasPrefixUnicode",
runFunction: run_StringHasPrefixUnicode,
tags: [.validation, .api, .String],
legacyFactor: 1000),
BenchmarkInfo(
name: "StringHasSuffixAscii",
runFunction: run_StringHasSuffixAscii,
tags: [.validation, .api, .String],
legacyFactor: 10),
BenchmarkInfo(
name: "StringHasSuffixUnicode",
runFunction: run_StringHasSuffixUnicode,
tags: [.validation, .api, .String],
legacyFactor: 1000),
]

if #available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) {
result.append(
BenchmarkInfo(
name: "StringIterateWords",
runFunction: run_iterateWords,
tags: [.validation, .String]))
}
return result
}

// FIXME(string)
public func run_StringHasPrefixAscii(_ n: Int) {
Expand Down Expand Up @@ -1644,11 +1651,8 @@ architecture on Linux.</p>

extension String {
@inline(never)
@available(SwiftStdlib 5.9, *)
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
var _words: [Substring] {
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else {
fatalError("Can't run this benchmark")
}
var result: [Substring] = []

var i = startIndex
Expand All @@ -1666,6 +1670,7 @@ extension String {
}
}

@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
public func run_iterateWords(_ n: Int) {
for _ in 0 ..< n {
blackHole(swiftOrgHTML._words)
Expand Down
14 changes: 14 additions & 0 deletions docs/DebuggingTheCompiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ benefit of all Swift developers.
- [Bisecting on SIL optimizer pass counts to identify optimizer bugs](#bisecting-on-sil-optimizer-pass-counts-to-identify-optimizer-bugs)
- [Using git-bisect in the presence of branch forwarding/feature branches](#using-git-bisect-in-the-presence-of-branch-forwardingfeature-branches)
- [Reducing SIL test cases using bug_reducer](#reducing-sil-test-cases-using-bug_reducer)
- [Disabling PCH Verification](#disabling-pch-verification)
- [Debugging the Compiler Build](#debugging-the-compiler-build)
- [Build Dry Run](#build-dry-run)
- [Debugging the Compiler Driver](#debugging-the-compiler-driver-build)
Expand Down Expand Up @@ -832,6 +833,19 @@ each time you change shas. To do this you can pass `--match-timestamp`
to automatically checkout match the timestamp of the `apple/swift` repo
across the other repos.

## Disabling PCH Verification

Sometimes one needs to try to compile against PCH modules where the PCH version
verification checking is too strict. To work around this, one can disable the
checking by passing in to swift:

```sh
-Xcc -Xclang -Xcc -fno-validate-pch
```

NOTE: If there are actual differences in between the on disk PCH format and the
format expected by the compiler crashes and undefined behavior may result.

# Debugging the Compiler Build

## Build Dry Run
Expand Down
37 changes: 37 additions & 0 deletions docs/EmbeddedSwift/ABI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Embedded Swift -- ABI

**⚠️ Embedded Swift is experimental. This document might be out of date with latest development.**

**‼️ Use the latest downloadable 'Trunk Development' snapshot from swift.org to use Embedded Swift. Public releases of Swift do not yet support Embedded Swift.**

For an introduction and motivation into Embedded Swift, please see "[A Vision for Embedded Swift](https://github.com/apple/swift-evolution/blob/main/visions/embedded-swift.md)", a Swift Evolution document highlighting the main goals and approaches.

## ABI stability

The ABI of code generated by Embedded Swift is not currently stable. For a concrete compiler version, it will be consistent, but do not mix code built with different compiler versions.

Similarly, do not mix Embedded Swift code with full Swift code, as the ABIs are different. Details are described in the following sections.

## Calling convention of Embedded Swift

As of today, Embedded Swift has identical calling convention to full Swift. However, this does not need to continue in the future, and there should not be expectations that the ABI of Embedded Swift is compatible with full Swift.

The compiler respects the ABIs and calling conventions of C and C++ when interoperating with code in those languages. Calling C/C++ functions from Embedded Swift code is supported, and similarly exporting Swift code via `@_extern`, `@_cdecl` or `@_expose` will match the right calling conventions that C/C++ expects.

## Metadata ABI of Embedded Swift

Embedded Swift eliminates almost all metadata compared to full Swift. However, class metadata is still used, because those serve as vtables for dynamic dispatch of methods to implement runtime polymorphism. The layout of Embedded Swift's class metadata is *different* from full Swift:

- The **super pointer** pointing to the class metadata record for the superclass is stored at **offset 0**. If the class is a root class, it is null.
- The **destructor pointer** is stored at **offset 1**. This function is invoked by Swift's deallocator when the class instance is destroyed.
- The **ivar destroyer** is stored at **offset 2**. This function is invoked to destroy instance members when creation of the object is cancelled (e.g. in a failable initializer).
- Lastly, the **vtable** is stored at **offset 3**: For each Swift class in the class's inheritance hierarchy, in order starting
from the root class and working down to the most derived class, the function pointers to the implementation of every method of the class in declaration order in stored.

## Heap object layout in Embedded Swift

Heap objects have the following layout in Embedded Swift:

- The **isa pointer** (pointer to the class metadata) is stored at **offset 0**.
- The **refcount** is stored inline at **offset 1**.
- Normal stored properties follow.
10 changes: 5 additions & 5 deletions docs/EmbeddedSwift/EmbeddedSwiftStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This status table describes which of the following standard library features can
| Codable, Encodable, Decodable | No |
| Collection + related protocols | Yes |
| Collection algorithms (sort, reverse) | Yes |
| CustomStringConvertible, CustomDebugStringConvertible | No |
| CustomStringConvertible, CustomDebugStringConvertible | Yes, except those that require reflection (e.g. Array's .description) |
| Dictionary (dynamic heap-allocated container) | Yes |
| FixedWidthInteger + related protocols | Yes |
| Hashable, Equatable, Comparable protocols | Yes |
Expand All @@ -45,15 +45,15 @@ This status table describes which of the following standard library features can
| Mirror (runtime reflection) | No, intentionally unsupported long-term |
| Objective-C bridging | No, intentionally unsupported long-term |
| Optional | Yes |
| print / debugPrint | Partial (only StaticStrings and integers) |
| print / debugPrint | Partial (only String, string interpolation, StaticStrings, integers, pointers and booleans) |
| Range, ClosedRange, Stride | Yes |
| Result | Yes |
| Set (dynamic heap-allocated container) | Yes |
| SIMD types | Yes |
| StaticString | Yes |
| String (dynamic) | No (work in progress) |
| String Interpolations | No (work in progress) |
| Unicode | No |
| String (dynamic) | Yes |
| String Interpolations | Yes |
| Unicode | Yes |
| Unsafe\[Mutable\]\[Raw\]\[Buffer\]Pointer | Yes |
| VarArgs | No |

Expand Down
76 changes: 67 additions & 9 deletions docs/EmbeddedSwift/UserManual.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ The following document explains how to use Embedded Swift's support in the Swift
A typical setup and build + run cycle for an embedded development board involves:

- (1) Getting an SDK with the C compilers, headers and libraries for the target
- (2) Building the C source code, and Swift source code
- (2) Building the C source code, and Swift source code into object files.
- (3) Linking all the libraries, C object files, and Swift object files.
- (4) Post-processing the linked firmware into a flashable format (UD2, BIN, or bespoke formats)
- (4) Post-processing the linked firmware into a flashable format (UF2, BIN, or bespoke formats)
- (5) Uploading the flashable binary to the board over a USB cable using some vendor-provided JTAG/SWD tool or by copying it to a fake USB Mass Storage volume presented by the board.
- (6) Restarting the board, observing physical effects of the firmware (LEDs light up) or UART output over USB, or presence on network, etc.

Most of these steps are out of scope for this document, instead refer to the vendor provided documentation and get familiar with the details of firmware development for your board without Swift in the mix first. Even if you want to build a completely pure Swift firmware, you are still very likely going to need the vendor provided tooling for linking, post-processing, uploading, etc.
Most of these steps are out of scope for this document, instead refer to the vendor provided documentation. This document only focuses on (2) from the list above, and it's important that you first get familiar with the details of firmware development for your board without Swift in the mix. Even if you want to build a completely pure Swift firmware, you are still going to need the vendor provided tooling for linking, post-processing, uploading, etc.

## Building code using Embedded Swift

Expand All @@ -41,15 +41,15 @@ $ swiftc -target <target triple> -enable-experimental-feature Embedded -wmo \

### Building Swift firmware for an embedded target

To build Swift firmware (for now ingnoring integration with SDKs, libraries and other pre-existing C code), we can use the `-target` argument to specify the CPU architecture. The target triple also decides whether the output object file will be an ELF file, or a Mach-O. For example:
To build Swift firmware (for now ignoring integration with SDKs, libraries and other pre-existing C code), we can use the `-target` argument to specify the CPU architecture. The target triple also decides whether the output object file will be an ELF file, or a Mach-O. For example:

```bash
# To build an ARMv7 Mach-O object file:
$ swiftc -target armv7-apple-none-macho -enable-experimental-feature Embedded -wmo \
input1.swift input2.swift ... -c -o output.o

# To build an ARMv7 ELF object file:
$ swiftc -target armv7-unknown-none-eabi -enable-experimental-feature Embedded -wmo \
$ swiftc -target armv7-none-none-eabi -enable-experimental-feature Embedded -wmo \
input1.swift input2.swift ... -c -o output.o
```

Expand All @@ -59,7 +59,7 @@ For example, a Raspberry Pi Pico / Pico W should target the ARMv6-M architecture

```bash
# To build an ELF object file for ARMv6-M with soft float ABI (floating-point arguments passed in integer registers) and "short enums":
$ swiftc -target armv6m-unknown-none-eabi -enable-experimental-feature Embedded -wmo \
$ swiftc -target armv6m-none-none-eabi -enable-experimental-feature Embedded -wmo \
-Xcc -mfloat-abi=soft -Xcc -fshort-enums \
input1.swift input2.swift ... -c -o output.o
```
Expand Down Expand Up @@ -98,6 +98,58 @@ Segment __TEXT: 16384
...
```

## Strings

Both StaticString and String types are available in Embedded Swift. As is the case in desktop Swift, certain operations on strings require Unicode data tables for strict Unicode compliance. In Embedded Swift. these data tables are provided as a separate static library (libUnicodeDataTables.a) that users need to link in manually – if they need to use these string operations. If the library is required, linking will fail due to missing on one or more of the following symbols:

```
_swift_stdlib_getAge
_swift_stdlib_getBinaryProperties
_swift_stdlib_getCaseMapping
_swift_stdlib_getComposition
_swift_stdlib_getDecompositionEntry
_swift_stdlib_getGeneralCategory
_swift_stdlib_getGraphemeBreakProperty
_swift_stdlib_getMapping
_swift_stdlib_getMphIdx
_swift_stdlib_getNameAlias
_swift_stdlib_getNormData
_swift_stdlib_getNumericType
_swift_stdlib_getNumericValue
_swift_stdlib_getScalarBitArrayIdx
_swift_stdlib_getScalarName
_swift_stdlib_getScript
_swift_stdlib_getScriptExtensions
_swift_stdlib_getSpecialMapping
_swift_stdlib_getWordBreakProperty
_swift_stdlib_isLinkingConsonant
_swift_stdlib_nfd_decompositions
```

To resolve this, link in the libswiftUnicodeDataTables.a that's in Swift toolchain's resource directory (`lib/swift/`) under the target triple that you're using:

```bash
$ swiftc <inputs> -target armv6m-none-none-eabi -enable-experimental-feature Embedded -wmo -c -o output.o
$ ld ... -o binary output.o $(dirname `which swiftc`)/../lib/swift/embedded/armv6m-none-none-eabi/libswiftUnicodeDataTables.a
```

**Unicode data tables are required for (list not exhaustive):**

- Comparing String objects for equality
- Sorting Strings
- Using String's hash values, and in particular using String as dictionary keys
- Using String's .count property
- Using Unicode-aware string processing APIs (.split(), iterating characters, indexing)
- Using Unicode-aware conversion String APIs (.uppercased(), .lowercased(), etc.)

**For contrast, unicode data tables are *not required for* (list not exhaustive):**

- Using StaticString
- Creating, concatenating, string interpolating, and printing String objects
- Using .utf8, .utf16, and .unicodeScalars views of strings, including their .count property, using them as dictionary keys

Manually linking libUnicodeDataTables.a is required for several reasons, including acknowledging that the data tables are desirable: Since they have a non-negligible size, it's useful to be aware that you are using them.

## Conditionalizing compilation for Embedded Swift

It's often useful to have source code be compilable under both regular Swift and Embedded Swift. The following syntax is available for that (but note that as the rest of Embedded Swift, it's experimental, subject to change and not considered source stable):
Expand Down Expand Up @@ -133,8 +185,7 @@ Features that are not available:
- **Not available**: Runtime reflection (`Mirror` APIs).
- **Not available**: Values of protocol types ("existentials"), e.g. `let a: Hashable = ...`, are not allowed. `Any` and `AnyObject` are also not allowed.
- **Not available**: Metatypes, e.g. `let t = SomeClass.Type` or `type(of: value)` are not allowed.
- **Not available yet (under development)**: The print() function for types other than StaticString and integers.
- **Not available yet (under development)**: String. (StaticString **is** available).
- **Not available**: Printing and stringification of arbitrary types (achieved via reflection in desktop Swift).
- **Not available yet (under development)**: Swift Concurrency.

For a more complete list of supported features in Embedded Swift, see [Embedded Swift -- Status](EmbeddedSwiftStatus.md).
Expand All @@ -159,7 +210,14 @@ The Embedded Swift standard library is distributed in the toolchain the same way

## Allocating and non-allocating Embedded Swift mode

Embedded Swift does allow instantiating and using reference types (classes) which are refcounted objects allocated on the heap. A common case of needing those is for dynamic containers like arrays and sets (they use dynamically-sized heap-allocated class instances as their storage). Outside of creating class instances and explicitly calling allocation APIs (e.g. `UnsafeMutablePointer.allocate()`), Embedded Swift does not perform allocations or cause heap usage.
Embedded Swift does allow instantiating and using reference types (classes) which are refcounted objects allocated on the heap. A common case of needing those is for dynamic containers like arrays and sets (they use dynamically-sized heap-allocated class instances as their storage). There is only a handful of Swift language features that cause allocations:

- creating class instances,
- escaping a closure that captures local variables,
- creating an indirect enum case with a payload referencing the enum itself
- explicitly calling allocation APIs (e.g. `UnsafeMutablePointer.allocate()`).

Outside of those cases, Embedded Swift does not perform allocations or cause heap usage.

Some embedded platforms don't have and/or don't want *any heap allocations whatsoever* and don't provide a heap at all. The `-no-allocations` compiler flag can be used to match that, which will cause the compiler to produce an error at compile time when creating class instances or calling allocation APIs.

Expand Down
2 changes: 1 addition & 1 deletion docs/HowToGuides/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Build the toolchain with optimizations, debuginfo, and assertions, using Ninja:
- macOS:
```sh
utils/build-script --skip-build-benchmarks \
--skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
--skip-ios --skip-watchos --skip-tvos --skip-xros --swift-darwin-supported-archs "$(uname -m)" \
--sccache --release-debuginfo --swift-disable-dead-stripping \
--bootstrapping=hosttools
```
Expand Down
Loading