File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,12 @@ class DeadFunctionAndGlobalElimination {
556
556
auto *fd = getBaseMethod (
557
557
cast<AbstractFunctionDecl>(entry.getMethod ().getDecl ()));
558
558
559
+ // In Embedded Swift, we don't expect SILFunction without definitions on
560
+ // vtable entries. Having one means the base method was DCE'd already,
561
+ // so let's avoid marking it alive in the subclass vtable either.
562
+ bool embedded = Module->getOptions ().EmbeddedSwift ;
563
+ if (embedded && !F->isDefinition ()) { continue ; }
564
+
559
565
if (// We also have to check the method declaration's access level.
560
566
// Needed if it's a public base method declared in another
561
567
// compilation unit (for this we have no SILFunction).
Original file line number Diff line number Diff line change 7
7
// RUN: %target-clang %t/a.o %t/print.o -o %t/a.out
8
8
// RUN: %target-run %t/a.out | %FileCheck %s
9
9
10
+ // RUN: %target-swift-frontend -O -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library
11
+ // RUN: %target-swift-frontend -O -c -I %t %t/Main.swift -enable-experimental-feature Embedded -o %t/a.o
12
+ // RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
13
+ // RUN: %target-clang %t/a.o %t/print.o -o %t/a.out
14
+ // RUN: %target-run %t/a.out | %FileCheck %s
15
+
16
+ // RUN: %target-swift-frontend -Osize -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library
17
+ // RUN: %target-swift-frontend -Osize -c -I %t %t/Main.swift -enable-experimental-feature Embedded -o %t/a.o
18
+ // RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
19
+ // RUN: %target-clang %t/a.o %t/print.o -o %t/a.out
20
+ // RUN: %target-run %t/a.out | %FileCheck %s
21
+
10
22
// REQUIRES: swift_in_compiler
11
23
// REQUIRES: executable_test
12
24
// REQUIRES: OS=macosx || OS=linux-gnu
You can’t perform that action at this time.
0 commit comments