[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 03:35:11 PDT 2017


bader added a comment.

> From all the above arguments, I feel like the right approach would be to implement it as Clang builtin which closely matches the operator semantic in my opinion. We could of course reuse the implementation of  __bultin_astype to avoid unnecessary extra work and code duplication.
> 
> Using the macro seems to me more like a workaround solution and overloaded functions don't seem to be entirely the right thing either.  What do you think about it?

I don't think we need another Clang built-in. __builtin_astype was added specifically for OpenCL needs (see rev. 132612).
Do you know better way to map astype operators (there are a lot of them as_<type>#) to single Clang built-in?


https://reviews.llvm.org/D28136





More information about the cfe-commits mailing list