Don't assert when we think we need copy/dispose, but don't need them.

Radar 6838889

llvm-svn: 70525
This commit is contained in:
Mike Stump 2009-05-01 01:31:57 +00:00
parent f8949a61bf
commit d898026e8a
2 changed files with 6 additions and 1 deletions

View File

@ -158,6 +158,8 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
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 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
subBlockHasCopyDispose);
assert(subBlockSize == BlockLiteralSize
&& "no imports allowed for global block");
assert(!subBlockHasCopyDispose && "no imports allowed for global block");
// isa
LiteralFields[0] = getNSConcreteGlobalBlock();

View File

@ -22,5 +22,9 @@ void *P = ^{
void *Q = __func__;
};
void (^test1)(void) = ^(void) {
__block int i;
^ { i = 1; }();
};
// RUN: true