Modern objective-c translator:'self' used inside
block literal is imported. // rdar://11259664 llvm-svn: 154876
This commit is contained in:
parent
2bf5f73977
commit
35f6e12bf0
|
@ -4156,11 +4156,15 @@ void RewriteModernObjC::GetBlockDeclRefExprs(Stmt *S) {
|
||||||
GetBlockDeclRefExprs(*CI);
|
GetBlockDeclRefExprs(*CI);
|
||||||
}
|
}
|
||||||
// Handle specific things.
|
// Handle specific things.
|
||||||
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(S))
|
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(S)) {
|
||||||
if (DRE->refersToEnclosingLocal() &&
|
if (DRE->refersToEnclosingLocal()) {
|
||||||
HasLocalVariableExternalStorage(DRE->getDecl())) {
|
// FIXME: Handle enums.
|
||||||
BlockDeclRefs.push_back(DRE);
|
if (!isa<FunctionDecl>(DRE->getDecl()))
|
||||||
|
BlockDeclRefs.push_back(DRE);
|
||||||
|
if (HasLocalVariableExternalStorage(DRE->getDecl()))
|
||||||
|
BlockDeclRefs.push_back(DRE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %s -o %t-rw.cpp
|
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %s -o %t-rw.cpp
|
||||||
// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
|
// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
|
||||||
// radar 9254348
|
// radar 9254348
|
||||||
|
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
|
||||||
|
// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
|
||||||
|
// rdar://11259664
|
||||||
|
|
||||||
void *sel_registerName(const char *);
|
void *sel_registerName(const char *);
|
||||||
typedef void (^BLOCK_TYPE)(void);
|
typedef void (^BLOCK_TYPE)(void);
|
||||||
|
|
Loading…
Reference in New Issue