[llvm-commits] [dragonegg] r149691 - /dragonegg/trunk/src/Convert.cpp
Duncan Sands
baldrick at free.fr
Fri Feb 3 05:08:36 PST 2012
Author: baldrick
Date: Fri Feb 3 07:08:36 2012
New Revision: 149691
URL: http://llvm.org/viewvc/llvm-project?rev=149691&view=rev
Log:
The GCC optimizers can create COND_EXPR nodes where the result type differs
from the operand type, but only trivially.
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=149691&r1=149690&r2=149691&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Fri Feb 3 07:08:36 2012
@@ -2325,7 +2325,8 @@
FalseVal = TriviallyTypeConvert(FalseVal, TrueVal->getType());
// Select the value to use based on the condition.
- return Builder.CreateSelect(CondVal, TrueVal, FalseVal);
+ Value *Result = Builder.CreateSelect(CondVal, TrueVal, FalseVal);
+ return TriviallyTypeConvert(Result, getRegType(TREE_TYPE(exp)));
}
Value *TreeToLLVM::EmitOBJ_TYPE_REF(tree exp) {
More information about the llvm-commits
mailing list