Skip to content

Commit fefe33f

Browse files
committed
[Runtime] Add missing bridgeObjectRR_xN entrypoints.
We're supposed to expose bridgeObjectRetain/Release_xN variants, but they were missing. This fixes the custom_rr_abi.swift test. Also remove the redundant extern "C" on the entrypoint definitions, which fixes some warnings. rdar://102793667 rdar://102783074
1 parent 40547a1 commit fefe33f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

include/swift/Runtime/CustomRRABI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Param returnTypeHelper(Ret (*)(Param)) {}
6262
// Helper macro that defines one entrypoint that takes the parameter in reg and
6363
// calls through to function.
6464
#define CUSTOM_RR_ENTRYPOINTS_DEFINE_ONE_ENTRYPOINT(reg, function) \
65-
extern "C" SWIFT_RUNTIME_EXPORT decltype(function( \
65+
SWIFT_RUNTIME_EXPORT decltype(function( \
6666
nullptr)) function##_x##reg() { \
6767
decltype(returnTypeHelper(function)) ptr; \
6868
asm(".ifnc %0, x" #reg "\n" \

stdlib/public/runtime/SwiftObject.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "llvm/ADT/StringRef.h"
2727
#include "swift/Basic/Lazy.h"
2828
#include "swift/Runtime/Casting.h"
29+
#include "swift/Runtime/CustomRRABI.h"
2930
#include "swift/Runtime/Debug.h"
3031
#include "swift/Runtime/EnvironmentVariables.h"
3132
#include "swift/Runtime/Heap.h"
@@ -616,6 +617,8 @@ static bool isBridgeObjectTaggedPointer(void *object) {
616617
#endif
617618
}
618619

620+
CUSTOM_RR_ENTRYPOINTS_DEFINE_ENTRYPOINTS(swift_bridgeObjectRetain)
621+
619622
SWIFT_RUNTIME_EXPORT
620623
void *swift::swift_nonatomic_bridgeObjectRetain(void *object) {
621624
#if SWIFT_OBJC_INTEROP
@@ -656,6 +659,8 @@ static bool isBridgeObjectTaggedPointer(void *object) {
656659
#endif
657660
}
658661

662+
CUSTOM_RR_ENTRYPOINTS_DEFINE_ENTRYPOINTS(swift_bridgeObjectRelease)
663+
659664
void swift::swift_nonatomic_bridgeObjectRelease(void *object) {
660665
#if SWIFT_OBJC_INTEROP
661666
if (isObjCTaggedPointer(object) || isBridgeObjectTaggedPointer(object))

test/Runtime/custom_rr_abi.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// UNSUPPORTED: use_os_stdlib
77
// UNSUPPORTED: back_deployment_runtime
88

9-
// REQUIRES: rdar102783074
10-
119
import StdlibUnittest
1210

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

0 commit comments

Comments
 (0)