Skip to content

[Runtime] Remove redundant swift_auth_code_function, use existing swift_auth_code. #82245

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
Jun 16, 2025
Merged
Show file tree
Hide file tree
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: 0 additions & 11 deletions include/swift/Runtime/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,17 +554,6 @@ swift_auth_code(T value, unsigned extra) {
#endif
}

template <typename T>
SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE static inline T
swift_auth_code_function(T value, unsigned extra) {
#if SWIFT_PTRAUTH
return (T)ptrauth_auth_function((void *)value,
ptrauth_key_function_pointer, extra);
#else
return value;
#endif
}

/// Does this platform support backtrace-on-crash?
#ifdef __APPLE__
# include <TargetConditionals.h>
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,7 @@ static void swift_task_deinitOnExecutorImpl(void *object,
SerialExecutorRef newExecutor,
size_t rawFlags) {
// Sign the function pointer
work = swift_auth_code_function(
work = swift_auth_code(
work, SpecialPointerAuthDiscriminators::DeinitWorkFunction);
// If the current executor is compatible with running the new executor,
// we can just immediately continue running with the resume function
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/Concurrency/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ swift_task_addCancellationHandlerImpl(
void *context) {
void *allocation =
swift_task_alloc(sizeof(CancellationNotificationStatusRecord));
auto unsigned_handler = swift_auth_code_function(handler,
auto unsigned_handler = swift_auth_code(handler,
SpecialPointerAuthDiscriminators::CancellationNotificationFunction);
auto *record = ::new (allocation)
CancellationNotificationStatusRecord(unsigned_handler, context);
Expand Down Expand Up @@ -1818,7 +1818,7 @@ swift_task_addPriorityEscalationHandlerImpl(
void *context) {
void *allocation =
swift_task_alloc(sizeof(EscalationNotificationStatusRecord));
auto unsigned_handler = swift_auth_code_function(handler,
auto unsigned_handler = swift_auth_code(handler,
SpecialPointerAuthDiscriminators::EscalationNotificationFunction);
auto *record = ::new (allocation)
EscalationNotificationStatusRecord(unsigned_handler, context);
Expand Down