From: Fariborz Jahanian Date: Wed, 6 Jul 2011 21:05:11 +0000 (+0000) Subject: revert patch for // rdar://9227352 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d5ac7c9ca31ef4d7f79822b3e4c486ec80f1c26;p=clang revert patch for // rdar://9227352 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134536 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 3488f2edb7..a0a8d667df 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -25,22 +25,6 @@ using namespace clang; using namespace CodeGen; -struct CallMemsetLocalBlockObject : EHScopeStack::Cleanup { - llvm::AllocaInst *BlockAddr; - CharUnits BlockSize; - - CallMemsetLocalBlockObject(llvm::AllocaInst *blockAddr, - CharUnits blocSize) - : BlockAddr(blockAddr), BlockSize(blocSize) {} - - void Emit(CodeGenFunction &CGF, bool isForEH) { - CGF.Builder.CreateMemSet(BlockAddr, - llvm::ConstantInt::get(CGF.Int8Ty, 0xCD), - BlockSize.getQuantity(), - BlockAddr->getAlignment()); - } -}; - CGBlockInfo::CGBlockInfo(const BlockExpr *blockExpr, const char *N) : Name(N), CXXThisIndex(0), CanBeGlobal(false), NeedsCopyDispose(false), HasCXXObject(false), UsesStret(false), StructureType(0), Block(blockExpr) { @@ -665,9 +649,6 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const BlockExpr *blockExpr) { llvm::Value *result = Builder.CreateBitCast(blockAddr, ConvertType(blockInfo.getBlockExpr()->getType())); - if (getLangOptions().CatchUndefined) - EHStack.pushCleanup(NormalCleanup, blockAddr, - blockInfo.BlockSize); return result; } diff --git a/test/CodeGen/reset-local-block.c b/test/CodeGen/reset-local-block.c deleted file mode 100644 index 6a7262f67e..0000000000 --- a/test/CodeGen/reset-local-block.c +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fcatch-undefined-behavior -o - %s | FileCheck %s -// rdar://9227352 - -typedef int (^BLOCK)(); - -BLOCK FUNC() { - int i; - double d; - BLOCK block = ^{ return i + (int)d; }; - if (!block) - block = ^{ return i; }; - return block; -} - -//CHECK: call void @llvm.memset{{.*}}, i8 -51, i64 36, i32 8, i1 false) -//CHECK: call void @llvm.memset{{.*}}, i8 -51, i64 44, i32 8, i1 false)