Skip to content

Commit 0e75f37

Browse files
authored
Merge branch 'master' into optimize-emit-clang-decl
2 parents cd7f205 + 7c6f1cc commit 0e75f37

File tree

382 files changed

+9084
-2283
lines changed

Some content is hidden

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

382 files changed

+9084
-2283
lines changed

cmake/modules/DarwinSDKs.cmake

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ is_sdk_requested(OSX swift_build_osx)
2020
if(swift_build_osx)
2121
configure_sdk_darwin(
2222
OSX "OS X" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX}"
23-
macosx macosx macosx "${SUPPORTED_OSX_ARCHS}")
23+
macosx macosx macosx macos "${SUPPORTED_OSX_ARCHS}")
2424
configure_target_variant(OSX-DA "OS X Debug+Asserts" OSX DA "Debug+Asserts")
2525
configure_target_variant(OSX-RA "OS X Release+Asserts" OSX RA "Release+Asserts")
2626
configure_target_variant(OSX-R "OS X Release" OSX R "Release")
@@ -33,7 +33,7 @@ is_sdk_requested(IOS swift_build_ios)
3333
if(swift_build_ios)
3434
configure_sdk_darwin(
3535
IOS "iOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
36-
iphoneos ios ios "${SUPPORTED_IOS_ARCHS}")
36+
iphoneos ios ios ios "${SUPPORTED_IOS_ARCHS}")
3737
configure_target_variant(IOS-DA "iOS Debug+Asserts" IOS DA "Debug+Asserts")
3838
configure_target_variant(IOS-RA "iOS Release+Asserts" IOS RA "Release+Asserts")
3939
configure_target_variant(IOS-R "iOS Release" IOS R "Release")
@@ -43,7 +43,8 @@ is_sdk_requested(IOS_SIMULATOR swift_build_ios_simulator)
4343
if(swift_build_ios_simulator)
4444
configure_sdk_darwin(
4545
IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
46-
iphonesimulator ios-simulator ios "${SUPPORTED_IOS_SIMULATOR_ARCHS}")
46+
iphonesimulator ios-simulator ios ios-simulator
47+
"${SUPPORTED_IOS_SIMULATOR_ARCHS}")
4748
configure_target_variant(
4849
IOS_SIMULATOR-DA "iOS Debug+Asserts" IOS_SIMULATOR DA "Debug+Asserts")
4950
configure_target_variant(
@@ -56,7 +57,7 @@ is_sdk_requested(TVOS swift_build_tvos)
5657
if(swift_build_tvos)
5758
configure_sdk_darwin(
5859
TVOS "tvOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
59-
appletvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
60+
appletvos tvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
6061
configure_target_variant(TVOS-DA "tvOS Debug+Asserts" TVOS DA "Debug+Asserts")
6162
configure_target_variant(TVOS-RA "tvOS Release+Asserts" TVOS RA "Release+Asserts")
6263
configure_target_variant(TVOS-R "tvOS Release" TVOS R "Release")
@@ -66,7 +67,8 @@ is_sdk_requested(TVOS_SIMULATOR swift_build_tvos_simulator)
6667
if(swift_build_tvos_simulator)
6768
configure_sdk_darwin(
6869
TVOS_SIMULATOR "tvOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
69-
appletvsimulator tvos-simulator tvos "${SUPPORTED_TVOS_SIMULATOR_ARCHS}")
70+
appletvsimulator tvos-simulator tvos tvos-simulator
71+
"${SUPPORTED_TVOS_SIMULATOR_ARCHS}")
7072
configure_target_variant(
7173
TVOS_SIMULATOR-DA "tvOS Debug+Asserts" TVOS_SIMULATOR DA "Debug+Asserts")
7274
configure_target_variant(
@@ -79,7 +81,7 @@ is_sdk_requested(WATCHOS swift_build_watchos)
7981
if(swift_build_watchos)
8082
configure_sdk_darwin(
8183
WATCHOS "watchOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
82-
watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
84+
watchos watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
8385
configure_target_variant(WATCHOS-DA "watchOS Debug+Asserts" WATCHOS DA "Debug+Asserts")
8486
configure_target_variant(WATCHOS-RA "watchOS Release+Asserts" WATCHOS RA "Release+Asserts")
8587
configure_target_variant(WATCHOS-R "watchOS Release" WATCHOS R "Release")
@@ -89,7 +91,8 @@ is_sdk_requested(WATCHOS_SIMULATOR swift_build_watchos_simulator)
8991
if(swift_build_watchos_simulator)
9092
configure_sdk_darwin(
9193
WATCHOS_SIMULATOR "watchOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
92-
watchsimulator watchos-simulator watchos "${SUPPORTED_WATCHOS_SIMULATOR_ARCHS}")
94+
watchsimulator watchos-simulator watchos watchos-simulator
95+
"${SUPPORTED_WATCHOS_SIMULATOR_ARCHS}")
9396
configure_target_variant(WATCHOS_SIMULATOR-DA "watchOS Debug+Asserts" WATCHOS_SIMULATOR DA "Debug+Asserts")
9497
configure_target_variant(WATCHOS_SIMULATOR-RA "watchOS Release+Asserts" WATCHOS_SIMULATOR RA "Release+Asserts")
9598
configure_target_variant(WATCHOS_SIMULATOR-R "watchOS Release" WATCHOS_SIMULATOR R "Release")

cmake/modules/StandaloneOverlay.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ include(SwiftConfigureSDK)
115115
include(SwiftComponents)
116116
include(DarwinSDKs)
117117

118+
find_package(Python2 COMPONENTS Interpreter REQUIRED)
119+
find_package(Python3 COMPONENTS Interpreter)
120+
if(NOT Python3_Interpreter_FOUND)
121+
message(WARNING "Python3 not found, using python2 as a fallback")
122+
add_executable(Python3::Interpreter IMPORTED)
123+
set_target_properties(Python3::Interpreter PROPERTIES
124+
IMPORTED_LOCATION ${Python2_EXECUTABLE})
125+
endif()
118126

119127
# Without this line, installing components is broken. This needs refactoring.
120128
swift_configure_components()

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function(_report_sdk prefix)
3939
message(STATUS " Architectures: ${SWIFT_SDK_${prefix}_ARCHITECTURES}")
4040
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
4141
message(STATUS " ${arch} triple: ${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}")
42+
message(STATUS " Module triple: ${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
4243
endforeach()
4344
if("${prefix}" STREQUAL "WINDOWS")
4445
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
@@ -115,9 +116,10 @@ endfunction()
115116
# SWIFT_SDK_${prefix}_ARCHITECTURES Architectures (as a list)
116117
# SWIFT_SDK_${prefix}_IS_SIMULATOR Whether this is a simulator target.
117118
# SWIFT_SDK_${prefix}_ARCH_${ARCH}_TRIPLE Triple name
119+
# SWIFT_SDK_${prefix}_ARCH_${ARCH}_MODULE Module triple name for this SDK
118120
macro(configure_sdk_darwin
119121
prefix name deployment_version xcrun_name
120-
version_min_name triple_name architectures)
122+
version_min_name triple_name module_name architectures)
121123
# Note: this has to be implemented as a macro because it sets global
122124
# variables.
123125

@@ -190,6 +192,9 @@ macro(configure_sdk_darwin
190192
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
191193
"${arch}-apple-${SWIFT_SDK_${prefix}_TRIPLE_NAME}")
192194

195+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE
196+
"${arch}-apple-${module_name}")
197+
193198
# If this is a simulator target, append -simulator.
194199
if (SWIFT_SDK_${prefix}_IS_SIMULATOR)
195200
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
@@ -198,12 +203,8 @@ macro(configure_sdk_darwin
198203

199204
if(SWIFT_ENABLE_MACCATALYST AND "${prefix}" STREQUAL "OSX")
200205
# For macCatalyst append the '-macabi' environment to the target triple.
201-
set(SWIFT_SDK_MACCATALYST_ARCH_${arch}_TRIPLE
202-
"${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}-macabi")
203-
204-
# macCatalyst triple
205-
set(SWIFT_MACCATALYST_TRIPLE
206-
"x86_64-apple-ios${SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST}-macabi")
206+
set(SWIFT_SDK_MACCATALYST_ARCH_${arch}_TRIPLE "${arch}-apple-ios-macabi")
207+
set(SWIFT_SDK_MACCATALYST_ARCH_${arch}_MODULE "${arch}-apple-ios-macabi")
207208

208209
# For macCatalyst, the xcrun_name is "macosx" since it uses that sdk.
209210
# Hard code the library subdirectory to "maccatalyst" in that case.
@@ -256,6 +257,8 @@ macro(configure_sdk_unix name architectures)
256257
message(SEND_ERROR "Couldn't find SWIFT_SDK_ANDROID_ARCH_armv7_PATH")
257258
endif()
258259
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "armv7-none-linux-androideabi")
260+
# The Android ABI isn't part of the module triple.
261+
set(SWIFT_SDK_ANDROID_ARCH_${arch}_MODULE "armv7-none-linux-android")
259262
elseif("${arch}" STREQUAL "aarch64")
260263
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "aarch64-linux-android")
261264
set(SWIFT_SDK_ANDROID_ARCH_${arch}_ALT_SPELLING "aarch64")
@@ -358,6 +361,11 @@ macro(configure_sdk_unix name architectures)
358361
message(FATAL_ERROR "unknown Unix OS: ${prefix}")
359362
endif()
360363
endif()
364+
365+
# If the module triple wasn't set explicitly, it's the same as the triple.
366+
if(NOT SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE)
367+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
368+
endif()
361369
endforeach()
362370

