Skip to content

Commit d25f6fc

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 23de52f + 6805e15 commit d25f6fc

File tree

2,398 files changed

+161859
-83357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,398 files changed

+161859
-83357
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ root = true
55
[*]
66
indent_style = space
77
indent_size = 2
8-
trim_trailing_whitespace = true
98
insert_final_newline = true

.github/CODEOWNERS

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
# TODO: /LICENSE.txt
3232
# TODO: /README.md
3333

34+
# Runtimes
35+
/Runtimes/**/CMakeLists.txt @etcwilde @compnerd @edymtt @justice-adams-apple
36+
/Runtimes/**/*.cmake @etcwilde @compnerd @edymtt @justice-adams-apple
37+
/Runtimes/Core/cmake/caches/Vendors/Apple/ @etcwilde @shahmishal @edymtt @justice-adams-apple
38+
3439
# SwiftCompilerSources
3540
/SwiftCompilerSources @eeckstein
3641

@@ -66,11 +71,20 @@
6671
/include/swift/AST/*Protocol* @hborla @slavapestov
6772
/include/swift/AST/*Requirement* @hborla @slavapestov
6873
/include/swift/AST/*Substitution* @slavapestov
74+
/include/swift/AST/DiagnosticGroup* @DougGregor
75+
/include/swift/AST/DiagnosticsClangImporter.def @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun @j-hui @fahadnayyar
76+
/include/swift/AST/DiagnosticsDriver.def @artemcm
77+
/include/swift/AST/DiagnosticsFrontend.def @artemcm @tshortli
78+
/include/swift/AST/DiagnosticsIDE.def @ahoppen @bnbarham @hamishknight @rintaro
79+
/include/swift/AST/DiagnosticsIRGen.def @rjmccall
80+
/include/swift/AST/DiagnosticsModuleDiffer.def @nkcsgexi
6981
/include/swift/AST/DiagnosticsParse.def @ahoppen @bnbarham @CodaFi @DougGregor @hamishknight @rintaro
82+
/include/swift/AST/DiagnosticsRefactoring.def @ahoppen @bnbarham @hamishknight @rintaro
83+
/include/swift/AST/DiagnosticsSIL.def @jckarter
7084
/include/swift/AST/Evaluator* @CodaFi @slavapestov
7185
/include/swift/Basic/ @DougGregor
7286
/include/swift/Basic/Features.def @DougGregor @hborla
73-
/include/swift/ClangImporter @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun
87+
/include/swift/ClangImporter @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun @j-hui @fahadnayyar
7488
/include/swift/DependencyScan @artemcm @cachemeifyoucan
7589
/include/swift/Driver*/ @artemcm
7690
/include/swift/Frontend*/ @artemcm @tshortli
@@ -81,7 +95,7 @@
8195
/include/swift/Migrator/ @nkcsgexi
8296
/include/swift/Option/*Options* @tshortli
8397
/include/swift/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @hamishknight @rintaro
84-
/include/swift/PrintAsClang @zoecarver @hyp @egorzhdan @Xazax-hun
98+
/include/swift/PrintAsClang @zoecarver @hyp @egorzhdan @Xazax-hun @j-hui @fahadnayyar
8599
/include/swift/Refactoring @ahoppen @bnbarham @hamishknight @rintaro
86100
/include/swift/Runtime/ @rjmccall
87101
/include/swift/SIL/ @jckarter
@@ -116,7 +130,7 @@
116130
/lib/ASTGen/ @ahoppen @bnbarham @CodaFi @hamishknight @rintaro
117131
/lib/Basic/ @DougGregor
118132
/lib/Basic/Windows @compnerd
119-
/lib/ClangImporter @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun
133+
/lib/ClangImporter @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun @j-hui @fahadnayyar
120134
/lib/ClangImporter/DWARFImporter* @adrian-prantl
121135
/lib/DependencyScan @artemcm @cachemeifyoucan
122136
/lib/Driver*/ @artemcm
@@ -135,7 +149,7 @@
135149
/lib/Markup/ @nkcsgexi
136150
/lib/Migrator/ @nkcsgexi
137151
/lib/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @hamishknight @rintaro
138-
/lib/PrintAsClang @zoecarver @hyp @egorzhdan @Xazax-hun
152+
/lib/PrintAsClang @zoecarver @hyp @egorzhdan @Xazax-hun @j-hui @fahadnayyar
139153
/lib/Refactoring/ @ahoppen @bnbarham @hamishknight @rintaro
140154
/lib/SIL/ @jckarter
141155
/lib/SIL/**/*DebugInfo* @adrian-prantl
@@ -158,6 +172,7 @@
158172
/lib/Sema/Constraint* @hborla @xedin
159173
/lib/Sema/DerivedConformance* @slavapestov
160174
/lib/Sema/DerivedConformanceDistributed* @ktoso @slavapestov
175+
/lib/Sema/OpenedExistentials* @AnthonyLatsis @slavapestov
161176
/lib/Sema/TypeCheckDistributed* @hborla @ktoso @xedin
162177
/lib/Sema/TypeCheckProtocol* @AnthonyLatsis @hborla @slavapestov
163178
/lib/Sema/TypeCheckType* @AnthonyLatsis @hborla @slavapestov @xedin
@@ -175,9 +190,9 @@
175190
/stdlib/private/*Runtime*/ @rjmccall
176191
/stdlib/private/SwiftReflectionTest/ @slavapestov
177192
/stdlib/public/*Demangl*/ @rjmccall
178-
/stdlib/public/Backtracing/ @al45tair
193+
/stdlib/public/RuntimeModule/ @al45tair @mikeash
179194
/stdlib/public/Concurrency/ @ktoso
180-
/stdlib/public/Cxx/ @zoecarver @hyp @egorzhdan @Xazax-hun
195+
/stdlib/public/Cxx/ @zoecarver @hyp @egorzhdan @Xazax-hun @j-hui @fahadnayyar
181196
/stdlib/public/Distributed/ @ktoso
182197
/stdlib/public/Observation/ @phausler
183198
/stdlib/public/SwiftRemoteMirror/ @slavapestov
@@ -202,7 +217,7 @@
202217
/test/IDE/ @ahoppen @bnbarham @hamishknight @rintaro
203218
/test/IRGen/ @rjmccall
204219
/test/Index/ @ahoppen @bnbarham @hamishknight @rintaro
205-
/test/Interop/ @zoecarver @hyp @egorzhdan @Xazax-hun
220+
/test/Interop/ @zoecarver @hyp @egorzhdan @Xazax-hun @j-hui @fahadnayyar
206221
/test/Migrator/ @nkcsgexi
207222
/test/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @hamishknight @rintaro
208223
/test/Profiler @ahoppen @bnbarham @hamishknight @rintaro

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ Runtimes/**/*.yaml
9696
Runtimes/**/*.inc
9797
Runtimes/**/*.json
9898
Runtimes/**/*.modulemap
99+
Runtimes/**/*.in

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
66
## Swift 6.1
77

