[cfe-commits] r92038 - /cfe/trunk/lib/Frontend/RewriteObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Dec 23 12:32:38 PST 2009
Author: fjahanian
Date: Wed Dec 23 14:32:38 2009
New Revision: 92038
URL: http://llvm.org/viewvc/llvm-project?rev=92038&view=rev
Log:
This patch concludes rewriteing of __block variables to allow
a small test case using Block_copy(...) API to pass.
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=92038&r1=92037&r2=92038&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Wed Dec 23 14:32:38 2009
@@ -3784,8 +3784,13 @@
S += (*I)->getNameAsString();
S += ", (void*)src->";
S += (*I)->getNameAsString();
- S += ", 3/*BLOCK_FIELD_IS_OBJECT*/);}";
+ if (BlockByRefDecls.count((*I)))
+ S += ", 8/*BLOCK_FIELD_IS_BYREF*/);";
+ else
+ S += ", 3/*BLOCK_FIELD_IS_OBJECT*/);";
}
+ S += "}\n";
+
S += "\nstatic void __";
S += funcName;
S += "_block_dispose_" + utostr(i);
@@ -3795,7 +3800,10 @@
E = ImportedBlockDecls.end(); I != E; ++I) {
S += "_Block_object_dispose((void*)src->";
S += (*I)->getNameAsString();
- S += ", 3/*BLOCK_FIELD_IS_OBJECT*/);";
+ if (BlockByRefDecls.count((*I)))
+ S += ", 8/*BLOCK_FIELD_IS_BYREF*/);";
+ else
+ S += ", 3/*BLOCK_FIELD_IS_OBJECT*/);";
}
S += "}\n";
return S;
More information about the cfe-commits
mailing list