[llvm-branch-commits] [cfe-tag] r137418 - /cfe/tags/Apple/objc_translate-203.10.1/src/tools/clang/lib/Rewrite/RewriteObjC.cpp

Ted Kremenek kremenek at apple.com
Thu Aug 11 19:18:18 PDT 2011


Author: kremenek
Date: Thu Aug 11 21:18:18 2011
New Revision: 137418

URL: http://llvm.org/viewvc/llvm-project?rev=137418&view=rev
Log:
Back-merge r136550 for <rdar://problem/9846759>.

Modified:
    cfe/tags/Apple/objc_translate-203.10.1/src/tools/clang/lib/Rewrite/RewriteObjC.cpp

Modified: cfe/tags/Apple/objc_translate-203.10.1/src/tools/clang/lib/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/objc_translate-203.10.1/src/tools/clang/lib/Rewrite/RewriteObjC.cpp?rev=137418&r1=137417&r2=137418&view=diff
==============================================================================
--- cfe/tags/Apple/objc_translate-203.10.1/src/tools/clang/lib/Rewrite/RewriteObjC.cpp (original)
+++ cfe/tags/Apple/objc_translate-203.10.1/src/tools/clang/lib/Rewrite/RewriteObjC.cpp Thu Aug 11 21:18:18 2011
@@ -4237,12 +4237,15 @@
   S += "*src) {";
   for (llvm::SmallPtrSet<ValueDecl*,8>::iterator I = ImportedBlockDecls.begin(),
       E = ImportedBlockDecls.end(); I != E; ++I) {
+    ValueDecl *VD = (*I);
     S += "_Block_object_assign((void*)&dst->";
     S += (*I)->getNameAsString();
     S += ", (void*)src->";
     S += (*I)->getNameAsString();
     if (BlockByRefDeclsPtrSet.count((*I)))
       S += ", " + utostr(BLOCK_FIELD_IS_BYREF) + "/*BLOCK_FIELD_IS_BYREF*/);";
+    else if (VD->getType()->isBlockPointerType())
+      S += ", " + utostr(BLOCK_FIELD_IS_BLOCK) + "/*BLOCK_FIELD_IS_BLOCK*/);";
     else
       S += ", " + utostr(BLOCK_FIELD_IS_OBJECT) + "/*BLOCK_FIELD_IS_OBJECT*/);";
   }
@@ -4255,10 +4258,13 @@
   S += "*src) {";
   for (llvm::SmallPtrSet<ValueDecl*,8>::iterator I = ImportedBlockDecls.begin(),
       E = ImportedBlockDecls.end(); I != E; ++I) {
+    ValueDecl *VD = (*I);
     S += "_Block_object_dispose((void*)src->";
     S += (*I)->getNameAsString();
     if (BlockByRefDeclsPtrSet.count((*I)))
       S += ", " + utostr(BLOCK_FIELD_IS_BYREF) + "/*BLOCK_FIELD_IS_BYREF*/);";
+    else if (VD->getType()->isBlockPointerType())
+      S += ", " + utostr(BLOCK_FIELD_IS_BLOCK) + "/*BLOCK_FIELD_IS_BLOCK*/);";
     else
       S += ", " + utostr(BLOCK_FIELD_IS_OBJECT) + "/*BLOCK_FIELD_IS_OBJECT*/);";
   }





More information about the llvm-branch-commits mailing list