[PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 23 11:43:26 PDT 2016


yaxunl added a comment.

In http://reviews.llvm.org/D19932#465781, @jvesely wrote:

> In http://reviews.llvm.org/D19932#465763, @cfe-commits wrote:
>
> > The returned pointer should point to the same pointee type as the argument. Header file cannot guarantee that.
> >
> > Sam
>
>
> how come? is there a possibility to have two different types using the same name?


Because the pointee type is arbitrary, you can only define it as

  global void* to_global(void*);

in the header file. Then you could have

  int *a;
  global double *b = to_global(a);

without diagnostics, but the spec requires that to_global(a) should have global int* type, therefore there should be some diagnostics.


Repository:
  rL LLVM

http://reviews.llvm.org/D19932





More information about the cfe-commits mailing list