Skip to content

Distributed: silence some -Wcast-function-type-mismatch #79037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions stdlib/public/Distributed/DistributedActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
///
///===----------------------------------------------------------------------===///

#include "swift/ABI/Task.h"
#include "swift/ABI/Actor.h"
#include "swift/ABI/Metadata.h"
#include "swift/ABI/Task.h"
#include "swift/Runtime/AccessibleFunction.h"
#include "swift/Runtime/Concurrency.h"
#include "swift/Runtime/STLCompatibility.h"

using namespace swift;

Expand Down Expand Up @@ -102,7 +103,7 @@ static void swift_distributed_execute_target_resume(
SWIFT_CONTEXT SwiftError *error) {
auto parentCtx = context->Parent;
auto resumeInParent =
reinterpret_cast<TargetExecutorSignature::ContinuationType *>(
std::bit_cast<TargetExecutorSignature::ContinuationType *>(
parentCtx->ResumeParent);
swift_task_dealloc(context);
// See `swift_distributed_execute_target` - `parentCtx` in this case
Expand Down Expand Up @@ -131,7 +132,7 @@ void swift_distributed_execute_target(
SwiftError *error =
swift_distributed_makeDistributedTargetAccessorNotFoundError();
auto resumeInParent =
reinterpret_cast<TargetExecutorSignature::ContinuationType *>(
std::bit_cast<TargetExecutorSignature::ContinuationType *>(
callerContext->ResumeParent);
resumeInParent(callerContext, error);
return;
Expand All @@ -149,8 +150,8 @@ void swift_distributed_execute_target(
swift_task_alloc(asyncFnPtr->ExpectedContextSize));

calleeContext->Parent = callerContext;
calleeContext->ResumeParent = reinterpret_cast<TaskContinuationFunction *>(
swift_distributed_execute_target_resume);
calleeContext->ResumeParent = std::bit_cast<TaskContinuationFunction *>(
&swift_distributed_execute_target_resume);

accessorEntry(calleeContext, argumentDecoder, argumentTypes, resultBuffer,
substitutions, witnessTables, numWitnessTables, actor,
Expand Down