summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ObjCARC/retain-block.ll
Commit message (Collapse)AuthorAgeFilesLines
* [objc-arc] Turn off the objc_retainBlock -> objc_retain optimization.Michael Gottesman2013-09-031-189/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [objc-arc] Move some block tests from basic.ll -> retain-block.ll and add ↵Michael Gottesman2013-09-031-5/+54
| | | | | | some missing CHECK-LABELS. llvm-svn: 189868
* Non optimizable objc_retainBlock calls are not forwarding.Michael Gottesman2013-03-281-2/+2
| | | | | | | | | | | | Since we handle optimizable objc_retainBlocks through strength reduction in OptimizableIndividualCalls, we know that all code after that point will only see non-optimizable objc_retainBlock calls. IsForwarding is only called by functions after that point, so it is ok to just classify objc_retainBlock as non-forwarding. <rdar://problem/13249661>. llvm-svn: 178285
* Use references to attribute groups on the call/invoke instructions.Bill Wendling2013-02-221-12/+14
| | | | | | | Listing all of the attributes for the callee of a call/invoke instruction is way too much and makes the IR unreadable. Use references to attributes instead. llvm-svn: 175877
* Implement proper ObjC ARC objc_retainBlock "escape" analysis, so thatDan Gohman2012-01-131-0/+138
the optimizer doesn't eliminate objc_retainBlock calls which are needed for their side effect of copying blocks onto the heap. This implements rdar://10361249. llvm-svn: 148076
OpenPOWER on IntegriCloud