rsmith added a comment.

Changes to ExprConstant and CGExprConstant appear to be pure cleanups; please 
check those in as a separate change.

When this is done, you should also be able to remove the `IgnoreImpCasts` and 
`EmitScalarConversion` calls in the `CK_VectorSplat` handling in 
`ScalarExprEmitter::VisitCastExpr`.


================
Comment at: lib/Sema/SemaExpr.cpp:5576
@@ +5575,3 @@
+    return ExprError();
+  return ImpCastExprToType(CastExprRes.get(), DestElemTy, CK);
+}
----------------
Looking at `ScalarExprEmitter::VisitCastExpr`, it seems like we are supposed to 
do something slightly bizarre if the source type is `bool` and we're in OpenCL 
mode -- in that case we're supposed to convert `true` to -1 instead of 1. In 
order for ExprConstant to get that case right, we should emit the appropriate 
implicit cast for that conversion here -- maybe add a 
`CK_SignedBooleanToIntegral` and a `CK_SignedBooleanToFloating`; I don't see 
any nice way to express this with our existing cast kinds.


http://reviews.llvm.org/D14877



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to