summaryrefslogtreecommitdiffstats
path: root/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
commit0e976818ea1c7624b7dc250e7e2f9d251845874f (patch)
tree653c0feb58abb12c4306122ca398018d2e0cc2c6 /lib
parenta9d45a3f423f60fa5d1f977acb5c8df50198f27e (diff)
Modern objective-c translator:'self' used inside
block literal is imported. // rdar://11259664 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Rewrite/RewriteModernObjC.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Rewrite/RewriteModernObjC.cpp b/lib/Rewrite/RewriteModernObjC.cpp
index 5d124aba9f..28502ddcbd 100644
--- a/lib/Rewrite/RewriteModernObjC.cpp
+++ b/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;
}