Commit Graph

24 Commits

Author SHA1 Message Date
Joe Groff
f3aa9f4766 Fix up mismerge of refcounting unit tests. 2016-02-18 10:06:07 -08:00
Joe Groff
ae0e855aaf Revert "Runtime: Remove retainCount entry points."
This reverts commit 51e0594e1c. The retainCount
entry points are used by Instruments.
2016-02-18 09:38:23 -08:00
Joe Groff
32872cb74a IRGen/Runtime: Relative-reference the nominal type descriptor and parent type from metadata.
Save a couple relocations per concrete value type, leaving only the value witness table as an absolute symbol.
2016-02-09 15:17:03 -08:00
practicalswift
8efa5f587e [gardening] Remove "-*- C++ -*-" tag from .cpp files
Emacs assumes .h files are C files by default which is why the
tag "-*- C++ -*-" is needed.

.cpp files do not have this problem.
2016-01-23 12:09:32 +01:00
Joe Groff
7775b9c261 Runtime: Remove swift_retainCount entry points.
These are no longer needed by the corelibs.
2016-01-06 14:12:03 -08:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Joe Groff
4b7ed84c42 Revert "Runtime: Remove retainCount entry points."
This reverts 51e0594e1c. The corelibs are using this entry point.
2015-12-22 13:06:42 -08:00
Joe Groff
51e0594e1c Runtime: Remove retainCount entry points.
They're only used for testing and ObjC interop, so don't need to be exported from the runtime.
2015-12-22 11:51:59 -08:00
John McCall
4d1b6e2eb6 Reform the runtime interface for unowned reference-counting.
This is a bit of a hodge-podge of related changes that I decided
weren't quite worth teasing apart:

First, rename the weak{Retain,Release} entrypoints to
unowned{Retain,Release} to better reflect their actual use
from generated code.

Second, standardize the names of the rest of the entrypoints around
unowned{operation}.

Third, standardize IRGen's internal naming scheme and API for
reference-counting so that (1) there are generic functions for
emitting operations using a given reference-counting style and
(2) all operations explicitly call out the kind and style of
reference counting.

Finally, implement a number of new entrypoints for unknown unowned
reference-counting.  These entrypoints use a completely different
and incompatible scheme for working with ObjC references.  The
primary difference is that the new scheme abandons the flawed idea
(which I take responsibility for) that we can simulate an unowned
reference count for ObjC references, and instead moves towards an
address-only scheme when the reference might store an ObjC reference.
(The current implementation is still trivially takable, but that is
not something we should be relying on.)  These will be tested in a
follow-up commit.  For now, we still rely on the bad assumption of
reference-countability.
2015-12-04 13:18:14 -08:00
Slava Pestov
54dd7892e8 SIL: Emit native ivar destroyer and store it in class metadata
Swift SVN r32644
2015-10-13 00:27:57 +00:00
Xin Tong
bc3fe169b4 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 return no reference and LLVMARCContract pass is modified NOT to rewrite
swift_retain_noresult to old swift_retain which forwarded the reference.

Swift SVN r32075
2015-09-18 20:35:39 +00:00
Michael Gottesman
121ef3ef9f Revert the series of commits for removing the return value from swift_retain_noresult.
I asked that the patches were split up so I could do post commit review.

This reverts commit r32059.
This reverts commit r32058.
This reverts commit r32056.
This reverts commit r32055.

Swift SVN r32060
2015-09-18 02:31:24 +00:00
Xin Tong
955e4ed652 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
2015-09-18 00:41:35 +00:00
Xin Tong
767044561e swift_unknownRetain_n returns no value on linux. we are moving towards returning/forwarding no object for swift_unknownRetain_n on Mac and Linux. rdar://22724641
Swift SVN r32002
2015-09-16 19:19:33 +00:00
Xin Tong
e1e439da1e Fix test case for unowned retain. weak ref count cant go to 0 before the object is deallocated
Swift SVN r31994
2015-09-16 17:07:25 +00:00
Xin Tong
275daaf750 recommiting. r31989. Implement weak/unowned retain_n/release_n entry points. rdar://22629226
Swift SVN r31991
2015-09-16 16:01:16 +00:00
Mark Lacey
fff32395cc Revert "Implement weak/unowned retain_n/release_n entry points. rdar://22629226"
This reverts commit r31989 because it broke the build due to a faulty
assert that fires in the refcounting unit test.

Swift SVN r31990
2015-09-16 06:15:31 +00:00
Xin Tong
206673b95d Implement weak/unowned retain_n/release_n entry points. rdar://22629226
Swift SVN r31989
2015-09-16 05:35:09 +00:00
Xin Tong
4dcf2909fe Add ObjC-specific test cases to separate file. post-commit for r31902
Swift SVN r31988
2015-09-16 02:49:00 +00:00
Xin Tong
64135ef2ee Implement unknownRetain_n/Release_n entry points
rdar://21945003

Swift SVN r31902
2015-09-11 19:28:18 +00:00
Michael Gottesman
4ce5cdad17 [llvm-arc-opts] Implement swift_{retain,release}_n.
rdar://21803771

Swift SVN r30204
2015-07-15 00:03:03 +00:00
David Farler
d473d6411a clang-700 build fix: constructor call is ambiguous
rdar://problem/19940607

Swift SVN r25641
2015-02-28 21:26:57 +00:00
John McCall
e67d1f2af4 Add simple unit tests for our native reference counting.
Swift SVN r24409
2015-01-14 01:38:50 +00:00