mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user