8+
* Previous versions of Swift would incorrectly allow Objective-C `-init...`
9+
methods with custom Swift names to be imported as initializers, but with base
10+
names other than `init`. The compiler now diagnoses these attributes and
11+
infers a name for the initializer as though they are not present.
12+
813
* Projected value initializers are now correctly injected into calls when
914
an argument exactly matches a parameter with an external property wrapper.
1015

CMakeLists.txt

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ else()
157157
set(SWIFT_HOST_VARIANT_SDK_default "OSX")
158158
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "WASI")
159159
set(SWIFT_HOST_VARIANT_SDK_default "WASI")
160+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
161+
set(SWIFT_HOST_VARIANT_SDK_default "EMSCRIPTEN")
160162
else()
161163
message(FATAL_ERROR "Unable to detect SDK for host system: ${CMAKE_SYSTEM_NAME}")
162164
endif()
@@ -695,10 +697,6 @@ option(SWIFT_IMPLICIT_CONCURRENCY_IMPORT
695697
"Implicitly import the Swift concurrency module"
696698
TRUE)
697699

698-
option(SWIFT_IMPLICIT_BACKTRACING_IMPORT
699-
"Implicitly import the Swift backtracing module"
700-
FALSE)
701-
702700
option(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
703701
"Enable build of the Swift concurrency module"
704702
FALSE)
@@ -731,6 +729,10 @@ option(SWIFT_ENABLE_SYNCHRONIZATION
731729
"Enable build of the Swift Synchronization module"
732730
FALSE)
733731

