[llvm-commits] [dragonegg] r159358 - /dragonegg/trunk/src/Convert.cpp
Duncan Sands
baldrick at free.fr
Thu Jun 28 09:43:49 PDT 2012
Author: baldrick
Date: Thu Jun 28 11:43:49 2012
New Revision: 159358
URL: http://llvm.org/viewvc/llvm-project?rev=159358&view=rev
Log:
In theory GCC may use MINUS_EXPR for the difference of two pointers, though it
doesn't seem to in practice (though see next patch).
Modified:
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=159358&r1=159357&r2=159358&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Thu Jun 28 11:43:49 2012
@@ -1862,7 +1862,9 @@
Value *TreeToLLVM::CreateAnySub(Value *LHS, Value *RHS, tree type) {
if (isa<FLOAT_TYPE>(type))
return Builder.CreateFSub(LHS, RHS);
- return Builder.CreateSub(LHS, RHS, "", hasNUW(type), hasNSW(type));
+ return Builder.CreateSub(CastToSameSizeInteger(LHS),
+ CastToSameSizeInteger(RHS), "",
+ hasNUW(type), hasNSW(type));
}
/// CreateTemporary - Create a new alloca instruction of the specified type,
More information about the llvm-commits
mailing list