Merge pull request #85313 from mikeash/rr-preservemost-no-embedded

[Runtime] Don't use custom retain/release calling convention in embedded Swift.
This commit is contained in:
Kavon Farvardin
2025-11-04 11:06:48 -08:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -252,7 +252,7 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
// differs from the standard calling convention. Currently this is only used for
// swift_retain, swift_release, and some internal helper functions that they
// call.
#if defined(__aarch64__)
#if defined(__aarch64__) && !SWIFT_RUNTIME_EMBEDDED
#define SWIFT_REFCOUNT_CC SWIFT_CC_PreserveMost
#define SWIFT_REFCOUNT_CC_PRESERVEMOST 1
#else

View File

@@ -59,8 +59,10 @@ namespace swift {
template <typename Ret, typename Param>
Param returnTypeHelper(Ret (*)(Param)) {}
#if SWIFT_REFCOUNT_CC_PRESERVEMOST
template <typename Ret, typename Param>
Param returnTypeHelper(SWIFT_REFCOUNT_CC Ret (*)(Param)) {}
#endif
#if defined(__LP64__) || defined(_LP64)
#define REGISTER_SUBSTITUTION_PREFIX ""