]> granicus.if.org Git - clang/commit
Add a couple fixes for rewriting ivars/methods that use/contain blocks.
authorSteve Naroff <snaroff@apple.com>
Thu, 30 Oct 2008 12:09:33 +0000 (12:09 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 30 Oct 2008 12:09:33 +0000 (12:09 +0000)
commitced80a848de94ef44b6e7b4ce6f182249b3141a8
tree30cc47a9138d7881a68727786ade33b5796b5c55
parentaa4d5ae6c450fdbe207cdb12373fc026376ece42
Add a couple fixes for rewriting ivars/methods that use/contain blocks.

Now this:

@interface Test
{
  void (^ivar)(void);
}
- (void)name;
@end

@implementation Test
- (void)name {
  ivar = ^{ printf("hello\n"); }; // ((struct Test_IMPL *)self)->ivar = (void (*)(void))&__name_block_impl_0((void *)__name_block_func_0);
  ivar(); // ((void (*)(struct __block_impl *))((struct __block_impl *)((struct Test_IMPL *)self)->ivar)->FuncPtr)((struct __block_impl *)((struct Test_IMPL *)self)->ivar);
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58428 91177308-0d34-0410-b5e6-96231b3b80d8
Driver/RewriteObjC.cpp