Skip to content

Commit 3caad6d

Browse files
committed
[Distributed] Dont emit TBD also for distributed thunks
This resolves pedantic "all" TBD validation issues, i.e. we dont emit unexpected records anymore - we would before as we only checked for is_distributed but we also want to skip those for is_distributed_thunk resolves rdar://128284016
1 parent cd2946b commit 3caad6d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ namespace {
10021002
// Emit the dispatch thunk.
10031003
auto shouldEmitDispatchThunk =
10041004
(Resilient || IGM.getOptions().WitnessMethodElimination) &&
1005-
!func.isDistributed();
1005+
(!func.isDistributed() || !func.isDistributedThunk());
10061006
if (shouldEmitDispatchThunk) {
10071007
IGM.emitDispatchThunk(func);
10081008
}

test/TBD/distributed_library_evolution.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// RUN: -enable-library-evolution \
1010
// RUN: -disable-availability-checking \
1111
// RUN: -emit-ir -o %t/test.ll -emit-tbd \
12+
// RUN: -validate-tbd-against-ir=all \
1213
// RUN: -emit-tbd-path %t/library.tbd -I %t -tbd-install_name protocol
1314

1415
// RUN: %target-swift-frontend %t/library.swift \
@@ -18,9 +19,11 @@
1819
// RUN: -package-name Package \
1920
// RUN: -module-name Library \
2021
// RUN: -emit-module-path %t/Library.swiftmodule \
22+
// RUN: -validate-tbd-against-ir=all \
2123
// RUN: -emit-module-interface-path %t/Library.swiftinterface
2224

23-
// RUN: %target-swift-frontend %t/actor.swift -enable-library-evolution \
25+
// RUN: %target-swift-frontend %t/actor.swift \
26+
// RUN: -enable-library-evolution \
2427
// RUN: -disable-availability-checking -emit-ir -o %t/test.ll -emit-tbd \
2528
// RUN: -emit-tbd-path %t/actor.tbd -I %t -tbd-install_name actor
2629

@@ -31,7 +34,8 @@
3134
// RUN: -package-name Package \
3235
// RUN: -enable-library-evolution \
3336
// RUN: -module-name Client \
34-
// RUN: -emit-module-path %t/Client.swiftmodule \
37+
// RUN: -emit-module-path %t/Client.swiftmodule \
38+
// RUN: -validate-tbd-against-ir=all \
3539
// RUN: -emit-module-interface-path %t/Client.swiftinterface
3640

3741

0 commit comments

Comments
 (0)