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

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 15 09:26:15 PDT 2017


bader added inline comments.


================
Comment at: lib/Headers/opencl-c.h:6588
-char __ovld __cnfn as_char(char);
-char __ovld __cnfn as_char(uchar);
-
----------------
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.


https://reviews.llvm.org/D28136





More information about the cfe-commits mailing list