[PATCH] D63256: [OpenCL] Split type and macro definitions into opencl-c-base.h

Andrew Savonichev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 14 08:48:38 PDT 2019


asavonic added a comment.

LGTM, except for the `IncludeDefaultHeader` and `DeclareOpenCLBuiltins` logic.



================
Comment at: lib/Frontend/CompilerInvocation.cpp:2194
     }
+    // Include base header file for builtin types and constants.
+    if (Opts.DeclareOpenCLBuiltins) {
----------------
Can we have the following logic instead? Otherwise `DeclareOpenCLBuiltins` implies `IncludeDefaultHeader` which is not always the case.

```
    if (Opts.IncludeDefaultHeader) {
      if (Opts.DeclareOpenCLBuiltins) {
	PPOpts.Includes.push_back("opencl-c-base.h");
      } else {
	PPOpts.Includes.push_back("opencl-c.h");
      }
    }
```


Repository:
  rC Clang

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

https://reviews.llvm.org/D63256





More information about the cfe-commits mailing list