[PATCH] D28136: [OpenCL] Implement as_type operator as alias of __builtin_astype.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 03:44:30 PDT 2017


Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks!



================
Comment at: lib/Headers/opencl-c.h:6588
-char __ovld __cnfn as_char(char);
-char __ovld __cnfn as_char(uchar);
-
----------------
bader wrote:
> Anastasia wrote:
> > Why do we have some of the overloads omitted? Would this cause any extra conversions? uchar -> char in this case?
> It's specific to how builtin_astype works. It drops first argument type and only cares about matching first argument size with the data type size provided as a second argument. So basically with single line we get all possible and impossible overloads of as_char(*).
> This define will pass any variable type char,uchar to builtin_astype.
Ok, I see. I hope we won't get the "impossible" ones though. :)


https://reviews.llvm.org/D28136





More information about the cfe-commits mailing list