Skip to content

Commit 1ce629e

Browse files
authored
Merge pull request #82247 from mikeash/auth-code-function-begone-6.2
[6.2][Runtime] Remove redundant swift_auth_code_function, use existing swift_auth_code.
2 parents acb53d2 + fbda570 commit 1ce629e

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

include/swift/Runtime/Config.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -554,17 +554,6 @@ swift_auth_code(T value, unsigned extra) {
554554
#endif
555555
}
556556

557-
template <typename T>
558-
SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE static inline T
559-
swift_auth_code_function(T value, unsigned extra) {
560-
#if SWIFT_PTRAUTH
561-
return (T)ptrauth_auth_function((void *)value,
562-
ptrauth_key_function_pointer, extra);
563-
#else
564-
return value;
565-
#endif
566-
}
567-
568557
/// Does this platform support backtrace-on-crash?
569558
#ifdef __APPLE__
570559
# include <TargetConditionals.h>

stdlib/public/Concurrency/Actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ static void swift_task_deinitOnExecutorImpl(void *object,
25762576
SerialExecutorRef newExecutor,
25772577
size_t rawFlags) {
25782578
// Sign the function pointer
2579-
work = swift_auth_code_function(
2579+
work = swift_auth_code(
25802580
work, SpecialPointerAuthDiscriminators::DeinitWorkFunction);
25812581
// If the current executor is compatible with running the new executor,
25822582
// we can just immediately continue running with the resume function

stdlib/public/Concurrency/Task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ swift_task_addCancellationHandlerImpl(
17631763
void *context) {
17641764
void *allocation =
17651765
swift_task_alloc(sizeof(CancellationNotificationStatusRecord));
1766-
auto unsigned_handler = swift_auth_code_function(handler,
1766+
auto unsigned_handler = swift_auth_code(handler,
17671767
SpecialPointerAuthDiscriminators::CancellationNotificationFunction);
17681768
auto *record = ::new (allocation)
17691769
CancellationNotificationStatusRecord(unsigned_handler, context);
@@ -1817,7 +1817,7 @@ swift_task_addPriorityEscalationHandlerImpl(
18171817
void *context) {
18181818
void *allocation =
18191819
swift_task_alloc(sizeof(EscalationNotificationStatusRecord));
1820-
auto unsigned_handler = swift_auth_code_function(handler,
1820+
auto unsigned_handler = swift_auth_code(handler,
18211821
SpecialPointerAuthDiscriminators::EscalationNotificationFunction);
18221822
auto *record = ::new (allocation)
18231823
EscalationNotificationStatusRecord(unsigned_handler, context);

0 commit comments

Comments
 (0)