From 455f42c9e8309593cc80de055453e128dbadba26 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 28 Aug 2014 17:24:14 +0000 Subject: Reverting r216675. This breaks some bots. Before this can be committed again, I have to explore runtime ABI requirements with libc++abi. llvm-svn: 216677 --- clang/lib/CodeGen/CGExprCXX.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'clang/lib/CodeGen/CGExprCXX.cpp') diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp index 1d175b25816..db876b11694 100644 --- a/clang/lib/CodeGen/CGExprCXX.cpp +++ b/clang/lib/CodeGen/CGExprCXX.cpp @@ -572,11 +572,11 @@ static llvm::Value *EmitCXXNewAllocSize(CodeGenFunction &CGF, } // On overflow, produce a -1 so operator new will fail. - if (hasAnyOverflow) - size = CGF.CGM.getCXXABI().EmitNewArrayLengthOverflowCheck( - CGF, true, nullptr, llvm::Constant::getAllOnesValue(CGF.SizeTy)); - else + if (hasAnyOverflow) { + size = llvm::Constant::getAllOnesValue(CGF.SizeTy); + } else { size = llvm::ConstantInt::get(CGF.SizeTy, allocationSize); + } // Otherwise, we might need to use the overflow intrinsics. } else { @@ -714,9 +714,9 @@ static llvm::Value *EmitCXXNewAllocSize(CodeGenFunction &CGF, // overwrite 'size' with an all-ones value, which should cause // operator new to throw. if (hasOverflow) - size = CGF.CGM.getCXXABI().EmitNewArrayLengthOverflowCheck(CGF, false, - hasOverflow, - size); + size = CGF.Builder.CreateSelect(hasOverflow, + llvm::Constant::getAllOnesValue(CGF.SizeTy), + size); } if (cookieSize == 0) -- cgit v1.2.3