Change swift_retain/swift_retain_n to return no value. this is part of a series of commits

to remove reference forwarding for some of the ARC entry points. rdar://22724641. After this
commit, swift_retain will be the same as swift_retain_noresult, returning no reference.
LLVMARCContract pass is also modified NOT to rewrite swift_retain_noresult to the
old swift_retain which forwards the reference.

Swift SVN r32055
This commit is contained in:
Xin Tong
2015-09-18 00:41:35 +00:00
parent 9335511c0d
commit 955e4ed652
9 changed files with 83 additions and 215 deletions

View File

@@ -59,8 +59,7 @@ TEST(RefcountingTest, retain_release) {
size_t value = 0;
auto object = allocTestObject(&value, 1);
EXPECT_EQ(0u, value);
auto retainResult = swift_retain(object);
EXPECT_EQ(object, retainResult);
swift_retain(object);
EXPECT_EQ(0u, value);
swift_release(object);
EXPECT_EQ(0u, value);
@@ -103,10 +102,8 @@ TEST(RefcountingTest, retain_release_n) {
size_t value = 0;
auto object = allocTestObject(&value, 1);
EXPECT_EQ(0u, value);
auto retainResult = swift_retain_n(object, 32);
EXPECT_EQ(object, retainResult);
retainResult = swift_retain(object);
EXPECT_EQ(object, retainResult);
swift_retain_n(object, 32);
swift_retain(object);
EXPECT_EQ(0u, value);
EXPECT_EQ(34u, swift_retainCount(object));
swift_release_n(object, 31);