732+
option(SWIFT_ENABLE_RUNTIME_MODULE
733+
"Build the Swift Runtime module"
734+
FALSE)
735+
734736
option(SWIFT_ENABLE_VOLATILE
735737
"Enable build of the Swift Volatile module"
736738
FALSE)
@@ -747,10 +749,6 @@ option(SWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION
747749
"Enable experimental SwiftParser validation by default"
748750
FALSE)
749751

750-
option(SWIFT_ENABLE_EXPERIMENTAL_POINTER_BOUNDS
751-
"Enable experimental safe wrappers around external functions"
752-
FALSE)
753-
754752
cmake_dependent_option(SWIFT_BUILD_SOURCEKIT
755753
"Build SourceKit" TRUE
756754
"SWIFT_ENABLE_DISPATCH" FALSE)
@@ -869,11 +867,6 @@ if (CMAKE_Swift_COMPILER)
869867
SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT)
870868
message(STATUS " Implicit 'string-processing' import: ${SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT}")
871869

872-
# Same for _Backtracing.
873-
swift_supports_implicit_module("backtracing"
874-
SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT)
875-
message(STATUS " Implicit 'backtracing' import: ${SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT}")
876-
877870
swift_get_package_cmo_support(
878871
Swift_COMPILER_PACKAGE_CMO_SUPPORT)
879872
message(STATUS " Package CMO: ${Swift_COMPILER_PACKAGE_CMO_SUPPORT}")
@@ -1032,11 +1025,6 @@ set(SWIFT_GYB_FLAGS
10321025
set(SWIFT_MODULE_CACHE_PATH
10331026
"${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/module-cache")
10341027

1035-
# Xcode: use libc++ and c++11 using proper build settings.
1036-
if(XCODE)
1037-
swift_common_xcode_cxx_config()
1038-
endif()
1039-
10401028
# Check what linux distribution is being used.
10411029
# This can be used to determine the default linker to use.
10421030
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22")
@@ -1091,6 +1079,9 @@ endif()
10911079
#
10921080
swift_common_cxx_warnings()
10931081

1082+
# Set sanitizer options for Swift compiler.
1083+
swift_common_sanitizer_config()
1084+
10941085
# Check if we're build with MSVC or Clang-cl, as these compilers have similar command line arguments.
10951086
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
10961087
set(SWIFT_COMPILER_IS_MSVC_LIKE TRUE)
@@ -1252,6 +1243,15 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WASI")
12521243
set(SWIFT_PRIMARY_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
12531244
set(SWIFT_PRIMARY_VARIANT_ARCH_default "${SWIFT_HOST_VARIANT_ARCH}")
12541245

1246+
elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "EMSCRIPTEN")
1247+
1248+
set(SWIFT_HOST_VARIANT "emscripten" CACHE STRING
1249+
"Deployment OS for Swift host tools (the compiler) [emscripten]")
1250+
1251+
configure_sdk_unix("Emscripten" "wasm32")
1252+
set(SWIFT_PRIMARY_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
1253+
set(SWIFT_PRIMARY_VARIANT_ARCH_default "${SWIFT_HOST_VARIANT_ARCH}")
1254+
12551255
elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*|XROS*)")
12561256

12571257
set(SWIFT_HOST_VARIANT "macosx" CACHE STRING
@@ -1398,6 +1398,7 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
13981398
message(STATUS "Synchronization Support: ${SWIFT_ENABLE_SYNCHRONIZATION}")
13991399
message(STATUS "Volatile Support: ${SWIFT_ENABLE_VOLATILE}")
14001400
message(STATUS "Pointer Bounds Support: ${SWIFT_ENABLE_EXPERIMENTAL_POINTER_BOUNDS}")
1401+
message(STATUS "Runtime Support: ${SWIFT_ENABLE_RUNTIME_MODULE}")
14011402
message(STATUS "")
14021403
else()
14031404
message(STATUS "Not building Swift standard library, SDK overlays, and runtime")
@@ -1582,6 +1583,7 @@ endif()
15821583
# New standard library build
15831584
option(SWIFT_ENABLE_NEW_RUNTIME_BUILD "Build Swift runtimes with new build system" OFF)
15841585
if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
1586+
message(STATUS "New runtime build enabled")
15851587

15861588
add_custom_target(PopulateRuntimeSourceDir
15871589
COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Resync.cmake"
@@ -1598,6 +1600,13 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
15981600
if(${SWIFT_SDK_${sdk}_${arch}_CACHE})
15991601
set(stdlib_cache_file_flag -C ${SWIFT_SDK_${sdk}_${arch}_CACHE})
16001602
endif()
1603+
1604+
set(stdlib_target_triple ${SWIFT_SDK_${sdk}_ARCH_${arch}_TRIPLE})
1605+
if(SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION)
1606+
string(APPEND stdlib_target_triple ${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION})
1607+
set(stdlib_deployment_version_flag -DCMAKE_OSX_DEPLOYMENT_TARGET=${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION})
1608+
endif()
1609+
16011610
ExternalProject_Add("${stdlib_target}-core"
16021611
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Core"
16031612
# TODO: Add this once we're ready to start swapping out the libraries
@@ -1611,12 +1620,19 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
16111620
-DCMAKE_Swift_COMPILER_WORKS:BOOLEAN=YES
16121621
-DBUILD_SHARED_LIBS:BOOLEAN=YES # TODO: Make this configurable
16131622
${stdlib_cache_file_flag}
1623+
${stdlib_deployment_version_flag}
16141624
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
16151625
-DCMAKE_INSTALL_PREFIX:FILEPATH=<INSTALL_DIR>
16161626
-DCMAKE_Swift_COMPILER:FILEPATH=$<IF:$<BOOL:${CMAKE_CROSSCOMPILING}>,${CMAKE_Swift_COMPILER},$<PATH:REPLACE_FILENAME,$<TARGET_FILE:swift-frontend>,swiftc>>
16171627
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
16181628
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
1619-
-DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS})
1629+
-DCMAKE_Swift_COMPILER_TARGET:STRING=${stdlib_target_triple}
1630+
-DCMAKE_C_COMPILER_TARGET:STRING=${stdlib_target_triple}
1631+
-DCMAKE_CXX_COMPILER_TARGET:STRING=${stdlib_target_triple}
1632+
-DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS}
1633+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
1634+
-DSwiftCore_PLATFORM_SUBDIR=${SWIFT_SDK_${sdk}_LIB_SUBDIR}
1635+
-DSwiftCore_ARCH_SUBDIR=${arch})
16201636
if(NOT ${CMAKE_CROSSCOMPILING})
16211637
add_dependencies("${stdlib_target}" swift-frontend)
16221638
endif()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
| **OS** | **Architecture** | **Build** |
3737
|---|:---:|:---:|
38-
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/main/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|
39-
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/main/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64)|
38+
|**[Android](https://github.com/swiftlang/swift-community-hosted-continuous-integration/blob/main/nodes/x86_64_ubuntu_24_04_android.json)** | X86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-build/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-build)|
39+
|**[Android](https://github.com/swiftlang/swift-community-hosted-continuous-integration/blob/main/nodes/aarch64_ubuntu_24_04_android.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64)|
4040
|**[Windows 2019 (VS 2019)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/main/nodes/x86_64_windows_2019_VS2019.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-windows-x86_64-vs2019/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-windows-x86_64-vs2019)|
4141

4242
## Welcome to Swift

0 commit comments

Comments
 (0)