[PATCH] D20444: [OpenCL] Include opencl-c.h by default as a clang module

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 3 09:34:21 PDT 2016


Anastasia added inline comments.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:7347
@@ -7346,3 +7346,3 @@
 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
-  " or pick a deployment target that supports them">;
+  " or %select{pick a deployment target that supports them|as OpenCL 2.0 or above}0">;
 def err_block_returning_array_function : Error<
----------------
-> for OpenCL version 2.0 or above

================
Comment at: test/Headers/opencl-c-header.cl:50
@@ +49,3 @@
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash %s | FileCheck %s
+// RUN: diff %t/1_0.pcm %t/opencl_c.pcm
+// RUN: rm %t/opencl_c.pcm
----------------
Sam, what was the aim of this test?

I was just wondering if we should instead check that the file is exactly the same i.e. hasn't been overwritten with exactly the same content?

================
Comment at: test/Headers/opencl-c-header.cl:53-54
@@ +52,4 @@
+
+// ===
+// Compile for OpenCL 2.0 for the first time. The module should change.
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash %s | FileCheck --check-prefix=CHECK20 %s
----------------
Indeed PCH size is an issue. I don't quite get why it expands from the original source code size by a factor or 2. Something to look at!

================
Comment at: test/Headers/opencl-c-header.cl:70
@@ +69,3 @@
+// RUN: %clang_cc1 -cc1 -triple amdgcn--amdhsa -emit-llvm -o - -cl-std=CL2.0  -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s | FileCheck --check-prefix=CHECK20 %s
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s | FileCheck %s
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s | FileCheck --check-prefix=CHECK20 %s
----------------
This line seems exactly the same as line 67.


http://reviews.llvm.org/D20444





More information about the cfe-commits mailing list