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

Alexey Bader via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 08:12:28 PDT 2016


bader accepted this revision.

================
Comment at: test/Headers/opencl-c-header.cl:30-31
@@ +29,4 @@
+
+// ===
+// Compile for OpenCL 2.0 for the first time. The module should change.
+// RUN: %clang_cc1 -cc1  -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
----------------
It would be nice to re-use that part of module that agnostic to OpenCL version. Most of the OpenCL 2.0 declarations are already in the module for OpenCL 1.0.
Pointer/size_t arguments could another reason to re-parse the header.

Just FYI: at the moment we use chained PCHes to reduce the footprint of the PCHes we ship with OpenCL implementation.
The chain looks like: <common part> + <standard specific part> + <platform specific part>, where 60% is occupied by <common part>, which is shared across all possible compilations.



http://reviews.llvm.org/D20444





More information about the cfe-commits mailing list