Skip to content

Commit f73ef13

Browse files
authored
Merge pull request #68724 from kubamracek/embedded-osize
[embedded] Disallow use of VWTs for take/copy/assign/destroy operations, even under -Osize
2 parents 4b7c020 + fda2a2a commit f73ef13

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/IRGen/Outlining.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ static bool canUseValueWitnessForValueOp(IRGenModule &IGM, SILType T) {
214214
if (!IGM.getSILModule().isTypeMetadataForLayoutAccessible(T))
215215
return false;
216216

217+
// No value witness tables in embedded Swift.
218+
if (IGM.Context.LangOpts.hasFeature(Feature::Embedded))
219+
return false;
220+
217221
// It is not a good code size trade-off to instantiate a metatype for
218222
// existentials, and also does not back-deploy gracefully in the case of
219223
// constrained protocols.

test/embedded/array-builtins-no-stdlib.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// RUN: %target-swift-emit-ir %s -parse-stdlib -module-name Swift -enable-experimental-feature Embedded -wmo -target arm64e-apple-none | %FileCheck %s
2+
// RUN: %target-swift-emit-ir %s -parse-stdlib -module-name Swift -enable-experimental-feature Embedded -wmo -target arm64e-apple-none -Osize | %FileCheck %s
3+
// RUN: %target-swift-emit-ir %s -parse-stdlib -module-name Swift -enable-experimental-feature Embedded -wmo -target arm64e-apple-none -O | %FileCheck %s
24

35
// REQUIRES: swift_in_compiler
46

0 commit comments

Comments
 (0)