Skip to content

Merge main 2022-06-18 #4653

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 171 commits into from
Jun 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
ed70111
Rename swift-latest symlink as swift-latest.xctoolchain
kateinoigakukun Oct 26, 2020
53d8c59
Fix formatting in `update-checkout-config.json`
MaxDesiatov Sep 4, 2021
a0b5615
[build] Remove support for older Xcode versions
egorzhdan May 19, 2022
55b1444
Fix assert triggering immediately in `sourcekitd-repl`.
mwyman May 20, 2022
3bec622
re-exported synthesized extensions need to go under the base module
QuietMisdreavus May 27, 2022
93a2b6f
Disallow async IBAction methods
etcwilde Jun 1, 2022
2612169
Optimize Dictionary.filter for native dictionaries
rctcwyvrn Jun 2, 2022
fad7453
Merge invalid async decl + attribute
etcwilde Jun 3, 2022
c6c0229
Merge branch 'main' into lily-dictionary-optimization
rctcwyvrn Jun 3, 2022
fbd70fe
Fix build error for linux builds and add basic validation test
rctcwyvrn Jun 3, 2022
f15a0b1
[CSFix] Detect conflicting pattern variables
xedin Jun 1, 2022
62ba749
[Diagnostics] Diagnose conflicting pattern variables
xedin Jun 1, 2022
9c8bebe
[CSClosure] Detect and diagnose conflicting pattern variables in case…
xedin Jun 1, 2022
a56e658
Fix ABI issue in NativeDictionary
rctcwyvrn Jun 3, 2022
c6b6bcd
Add fix recommendation
etcwilde Jun 4, 2022
28572b3
Emit fix-it for diagnostic
etcwilde Jun 5, 2022
129b9c0
Format patches
etcwilde Jun 5, 2022
7792a31
[Distributed] Implement missing case in permitting witnesses
ktoso Jun 10, 2022
bd052ee
improve FIXME to link to issue
ktoso Jun 10, 2022
911b42f
workaround for #59356 while still implementing the witness feature
ktoso Jun 10, 2022
0d117c1
Don't Mutate ModuleDecl's File List When Creating Synthesized Files
CodaFi Jun 11, 2022
94e8f53
Enable string processing by default.
rxwei Apr 12, 2022
f706ea5
Update the README with AArch64 links for the builds
shahmishal Jun 13, 2022
ed393b2
[cxx-interop] Disable SIL tests failing on aarch64
egorzhdan Jun 13, 2022
1062625
Merge pull request #59402 from apple/egorzhdan/sil-tests
shahmishal Jun 13, 2022
72499c5
[Concurrency] Set final subsystem/categories for concurrency tracing.
mikeash Jun 9, 2022
9254c47
[interop][SwiftToCxx] emit swift type metadata access function declar…
hyp Jun 13, 2022
ac68360
[NFC] Use an Iterator Again in WMO Type Checking
CodaFi Jun 11, 2022
0909728
Merge pull request #58992 from mwyman/sourcekitd-repl-fix
benlangmuir Jun 13, 2022
39ba0bc
[NFC] Silenced unused private field warning.
nate-chandler Jun 13, 2022
8a02f6f
Sema: Infer the availability of extensions without explicit availabil…
tshortli Jun 13, 2022
2342804
[docs] Add a small howto on setting up LSP/Emacs as a C++ IDE for wor…
gottesmm Jun 13, 2022
3396ede
Merge pull request #42611 from rxwei/string-processing-default
rxwei Jun 13, 2022
2da382d
Merge pull request #59243 from rctcwyvrn/lily-dictionary-optimization
lorentey Jun 13, 2022
104271c
Minor concurrency test requirement cleanups
DougGregor Jun 13, 2022
4e2d41a
Fix PMO to not scalarize empty tuple (#59382)
meg-gupta Jun 13, 2022
ae2b660
Merge pull request #59408 from nate-chandler/nfc/20220613/1/silenced-…
swift-ci Jun 13, 2022
4ac5195
stop cloning swift-cmark twice
QuietMisdreavus Jun 13, 2022
1228265
Merge pull request #59412 from gottesmm/pr-42c3a6f19df445d0ceab9eecc1…
swift-ci Jun 13, 2022
7ee5986
Tests: Add expectation for ObjCBool to the AnyObject.swift test case.
tshortli Jun 13, 2022
e9859d2
Merge pull request #59398 from apple/shahmishal/readme-update
shahmishal Jun 13, 2022
01d7b57
[stdlib] Fix handling of duplicate items in generic Set.intersection
lorentey Jun 13, 2022
a65ddbe
[interop][SwiftToCxx] print out value witness table definition in swi…
hyp Jun 13, 2022
f033aad
[interop][SwiftToCxx] pass struct to function as inout
WANGJIEKE Jun 13, 2022
b787172
[interop][SwiftToCxx] emit destructor that calls value witness destro…
hyp Jun 13, 2022
1a337ea
Merge pull request #59406 from hyp/eng/type-metadata-access-f-interop
hyp Jun 13, 2022
a845fa5
Merge pull request #59383 from CodaFi/file-this-one-under-i-for-immut…
CodaFi Jun 13, 2022
0edd0f0
[Distributed] serialization req must be existential
ktoso Jun 13, 2022
3533686
[interop][SwiftToCxx] emit copy constructor that calls value witness …
hyp Jun 13, 2022
ff37c4e
[interop][SwiftToCxx] NFC, extract value witness extraction printing …
hyp Jun 13, 2022
0e9bef2
Merge pull request #59409 from tshortli/inferred-availability-for-ext…
tshortli Jun 13, 2022
9eded15
Merge pull request #59129 from apple/QuietMisdreavus/exported-ext
swift-ci Jun 13, 2022
1891677
Remove StringMemoryTest (#59413)
Azoy Jun 13, 2022
0bd04f8
Merge pull request #59404 from ktoso/wip-cleanup-ser-req-cant-be-nonp…
swift-ci Jun 14, 2022
3bd45ec
Merge pull request #59417 from lorentey/fix-generic-set-intersection
lorentey Jun 14, 2022
8e6d721
[Distributed] Further witness checking cleanup and tests
ktoso Jun 14, 2022
55a92da
Diagnose `@Sendable` on actor-isolated synchronous functions.
DougGregor Jun 14, 2022
705e562
improve based on code review feedback
WANGJIEKE Jun 14, 2022
35355af
Merge pull request #59358 from apple/wip-missing-witness-allowance
swift-ci Jun 14, 2022
0973224
[ConstraintSystem] Sort type variables when dumping a constraint system
ahoppen Jun 14, 2022
4d0054b
Indentation and line breaks attributes for Switch/Case and Closure
evnik Jun 13, 2022
f9aa02b
[interop][SwiftToCxx] fix the source compat failures
hyp Jun 14, 2022
fe26d15
Fix availability in new tests
DougGregor Jun 14, 2022
4606c9f
Merge pull request #59424 from DougGregor/sendable-actor-isolated-fun…
DougGregor Jun 14, 2022
b17b4d5
[interop][SwiftToCxx] NFC, rename printStructDecl to printValueTypeDecl
hyp Jun 14, 2022
ed4e8d6
SILOptimizer: Fix invariant violation in getWitnessMethodSubstitution…
slavapestov Jun 14, 2022
774a94f
Make sure we can dig out the (distributed) actor from an archetype.
DougGregor Jun 14, 2022
0505266
fix printing for inout type with nullability
WANGJIEKE Jun 14, 2022
7ba07ae
Merge pull request #59210 from xedin/conflicting-patterns-in-case
xedin Jun 14, 2022
4d0d4af
Merge pull request #59419 from apple/eng/copy-destroy-swift-value-in-cxx
hyp Jun 14, 2022
5141a1e
Merge pull request #59436 from DougGregor/closure-actor-isolation-proto
DougGregor Jun 14, 2022
e1d5c0d
Merge pull request #59428 from ahoppen/pr/sort-type-variables
ahoppen Jun 14, 2022
795751c
Merge pull request #59434 from slavapestov/devirtualize-class-witness…
slavapestov Jun 14, 2022
0ced5ec
[cxx-interop] Re-enable C++ stdlib overlay on Linux
egorzhdan Jun 14, 2022
25a7988
Teach witness thunks to hop to the actor when needed.
DougGregor Jun 14, 2022
840b7ea
Enter actor isolation for a distributed witness via the distributed t…
DougGregor Jun 15, 2022
776c5d6
Merge pull request #59418 from WANGJIEKE/cxx-interop-inout-struct
hyp Jun 15, 2022
b04ae71
Merge pull request #59438 from hyp/eng/interop-rename-printValueTypeDecl
hyp Jun 15, 2022
d7fd123
[interop][SwiftToCxx] emit instance property getters for structs
hyp Jun 14, 2022
81b18d2
[cxx-interop] Pass `--gcc-toolchain` to Clang driver when determining…
egorzhdan Jun 14, 2022
bd46bda
AST: Narrow the filtering of unavailable conformances to Sendable only
slavapestov Jun 15, 2022
2a2f70f
Fix tests who aren't using %target-cpu (#59433)
Azoy Jun 15, 2022
12d0d2b
Merge pull request #59450 from DougGregor/actor-isolated-sync-witness
DougGregor Jun 15, 2022
ab9e628
[Threading][Runtime] Separate threading error function to fix link on…
al45tair Jun 15, 2022
649889f
Merge pull request #59442 from apple/egorzhdan/cxx-overlay-linux-reen…
egorzhdan Jun 15, 2022
40cee8a
Merge pull request #59457 from al45tair/fix-linux-threading-link
al45tair Jun 15, 2022
f2b4a43
[interop][SwiftToCxx] emit non-mutating instance methods for structs
hyp Jun 15, 2022
a00c0b4
Merge pull request #59445 from hyp/eng/emit-struct-instance-getters
hyp Jun 15, 2022
f476f62
[cxx-interop][SwiftCompilerSources] Workaround for `std::string` cras…
egorzhdan Jun 15, 2022
30cb7a2
Merge pull request #59349 from mikeash/concurrency-tracing-log-catego…
mikeash Jun 15, 2022
92d7e63
Unique the debug info function declarations for Swift runtime failure…
adrian-prantl Jun 14, 2022
3211bd8
Emit Sendable diagnostics in actor-like deinits only in 'complete' ch…
kavon Jun 15, 2022
53f5767
Merge pull request #59416 from apple/QuietMisdreavus/dedup-cmark
shahmishal Jun 15, 2022
38146fc
[AST] Add mechanism to notify module loading to other clients
medismailben Jun 7, 2022
4859f89
Merge pull request #59466 from medismailben/main
shahmishal Jun 15, 2022
6cdfc29
[typelowering] Use the RawASTType when looking up TypeLowerings.
gottesmm Jun 14, 2022
8216a2a
[move-only] Rename AbstractionPattern move only wrapper add/remove me…
gottesmm Jun 15, 2022
4eebe7c
[typelowering] Rename isMoveOnly() -> isMoveOnlyWrapped()
gottesmm Jun 15, 2022
72523cf
[move-only] Fix a few bugs around MoveOnlyWrapperToCopyableValue.
gottesmm Jun 15, 2022
156f02c
[Docs] Add note for intel users when setting up clion
0x41c Jun 15, 2022
a0a0ebb
Enable Mem2Reg for allocs with load_borrow (#59350)
meg-gupta Jun 15, 2022
768a82f
Handle undefs in a few utilities used in RLE (#59448)
meg-gupta Jun 15, 2022
21c390f
Revert "[AST] Add mechanism to notify module loading to other clients"
medismailben Jun 15, 2022
4230a66
Sema: Fix availability checking in function default argument closure …
tshortli Jun 15, 2022
1328dca
[AST] Add mechanism to notify module loading to other clients
medismailben Jun 15, 2022
66d7133
Merge pull request #59473 from medismailben/main
shahmishal Jun 15, 2022
0d5c138
[interop][SwiftToCxx] place ptrauth attribute on the function type it…
hyp Jun 15, 2022
c96c693
Merge branch 'apple:main' into update-getting-started
0x41c Jun 15, 2022
1628798
Add Extended Existential Vaulue Projection Utilities
CodaFi Jun 15, 2022
d4952d5
Add Runtime Demangling for Extended Existentials
CodaFi Jun 15, 2022
14edd57
Generalize Metadata Lookup for Shapes
CodaFi Jun 15, 2022
d1b2439
Merge pull request #59475 from tshortli/build-default-argument-expr-trcs
tshortli Jun 16, 2022
df462ea
[Distributed] Be able to synthesize actorSystem prop from request (#5…
ktoso Jun 16, 2022
a81bb11
[cmake] Prevent test failures by disabling LTO for swift runtime
thevinster Jun 14, 2022
ca292b4
Merge pull request #59469 from 0x41c/update-getting-started
swift-ci Jun 16, 2022
702238c
Merge pull request #59478 from hyp/eng/95224817
hyp Jun 16, 2022
562e221
Merge pull request #59461 from hyp/eng/emit-instance-struct-methods
hyp Jun 16, 2022
5474d7e
[interop][SwiftToCxx] Add support for emitting resilient struct bindings
hyp Jun 16, 2022
9e4670a
Implement Casting For Extended Existentials
CodaFi Jun 15, 2022
f577330
[interop][SwiftToCxx] fix copy constructor for resilient structs
hyp Jun 16, 2022
bda8aac
Merge pull request #59468 from gottesmm/pr-ca8c452eb2068fedf55ec81469…
gottesmm Jun 16, 2022
d0b2f41
Merge pull request #59463 from adrian-prantl/3259672-main
swift-ci Jun 16, 2022
61e484c
[interop][SwiftToCxx] correctly align allocation for opaque Swift value
hyp Jun 16, 2022
38387ad
[interop][SwiftToCxx] add _Nonnull to resilient struct constructor th…
hyp Jun 16, 2022
5c3b4ca
[interop][SwiftToCxx] annotate OpaqueStorage with noexcept
hyp Jun 16, 2022
34445a0
Merge pull request #59455 from CodaFi/dyno-saur
CodaFi Jun 16, 2022
d5ff396
Disable running watchOS simulator (32-bit) test by default
shahmishal Jun 16, 2022
fae8d20
Merge pull request #59425 from thevinster/lto
al45tair Jun 16, 2022
ec2c25d
Merge pull request #59430 from evnik/FormatImprovements
kimdv Jun 16, 2022
1d47f1a
Merge pull request #59462 from apple/egorzhdan/cxx-libswift-workaroun…
egorzhdan Jun 16, 2022
40a7e68
[cxx-interop] Import iterator dereference operators
egorzhdan Jun 15, 2022
3af0e5d
Merge pull request #58980 from apple/egorzhdan/rm-xcode-versions
shahmishal Jun 16, 2022
1e39efa
[cxx-interop] Disable SIL tests failing on aarch64
egorzhdan Jun 13, 2022
a3802ea
Merge pull request #34433 from kateinoigakukun/katei/create-symlink-a…
shahmishal Jun 16, 2022
c26b508
Merge pull request #59453 from slavapestov/lookup-conformance-unavail…
slavapestov Jun 16, 2022
9b1f5e6
Merge pull request #59465 from apple/egorzhdan/cxx-operator-dereference
egorzhdan Jun 16, 2022
c95db5e
Merge pull request #39176 from apple/maxd/checkout-json-formatting
swift-ci Jun 16, 2022
5ac648b
Merge pull request #59489 from apple/egorzhdan/mute-tests
egorzhdan Jun 16, 2022
ee87094
[ASTContext] Fix unordered member initialization warning (NFC)
medismailben Jun 16, 2022
261bb56
Merge pull request #59483 from apple/disable-32bit-watchos-sim-test
shahmishal Jun 16, 2022
45820d3
Merge pull request #59452 from kavon/silence-deinit-warnings
swift-ci Jun 16, 2022
a8ecfc9
consider requirements of an underscored protocol to also be underscor…
QuietMisdreavus Jun 16, 2022
07043a7
[Sema] Update regex capture decoding
hamishknight Jun 16, 2022
c06e811
Fixup Extended Existential Metatype Casts
CodaFi Jun 16, 2022
115acc2
Failing Casts Should Not Crash
CodaFi Jun 16, 2022
b8ee625
[interop][SwiftToCxx] fix aligned allocation refs
hyp Jun 16, 2022
f755904
Merge pull request #59205 from etcwilde/ewilde/no-async-ibactions
swift-ci Jun 16, 2022
7e84355
Merge pull request #59498 from medismailben/main
medismailben Jun 16, 2022
824fa48
Check The Last Node After Unwrapping Metatypes
CodaFi Jun 16, 2022
16c3323
Switch From Bitwise to Logical And
CodaFi Jun 17, 2022
8bb5270
[Gardening] Remove a Copy-Pasted Header
CodaFi Jun 17, 2022
57f721a
[cxx-interop] Remove "enable-cxx-interop" flag again.
zoecarver Jun 16, 2022
74503f0
Use the distributed thunk for non-distributed protocol requirements (…
DougGregor Jun 17, 2022
cfab1d8
Merge pull request #59516 from CodaFi/taking-a-header
swift-ci Jun 17, 2022
21d3510
Merge pull request #59515 from CodaFi/illogical
CodaFi Jun 17, 2022
5e065f0
Revert "consider requirements of an underscored protocol to also be u…
QuietMisdreavus Jun 17, 2022
922e230
Merge pull request #59521 from apple/revert-59480-QuietMisdreavus/und…
shahmishal Jun 17, 2022
541aa8d
Merge pull request #59507 from CodaFi/metastability
CodaFi Jun 17, 2022
28375ae
[c++-interop] Providing information about enum types from inferDefaul…
plotfi Jun 13, 2022
0c909c2
Merge pull request #59482 from hyp/eng/emit-resilient-structs
hyp Jun 17, 2022
59a9e28
Merge pull request #59510 from zoecarver/remove-enable-interop-pt-2
zoecarver Jun 17, 2022
8a546a9
Merge pull request #59421 from plotfi/typedef-ns-options-name-fixup
plotfi Jun 17, 2022
718de93
Add a mangling for constant static arrays.
eeckstein Jun 14, 2022
3de5c53
lit.cfg: add a `%target-future-triple` substitution.
eeckstein Jun 14, 2022
9d61e21
runtime: export two symbols used to create static constant arrays.
eeckstein Jun 14, 2022
aca0d83
IRGen: generate static arrays in read-only data sections.
eeckstein Jun 14, 2022
afa599c
Merge pull request #59506 from hamishknight/not-so-null
hamishknight Jun 17, 2022
b8804cd
Merge pull request #59431 from eeckstein/read-only-static-arrays
eeckstein Jun 17, 2022
a8ad273
Add cmark gfm info back
shahmishal Jun 17, 2022
f43005a
Merge remote-tracking branch 'apple/main' into katei/merge-main-2022-…
kateinoigakukun Jun 17, 2022
5de2df0
Wasm: Set SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES
kateinoigakukun Jun 18, 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
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ to track the status of our builds, please refer to our [GitHub Actions page](htt
# Swift Programming Language


| | **Architecture** | **main** | **Package** |
|---|:---:|:---:|:---:|
| **macOS** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-macos/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-macos)|[![Build Status](https://ci.swift.org/job/oss-swift-package-macos/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-macos)|
| **Ubuntu 18.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-18_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-18_04)|
| **Ubuntu 20.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04)|
| **CentOS 7** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-centos-7/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-centos-7)|[![Build Status](https://ci.swift.org/job/oss-swift-package-centos-7/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-centos-7)|
| **Amazon Linux 2** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2)|[![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2)|
| | **Architecture** | **Build** |
|---|:---:|:---:|
| **macOS** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-macos/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-macos)|
| **Ubuntu 18.04** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-18_04)|
| **Ubuntu 20.04** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04)|
| **Ubuntu 20.04** | AArch64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04-aarch64/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04-aarch64)|
| **Ubuntu 22.04** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-22_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-22_04)|
| **Ubuntu 22.04** | AArch64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-22_04-aarch64/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-22_04-aarch64)|
| **CentOS 7** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-centos-7/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-centos-7)|
| **Amazon Linux 2** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2)|
| **Amazon Linux 2** | AArch64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2-aarch64/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2-aarch64)|

