Skip to content

Commit a622afd

Browse files
authored
Merge pull request #2489 from swiftwasm/main
[pull] swiftwasm from main
2 parents 1584d93 + 7fada0a commit a622afd

File tree

106 files changed

+3014
-1050
lines changed

Some content is hidden

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

106 files changed

+3014
-1050
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
147147
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
148148
# can be reused when a new version of Swift comes out (assuming the user hasn't
149149
# manually set it as part of their own CMake configuration).
150-
set(SWIFT_VERSION "5.3")
150+
set(SWIFT_VERSION "5.4")
151151

152152
set(SWIFT_VENDOR "" CACHE STRING
153153
"The vendor name of the Swift compiler")
@@ -660,9 +660,10 @@ endif()
660660
#
661661

662662
if(XCODE)
663-
# FIXME: Cannot cross-compile the standard library using Xcode. Xcode
664-
# insists on passing -mmacosx-version-min to the compiler, and we need
665-
# to pass -mios-version-min. Clang sees both options and complains.
663+
# FIXME: It used to be the case that Xcode would force
664+
# -m${platform}-version-min flags that would conflict with those computed
665+
# by build-script. version-min flags are deprecated in favor of -target since
666+
# clang-11, so we might be able to undo this.
666667
set(SWIFT_SDKS "OSX")
667668
endif()
668669

benchmark/utils/DriverUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ final class TestRunner {
446446
/// of context switches.
447447
///
448448
/// This method of estimating memory usage is valid only for executing single
449-
/// benchmark. That's why we don't worry about reseting the `baseline` in
449+
/// benchmark. That's why we don't worry about resetting the `baseline` in
450450
/// `resetMeasurements`.
451451
///
452452
/// FIXME: This current implementation doesn't work on Linux. It is disabled

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ function(_add_host_variant_c_compile_link_flags name)
114114
# side effects are introduced should a new search path be added.
115115
target_compile_options(${name} PRIVATE
116116
-arch ${SWIFT_HOST_VARIANT_ARCH}
117-
"-F${SWIFT_SDK_${SWIFT_HOST_VARIANT_ARCH}_PATH}/../../../Developer/Library/Frameworks"
118-
"-m${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_VERSION_MIN_NAME}-version-min=${DEPLOYMENT_VERSION}")
117+
"-F${SWIFT_SDK_${SWIFT_HOST_VARIANT_ARCH}_PATH}/../../../Developer/Library/Frameworks")
119118
endif()
120119

121120
_compute_lto_flag("${SWIFT_TOOLS_ENABLE_LTO}" _lto_flag_out)

cmake/modules/DarwinSDKs.cmake

