diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-08-28 17:24:14 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-08-28 17:24:14 +0000 |
commit | 455f42c9e8309593cc80de055453e128dbadba26 (patch) | |
tree | 9ae09c6bf47e074e6c8c896c95968324f5d03e98 /clang/lib/CodeGen/CGExprCXX.cpp | |
parent | 85b99da72a0ab1d3f2e62bc640080be6748182da (diff) | |
download | bcm5719-llvm-455f42c9e8309593cc80de055453e128dbadba26.tar.gz bcm5719-llvm-455f42c9e8309593cc80de055453e128dbadba26.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprCXX.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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) |