summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-04-16 23:00:57 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-04-16 23:00:57 +0000
commit35f6e12bf00f1ee5706cccb32aad6809ac0e72b1 (patch)
tree301f15ec88c15880f511c31a8bb2e656752d705a /clang/lib
parent2bf5f739777b0636954d2030e4d0879116fdeb8b (diff)
downloadbcm5719-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.cpp12
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;
}
OpenPOWER on IntegriCloud