363371
# Add this to the list of known SDKs.
@@ -388,6 +396,9 @@ macro(configure_sdk_windows name environment architectures)
388396
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
389397
"${arch}-unknown-windows-${environment}")
390398
endif()
399+
400+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
401+
391402
# NOTE: set the path to / to avoid a spurious `--sysroot` from being passed
392403
# to the driver -- rely on the `INCLUDE` AND `LIB` environment variables
393404
# instead.

docs/ABI/Mangling.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ mangled in to disambiguate.
589589
impl-function-type ::= type* 'I' FUNC-ATTRIBUTES '_'
590590
impl-function-type ::= type* generic-signature 'I' FUNC-ATTRIBUTES '_'
591591

592-
FUNC-ATTRIBUTES ::= PATTERN-SUBS? INVOCATION-SUBS? PSEUDO-GENERIC? CALLEE-ESCAPE? DIFFERENTIABILITY-KIND? CALLEE-CONVENTION FUNC-REPRESENTATION? COROUTINE-KIND? PARAM-CONVENTION* RESULT-CONVENTION* ('Y' PARAM-CONVENTION)* ('z' RESULT-CONVENTION)?
592+
FUNC-ATTRIBUTES ::= PATTERN-SUBS? INVOCATION-SUBS? PSEUDO-GENERIC? CALLEE-ESCAPE? DIFFERENTIABILITY-KIND? CALLEE-CONVENTION FUNC-REPRESENTATION? COROUTINE-KIND? (PARAM-CONVENTION PARAM-DIFFERENTIABILITY?)* RESULT-CONVENTION* ('Y' PARAM-CONVENTION)* ('z' RESULT-CONVENTION)?
593593

