diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2016-09-07 22:11:02 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2016-09-07 22:11:02 +0000 |
commit | eade17271a04176fc6a450db7723933c23a8bec7 (patch) | |
tree | f5564aa4fd2cb01c7649b46e36905610263f8442 | |
parent | e95e7d5d646d760bf3d6862f8265cc8fb14438f7 (diff) | |
download | bcm5719-llvm-eade17271a04176fc6a450db7723933c23a8bec7.tar.gz bcm5719-llvm-eade17271a04176fc6a450db7723933c23a8bec7.zip |
Avoid ambiguity in calling atom_add functions.
clang (since r280553) allows pointer casts in function overloads,
so we need to disambiguate the second argument.
clang might be smarter about overloads in the future
see https://reviews.llvm.org/D24113, but let's be safe in libclc anyway.
llvm-svn: 280871
4 files changed, 4 insertions, 4 deletions
diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl index a74158d45fc..cc24d2f3de0 100644 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl +++ b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl @@ -2,7 +2,7 @@ #define IMPL(TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(global TYPE *p) { \ - return atom_sub(p, 1); \ + return atom_sub(p, (TYPE)1); \ } IMPL(int) diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl index 1404b5aa447..9193ae3a6be 100644 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl +++ b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl @@ -2,7 +2,7 @@ #define IMPL(TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(global TYPE *p) { \ - return atom_add(p, 1); \ + return atom_add(p, (TYPE)1); \ } IMPL(int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl index d22c333f5d5..cfb3d809070 100644 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl +++ b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl @@ -2,7 +2,7 @@ #define IMPL(TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(local TYPE *p) { \ - return atom_sub(p, 1); \ + return atom_sub(p, (TYPE)1); \ } IMPL(int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl index 4ba0d062997..8ea473847e9 100644 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl +++ b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl @@ -2,7 +2,7 @@ #define IMPL(TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(local TYPE *p) { \ - return atom_add(p, 1); \ + return atom_add(p, (TYPE)1); \ } IMPL(int) |