aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-04-01 23:08:13 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-04-01 23:08:13 +0000
commit651ba520f9e1b38eeadbfc9bd21d0b7e570d69b7 (patch)
tree6f3503ec5393cc2e863ae7249ac5e6fd56a9e134 /lib/Rewrite
parent1051fc0ba0fb924d6d4a88a2113460a40a542614 (diff)
Fixes a rewriter bug rewriting call to a byref
block pointer nested inside a block. // rdar:// 9204669 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite')
-rw-r--r--lib/Rewrite/RewriteObjC.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 88703e1917..13cd671f12 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -4330,20 +4330,7 @@ std::string RewriteObjC::SynthesizeBlockImpl(BlockExpr *CE, std::string Tag,
S += " ";
std::string FieldName = (*I)->getNameAsString();
std::string ArgName = "_" + FieldName;
- // Handle nested closure invocation. For example:
- //
- // void (^myImportedBlock)(void);
- // myImportedBlock = ^(void) { setGlobalInt(x + y); };
- //
- // void (^anotherBlock)(void);
- // anotherBlock = ^(void) {
- // myImportedBlock(); // import and invoke the closure
- // };
- //
- if (isTopLevelBlockPointerType((*I)->getType())) {
- S += "struct __block_impl *";
- Constructor += ", void *" + ArgName;
- } else {
+ {
std::string TypeString;
RewriteByRefString(TypeString, FieldName, (*I));
TypeString += " *";
@@ -4381,11 +4368,7 @@ std::string RewriteObjC::SynthesizeBlockImpl(BlockExpr *CE, std::string Tag,
}
else
Constructor += ", ";
- if (isTopLevelBlockPointerType((*I)->getType()))
- Constructor += Name + "((struct __block_impl *)_"
- + Name + "->__forwarding)";
- else
- Constructor += Name + "(_" + Name + "->__forwarding)";
+ Constructor += Name + "(_" + Name + "->__forwarding)";
}
Constructor += " {\n";