llvm-6502/lib
Michael Gottesman e8c161a924 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172287 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 01:25:15 +00:00
..
Analysis Update CMakeLists for CallPrinter.cpp. 2013-01-11 17:34:05 +00:00
Archive Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
AsmParser There was a switch fall-through in the parser for textual LLVM that caused 2013-01-07 13:32:38 +00:00
Bitcode Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test hangings. 2013-01-09 23:36:50 +00:00
CodeGen Limit the search space in RAGreedy::tryEvict(). 2013-01-12 00:57:44 +00:00
DebugInfo [Object, DebugInfo] Make DWARFContext BE-aware. 2013-01-09 02:45:05 +00:00
ExecutionEngine Fix bug in exception table allocation (PR13678) 2013-01-11 16:33:30 +00:00
IR Support for half intrinsics. Pushes MMX into slower encoding path. 2013-01-11 01:45:05 +00:00
Linker Fix a copy/paste error in the IR Linker, casting an ArrayType instead of a VectorType. 2013-01-10 10:49:36 +00:00
MC Stop hiding the interface-exposed EatToEndOfStatement (see r172276). 2013-01-12 00:23:24 +00:00
Object [Object][Archive] Fix name handling with bsd style long names. 2013-01-10 01:05:34 +00:00
Option Resort the #include lines in include/... and lib/... with the 2013-01-02 10:22:59 +00:00
Support SMDiagnostic: don't emit ranges if there are /any/ multibyte characters. 2013-01-11 02:37:55 +00:00
TableGen TableGen: Keep track of superclass reference ranges. 2013-01-10 18:50:11 +00:00
Target This patch tackles the problem of parsing Mips 2013-01-12 01:03:14 +00:00
Transforms 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
CMakeLists.txt Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00
LLVMBuild.txt Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00
Makefile Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00