594594
PATTERN-SUBS ::= 's' // has pattern substitutions
595595
INVOCATION-SUB ::= 'I' // has invocation substitutions
@@ -626,6 +626,8 @@ mangled in to disambiguate.
626626
PARAM-CONVENTION ::= 'g' // direct guaranteed
627627
PARAM-CONVENTION ::= 'e' // direct deallocating
628628

629+
PARAM-DIFFERENTIABILITY ::= 'w' // @noDerivative
630+
629631
RESULT-CONVENTION ::= 'r' // indirect
630632
RESULT-CONVENTION ::= 'o' // owned
631633
RESULT-CONVENTION ::= 'd' // unowned

docs/Lexicon.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
471471
compared across translation units to determine, e.g., when references in
472472
one translation refer to an entity defined in another translation unit.
473473

474-
value witness table
474+
VWT (value witness table)
475475
A runtime structure that describes how to do basic operations on an unknown
476476
value, like "assign", "copy", and "destroy". (For example, does copying
477477
this value require any retains?)
@@ -496,7 +496,7 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
496496
`vtable <vtable (virtual dispatch table)>` but for a protocol instead of
497497
a class.
498498

499-
Only conceptually related to a `value witness table`.
499+
Only conceptually related to a `value witness table <VWT (value witness table)>`.
500500

