[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 16 11:09:39 PDT 2018
leonardchan added inline comments.
================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1032
+ // them.
+ return Builder.CreateIsNotNull(Src);
+ }
----------------
ebevhan wrote:
> Is this comment true? I don't think EmitFixedPointConversion does this.
>
> Maybe I'm misinterpreting what it means.
Ah sorry, this was my bad. I briefly forgot that we intended for overflow into the bit to be undefined behavior. In that case, this comment doesn't make sense and should be removed, but we still shouldn't have to clear/check the padding bit in this case because we should assume it's zero'd.
So this refers to handling when the padding bit needs to be cleared since if we ever have an operation that reads the whole int of an underlying unsigned type. I accidentally wrote this comment thinking that it would be cleared/zero'd at some point when we decided before that overflow into this padding was just undefined behavior. Updated the comment to reflect this.
Repository:
rC Clang
https://reviews.llvm.org/D53308
More information about the cfe-commits
mailing list