Skip to content

Commit b909d3c

Browse files
Merge remote-tracking branch 'origin/release/5.7' into katei/merge-release-5.7-2022-11-03
2 parents 258e256 + 41da05d commit b909d3c

File tree

67 files changed

+254
-119
lines changed

Some content is hidden

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

67 files changed

+254
-119
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ function(add_swift_compiler_modules_library name)
7676
"-Xfrontend" "-validate-tbd-against-ir=none"
7777
"-Xfrontend" "-enable-cxx-interop"
7878
"-Xcc" "-UIBOutlet" "-Xcc" "-UIBAction" "-Xcc" "-UIBInspectable")
79+
if (NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
80+
list(APPEND swift_compile_options "-Xfrontend" "-disable-implicit-string-processing-module-import")
81+
endif()
7982

8083
if(CMAKE_BUILD_TYPE STREQUAL Debug)
8184
list(APPEND swift_compile_options "-g")

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
515515
// forward slash regex `/.../`.
516516
if (!Opts.EnableExperimentalStringProcessing)
517517
Opts.EnableBareSlashRegexLiterals = false;
518+
} else {
519+
Opts.EnableExperimentalStringProcessing = true;
518520
}
519521

520522
Opts.DisableAvailabilityChecking |=

lib/Frontend/Frontend.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,9 @@ bool CompilerInvocation::shouldImportSwiftConcurrency() const {
794794

795795
bool CompilerInvocation::shouldImportSwiftStringProcessing() const {
796796
return getLangOptions().EnableExperimentalStringProcessing &&
797-
!getLangOptions().DisableImplicitStringProcessingModuleImport;
797+
!getLangOptions().DisableImplicitStringProcessingModuleImport &&
798+
getFrontendOptions().InputMode !=
799+
FrontendOptions::ParseInputMode::SwiftModuleInterface;
798800
}
799801

800802
/// Implicitly import the SwiftOnoneSupport module in non-optimized

lib/IRGen/Outlining.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ static bool canUseValueWitnessForValueOp(IRGenModule &IGM, SILType T) {
209209
if (!IGM.getSILModule().isTypeMetadataForLayoutAccessible(T))
210210
return false;
211211

212+
// It is not a good code size trade-off to instantiate a metatype for
213+
// existentials, and also does not back-deploy gracefully in the case of
214+
// constrained protocols.
215+
if (T.getASTType()->isExistentialType())
216+
return false;
217+
212218
if (needsSpecialOwnershipHandling(T))
213219
return false;
214220
if (T.getASTType()->hasDynamicSelfType())

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,12 @@ function(add_swift_target_library name)
17661766
"-Xfrontend;-disable-implicit-distributed-module-import")
17671767
endif()
17681768

1769+
# Turn off implicit import of _StringProcessing when building libraries
1770+
if(SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING)
1771+
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS
1772+
"-Xfrontend;-disable-implicit-string-processing-module-import")
1773+
endif()
1774+
17691775
if(SWIFTLIB_IS_STDLIB AND SWIFT_STDLIB_ENABLE_PRESPECIALIZATION)
17701776
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-prespecialize-generic-metadata")
17711777
endif()

stdlib/public/BackDeployConcurrency/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ list(REMOVE_ITEM SWIFT_SDK_IOS_SIMULATOR_ARCHITECTURES "i386")
2929
list(REMOVE_ITEM SWIFT_SDK_IOS_ARCHITECTURES "arm64e")
3030
list(REMOVE_ITEM SWIFT_SDK_OSX_ARCHITECTURES "arm64e")
3131

32+
# Don't build the libraries for 64-bit watchOS targets;
33+
# there is no back-deployment to them.
34+
list(REMOVE_ITEM SWIFT_SDK_WATCHOS_ARCHITECTURES "arm64" "arm64e")
35+
3236
# The back-deployed library can only be shared.
3337
list(APPEND SWIFT_STDLIB_LIBRARY_BUILD_TYPES SHARED)
3438

test/AutoDiff/validation-test/differentiable_protocol_requirements.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-run-simple-swift
22
// REQUIRES: executable_test
3-
3+
// REQUIRES: rdar89860761
44
// Disabled due to test failure with `-O`: SR-13250.
55
// SR-13250 is tracking the fix for compiling this test with optimizations.
66
// XFAIL: swift_test_mode_optimize

test/Concurrency/Backdeploy/weak_linking.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend %s -target x86_64-apple-macosx12.0 -module-name main -emit-ir -o %t/new.ir
2+
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macosx12.0 -module-name main -emit-ir -o %t/new.ir
33
// RUN: %FileCheck %s --check-prefix=NEW < %t/new.ir
4-
// RUN: %target-swift-frontend %s -target x86_64-apple-macosx10.15 -module-name main -emit-ir -o %t/old.ir -disable-availability-checking
4+
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macosx10.15 -module-name main -emit-ir -o %t/old.ir -disable-availability-checking
55
// RUN: %FileCheck %s --check-prefix=OLD < %t/old.ir
6-
// RUN: %target-swift-frontend %s -target x86_64-apple-macosx10.15 -O -module-name main -emit-ir -o %t/optimized.ir -disable-availability-checking
6+
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macosx10.15 -O -module-name main -emit-ir -o %t/optimized.ir -disable-availability-checking
77
// RUN: %FileCheck %s --check-prefix=OPTIMIZED < %t/optimized.ir
88

99

test/Frontend/module-alias-explicit-build.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
// RUN: echo "\"moduleName\": \"_Concurrency\"," >> %/t/inputs/map.json
3434
// RUN: echo "\"modulePath\": \"%/concurrency_module\"," >> %/t/inputs/map.json
3535
// RUN: echo "\"isFramework\": false" >> %/t/inputs/map.json
36+
// RUN: echo "}," >> %/t/inputs/map.json
37+
// RUN: echo "{" >> %/t/inputs/map.json
38+
// RUN: echo "\"moduleName\": \"_StringProcessing\"," >> %/t/inputs/map.json
39+
// RUN: echo "\"modulePath\": \"%/string_processing_module\"," >> %/t/inputs/map.json
40+
// RUN: echo "\"isFramework\": false" >> %/t/inputs/map.json
3641
// RUN: echo "}]" >> %/t/inputs/map.json
3742

3843
/// Create a module Foo that imports Cat with -module-alias Cat=Bar with an explicit module loader

test/Frontend/skip-function-bodies.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %empty-directory(%t)
22

3+
// REQUIRES: rdar101495870
4+
35
// Check -emit-ir and -c are invalid when skipping function bodies
46
// RUN: not %target-swift-frontend -emit-ir %s -experimental-skip-non-inlinable-function-bodies %s 2>&1 | %FileCheck %s --check-prefix ERROR
57
// RUN: not %target-swift-frontend -c %s -experimental-skip-non-inlinable-function-bodies %s 2>&1 | %FileCheck %s --check-prefix ERROR

0 commit comments

Comments
 (0)