[cfe-commits] r91652 - in /cfe/trunk: lib/Frontend/RewriteObjC.cpp test/Rewriter/rewrite-block-ivar-call.mm
Fariborz Jahanian
fjahanian at apple.com
Thu Dec 17 17:15:21 PST 2009
Author: fjahanian
Date: Thu Dec 17 19:15:21 2009
New Revision: 91652
URL: http://llvm.org/viewvc/llvm-project?rev=91652&view=rev
Log:
Implemented rewriting of invocation of a block ivar.
(radar 7482224).
Added:
cfe/trunk/test/Rewriter/rewrite-block-ivar-call.mm
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=91652&r1=91651&r2=91652&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Thu Dec 17 19:15:21 2009
@@ -4060,6 +4060,8 @@
SourceLocation(), cast<Expr>(RHSStmt),
Exp->getType());
return CondExpr;
+ } else if (const ObjCIvarRefExpr *IRE = dyn_cast<ObjCIvarRefExpr>(BlockExp)) {
+ CPT = IRE->getType()->getAs<BlockPointerType>();
} else {
assert(1 && "RewriteBlockClass: Bad type");
}
Added: cfe/trunk/test/Rewriter/rewrite-block-ivar-call.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-block-ivar-call.mm?rev=91652&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-block-ivar-call.mm (added)
+++ cfe/trunk/test/Rewriter/rewrite-block-ivar-call.mm Thu Dec 17 19:15:21 2009
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -x objective-c++ -fblocks -rewrite-objc -o - %s
+
+ at interface Foo {
+ void (^_block)(void);
+}
+ at end
+
+ at implementation Foo
+- (void)bar {
+ _block();
+}
+ at end
More information about the cfe-commits
mailing list