[stdlib] Kill _swift_isUniquelyReferenced @asmname

Swift SVN r22576
This commit is contained in:
Dave Abrahams
2014-10-07 21:40:48 +00:00
parent 6c235c83b0
commit cc9bc0c274
6 changed files with 15 additions and 19 deletions

View File

@@ -28,6 +28,7 @@
#include <cstdio>
#include <cstdlib>
#include <unistd.h>
#include "../shims/RuntimeShims.h"
using namespace swift;
@@ -523,11 +524,15 @@ void swift::_swift_abortRetainUnowned(const void *object) {
swift::crash("attempted to retain deallocated object");
}
// Given the bits of a Native swift object reference, or of a
// word-sized Swift enum containing a Native swift object reference as
// a payload, return true iff the object's strong reference count is
// 1.
extern "C" bool _swift_isUniquelyReferenced(std::uintptr_t bits) {
//===----------------------------------------------------------------------===//
// FIXME: this should return bool but it chokes the compiler
// <rdar://problem/18573806>
//===----------------------------------------------------------------------===//
/// Given the bits of a Native swift object reference, or of a
/// word-sized Swift enum containing a Native swift object reference as
/// a payload, return true iff the object's strong reference count is
/// 1.
unsigned char swift::_swift_isUniquelyReferenced(std::uintptr_t bits) {
const auto object = reinterpret_cast<HeapObject*>(
bits & ~heap_object_abi::SwiftSpareBitsMask);