summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 8d28b2485f2..08d340ef7b5 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1576,12 +1576,13 @@ Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) {
llvm::PointerType::getUnqual(handlerTy));
handlerFunction = Builder.CreateLoad(handlerFunction);
- llvm::Value *handlerResult = Builder.CreateCall4(handlerFunction,
- Builder.CreateSExt(Ops.LHS, CGF.Int64Ty),
- Builder.CreateSExt(Ops.RHS, CGF.Int64Ty),
- llvm::ConstantInt::get(llvm::Type::getInt8Ty(VMContext), OpID),
- llvm::ConstantInt::get(llvm::Type::getInt8Ty(VMContext),
- cast<llvm::IntegerType>(opTy)->getBitWidth()));
+ llvm::Value *lhs = Builder.CreateSExt(Ops.LHS, CGF.Int64Ty);
+ llvm::Value *rhs = Builder.CreateSExt(Ops.RHS, CGF.Int64Ty);
+
+ llvm::Value *handlerResult =
+ Builder.CreateCall4(handlerFunction, lhs, rhs,
+ Builder.getInt8(OpID),
+ Builder.getInt8(cast<llvm::IntegerType>(opTy)->getBitWidth()));
handlerResult = Builder.CreateTrunc(handlerResult, opTy);
OpenPOWER on IntegriCloud