Skip to content

[Runtime] Add missing bridgeObjectRR_xN entrypoints. #62317

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
Nov 30, 2022
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
2 changes: 1 addition & 1 deletion include/swift/Runtime/CustomRRABI.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Param returnTypeHelper(Ret (*)(Param)) {}
// Helper macro that defines one entrypoint that takes the parameter in reg and
// calls through to function.
#define CUSTOM_RR_ENTRYPOINTS_DEFINE_ONE_ENTRYPOINT(reg, function) \
extern "C" SWIFT_RUNTIME_EXPORT decltype(function( \
SWIFT_RUNTIME_EXPORT decltype(function( \
nullptr)) function##_x##reg() { \
decltype(returnTypeHelper(function)) ptr; \
asm(".ifnc %0, x" #reg "\n" \
Expand Down
5 changes: 5 additions & 0 deletions stdlib/public/runtime/SwiftObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "llvm/ADT/StringRef.h"
#include "swift/Basic/Lazy.h"
#include "swift/Runtime/Casting.h"
#include "swift/Runtime/CustomRRABI.h"
#include "swift/Runtime/Debug.h"
#include "swift/Runtime/EnvironmentVariables.h"
#include "swift/Runtime/Heap.h"
Expand Down Expand Up @@ -616,6 +617,8 @@ static bool isBridgeObjectTaggedPointer(void *object) {
#endif
}

CUSTOM_RR_ENTRYPOINTS_DEFINE_ENTRYPOINTS(swift_bridgeObjectRetain)

SWIFT_RUNTIME_EXPORT
void *swift::swift_nonatomic_bridgeObjectRetain(void *object) {
#if SWIFT_OBJC_INTEROP
Expand Down Expand Up @@ -656,6 +659,8 @@ static bool isBridgeObjectTaggedPointer(void *object) {
#endif
}

CUSTOM_RR_ENTRYPOINTS_DEFINE_ENTRYPOINTS(swift_bridgeObjectRelease)

void swift::swift_nonatomic_bridgeObjectRelease(void *object) {
#if SWIFT_OBJC_INTEROP
if (isObjCTaggedPointer(object) || isBridgeObjectTaggedPointer(object))
Expand Down
2 changes: 0 additions & 2 deletions test/Runtime/custom_rr_abi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

// REQUIRES: rdar102783074

import StdlibUnittest

// A class that can provider a retainable pointer and determine whether it's
Expand Down