]> granicus.if.org Git - clang/commitdiff
Handle bookkeeping for imported blocks (in SynthesizeBlockImpl).
authorSteve Naroff <snaroff@apple.com>
Sat, 4 Oct 2008 18:00:11 +0000 (18:00 +0000)
committerSteve Naroff <snaroff@apple.com>
Sat, 4 Oct 2008 18:00:11 +0000 (18:00 +0000)
This code was "lost" with my recent changes to SynthesizeBlockFunc.

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

Driver/RewriteBlocks.cpp

index 7f9b8ea952788f5b5316c14d5403722aebe527cd..57d3a84560c23a987f2f4a4e2573fd4a4942b1a9 100644 (file)
@@ -483,7 +483,14 @@ std::string RewriteBlocks::SynthesizeBlockImpl(BlockExpr *CE, std::string Tag) {
     for (unsigned i = 0; i < BlockDeclRefs.size(); i++)
       if (BlockDeclRefs[i]->isByRef())
         BlockByRefDecls.insert(BlockDeclRefs[i]->getDecl());
-        
+    // Find any imported blocks...they will need special attention.
+    for (unsigned i = 0; i < BlockDeclRefs.size(); i++)
+      if (isBlockPointerType(BlockDeclRefs[i]->getType())) {
+        GetBlockCallExprs(CE);
+        ImportedBlockDecls.insert(BlockDeclRefs[i]->getDecl());
+      }
+      
     // Output all "by copy" declarations.
     for (llvm::SmallPtrSet<ValueDecl*,8>::iterator I = BlockByCopyDecls.begin(), 
          E = BlockByCopyDecls.end(); I != E; ++I) {