[PATCH] D63876: [OpenCL] Define CLK_NULL_EVENT without cast

Sven van Haastregt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 02:11:44 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366546: [OpenCL] Define CLK_NULL_EVENT without cast (authored by svenvh, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D63876?vs=206850&id=210778#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63876/new/

https://reviews.llvm.org/D63876

Files:
  cfe/trunk/lib/Headers/opencl-c-base.h
  cfe/trunk/test/SemaOpenCL/clk_event_t.cl


Index: cfe/trunk/test/SemaOpenCL/clk_event_t.cl
===================================================================
--- cfe/trunk/test/SemaOpenCL/clk_event_t.cl
+++ cfe/trunk/test/SemaOpenCL/clk_event_t.cl
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++
 
 // Taken from opencl-c.h
-#define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t))
+#define CLK_NULL_EVENT (__builtin_astype(((__SIZE_MAX__)), clk_event_t))
 
 global clk_event_t ce; // expected-error {{the '__global clk_event_t' type cannot be used to declare a program scope variable}}
 
@@ -10,6 +10,7 @@
   event_t e;
   clk_event_t ce1;
   clk_event_t ce2;
+  clk_event_t ce3 = CLK_NULL_EVENT;
 
   if (e == ce1) { // expected-error {{invalid operands to binary expression ('event_t' and 'clk_event_t')}}
     return 9;
Index: cfe/trunk/lib/Headers/opencl-c-base.h
===================================================================
--- cfe/trunk/lib/Headers/opencl-c-base.h
+++ cfe/trunk/lib/Headers/opencl-c-base.h
@@ -413,7 +413,7 @@
 #define CLK_OUT_OF_RESOURCES                        -5
 
 #define CLK_NULL_QUEUE                              0
-#define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t))
+#define CLK_NULL_EVENT (__builtin_astype(((__SIZE_MAX__)), clk_event_t))
 
 // execution model related definitions
 #define CLK_ENQUEUE_FLAGS_NO_WAIT                   0x0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63876.210778.patch
Type: text/x-patch
Size: 1424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190719/bfbd3765/attachment.bin>


More information about the llvm-commits mailing list