[stdlib] Switch some shims to use id

Since ObjC functions take their arguments at +0, we don't need to erase
"object-ness" in order to avoid disturbing reference counts.  This
interacts much better with lifetime optimizations, since the caller must
ensure the argument isn't released until these functions return.

Swift SVN r22580
This commit is contained in:
Dave Abrahams
2014-10-07 22:15:11 +00:00
parent e4d8ea49e4
commit 512da79b7a
3 changed files with 10 additions and 11 deletions

View File

@@ -683,9 +683,7 @@ extern "C" const char *swift_getGenericClassObjCName(const ClassMetadata *clas,
// Given a non-nil object reference, return true iff the object uses
// native swift reference counting.
bool swift::_swift_usesNativeSwiftReferenceCounting_nonNull(
const void *object
) {
bool swift::_swift_usesNativeSwiftReferenceCounting_nonNull(id object) {
assert(object != nullptr);
#if SWIFT_OBJC_INTEROP
return !isObjCTaggedPointer(object) &&
@@ -697,9 +695,7 @@ bool swift::_swift_usesNativeSwiftReferenceCounting_nonNull(
// Given a non-nil object reference, return true iff the object is a
// native swift object with strong reference count of 1.
bool swift::_swift_isUniquelyReferencedNative_nonNull(
const void* object
) {
bool swift::_swift_isUniquelyReferencedNative_nonNull(id object) {
assert(object != nullptr);
return
#if SWIFT_OBJC_INTEROP