On Sat, Dec 4, 2010 at 2:50 AM, Peter Collingbourne <[email protected]> wrote:
> +def cl_single_precision_constant : Flag<"-cl-single-precision-constant">,
> +  HelpText<"OpenCL only. Treat double precision floating-point constant as 
> single precision constant.">;

This claims the option is OpenCL only, but that doesn't seem to be
checked below:

> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Dec  3 19:50:56 2010
> @@ -2394,6 +2394,9 @@
>     bool isExact = (result == APFloat::opOK);
>     Res = FloatingLiteral::Create(Context, Val, isExact, Ty, 
> Tok.getLocation());
>
> +    if (getLangOptions().SinglePrecisionConstants && Ty == Context.DoubleTy)
> +      ImpCastExprToType(Res, Context.FloatTy, CK_FloatingCast);
> +
>   } else if (!Literal.isIntegerLiteral()) {
>     return ExprError();
>   } else {
>

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to