yaxunl marked 6 inline comments as done.
yaxunl added inline comments.

================
Comment at: lib/Serialization/ASTReader.cpp:3167
     case OPENCL_EXTENSIONS:
-      // Later tables overwrite earlier ones.
-      OpenCLExtensions.swap(Record);
----------------
Anastasia wrote:
> Btw, OpenCLTypeExtMap and OpenCLTypeDeclMap don't have to be serialized?
Yes. I will add it.


================
Comment at: test/Parser/opencl-atomics-cl20.cl:51
 // expected-error@-28 {{use of type 'atomic_double' (aka '_Atomic(double)') 
requires cl_khr_int64_extended_atomics extension to be enabled}}
-// expected-error-re@-27 {{use of type 'atomic_intptr_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-28 {{use of type 'atomic_intptr_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be 
enabled}}
-// expected-error-re@-28 {{use of type 'atomic_uintptr_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-29 {{use of type 'atomic_uintptr_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be 
enabled}}
-// expected-error-re@-29 {{use of type 'atomic_size_t' (aka '_Atomic({{.+}})') 
requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-30 {{use of type 'atomic_size_t' (aka '_Atomic({{.+}})') 
requires cl_khr_int64_extended_atomics extension to be enabled}}
-// expected-error-re@-30 {{use of type 'atomic_ptrdiff_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-31 {{use of type 'atomic_ptrdiff_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be 
enabled}}
+#if __LP64__
+// expected-error-re@-28 {{use of type 'atomic_intptr_t' (aka 
'_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
----------------
Anastasia wrote:
> yaxunl wrote:
> > Anastasia wrote:
> > > Why this change?
> > atomic_intptr_t etc. requires cl_khr_int64_extended_atomics only on 64 bit 
> > platforms.
> > 
> > This is a bug which was fixed by this patch.
> The spec says:
> "If the device address space is 64-bits, the data types atomic_intptr_t, 
> atomic_uintptr_t,
> atomic_size_t and atomic_ptrdiff_t are supported if the 
> cl_khr_int64_base_atomics and
> cl_khr_int64_extended_atomics extensions are supported."
> 
> This seems to be the same as long and double?
Yes. Use of long and double were correctly diagnosed if the corresponding 
extension was disabled but size_t/intptr_t/uintptr_t/ptrdiff_t was not. This 
patch fixes that.


https://reviews.llvm.org/D21698



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to