summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers
diff options
context:
space:
mode:
authorSven van Haastregt <sven.vanhaastregt@arm.com>2019-06-24 10:06:40 +0000
committerSven van Haastregt <sven.vanhaastregt@arm.com>2019-06-24 10:06:40 +0000
commitb502a44110ff38ea22abf01d38aa698fc9ff6198 (patch)
treeca87400dec03a673b8b38bab34d444682415088a /clang/lib/Headers
parent853dfab799f19ce6b1fa1cadab7c7c47b0378ed3 (diff)
downloadbcm5719-llvm-b502a44110ff38ea22abf01d38aa698fc9ff6198.tar.gz
bcm5719-llvm-b502a44110ff38ea22abf01d38aa698fc9ff6198.zip
[OpenCL] Restore ATOMIC_VAR_INIT
We accidentally lost the ATOMIC_VAR_INIT and ATOMIC_FLAG_INIT macros in r363794. Also put the `memory_order` typedef back inside a `>= CL2.0` guard. llvm-svn: 364174
Diffstat (limited to 'clang/lib/Headers')
-rw-r--r--clang/lib/Headers/opencl-c-base.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
index 19aaa90c1a7..a82954ddd32 100644
--- a/clang/lib/Headers/opencl-c-base.h
+++ b/clang/lib/Headers/opencl-c-base.h
@@ -297,8 +297,11 @@ typedef enum memory_scope {
* image memory.
*/
#define CLK_IMAGE_MEM_FENCE 0x04
-#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
+#ifndef ATOMIC_VAR_INIT
+#define ATOMIC_VAR_INIT(x) (x)
+#endif //ATOMIC_VAR_INIT
+#define ATOMIC_FLAG_INIT 0
// enum values aligned with what clang uses in EmitAtomicExpr()
typedef enum memory_order
@@ -310,6 +313,8 @@ typedef enum memory_order
memory_order_seq_cst = __ATOMIC_SEQ_CST
} memory_order;
+#endif //__OPENCL_C_VERSION__ >= CL_VERSION_2_0
+
// OpenCL v1.1 s6.11.3, v1.2 s6.12.14, v2.0 s6.13.14 - Image Read and Write Functions
// These values need to match the runtime equivalent
OpenPOWER on IntegriCloud