Lines changed: 8 additions & 8 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 macos "${SUPPORTED_OSX_ARCHS}")
23+
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")
@@ -38,7 +38,7 @@ if(swift_build_freestanding)
3838
"Which architectures to build when building the FREESTANDING stdlib")
3939
configure_sdk_darwin(
4040
FREESTANDING "FREESTANDING" ""
41-
"${SWIFT_FREESTANDING_SDK}" freestanding
41+
"${SWIFT_FREESTANDING_SDK}"
4242
"${SWIFT_FREESTANDING_TRIPLE_NAME}" "${SWIFT_FREESTANDING_MODULE_NAME}" "${SWIFT_FREESTANDING_ARCHS}")
4343
set(SWIFT_SDK_FREESTANDING_LIB_SUBDIR "freestanding")
4444
configure_target_variant(FREESTANDING-DA "FREESTANDING Debug+Asserts" FREESTANDING DA "Debug+Asserts")
@@ -54,7 +54,7 @@ is_sdk_requested(IOS swift_build_ios)
5454
if(swift_build_ios)
5555
configure_sdk_darwin(
5656
IOS "iOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
57-
iphoneos ios ios ios "${SUPPORTED_IOS_ARCHS}")
57+
iphoneos ios ios "${SUPPORTED_IOS_ARCHS}")
5858
configure_target_variant(IOS-DA "iOS Debug+Asserts" IOS DA "Debug+Asserts")
5959
configure_target_variant(IOS-RA "iOS Release+Asserts" IOS RA "Release+Asserts")
6060
configure_target_variant(IOS-R "iOS Release" IOS R "Release")
@@ -64,7 +64,7 @@ is_sdk_requested(IOS_SIMULATOR swift_build_ios_simulator)
6464
if(swift_build_ios_simulator)
6565
configure_sdk_darwin(
6666
IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
67-
iphonesimulator ios-simulator ios ios-simulator
67+
iphonesimulator ios ios-simulator
6868
"${SUPPORTED_IOS_SIMULATOR_ARCHS}")
6969
configure_target_variant(
7070
IOS_SIMULATOR-DA "iOS Debug+Asserts" IOS_SIMULATOR DA "Debug+Asserts")
@@ -78,7 +78,7 @@ is_sdk_requested(TVOS swift_build_tvos)
7878
if(swift_build_tvos)
7979
configure_sdk_darwin(
8080
TVOS "tvOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
81-
appletvos tvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
81+
appletvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
8282
configure_target_variant(TVOS-DA "tvOS Debug+Asserts" TVOS DA "Debug+Asserts")
8383
configure_target_variant(TVOS-RA "tvOS Release+Asserts" TVOS RA "Release+Asserts")
8484
configure_target_variant(TVOS-R "tvOS Release" TVOS R "Release")
@@ -88,7 +88,7 @@ is_sdk_requested(TVOS_SIMULATOR swift_build_tvos_simulator)
8888
if(swift_build_tvos_simulator)
8989
configure_sdk_darwin(
9090
TVOS_SIMULATOR "tvOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
91-
appletvsimulator tvos-simulator tvos tvos-simulator
91+
appletvsimulator tvos tvos-simulator
9292
"${SUPPORTED_TVOS_SIMULATOR_ARCHS}")
9393
configure_target_variant(
9494
TVOS_SIMULATOR-DA "tvOS Debug+Asserts" TVOS_SIMULATOR DA "Debug+Asserts")
@@ -102,7 +102,7 @@ is_sdk_requested(WATCHOS swift_build_watchos)
102102
if(swift_build_watchos)
103103
configure_sdk_darwin(
104104
WATCHOS "watchOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
105-
watchos watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
105+
watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
106106
configure_target_variant(WATCHOS-DA "watchOS Debug+Asserts" WATCHOS DA "Debug+Asserts")
107107
configure_target_variant(WATCHOS-RA "watchOS Release+Asserts" WATCHOS RA "Release+Asserts")
108108
configure_target_variant(WATCHOS-R "watchOS Release" WATCHOS R "Release")
@@ -112,7 +112,7 @@ is_sdk_requested(WATCHOS_SIMULATOR swift_build_watchos_simulator)
112112
if(swift_build_watchos_simulator)
113113
configure_sdk_darwin(
114114
WATCHOS_SIMULATOR "watchOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
115-
watchsimulator watchos-simulator watchos watchos-simulator
115+
watchsimulator watchos watchos-simulator
116116
"${SUPPORTED_WATCHOS_SIMULATOR_ARCHS}")
117117
configure_target_variant(WATCHOS_SIMULATOR-DA "watchOS Debug+Asserts" WATCHOS_SIMULATOR DA "Debug+Asserts")
118118
configure_target_variant(WATCHOS_SIMULATOR-RA "watchOS Release+Asserts" WATCHOS_SIMULATOR RA "Release+Asserts")

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ function(_report_sdk prefix)
2828
message(STATUS " Version: ${SWIFT_SDK_${prefix}_VERSION}")
2929
message(STATUS " Build number: ${SWIFT_SDK_${prefix}_BUILD_NUMBER}")
3030
message(STATUS " Deployment version: ${SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION}")
31-
message(STATUS " Version min name: ${SWIFT_SDK_${prefix}_VERSION_MIN_NAME}")
3231
message(STATUS " Triple name: ${SWIFT_SDK_${prefix}_TRIPLE_NAME}")
3332
message(STATUS " Simulator: ${SWIFT_SDK_${prefix}_IS_SIMULATOR}")
3433
endif()
@@ -125,7 +124,6 @@ endfunction()
125124
# name # Display name for this SDK
126125
# deployment_version # Deployment version
127126
# xcrun_name # SDK name to use with xcrun
128-
# version_min_name # The name used in the -mOS-version-min flag
129127
# triple_name # The name used in Swift's -triple
130128
# architectures # A list of architectures this SDK supports
131129
# )
@@ -143,7 +141,6 @@ endfunction()
143141
# SWIFT_SDK_${prefix}_BUILD_NUMBER SDK build number (e.g., 14A389a)
144142
# SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION Deployment version (e.g., 10.9, 7.0)
145143
# SWIFT_SDK_${prefix}_LIB_SUBDIR Library subdir for this SDK
146-
# SWIFT_SDK_${prefix}_VERSION_MIN_NAME Version min name for this SDK
147144
# SWIFT_SDK_${prefix}_TRIPLE_NAME Triple name for this SDK
148145
# SWIFT_SDK_${prefix}_OBJECT_FORMAT The object file format (e.g. MACHO)
149146
# SWIFT_SDK_${prefix}_USE_ISYSROOT Whether to use -isysroot
@@ -153,7 +150,7 @@ endfunction()
153150
# SWIFT_SDK_${prefix}_ARCH_${ARCH}_MODULE Module triple name for this SDK
154151
macro(configure_sdk_darwin
155152
prefix name deployment_version xcrun_name
156-
version_min_name triple_name module_name architectures)
153+
triple_name module_name architectures)
157154
# Note: this has to be implemented as a macro because it sets global
158155
# variables.
159156

@@ -186,7 +183,6 @@ macro(configure_sdk_darwin
186183
set(SWIFT_SDK_${prefix}_NAME "${name}")
187184
set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "${deployment_version}")
188185
set(SWIFT_SDK_${prefix}_LIB_SUBDIR "${xcrun_name}")
189-
set(SWIFT_SDK_${prefix}_VERSION_MIN_NAME "${version_min_name}")
190186
set(SWIFT_SDK_${prefix}_TRIPLE_NAME "${triple_name}")
191187
set(SWIFT_SDK_${prefix}_OBJECT_FORMAT "MACHO")
192188
set(SWIFT_SDK_${prefix}_USE_ISYSROOT TRUE)
@@ -495,7 +491,6 @@ function(configure_target_variant prefix name sdk build_config lib_subdir)
495491
set(SWIFT_VARIANT_${prefix}_BUILD_NUMBER ${SWIFT_SDK_${sdk}_BUILD_NUMBER})
496492
set(SWIFT_VARIANT_${prefix}_DEPLOYMENT_VERSION ${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION})
497493
set(SWIFT_VARIANT_${prefix}_LIB_SUBDIR "${lib_subdir}/${SWIFT_SDK_${sdk}_LIB_SUBDIR}")
498-
set(SWIFT_VARIANT_${prefix}_VERSION_MIN_NAME ${SWIFT_SDK_${sdk}_VERSION_MIN_NAME})
499494
set(SWIFT_VARIANT_${prefix}_TRIPLE_NAME ${SWIFT_SDK_${sdk}_TRIPLE_NAME})
500495
set(SWIFT_VARIANT_${prefix}_ARCHITECTURES ${SWIFT_SDK_${sdk}_ARCHITECTURES})
501496
endfunction()

docs/OptimizationTips.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ end of the callee. This means that if one writes a function like the following:
263263
::
264264

265265
func append_one(_ a: [Int]) -> [Int] {
266+
var a = a
266267
a.append(1)
267268
return a
268269
}

include/swift/AST/ASTContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,8 @@ class ASTContext final {
795795
StringRef moduleName,
796796
bool isUnderlyingClangModule,
797797
ModuleDependenciesCache &cache,
798-
InterfaceSubContextDelegate &delegate);
798+
InterfaceSubContextDelegate &delegate,
799+
bool cacheOnly = false);
799800

