1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
llvm-mirror/lib
Michael Gottesman 81c7cd8b47 [objc-arc] Turn off the objc_retainBlock -> objc_retain optimization.
The reason that I am turning off this optimization is that there is an
additional case where a block can escape that has come up. Specifically, this
occurs when a block is used in a scope outside of its current scope.

This can cause a captured retainable object pointer whose life is preserved by
the objc_retainBlock to be deallocated before the block is invoked.

An example of the code needed to trigger the bug is:

----
\#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
  void (^somethingToDoLater)();

  {
    NSObject *obj = [NSObject new];

    somethingToDoLater = ^{
      [obj self]; // Crashes here
    };
  }

  NSLog(@"test.");

  somethingToDoLater();
  return 0;
}
----

In the next commit, I remove all the dead code that results from this.

Once I put in the fixing commit I will bring back the tests that I deleted in
this commit.

rdar://14802782.
rdar://14868830.

llvm-svn: 189869
2013-09-03 22:40:54 +00:00
..
Analysis Revert: r189565 - Add getUnrollingPreferences to TTI 2013-08-29 03:33:15 +00:00
AsmParser Add function attribute 'optnone'. 2013-08-23 11:53:55 +00:00
Bitcode Add function attribute 'optnone'. 2013-08-23 11:53:55 +00:00
CodeGen Add a hashing routine that handles hashing types. Add a test for 2013-09-03 21:57:57 +00:00
DebugInfo Add support for DebugFission to DWARF parser 2013-08-27 09:20:22 +00:00
ExecutionEngine llvm interpreter: select, shuffle and insertelement instructions. 2013-09-02 06:40:09 +00:00
IR DIBuilder: retain a type when created with a unique identifier. 2013-08-29 23:17:54 +00:00
IRReader
Linker
MC Move everything depending on Object/MachOFormat.h over to Support/MachO.h. 2013-09-01 04:28:48 +00:00
Object Move everything depending on Object/MachOFormat.h over to Support/MachO.h. 2013-09-01 04:28:48 +00:00
Option Option parsing: support case-insensitive option matching. 2013-08-28 20:04:31 +00:00
Support Fix some rather confusing indentation and control flow in the errno 2013-09-02 05:55:10 +00:00
TableGen Add an error check for a typo I accidentally made in a td file that caused an assert to fire. 2013-08-20 04:22:09 +00:00
Target WIP: Refactor some code so that it can be called by more than just one method. No functionality change. 2013-09-03 20:59:07 +00:00
Transforms [objc-arc] Turn off the objc_retainBlock -> objc_retain optimization. 2013-09-03 22:40:54 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile