1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
llvm-mirror/test/Transforms/ObjCARC
Michael Gottesman c59f1a814a Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool.
The reason that this occurs is that tail calling objc_autorelease eventually
tail calls -[NSObject autorelease] which supports fast autorelease. This can
cause us to violate the semantic gaurantees of __autoreleasing variables that
assignment to an __autoreleasing variables always yields an object that is
placed into the innermost autorelease pool.

The fix included in this patch works by:

1. In the peephole optimization function OptimizeIndividualFunctions, always
remove tail call from objc_autorelease.
2. Whenever we convert to/from an objc_autorelease, set/unset the tail call
keyword as appropriate.

*NOTE* I also handled the case where objc_autorelease is converted in
OptimizeReturns to an autoreleaseRV which still violates the ARC semantics. I
will be removing that in a later patch and I wanted to make sure that the tree
is in a consistent state vis-a-vis ARC always.

Additionally some test cases are provided and all tests that have tail call marked
objc_autorelease keywords have been modified so that tail call has been removed.

*NOTE* One test fails due to a separate bug that I am going to commit soon. Thus
I marked the check line TMP: instead of CHECK: so make check does not fail.

llvm-svn: 172287
2013-01-12 01:25:15 +00:00
..
apelim.ll Use llvm.global_ctors to locate global constructors instead 2012-01-18 21:19:38 +00:00
basic.ll Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool. 2013-01-12 01:25:15 +00:00
cfg-hazards.ll Don't let arbitrary calls disrupt nested retain+release pairs if 2011-08-12 00:26:31 +00:00
contract-marker.ll
contract-storestrong-ivar.ll Set the "tail" flag on pattern-matched objc_storeStrong calls. 2012-01-19 19:14:36 +00:00
contract-storestrong.ll Fix the objc_storeStrong recognizer to stop before walking off the 2012-05-09 23:08:33 +00:00
contract-testcases.ll Fix the objc_autoreleasedReturnValue optimization code to locate 2012-06-25 19:47:37 +00:00
contract.ll Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool. 2013-01-12 01:25:15 +00:00
empty-block.ll When eliminating unnecessary retain+autorelease on return values, 2011-09-29 22:27:34 +00:00
escape.ll Consider ObjC runtime calls objc_storeWeak and others which make a copy of 2012-04-13 18:28:58 +00:00
expand.ll
gvn.ll
invoke.ll Fix broken check lines. 2012-08-17 12:28:26 +00:00
lit.local.cfg Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed. 2012-02-16 06:28:33 +00:00
move-and-form-retain-autorelease.ll Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool. 2013-01-12 01:25:15 +00:00
move-and-merge-autorelease.ll
nested.ll Make provenance checking conservative in cases when 2012-09-04 23:16:20 +00:00
no-objc-arc-exceptions.ll Calls and invokes with the new clang.arc.no_objc_arc_exceptions 2012-02-17 18:59:53 +00:00
path-overflow.ll Detect overflow in the path count computation. rdar://12277446. 2012-09-12 20:45:17 +00:00
pointer-types.ll It turns out that clang does use pointer-to-function types to 2011-12-14 19:10:53 +00:00
post-inlining.ll
pr12270.ll Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID 2012-12-30 02:33:22 +00:00
retain-block-alloca.ll Teach the ARC optimizer about the !clang.arc.copy_on_escape metadata 2011-10-17 22:53:25 +00:00
retain-block-load.ll Just like in regular escape analysis, loads and stores through 2012-02-13 22:57:02 +00:00
retain-block-side-effects.ll objc_retainBlock is not NoModRef because it can update forwarding pointers 2011-09-14 18:13:00 +00:00
retain-block.ll Implement proper ObjC ARC objc_retainBlock "escape" analysis, so that 2012-01-13 00:39:07 +00:00
retain-not-declared.ll Don't convert objc_retainAutoreleasedReturnValue to objc_retain if it 2012-03-23 18:09:00 +00:00
rle-s2l.ll
rv.ll Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool. 2013-01-12 01:25:15 +00:00
split-backedge.ll Avoid a bug in the path count computation, preventing an infinite 2012-04-19 21:50:46 +00:00
tail-call-invariant-enforcement.ll Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool. 2013-01-12 01:25:15 +00:00
weak-contract.ll
weak-copies.ll
weak-dce.ll Fix replacing all the users of objc weak runtime routines 2012-05-18 22:17:29 +00:00
weak.ll