зеркало из https://github.com/microsoft/clang-1.git
Minor rewriter cleanup and a test for a block rewriting bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
6418825fb8
Коммит
210c248449
|
@ -3918,7 +3918,6 @@ std::string RewriteObjC::SynthesizeBlockFunc(BlockExpr *CE, int i,
|
|||
for (llvm::SmallVector<ValueDecl*,8>::iterator I = BlockByCopyDecls.begin(),
|
||||
E = BlockByCopyDecls.end(); I != E; ++I) {
|
||||
S += " ";
|
||||
std::string Name = (*I)->getNameAsString();
|
||||
// Handle nested closure invocation. For example:
|
||||
//
|
||||
// void (^myImportedClosure)(void);
|
||||
|
@ -3937,6 +3936,7 @@ std::string RewriteObjC::SynthesizeBlockFunc(BlockExpr *CE, int i,
|
|||
S += "__cself->" + (*I)->getNameAsString() + "; // bound by copy\n";
|
||||
}
|
||||
else {
|
||||
std::string Name = (*I)->getNameAsString();
|
||||
(*I)->getType().getAsStringInternal(Name, Context->PrintingPolicy);
|
||||
S += Name + " = __cself->" +
|
||||
(*I)->getNameAsString() + "; // bound by copy\n";
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
|
||||
// radar 7638400
|
||||
|
||||
// FIXME. Arrange this test's rewritten source to compile with clang
|
||||
@interface X
|
||||
@end
|
||||
|
||||
|
@ -14,3 +15,16 @@ static void enumerateIt(void (^block)(id, id, char *)) {
|
|||
@end
|
||||
|
||||
// CHECK-LP: static void enumerateIt(void (*)(id, id, char *));
|
||||
|
||||
// radar 7651312
|
||||
void apply(void (^block)(int));
|
||||
|
||||
static void x(int (^cmp)(int, int)) {
|
||||
x(cmp);
|
||||
}
|
||||
|
||||
static void y(int (^cmp)(int, int)) {
|
||||
apply(^(int sect) {
|
||||
x(cmp);
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче