[cfe-commits] r70525 - in /cfe/trunk: lib/CodeGen/CGBlocks.cpp test/CodeGen/blocks.c
Mike Stump
mrs at apple.com
Thu Apr 30 18:31:57 PDT 2009
Author: mrs
Date: Thu Apr 30 20:31:57 2009
New Revision: 70525
URL: http://llvm.org/viewvc/llvm-project?rev=70525&view=rev
Log:
Don't assert when we think we need copy/dispose, but don't need them.
Radar 6838889
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/test/CodeGen/blocks.c
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=70525&r1=70524&r2=70525&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Thu Apr 30 20:31:57 2009
@@ -158,6 +158,8 @@
BlockHasCopyDispose |= subBlockHasCopyDispose;
Elts[3] = Fn;
+ // FIXME: Don't use BlockHasCopyDispose, it is set more often then necessary, for
+ // example: { ^{ __block int i; ^{ i = 1; }(); }(); }
if (subBlockHasCopyDispose)
flags |= BLOCK_HAS_COPY_DISPOSE;
@@ -557,7 +559,6 @@
subBlockHasCopyDispose);
assert(subBlockSize == BlockLiteralSize
&& "no imports allowed for global block");
- assert(!subBlockHasCopyDispose && "no imports allowed for global block");
// isa
LiteralFields[0] = getNSConcreteGlobalBlock();
Modified: cfe/trunk/test/CodeGen/blocks.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks.c?rev=70525&r1=70524&r2=70525&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/blocks.c (original)
+++ cfe/trunk/test/CodeGen/blocks.c Thu Apr 30 20:31:57 2009
@@ -22,5 +22,9 @@
void *Q = __func__;
};
+void (^test1)(void) = ^(void) {
+ __block int i;
+ ^ { i = 1; }();
+};
// RUN: true
More information about the cfe-commits
mailing list