501501
WMO (whole-module optimization)
502502
A compilation mode where all files in a module are compiled in a single

docs/SIL.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4558,11 +4558,11 @@ init_existential_value
45584558
``````````````````````
45594559
::
45604560

4561-
sil-instruction ::= 'init_existential_value' sil-operand ':' sil-type ','
4562-
sil-type
4561+
sil-instruction ::= 'init_existential_value' sil-operand ',' sil-type ','
4562+
sil-type
45634563

4564-
%1 = init_existential_value %0 : $L' : $C, $P
4565-
// %0 must be of loadable type $L', lowered from AST type $L, conforming to
4564+
%1 = init_existential_value %0 : $L, $C, $P
4565+
// %0 must be of loadable type $L, lowered from AST type $C, conforming to
45664566
// protocol(s) $P
45674567
// %1 will be of type $P
45684568

docs/StandardLibraryProgrammersManual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ The standard library cannot import the Darwin module (much less an ICU module),
220220
221221
#### `_FixedArray`
222222
223-
The standard library has internal fixed size arrays of some limited sizes. This provides fast random access into contiguous (usually stack-allocated) memory. These are metaprogrammed based on size, so if you need a new size not currently defined, add it to the `sizes` gyb variable. See [FixedArray.swift.gyb](https://github.com/apple/swift/blob/master/stdlib/public/core/FixedArray.swift.gyb) for implementation.
223+
The standard library has internal array of fixed size 16. This provides fast random access into contiguous (usually stack-allocated) memory. See [FixedArray.swift](https://github.com/apple/swift/blob/master/stdlib/public/core/FixedArray.swift) for implementation.
224224
225225
#### Thread Local Storage
226226

docs/WindowsBuild.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cmake -B "S:\b\toolchain" -G Ninja -S S:\toolchain\llvm ^
101101
-DSWIFT_PATH_TO_LIBDISPATCH_SOURCE=S:\toolchain\swift-corelibs-libdispatch ^
102102
-DLLVM_ENABLE_PDB=YES ^
103103
-DLLVM_ENABLE_LIBEDIT=NO ^
104-
-DLLDB_DISABLE_PYTHON=YES ^
104+
-DLLDB_ENABLE_PYTHON=NO ^
105105
-DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-64/usr/include" ^
106106
-DSWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-64/usr/lib/icuuc64.lib" ^
107107
-DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-64/usr/include" ^

include/swift/ABI/Metadata.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,6 +3373,7 @@ class TargetGenericMetadataPatternTrailingObjects :
33733373
/// class metadata.
33743374
///
33753375
/// See also: [pre-5.2-extra-data-zeroing]
3376+
/// See also: [pre-5.3-extra-data-zeroing]
33763377
const GenericMetadataPartialPattern *getExtraDataPattern() const {
33773378
assert(asSelf()->hasExtraDataPattern());
33783379
return this->template getTrailingObjects<GenericMetadataPartialPattern>();

include/swift/AST/ASTTypeIDZone.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ SWIFT_TYPEID(AncestryFlags)
1919
SWIFT_TYPEID(CtorInitializerKind)
2020
SWIFT_TYPEID(FunctionBuilderBodyPreCheck)
2121
SWIFT_TYPEID(GenericSignature)
22+
SWIFT_TYPEID(ImplicitImport)
2223
SWIFT_TYPEID(ImplicitMemberAction)
2324
SWIFT_TYPEID(ParamSpecifier)
2425
SWIFT_TYPEID(PropertyWrapperBackingPropertyInfo)

0 commit comments

Comments
 (0)