]> granicus.if.org Git - clang/commitdiff
Template code for rewrite of __block variables - wip.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 22 Dec 2009 00:48:54 +0000 (00:48 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 22 Dec 2009 00:48:54 +0000 (00:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91865 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/RewriteObjC.cpp

index 289d4d6a1a0bd8739c204b8f1f3fd536939f4cc3..2aecf7728194a23de74b363921b371ab4fd7ec40 100644 (file)
@@ -324,6 +324,7 @@ namespace {
     // Block specific rewrite rules.
     void RewriteBlockCall(CallExpr *Exp);
     void RewriteBlockPointerDecl(NamedDecl *VD);
+    void RewriteByRefVar(NamedDecl *VD);
     Stmt *RewriteBlockDeclRefExpr(BlockDeclRefExpr *VD);
     void RewriteBlockPointerFunctionArgs(FunctionDecl *FD);
 
@@ -4321,6 +4322,10 @@ void RewriteObjC::RewriteBlockPointerDecl(NamedDecl *ND) {
   return;
 }
 
+void RewriteObjC::RewriteByRefVar(NamedDecl *ND) {
+  return;
+}
+
 void RewriteObjC::CollectBlockDeclRefInfo(BlockExpr *Exp) {
   // Add initializers for any closure decl refs.
   GetBlockDeclRefExprs(Exp->getBody());
@@ -4665,6 +4670,8 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
           RewriteBlockPointerDecl(ND);
         else if (ND->getType()->isFunctionPointerType())
           CheckFunctionPointerDecl(ND->getType(), ND);
+        if (ND->hasAttr<BlocksAttr>())
+          RewriteByRefVar(ND);
       }
       if (TypedefDecl *TD = dyn_cast<TypedefDecl>(SD)) {
         if (isTopLevelBlockPointerType(TD->getUnderlyingType()))