[libclc] r280871 - Avoid ambiguity in calling atom_add functions.
Jan Vesely via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 7 15:11:02 PDT 2016
Author: jvesely
Date: Wed Sep 7 17:11:02 2016
New Revision: 280871
URL: http://llvm.org/viewvc/llvm-project?rev=280871&view=rev
Log:
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.
Modified:
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl?rev=280871&r1=280870&r2=280871&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl Wed Sep 7 17:11:02 2016
@@ -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)
Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl?rev=280871&r1=280870&r2=280871&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl Wed Sep 7 17:11:02 2016
@@ -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)
Modified: libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl?rev=280871&r1=280870&r2=280871&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl Wed Sep 7 17:11:02 2016
@@ -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)
Modified: libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl?rev=280871&r1=280870&r2=280871&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl Wed Sep 7 17:11:02 2016
@@ -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)
More information about the cfe-commits
mailing list