Skip to content

Commit f92722b

Browse files
Merge pull request #4721 from swiftwasm/release/5.7
[pull] swiftwasm-release/5.7 from release/5.7
2 parents 7b41f26 + abcc4b0 commit f92722b

File tree

6 files changed

+1075
-12
lines changed

6 files changed

+1075
-12
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,10 @@ namespace {
913913
if (entry.getFunction().isAutoDiffDerivativeFunction())
914914
declRef = declRef.asAutoDiffDerivativeFunction(
915915
entry.getFunction().getAutoDiffDerivativeFunctionIdentifier());
916+
if (entry.getFunction().isDistributedThunk()) {
917+
flags = flags.withIsAsync(true);
918+
declRef = declRef.asDistributed();
919+
}
916920
addDiscriminator(flags, schema, declRef);
917921
}
918922

lib/IRGen/GenProto.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,8 @@ class AccessorConformanceInfo : public ConformanceInfo {
13521352
auto &entry = SILEntries.front();
13531353
SILEntries = SILEntries.slice(1);
13541354

1355+
bool isAsyncRequirement = requirement.hasAsync();
1356+
13551357
#ifndef NDEBUG
13561358
assert(entry.getKind() == SILWitnessTable::Method
13571359
&& "sil witness table does not match protocol");
@@ -1364,10 +1366,9 @@ class AccessorConformanceInfo : public ConformanceInfo {
13641366
#endif
13651367

13661368
SILFunction *Func = entry.getMethodWitness().Witness;
1367-
auto *afd = cast<AbstractFunctionDecl>(
1368-
entry.getMethodWitness().Requirement.getDecl());
13691369
llvm::Constant *witness = nullptr;
13701370
if (Func) {
1371+
assert(Func->isAsync() == isAsyncRequirement);
13711372
if (Func->isAsync()) {
13721373
witness = IGM.getAddrOfAsyncFunctionPointer(Func);
13731374
} else {
@@ -1376,7 +1377,7 @@ class AccessorConformanceInfo : public ConformanceInfo {
13761377
} else {
13771378
// The method is removed by dead method elimination.
13781379
// It should be never called. We add a pointer to an error function.
1379-
if (afd->hasAsync()) {
1380+
if (isAsyncRequirement) {
13801381
witness = llvm::ConstantExpr::getBitCast(
13811382
IGM.getDeletedAsyncMethodErrorAsyncFunctionPointer(),
13821383
IGM.FunctionPtrTy);
@@ -1388,8 +1389,9 @@ class AccessorConformanceInfo : public ConformanceInfo {
13881389
witness = llvm::ConstantExpr::getBitCast(witness, IGM.Int8PtrTy);
13891390

13901391
PointerAuthSchema schema =
1391-
afd->hasAsync() ? IGM.getOptions().PointerAuth.AsyncProtocolWitnesses
1392-
: IGM.getOptions().PointerAuth.ProtocolWitnesses;
1392+
isAsyncRequirement
1393+
? IGM.getOptions().PointerAuth.AsyncProtocolWitnesses
1394+
: IGM.getOptions().PointerAuth.ProtocolWitnesses;
13931395
Table.addSignedPointer(witness, schema, requirement);
13941396
return;
13951397
}

stdlib/public/runtime/Metadata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ static void swift_objc_classCopyFixupHandler(Class oldClass, Class newClass) {
471471
reinterpret_cast<void *const *>(&src[i]),
472472
descriptors[i].Flags.getExtraDiscriminator(),
473473
!descriptors[i].Flags.isAsync(),
474-
/*allowNull*/ false); // Don't allow NULL for Obj-C classes
474+
/*allowNull*/ true); // NULL allowed for VFE (methods in the vtable
475+
// might be proven unused and null'ed)
475476
}
476477
}
477478

test/Distributed/Runtime/distributed_actor_func_calls_remoteCall_through_generic.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
// REQUIRES: concurrency
88
// REQUIRES: distributed
99

10-
// FIXME: rdar://96520492 Test fails on specific config: Tools Opt+Assert, Stdlib Opt+DebInfo+Assert, iOS_arm64e
11-
// UNSUPPORTED: CPU=arm64e
12-
1310
// rdar://76038845
1411
// UNSUPPORTED: use_os_stdlib
1512
// UNSUPPORTED: back_deployment_runtime

test/Distributed/Runtime/distributed_actor_func_calls_remoteCall_through_generic_and_inner.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
// UNSUPPORTED: use_os_stdlib
1212
// UNSUPPORTED: back_deployment_runtime
1313

14-
// FIXME: rdar://96520224 Test fails on specific config: Tools Opt+Assert, Stdlib Opt+DebInfo+Assert, iOS_arm64e
15-
// UNSUPPORTED: CPU=arm64e
16-
1714
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
1815
// UNSUPPORTED: OS=windows-msvc
1916

0 commit comments

Comments
 (0)