800801
/// Retrieve the module dependencies for the Swift module with the given name.
801802
Optional<ModuleDependencies> getSwiftModuleDependencies(

include/swift/AST/Attr.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ SIMPLE_DECL_ATTR(IBSegueAction, IBSegueAction,
534534

535535
DECL_ATTR(_originallyDefinedIn, OriginallyDefinedIn,
536536
OnNominalType | OnFunc | OnVar | OnExtension | UserInaccessible |
537-
AllowMultipleAttributes |
537+
AllowMultipleAttributes | LongAttribute |
538538
ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
539539
96)
540540

include/swift/AST/AvailabilitySpec.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ class OtherPlatformAvailabilitySpec : public AvailabilitySpec {
201201
: AvailabilitySpec(AvailabilitySpecKind::OtherPlatform),
202202
StarLoc(StarLoc) {}
203203

204+
SourceLoc getStarLoc() const { return StarLoc; }
205+
204206
SourceRange getSourceRange() const { return SourceRange(StarLoc, StarLoc); }
205207

206208
void print(raw_ostream &OS, unsigned Indent) const;

include/swift/AST/DiagnosticsParse.def

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,14 @@ WARNING(originally_defined_in_major_minor_only,none,
14891489
WARNING(originally_defined_in_missing_platform_name,none,
14901490
"* as platform name has no effect", ())
14911491

1492+
WARNING(originally_defined_in_swift_version, none,
1493+
"Swift language version checks has no effect "
1494+
"in @_originallyDefinedIn", ())
1495+
1496+
WARNING(originally_defined_in_package_description, none,
1497+
"PackageDescription version checks has no effect "
1498+
"in @_originallyDefinedIn", ())
1499+
14921500
// convention
14931501
ERROR(convention_attribute_expected_lparen,none,
14941502
"expected '(' after 'convention' attribute", ())

0 commit comments

Comments
 (0)