[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast
Leonard Chan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 23 10:43:16 PDT 2018
leonardchan added inline comments.
================
Comment at: clang/lib/AST/ExprConstant.cpp:9599
+ return false;
+ return Success(Val.getInt().getBoolValue(), E);
+ }
----------------
rjmccall wrote:
> I know you haven't really done constant-evaluation yet, but I think you should at least be setting up operations like this correctly:
>
> 1. There should be an `EvaluateFixedPoint` function that evaluates an expression as a fixed-point value, just like `EvaluateFloat` and the others, which can be structured to use `FixedPointExprEvaluator`.
> 2. There should be a `getBoolValue` method on `APFixedPoint`.
I will add these in another patch since this has LGTM.
Repository:
rC Clang
https://reviews.llvm.org/D53308
More information about the cfe-commits
mailing list