Skip to content

Commit 54a3429

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 4cce5f8 commit 54a3429

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/IRGen/GenMeta.cpp

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

test/Distributed/Runtime/distributed_actor_remoteCall_accessibleFunctions_crossModule.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// RUN: -module-name FakeDistributedActorSystems \
1010
// RUN: %S/../Inputs/FakeDistributedActorSystems.swift \
1111
// RUN: -enable-library-evolution \
12+
// RUN: -Xfrontend -validate-tbd-against-ir=all \
1213
// RUN: -o %t/%target-library-name(FakeDistributedActorSystems)
1314

1415
/// Build the Lib
@@ -23,6 +24,7 @@
2324
// RUN: %t/src/ResilientAPILib.swift \
2425
// RUN: -lFakeDistributedActorSystems \
2526
// RUN: -enable-library-evolution \
27+
// RUN: -Xfrontend -validate-tbd-against-ir=all \
2628
// RUN: -o %t/%target-library-name(ResilientAPILib)
2729

2830
/// Build the ActorLib
@@ -37,6 +39,7 @@
3739
// RUN: -lFakeDistributedActorSystems \
3840
// RUN: -lResilientAPILib \
3941
// RUN: -enable-library-evolution \
42+
// RUN: -Xfrontend -validate-tbd-against-ir=all \
4043
// RUN: -o %t/%target-library-name(ResilientImplLib)
4144

4245
/// Build the client
@@ -51,6 +54,7 @@
5154
// RUN: -L %t \
5255
// RUN: %s \
5356
// RUN: -enable-library-evolution \
57+
// RUN: -Xfrontend -validate-tbd-against-ir=all \
5458
// RUN: -o %t/a.out
5559

5660
// Sign the main binary and all libraries

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)