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

2017-03-16 Thread Anastasia Stulova via Phabricator via cfe-commits
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: >

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

2017-03-15 Thread Alexey Bader via Phabricator via cfe-commits
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 ->

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

2017-03-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D28136#701508, @bader wrote: > > 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

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

2017-03-15 Thread Alexey Bader via Phabricator via cfe-commits
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

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

2017-03-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D28136#697844, @bader wrote: > > Why do you think this is a bug? It seems to follow standard behavior in C > > to promote char to int if required. Just like if you would have a C code: > > > > int as_int(int i); > > void foo() { > >

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

2017-03-10 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. > Why do you think this is a bug? It seems to follow standard behavior in C to > promote char to int if required. Just like if you would have a C code: > > int as_int(int i); > void foo() { > char src = 1; > int dst = as_int(src); > } > > > This

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

2017-03-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D28136#697673, @echuraev wrote: > In https://reviews.llvm.org/D28136#634356, @Anastasia wrote: > > > This has been discussed during the initial review for the header: > > > >

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

2017-03-10 Thread Egor Churaev via Phabricator via cfe-commits
echuraev added a comment. In https://reviews.llvm.org/D28136#634356, @Anastasia wrote: > This has been discussed during the initial review for the header: > http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160425/157187.html > > The main issue is after preprocessing the header the

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

2017-03-10 Thread Egor Churaev via Phabricator via cfe-commits
echuraev updated this revision to Diff 91327. https://reviews.llvm.org/D28136 Files: lib/Headers/opencl-c.h test/SemaOpenCL/as_type.cl Index: test/SemaOpenCL/as_type.cl === --- test/SemaOpenCL/as_type.cl +++

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

2017-01-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. This has been discussed during the initial review for the header: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160425/157187.html The main issue is after preprocessing the header the original function name is no longer available in diagnostics reported.

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

2016-12-28 Thread Egor Churaev via Phabricator via cfe-commits
echuraev created this revision. echuraev added a reviewer: Anastasia. echuraev added subscribers: bader, yaxunl, cfe-commits. https://reviews.llvm.org/D28136 Files: lib/Headers/opencl-c.h Index: lib/Headers/opencl-c.h === ---