]> granicus.if.org Git - clang/commitdiff
revert patch for // rdar://9227352
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 6 Jul 2011 21:05:11 +0000 (21:05 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 6 Jul 2011 21:05:11 +0000 (21:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134536 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp
test/CodeGen/reset-local-block.c [deleted file]

index 3488f2edb7e657a55bc8e5dc9b235f1a61585839..a0a8d667df622e513202d154c156b553070f6b00 100644 (file)
 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<CallMemsetLocalBlockObject>(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 (file)
index 6a7262f..0000000
+++ /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)