File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -431,6 +431,15 @@ void CrossModuleOptimization::serializeWitnessTablesInModule() {
431431}
432432
433433void CrossModuleOptimization::serializeVTablesInModule () {
434+ if (everything) {
435+ for (SILVTable *vt : M.getVTables ()) {
436+ vt->setSerializedKind (IsSerialized);
437+ for (auto &entry : vt->getEntries ()) {
438+ makeFunctionUsableFromInline (entry.getImplementation ());
439+ }
440+ }
441+ return ;
442+ }
434443 if (!isPackageCMOEnabled (M.getSwiftModule ()))
435444 return ;
436445
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: %{python} %utils/split_file.py -o %t %s
3+
4+ // RUN: %target-swift-frontend -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library
5+ // RUN: %target-swift-frontend -c -I %t %t/Main.swift -enable-experimental-feature Embedded -o %t/a.o
6+ // RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
7+ // RUN: %target-clang %t/a.o %t/print.o -o %t/a.out
8+ // RUN: %target-run %t/a.out | %FileCheck %s
9+
10+ // REQUIRES: swift_in_compiler
11+ // REQUIRES: executable_test
12+ // REQUIRES: OS=macosx || OS=linux-gnu
13+ // REQUIRES: swift_feature_Embedded
14+
15+ // BEGIN MyModule.swift
16+
17+ public enum MyEnum {
18+ case aCase
19+ }
20+
21+ open class BaseClass {
22+ open var type : MyEnum ? { nil }
23+ }
24+
25+ public final class DerivedClass : BaseClass {
26+ public override var type : MyEnum { . aCase }
27+
28+ public override init ( ) {
29+ }
30+ }
31+
32+ open class BaseGenericClass < T> {
33+ open var type : MyEnum ? { nil }
34+ }
35+
36+ public final class DerivedGenericClass < T> : BaseGenericClass < T > {
37+ public override var type : MyEnum { . aCase }
38+
39+ public override init ( ) {
40+ }
41+ }
42+
43+ public func createGenClass( ) -> BaseGenericClass < Bool > {
44+ return DerivedGenericClass < Bool > ( )
45+ }
46+
47+ // BEGIN Main.swift
48+
49+ import MyModule
50+
51+ let dc = DerivedClass ( )
52+ let dgc = DerivedGenericClass < Int > ( )
53+ let gc = createGenClass ( )
54+ print ( " OK! " )
55+
56+ // CHECK: OK!
57+
You can’t perform that action at this time.
0 commit comments