[llvm-commits] [dragonegg] r136688 - /dragonegg/trunk/src/Convert.cpp

Duncan Sands baldrick at free.fr
Tue Aug 2 08:16:34 PDT 2011


Author: baldrick
Date: Tue Aug  2 10:16:33 2011
New Revision: 136688

URL: http://llvm.org/viewvc/llvm-project?rev=136688&view=rev
Log:
Allow the true and falses to be different if they are both pointer
types.  The gcc optimizers can create this situation, where (eg) one
operand is an i8*, and the other a [1024xi8]*.

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=136688&r1=136687&r2=136688&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Tue Aug  2 10:16:33 2011
@@ -2434,6 +2434,7 @@
   // Emit the true and false values.
   Value *TrueVal = EmitRegister(TREE_OPERAND(exp, 1));
   Value *FalseVal = EmitRegister(TREE_OPERAND(exp, 2));
+  FalseVal = TriviallyTypeConvert(FalseVal, TrueVal->getType());
 
   // Select the value to use based on the condition.
   return Builder.CreateSelect(CondVal, TrueVal, FalseVal);





More information about the llvm-commits mailing list