[cfe-commits] r110354 - /cfe/trunk/lib/CodeGen/CGExprScalar.cpp
John McCall
rjmccall at apple.com
Thu Aug 5 11:11:10 PDT 2010
Author: rjmccall
Date: Thu Aug 5 13:11:10 2010
New Revision: 110354
URL: http://llvm.org/viewvc/llvm-project?rev=110354&view=rev
Log:
Argument evaluation order is not guaranteed. Split these out to force an order.
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=110354&r1=110353&r2=110354&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Thu Aug 5 13:11:10 2010
@@ -1576,12 +1576,13 @@
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);
More information about the cfe-commits
mailing list