diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-04-16 23:00:57 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-04-16 23:00:57 +0000 |
commit | 35f6e12bf00f1ee5706cccb32aad6809ac0e72b1 (patch) | |
tree | 301f15ec88c15880f511c31a8bb2e656752d705a /clang/lib | |
parent | 2bf5f739777b0636954d2030e4d0879116fdeb8b (diff) | |
download | bcm5719-llvm-35f6e12bf00f1ee5706cccb32aad6809ac0e72b1.tar.gz bcm5719-llvm-35f6e12bf00f1ee5706cccb32aad6809ac0e72b1.zip |
Modern objective-c translator:'self' used inside
block literal is imported. // rdar://11259664
llvm-svn: 154876
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Rewrite/RewriteModernObjC.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Rewrite/RewriteModernObjC.cpp b/clang/lib/Rewrite/RewriteModernObjC.cpp index 5d124aba9f2..28502ddcbda 100644 --- a/clang/lib/Rewrite/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/RewriteModernObjC.cpp @@ -4156,11 +4156,15 @@ void RewriteModernObjC::GetBlockDeclRefExprs(Stmt *S) { GetBlockDeclRefExprs(*CI); } // Handle specific things. - if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(S)) - if (DRE->refersToEnclosingLocal() && - HasLocalVariableExternalStorage(DRE->getDecl())) { - BlockDeclRefs.push_back(DRE); + if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(S)) { + if (DRE->refersToEnclosingLocal()) { + // FIXME: Handle enums. + if (!isa<FunctionDecl>(DRE->getDecl())) + BlockDeclRefs.push_back(DRE); + if (HasLocalVariableExternalStorage(DRE->getDecl())) + BlockDeclRefs.push_back(DRE); } + } return; } |