[cfe-commits] r96361 - in /cfe/trunk: lib/Frontend/RewriteObjC.cpp test/Rewriter/rewrite-block-pointer.mm
Fariborz Jahanian
fjahanian at apple.com
Tue Feb 16 09:26:03 PST 2010
Author: fjahanian
Date: Tue Feb 16 11:26:03 2010
New Revision: 96361
URL: http://llvm.org/viewvc/llvm-project?rev=96361&view=rev
Log:
Minor rewriter cleanup and a test for a block rewriting bug.
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
cfe/trunk/test/Rewriter/rewrite-block-pointer.mm
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=96361&r1=96360&r2=96361&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Tue Feb 16 11:26:03 2010
@@ -3918,7 +3918,6 @@
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 @@
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";
Modified: cfe/trunk/test/Rewriter/rewrite-block-pointer.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-block-pointer.mm?rev=96361&r1=96360&r2=96361&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-block-pointer.mm (original)
+++ cfe/trunk/test/Rewriter/rewrite-block-pointer.mm Tue Feb 16 11:26:03 2010
@@ -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 @@
@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);
+ });
+}
More information about the cfe-commits
mailing list