**Swift Community-Hosted CI Platforms**

Expand Down
5 changes: 4 additions & 1 deletion SwiftCompilerSources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ function(add_swift_compiler_modules_library name)

set(swift_compile_options
"-Xfrontend" "-validate-tbd-against-ir=none"
"-Xfrontend" "-enable-cxx-interop"
"-Xfrontend" "-enable-experimental-cxx-interop"
"-Xcc" "-UIBOutlet" "-Xcc" "-UIBAction" "-Xcc" "-UIBInspectable")
if (NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
list(APPEND swift_compile_options "-Xfrontend" "-disable-implicit-string-processing-module-import")
endif()

if(CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND swift_compile_options "-g")
Expand Down
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private extension Target {
static let defaultSwiftSettings: [SwiftSetting] = [
.unsafeFlags([
"-Xfrontend", "-validate-tbd-against-ir=none",
"-Xfrontend", "-enable-cxx-interop",
"-Xfrontend", "-enable-experimental-cxx-interop",
// Bridging modules and headers
"-Xcc", "-I", "-Xcc", "../include",
"-cross-module-optimization"
Expand Down
3 changes: 2 additions & 1 deletion SwiftCompilerSources/Sources/SIL/BasicBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ final public class BasicBlock : ListNode, CustomStringConvertible, HasShortDescr
public var function: Function { SILBasicBlock_getFunction(bridged).function }

public var description: String {
String(_cxxString: SILBasicBlock_debugDescription(bridged))
let stdString = SILBasicBlock_debugDescription(bridged)
return String(_cxxString: stdString)
}
public var shortDescription: String { name }

Expand Down
3 changes: 2 additions & 1 deletion SwiftCompilerSources/Sources/SIL/Function.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final public class Function : CustomStringConvertible, HasShortDescription {
}

final public var description: String {
String(_cxxString: SILFunction_debugDescription(bridged))
let stdString = SILFunction_debugDescription(bridged)
return String(_cxxString: stdString)
}

public var shortDescription: String { name.string }
Expand Down
3 changes: 2 additions & 1 deletion SwiftCompilerSources/Sources/SIL/GlobalVariable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final public class GlobalVariable : CustomStringConvertible, HasShortDescription
}

public var description: String {
String(_cxxString: SILGlobalVariable_debugDescription(bridged))
let stdString = SILGlobalVariable_debugDescription(bridged)
return String(_cxxString: stdString)
}

public var shortDescription: String { name.string }
Expand Down
6 changes: 4 additions & 2 deletions SwiftCompilerSources/Sources/SIL/Instruction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class Instruction : ListNode, CustomStringConvertible, Hashable {
final public var function: Function { block.function }

final public var description: String {
String(_cxxString: SILNode_debugDescription(bridgedNode))
let stdString = SILNode_debugDescription(bridgedNode)
return String(_cxxString: stdString)
}

final public var operands: OperandArray {
Expand Down Expand Up @@ -142,7 +143,8 @@ public class SingleValueInstruction : Instruction, Value {

public final class MultipleValueInstructionResult : Value {
final public var description: String {
String(_cxxString: SILNode_debugDescription(bridgedNode))
let stdString = SILNode_debugDescription(bridgedNode)
return String(_cxxString: stdString)
}

public var instruction: Instruction {
Expand Down
3 changes: 2 additions & 1 deletion SwiftCompilerSources/Sources/SIL/Value.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public enum Ownership {

extension Value {
public var description: String {
String(_cxxString: SILNode_debugDescription(bridgedNode))
let stdString = SILNode_debugDescription(bridgedNode)
return String(_cxxString: stdString)
}

public var uses: UseList {
Expand Down
1 change: 1 addition & 0 deletions docs/ABI/Mangling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ Entities
entity-spec ::= 'fE' // ivar destroyer; untyped
entity-spec ::= 'fe' // ivar initializer; untyped
entity-spec ::= 'Tv' NATURAL // outlined global variable (from context function)
entity-spec ::= 'Tv' NATURAL 'r' // outlined global read-only object
entity-spec ::= 'Te' bridge-spec // outlined objective c method call

entity-spec ::= decl-name label-list function-signature generic-signature? 'F' // function
Expand Down
1 change: 1 addition & 0 deletions docs/HowToGuides/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ In project settings, locate `Build, Execution, Deployment > CMake`. You will nee
- `-D SWIFT_PATH_TO_CMARK_BUILD=SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64 -D LLVM_DIR=SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/cmake/llvm -D Clang_DIR=SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/cmake/clang -D CMAKE_BUILD_TYPE=RelWithDebInfoAssert -G Ninja -S .`
- replace the `SOME_PATH` to the path where your `swift-project` directory is
- the CMAKE_BUILD_TYPE should match the build configuration name, so if you named this profile `RelWithDebInfo` the CMAKE_BUILD_TYPE should also be `RelWithDebInfo`
- **Note**: If you're using an intel machine to build swift, you'll need to replace the architecture in the options. (ex: `arm64` with `x86_64`)

With this done, CLion should be able to successfully import the project and have full autocomplete and code navigation powers.

Expand Down
76 changes: 76 additions & 0 deletions docs/HowToGuides/SettingUpLSPEmacs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# How to setup LSP + Emacs as a C++ IDE for Swift

This document describes how to setup a new emacs installation to use LSP and
other modes to create a C++ IDE for working on the compiler code base. It
enables autocompletion, lookup API at point, as well as formatting, renaming,
and syntax highlighting.

## Setting up Package.el for MELPA

Before we do anything, we need to setup package.el so we can grab packages from
[https://melpa.org/](MELPA) and GNU. This can be done by
including the below in your elisp startup file. Make sure it is run before any
other code is run.

```
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t)
(package-initialize)
```

## Download packages

The packages needed as of this document being written (Jun 2022) are:

* use-package
* company
* lsp-mode
* lsp-ui
* helm-lsp
* lsp-treemacs

One can install these by running the command `package-install` inside emacs.

## Configuring LSP

Finally, now we need to configure out installation so everything is setup
correctly. This can be done by including the following in ones .emacs:

```
(use-package company
:ensure t
:config
;; Enable completion-as-you-type behavior.
;; don't add any dely before trying to complete thing being typed
;; the call/response to gopls is asynchronous so this should have little
;; to no affect on edit latency
(setq company-idle-delay 0.1)
;; start completing after a single character instead of 3
(setq company-minimum-prefix-length 1)
;; align fields in completions
(setq company-tooltip-align-annotations t)
)
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
:hook (c-mode-common . lsp)
:custom
;; Prevent lsp from inserting header decorators.
(lsp-clients-clangd-args '("--header-insertion-decorators=0" "--header-insertion=never"))
:init
;; Enable easy local renaming using LSP
(bind-key "C-x l" 'lsp-rename)
:config
;; The CAPF back-end provides a bridge to the standard
;; completion-at-point-functions facility, and thus works with any major mode
;; that defines a proper completion function.
(setq lsp-completion-provider :capf)
(add-hook 'go-mode-hook #'lsp-go-install-save-hooks))

(use-package lsp-ui :commands lsp-ui-mode)
(use-package helm-lsp :commands helm-lsp-workspace-symbol
:config
(define-key lsp-mode-map [remap xref-find-apropos] #'helm-lsp-workspace-symbol))
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)
```
1 change: 1 addition & 0 deletions include/swift/ABI/MetadataValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ class ExtendedExistentialTypeShapeFlags {
SpecialKind getSpecialKind() const {
return SpecialKind((Data & SpecialKindMask) >> SpecialKindShift);
}
bool isOpaque() const { return getSpecialKind() == SpecialKind::None; }
bool isClassConstrained() const {
return getSpecialKind() == SpecialKind::Class;
}
Expand Down
35 changes: 25 additions & 10 deletions include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ class ASTContext final {
ASTContext(const ASTContext&) = delete;
void operator=(const ASTContext&) = delete;

ASTContext(LangOptions &langOpts, TypeCheckerOptions &typecheckOpts,
SILOptions &silOpts, SearchPathOptions &SearchPathOpts,
ClangImporterOptions &ClangImporterOpts,
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
SourceManager &SourceMgr, DiagnosticEngine &Diags);
ASTContext(
LangOptions &langOpts, TypeCheckerOptions &typecheckOpts,
SILOptions &silOpts, SearchPathOptions &SearchPathOpts,
ClangImporterOptions &ClangImporterOpts,
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
SourceManager &SourceMgr, DiagnosticEngine &Diags,
std::function<bool(llvm::StringRef, bool)> PreModuleImportCallback = {});

public:
// Members that should only be used by ASTContext.cpp.
Expand All @@ -238,11 +240,13 @@ class ASTContext final {

void operator delete(void *Data) throw();

static ASTContext *get(LangOptions &langOpts, TypeCheckerOptions &typecheckOpts,
SILOptions &silOpts, SearchPathOptions &SearchPathOpts,
ClangImporterOptions &ClangImporterOpts,
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
SourceManager &SourceMgr, DiagnosticEngine &Diags);
static ASTContext *
get(LangOptions &langOpts, TypeCheckerOptions &typecheckOpts,
SILOptions &silOpts, SearchPathOptions &SearchPathOpts,
ClangImporterOptions &ClangImporterOpts,
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
SourceManager &SourceMgr, DiagnosticEngine &Diags,
std::function<bool(llvm::StringRef, bool)> PreModuleImportCallback = {});
~ASTContext();

/// Optional table of counters to report, nullptr when not collecting.
Expand Down Expand Up @@ -374,6 +378,10 @@ class ASTContext final {
llvm::BumpPtrAllocator &
getAllocator(AllocationArena arena = AllocationArena::Permanent) const;

/// An optional generic callback function invoked prior to importing a module.
mutable std::function<bool(llvm::StringRef ModuleName, bool IsOverlay)>
PreModuleImportCallback;

public:
/// Allocate - Allocate memory from the ASTContext bump pointer.
void *Allocate(unsigned long bytes, unsigned alignment,
Expand Down Expand Up @@ -872,6 +880,10 @@ class ASTContext final {
/// for extended existential types.
AvailabilityContext getParameterizedExistentialRuntimeAvailability();

/// Get the runtime availability of immortal ref-count symbols, which are
/// needed to place array buffers into constant data sections.
AvailabilityContext getImmortalRefCountSymbolsAvailability();

/// Get the runtime availability of features introduced in the Swift 5.2
/// compiler for the target platform.
AvailabilityContext getSwift52Availability();
Expand Down Expand Up @@ -1107,6 +1119,9 @@ class ASTContext final {
/// If a module by this name has already been loaded, the existing module will
/// be returned.
///
/// \param ModulePath The module's \c ImportPath which describes
/// the name of the module being loaded, possibly including submodules.

/// \returns The requested module, or NULL if the module cannot be found.
ModuleDecl *getModule(ImportPath::Module ModulePath);

Expand Down
6 changes: 5 additions & 1 deletion include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
bool isActor() const;

/// Whether this nominal type qualifies as a distributed actor, meaning that
/// it is either a distributed actor.
/// it is either a distributed actor or a DistributedActor constrained protocol.
bool isDistributedActor() const;

/// Whether this nominal type qualifies as any actor (plain or distributed).
Expand Down Expand Up @@ -5744,6 +5744,10 @@ class ParamDecl : public VarDecl {
Bits.ParamDecl.defaultArgumentKind = static_cast<unsigned>(K);
}

void setDefaultArgumentKind(ArgumentAttrs K) {
setDefaultArgumentKind(K.argumentKind);
}

bool isNoImplicitCopy() const {
return getAttrs().hasAttribute<NoImplicitCopyAttr>();
}
Expand Down
36 changes: 36 additions & 0 deletions include/swift/AST/DefaultArgumentKind.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#ifndef SWIFT_DEFAULTARGUMENTKIND_H
#define SWIFT_DEFAULTARGUMENTKIND_H

#include "llvm/ADT/StringRef.h"
#include <cstdint>
#include <string>

namespace llvm {
class StringRef;
Expand Down Expand Up @@ -52,6 +54,40 @@ enum class DefaultArgumentKind : uint8_t {
};
enum { NumDefaultArgumentKindBits = 4 };

struct ArgumentAttrs {
DefaultArgumentKind argumentKind;
bool isUnavailableInSwift = false;
llvm::StringRef CXXOptionsEnumName = "";

ArgumentAttrs(DefaultArgumentKind argumentKind,
bool isUnavailableInSwift = false,
llvm::StringRef CXXOptionsEnumName = "")
: argumentKind(argumentKind), isUnavailableInSwift(isUnavailableInSwift),
CXXOptionsEnumName(CXXOptionsEnumName) {}

bool operator !=(const DefaultArgumentKind &rhs) const {
return argumentKind != rhs;
}

bool operator==(const DefaultArgumentKind &rhs) const {
return argumentKind == rhs;
}

bool hasDefaultArg() const {
return argumentKind != DefaultArgumentKind::None;
}

bool hasAlternateCXXOptionsEnumName() const {
return !CXXOptionsEnumName.empty() && isUnavailableInSwift;
}

llvm::StringRef getAlternateCXXOptionsEnumName() const {
assert(hasAlternateCXXOptionsEnumName() &&
"Expected a C++ Options type for C++-Interop but found none.");
return CXXOptionsEnumName;
}
};

} // end namespace swift

#endif // LLVM_SWIFT_DEFAULTARGUMENTKIND_H
Expand Down
10 changes: 8 additions & 2 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,8 @@ NOTE(fixit_rename_in_swift,none,
"change Swift name to %0", (DeclName))
NOTE(fixit_rename_in_objc,none,
"change Objective-C selector to %0", (ObjCSelector))
NOTE(remove_async_add_task,none,
"remove 'async' and wrap in 'Task' to use concurrency in %0", (DeclName))
ERROR(no_objc_tagged_pointer_not_class_protocol,none,
"@unsafe_no_objc_tagged_pointer can only be applied to class protocols",
())
Expand All @@ -1464,11 +1466,12 @@ ERROR(cdecl_empty_name,none,
"@_cdecl symbol name cannot be empty", ())
ERROR(cdecl_throws,none,
"raising errors from @_cdecl functions is not supported", ())
ERROR(cdecl_async,none,
"@_cdecl functions cannot be asynchronous", ())

ERROR(attr_methods_only,none,
"only methods can be declared %0", (DeclAttribute))
ERROR(attr_decl_async,none,
"@%0 %1 cannot be asynchronous", (StringRef, DescriptiveDeclKind))

ERROR(access_control_in_protocol,none,
"%0 modifier cannot be used in protocols", (DeclAttribute))
NOTE(access_control_in_protocol_detail,none,
Expand Down Expand Up @@ -4563,6 +4566,9 @@ ERROR(effectful_keypath_component,none,
ERROR(local_function_executed_concurrently,none,
"concurrently-executed %0 %1 must be marked as '@Sendable'",
(DescriptiveDeclKind, DeclName))
ERROR(sendable_isolated_sync_function,none,
"%0 synchronous %1 %2 cannot be marked as '@Sendable'",
(ActorIsolation, DescriptiveDeclKind, DeclName))
ERROR(concurrent_access_of_local_capture,none,
"%select{mutation of|reference to}0 captured %1 %2 in "
"concurrently-executing code",
Expand Down
4 changes: 0 additions & 4 deletions include/swift/AST/FileUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ class FileUnit : public DeclContext, public ASTAllocated<FileUnit> {

/// Returns the synthesized file for this source file, creating one and
/// inserting it into the module if it does not exist.
///
/// \warning Because this function mutates the parent module's list of files,
/// it will invalidate the iterators of any upstream callers of
/// \c ModuleDecl::getFiles().
SynthesizedFileUnit &getOrCreateSynthesizedFile();

/// Look up a (possibly overloaded) value set at top-level scope
Expand Down
Loading